diff --git a/.hgtags b/.hgtags index 001205086b5..61755b3df8a 100644 --- a/.hgtags +++ b/.hgtags @@ -1,3 +1,15 @@ +8fd0a4569191f33c98ee90c2709174a342fefb0d jdk-9+167 +fcabc74bd44e56c7419d111d59b95669ecb33c55 jdk-9+168 +d3e973f1809606c67412361041ad197e50fe8cec jdk-9+166 +3965b747cfe1e6cbd66b8739da5a1ea6ec6985e9 jdk-9+165 +d16aebbb56d37f12e0c0b0a4fb427db65e1fb1a8 jdk-9+162 +18c41483a082e097ac2f5f983c1226ed94aa4215 jdk-9+163 +32db52c675e7d5bc413605d2e89b68b608b19be0 jdk-9+164 +fd1497902bbe3aa24b21f270ecdcb8de5f7aa9ac jdk-9+159 +6aa8be0c4e054fe8b3ab016ae00d16d680f92145 jdk-9+160 +f6883b1a5a6478437cd4181c4bd45328ab24feaf jdk-9+161 +fa3e76b477829afc4476f0b725cfaa440a6fd917 jdk-9+157 +b5015f742ba648184bb7fc547197bd33ebfde30d jdk-9+158 1cc8dd79fd1cd13d36b385196271a29632c67c3b jdk7-b24 bf2517e15f0c0f950e5b3143c4ca11e2df73dcc1 jdk7-b25 5ae7db536e3fcf6be78e45b240a9058095e0ed38 jdk7-b26 @@ -399,3 +411,10 @@ d7034ff7f8e257e81c9f95c7785dd4eaaa3c2afc jdk-9+153 8c70d170e62c0c58b5bc3ba666bd140399b98c9c jdk-10+0 45b751afd11e6c05991cf4913c5a0ac3304fcc4e jdk-9+154 f4aff695ffe05cfdb69d8af25a4ddc6a029754ea jdk-9+155 +06bce0388880b5ff8e040e4a9d72a3ea11dac321 jdk-9+156 +74116beae88a8f17a80301aa6c83865c82f10ece jdk-10+1 +4a79ad46e578112fce68f1af9dd931025cc235cb jdk-10+2 +d1cab6c7e608479be4ebfad48a25b0ed48600f62 jdk-10+3 +02253db2ace1422f576f58502fc7831ead77424b jdk-10+4 +f113ce12fe24fbd24acf02711372d9f1e1c12426 jdk-10+5 +1407b19a2ddf6baae162f5a1a5b96af473f4d7d1 jdk-10+6 diff --git a/.hgtags-top-repo b/.hgtags-top-repo index 3d81f131af0..69291313dcc 100644 --- a/.hgtags-top-repo +++ b/.hgtags-top-repo @@ -396,5 +396,25 @@ b119012d1c2ab2570fe8718633840d0c1f1f441d jdk-9+149 71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151 ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152 816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153 +8d22611ffb6540bc1ace64a00c048c8b82d8c69a jdk-10+0 8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154 688a3863c00ebc089ab17ee1fc46272cbbd96815 jdk-9+155 +783ec7542cf7154e5d2b87f55bb97d28f81e9ada jdk-9+156 +4df5f619c9ead4604d2f97ed231b3a35ec688c41 jdk-10+1 +4eb77fb98952dc477a4229575c81d2263a9ce711 jdk-9+157 +a4087bc10a88a43ea3ad0919b5b4af1c86977221 jdk-9+158 +fe8466adaef8178dba94be53c789a0aaa87d13bb jdk-9+159 +4d29ee32d926ebc960072d51a3bc558f95c1cbad jdk-9+160 +cda60babd152d889aba4d8f20a8f643ab151d3de jdk-9+161 +21b063d75b3edbffb9bebc8872d990920c4ae1e5 jdk-9+162 +c38c6b270ccc8e2b86d1631bcf42248241b54d2c jdk-9+163 +7810f75d016a52e32295c4233009de5ca90e31af jdk-9+164 +aff4f339acd40942d3dab499846b52acd87b3af1 jdk-9+165 +ba5b16c9c6d80632b61959a33d424b1c3398ce62 jdk-9+166 +35017c286513ddcbcc6b63b99679c604993fc639 jdk-9+167 +143d4c87bc1ef1ed6dadd613cd9dd4488fdefc29 jdk-9+168 +9c7248b787c39b034d4f48d4aa48df903836cca7 jdk-10+2 +06373236a30801f72e2a31ee5c691c2a1e500f57 jdk-10+3 +8ec175c61fc3f58328a3324f07d7ded00e060be3 jdk-10+4 +111e2e7d00f45c983cdbc9c59ae40552152fcc23 jdk-10+5 +03fe61bb7670644cf6e46b5cfafb6b27c0e0157e jdk-10+6 \ No newline at end of file diff --git a/.jcheck/conf b/.jcheck/conf index 5c6f62dc12c..b2581358014 100644 --- a/.jcheck/conf +++ b/.jcheck/conf @@ -1 +1 @@ -project=jdk9 +project=jdk10 diff --git a/README b/README index 477b38887fc..537dea30aec 100644 --- a/README +++ b/README @@ -1,40 +1,10 @@ -README: - This file should be located at the top of the OpenJDK Mercurial root - repository. A full OpenJDK repository set (forest) should also include - the following 7 nested repositories: - "jdk", "hotspot", "langtools", "nashorn", "corba", "jaxws" and "jaxp". +Welcome to OpenJDK! +=================== - The root repository can be obtained with something like: - hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9 +For information about building OpenJDK, including how to fully retrieve all +source code, please see either of these: - You can run the get_source.sh script located in the root repository to get - the other needed repositories: - cd openjdk9 && sh ./get_source.sh + * common/doc/building.html (html version) + * common/doc/building.md (markdown version) - 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 OpenJDK. - -Simple Build Instructions: - - 0. Get the necessary system software/packages installed on your system, see - http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html - - 1. If you don't have a jdk8 or newer jdk, download and install it from - http://java.sun.com/javase/downloads/index.jsp - Add the /bin directory of this installation to your PATH environment - variable. - - 2. Configure the build: - bash ./configure - - 3. Build the OpenJDK: - make all - The resulting JDK image should be found in build/*/images/jdk - -where make is GNU make 3.81 or newer, /usr/bin/make on Linux usually -is 3.81 or newer. Note that on Solaris, GNU make is called "gmake". - -Complete details are available in the file: - http://hg.openjdk.java.net/jdk9/jdk9/raw-file/tip/README-builds.html +See http://openjdk.java.net/ for more information about OpenJDK. diff --git a/README-builds.html b/README-builds.html deleted file mode 100644 index 6d7d5b52461..00000000000 --- a/README-builds.html +++ /dev/null @@ -1,1406 +0,0 @@ - - - OpenJDK Build README - - -

OpenJDK

- -

OpenJDK Build README

- -
- -

- -

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 IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

- -

Some Headlines:

- - - -
- -

Contents

- - - -
- - - -
- -

- -

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.

- -

- -

Getting the Source

- -

To get the entire set of OpenJDK Mercurial repositories use the script -get_source.sh located in the root repository:

- -
  hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
-  cd YourOpenJDK
-  bash ./get_source.sh
-
- -

Once you have all the repositories, keep in mind that each repository is its -own independent repository. You can also re-run ./get_source.sh anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same hg command to each of the repositories. For -example, the script make/scripts/hgforest.sh can be used to repeat the -same hg command on every repository, e.g.

- -
  cd YourOpenJDK
-  bash ./make/scripts/hgforest.sh status
-
- -

- -

Repositories

- -

The set of repositories and what they contain:

- - - -

Repository Source Guidelines

- -

There are some very basic guidelines:

- - - -
- -

- -

Building

- -

The very first step in building the OpenJDK is making sure the system itself -has everything it needs to do OpenJDK builds. Once a system is setup, it -generally doesn't need to be done again.

- -

Building the OpenJDK is now done with running a configure script which will -try and find and verify you have everything you need, followed by running -make, e.g.

- -
-

bash ./configure
- make all

-
- -

Where possible the configure script will attempt to located the various -components in the default locations or via component specific variable -settings. When the normal defaults fail or components cannot be found, -additional configure options may be necessary to help configure find the -necessary tools for the build, or you may need to re-visit the setup of your -system due to missing software packages.

- -

NOTE: The configure script file does not have execute permissions and -will need to be explicitly run with bash, see the source guidelines.

- -
- -

- -

System Setup

- -

Before even attempting to use a system to build the OpenJDK there are some very -basic system setups needed. For all systems:

- - - -

And for specific systems:

- - - -

- -

Linux

- -

With Linux, try and favor the system packages over building your own or getting -packages from other areas. Most Linux builds should be possible with the -system's available packages.

- -

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.

- -

- -

Solaris

- -

- -
Studio Compilers
- -

At a minimum, the Studio 12 Update 4 Compilers (containing -version 5.13 of the C and C++ compilers) is required, including specific -patches.

- -

The Solaris Studio installation should contain at least these packages:

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
PackageVersion
developer/solarisstudio-124/backend12.4-1.0.6.0
developer/solarisstudio-124/c++12.4-1.0.10.0
developer/solarisstudio-124/cc12.4-1.0.4.0
developer/solarisstudio-124/library/c++-libs12.4-1.0.10.0
developer/solarisstudio-124/library/math-libs12.4-1.0.0.1
developer/solarisstudio-124/library/studio-gccrt12.4-1.0.0.1
developer/solarisstudio-124/studio-common12.4-1.0.0.1
developer/solarisstudio-124/studio-ja12.4-1.0.0.1
developer/solarisstudio-124/studio-legal12.4-1.0.0.1
developer/solarisstudio-124/studio-zhCN12.4-1.0.0.1

-
- -

In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc -version.

- -

Place the bin directory in 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.

- -

- -

Windows

- -
Windows Unix Toolkit
- -

Building on Windows requires a Unix-like environment, notably a Unix-like -shell. There are several such environments available of which -Cygwin and -MinGW/MSYS are currently supported for the -OpenJDK build. One of the differences of these systems from standard Windows -tools is the way they handle Windows path names, particularly path names which -contain spaces, backslashes as path separators and possibly drive letters. -Depending on the use case and the specifics of each environment these path -problems can be solved by a combination of quoting whole paths, translating -backslashes to forward slashes, escaping backslashes with additional -backslashes and translating the path names to their "8.3" -version.

- -

- -
CYGWIN
- -

CYGWIN is an open source, Linux-like environment which tries to emulate a -complete POSIX layer on Windows. It tries to be smart about path names and can -usually handle all kinds of paths if they are correctly quoted or escaped -although internally it maps drive letters <drive>: to a virtual directory -/cygdrive/<drive>.

- -

You can always use the cygpath utility to map pathnames with spaces or the -backslash character into the C:/ style of pathname (called 'mixed'), e.g. -cygpath -s -m "<path>".

- -

Note that the 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 use ":"). 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.

- -

The OpenJDK build requires CYGWIN version 1.7.16 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.

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system

-
- -

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).

- -

- -
MinGW/MSYS
- -

MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific -header files and import libraries combined with GNU toolsets that allow one to -produce native Windows programs that do not rely on any 3rd-party C runtime -DLLs. MSYS is a supplement to MinGW which allows building applications and -programs which rely on traditional UNIX tools to be present. Among others this -includes tools like bash and make. See MinGW/MSYS for more information.

- -

Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters -<drive>: replaced by a virtual directory /<drive>. Additionally, MSYS -automatically detects binaries compiled for the MSYS environment and feeds them -with the internal, Unix-style path names. If native Windows applications are -called from within MSYS programs their path arguments are automatically -converted back to Windows style path names with drive letters and backslashes -as path separators. This may cause problems for Windows applications which use -forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may -wrongly replace such parameters by drive letters.

- -

In addition to the tools which will be installed by default, you have to -manually install the msys-zip and msys-unzip packages. This can be easily -done with the MinGW command line installer:

- -
  mingw-get.exe install msys-zip
-  mingw-get.exe install msys-unzip
-
- -

- -
Visual Studio 2013 Compilers
- -

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

- -

Only the C++ part of VS2013 is needed. Try to let the installation go to the -default install directory. Always reboot your system after installing VS2013. -The system environment variable VS120COMNTOOLS should be set in your -environment.

- -

Make sure that TMP and TEMP are also set in the environment and refer to -Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, -and not C:/temp. C:\temp is just an example, it is assumed that this area -is private to the user, so by default after installs you should see a unique -user path in these variables.

- -

- -

Mac OS X

- -

Make sure you get the right XCode version.

- -
- -

- -

Configure

- -

The basic invocation of the configure script looks like:

- -
-

bash ./configure [options]

-
- -

This will create an output directory containing the "configuration" and setup -an area for the build result. This directory typically looks like:

- -
-

build/linux-x64-normal-server-release

-
- -

configure will try to figure out what system you are running on and where all -necessary build components are. If you have all prerequisites for building -installed, it should find everything. If it fails to detect any component -automatically, it will exit and inform you about the problem. When this -happens, read more below in the configure options.

- -

Some examples:

- -
-

Windows 32bit build with freetype specified:
- bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32

- -

Debug 64bit Build:
- bash ./configure --enable-debug --with-target-bits=64

-
- -

- -

Configure Options

- -

Complete details on all the OpenJDK configure options can be seen with:

- -
-

bash ./configure --help=short

-
- -

Use -help to see all the configure options available. You can generate any -number of different configurations, e.g. debug, release, 32, 64, etc.

- -

Some of the more commonly used configure options are:

- -
-

--enable-debug
- set the debug level to fastdebug (this is a shorthand for --with-debug- - level=fastdebug)

-
- -

- -
-

--with-alsa=path
- select the location of the Advanced Linux Sound Architecture (ALSA)

- -

Version 0.9.1 or newer of the ALSA files are required for building the - OpenJDK on Linux. These Linux files are usually available from an "alsa" of - "libasound" development package, and it's highly recommended that you try - and use the package provided by the particular version of Linux that you are - using.

- -

--with-boot-jdk=path
- select the Bootstrap JDK

- -

--with-boot-jdk-jvmargs="args"
- provide the JVM options to be used to run the Bootstrap JDK

- -

--with-cacerts=path
- select the path to the cacerts file.

- -

See Certificate Authority on Wikipedia for a better understanding of the Certificate - Authority (CA). A certificates file named "cacerts" represents a system-wide - keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers.

-
- -

- -
-

--with-cups=path
- select the CUPS install location

- -

The Common UNIX Printing System (CUPS) Headers are required for building the - OpenJDK on Solaris and Linux. The Solaris header files can be obtained by - installing the package print/cups.

- -

The CUPS header files can always be downloaded from - www.cups.org.

- -

--with-cups-include=path
- select the CUPS include directory location

- -

--with-debug-level=level
- select the debug information level of release, fastdebug, or slowdebug

- -

--with-dev-kit=path
- select location of the compiler install or developer install location

-
- -

- -
-

--with-freetype=path
- select the freetype files to use.

- -

Expecting the freetype libraries under lib/ and the headers under - include/.

- -

Version 2.3 or newer of FreeType is required. On Unix systems required files - can be available as part of your distribution (while you still may need to - upgrade them). Note that you need development version of package that - includes both the FreeType library and header files.

- -

You can always download latest FreeType version from the FreeType - website. 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.

- -

--with-import-hotspot=path
- select the location to find hotspot binaries from a previous build to avoid - building hotspot

- -

--with-target-bits=arg
- select 32 or 64 bit build

- -

--with-jvm-variants=variants
- select the JVM variants to build from, comma separated list that can - include: server, client, kernel, zero and zeroshark

- -

--with-memory-size=size
- select the RAM size that GNU make will think this system has

- -

--with-msvcr-dll=path
- select the msvcr100.dll file to include in the Windows builds (C/C++ - runtime library for Visual Studio).

- -

This is usually picked up automatically from the redist directories of - Visual Studio 2013.

- -

--with-num-cores=cores
- select the number of cores to use (processor count or CPU count)

-
- -

- -
-

--with-x=path
- select the location of the X11 and xrender files.

- -

The XRender Extension Headers are required for building the OpenJDK on - Solaris and 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. - The Solaris XRender header files 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 or - /usr/openwin/share/include/X11/extensions/Xrender.h

-
- -
- -

- -

Make

- -

The basic invocation of the make utility looks like:

- -
-

make all

-
- -

This will start the build to the output directory containing the -"configuration" that was created by the configure script. Run make help for -more information on the available targets.

- -

There are some of the make targets that are of general interest:

- -
-

empty
- build everything but no images

- -

all
- build everything including images

- -

all-conf
- build all configurations

- -

images
- create complete j2sdk and j2re images

- -

install
- install the generated images locally, typically in /usr/local

- -

clean
- remove all files generated by make, but not those generated by configure

- -

dist-clean
- remove all files generated by both and configure (basically killing the - configuration)

- -

help
- give some help on using make, including some interesting make targets

-
- -
- -

- -

Testing

- -

When the build is completed, you should see the generated binaries and -associated files in the j2sdk-image directory in the output directory. In -particular, the build/*/images/j2sdk-image/bin directory should contain -executables for the OpenJDK tools and utilities for that configuration. The -testing tool jtreg will be needed and can be found at: the jtreg -site. The provided regression tests in the -repositories can be run with the command:

- -
-

cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all

-
- -
- -

- -

Appendix A: Hints and Tips

- -

- -

FAQ

- -

Q: The generated-configure.sh file looks horrible! How are you going to -edit it?
-A: The generated-configure.sh file is generated (think "compiled") by the -autoconf tools. The source code is in configure.ac and various .m4 files in -common/autoconf, which are much more readable.

- -

Q: Why is the generated-configure.sh file checked in, if it is -generated?
-A: If it was not generated, every user would need to have the autoconf -tools installed, and re-generate the configure file as the first step. Our -goal is to minimize the work needed to be done by the user to start building -OpenJDK, and to minimize the number of external dependencies required.

- -

Q: Do you require a specific version of autoconf for regenerating -generated-configure.sh?
-A: Yes, version 2.69 is required and should be easy enough to aquire on all -supported operating systems. The reason for this is to avoid large spurious -changes in generated-configure.sh.

- -

Q: How do you regenerate generated-configure.sh after making changes to -the input files?
-A: Regnerating generated-configure.sh should always be done using the -script common/autoconf/autogen.sh to ensure that the correct files get -updated. This script should also be run after mercurial tries to merge -generated-configure.sh as a merge of the generated file is not guaranteed to -be correct.

- -

Q: What are the files in common/makefiles/support/* for? They look like -gibberish.
-A: They are a somewhat ugly hack to compensate for command line length -limitations on certain platforms (Windows, Solaris). Due to a combination of -limitations in make and the shell, command lines containing too many files will -not work properly. These helper files are part of an elaborate hack that will -compress the command line in the makefile and then uncompress it safely. We're -not proud of it, but it does fix the problem. If you have any better -suggestions, we're all ears! :-)

- -

Q: I want to see the output of the commands that make runs, like in the old -build. How do I do that?
-A: You specify the LOG variable to make. There are several log levels:

- - - -

Q: When do I have to re-run configure?
-A: Normally you will run configure only once for creating a -configuration. You need to re-run configuration only if you want to change any -configuration options, or if you pull down changes to the configure script.

- -

Q: I have added a new source file. Do I need to modify the makefiles?
-A: Normally, no. If you want to create e.g. a new native library, you will -need to modify the makefiles. But for normal file additions or removals, no -changes are needed. There are certan exceptions for some native libraries where -the source files are spread over many directories which also contain sources -for other libraries. In these cases it was simply easier to create include -lists rather than excludes.

- -

Q: When I run configure --help, I see many strange options, like ---dvidir. What is this?
-A: Configure provides a slew of options by default, to all projects that -use autoconf. Most of them are not used in OpenJDK, so you can safely ignore -them. To list only OpenJDK specific features, use configure --help=short -instead.

- -

Q: configure provides OpenJDK-specific features such as --with- -builddeps-server that are not described in this document. What about those?
-A: Try them out if you like! But be aware that most of these are -experimental features. Many of them don't do anything at all at the moment; the -option is just a placeholder. Others depend on pieces of code or infrastructure -that is currently not ready for prime time.

- -

Q: How will you make sure you don't break anything?
-A: We have a script that compares the result of the new build system with -the result of the old. For most part, we aim for (and achieve) byte-by-byte -identical output. There are however technical issues with e.g. native binaries, -which might differ in a byte-by-byte comparison, even when building twice with -the old build system. For these, we compare relevant aspects (e.g. the symbol -table and file size). Note that we still don't have 100% equivalence, but we're -close.

- -

Q: I noticed this thing X in the build that looks very broken by design. -Why don't you fix it?
-A: Our goal is to produce a build output that is as close as technically -possible to the old build output. If things were weird in the old build, they -will be weird in the new build. Often, things were weird before due to -obscurity, but in the new build system the weird stuff comes up to the surface. -The plan is to attack these things at a later stage, after the new build system -is established.

- -

Q: The code in the new build system is not that well-structured. Will you -fix this?
-A: Yes! The new build system has grown bit by bit as we converted the old -system. When all of the old build system is converted, we can take a step back -and clean up the structure of the new build system. Some of this we plan to do -before replacing the old build system and some will need to wait until after.

- -

Q: Is anything able to use the results of the new build's default make -target?
-A: Yes, this is the minimal (or roughly minimal) set of compiled output -needed for a developer to actually execute the newly built JDK. The idea is -that in an incremental development fashion, when doing a normal make, you -should only spend time recompiling what's changed (making it purely -incremental) and only do the work that's needed to actually run and test your -code. The packaging stuff that is part of the images target is not needed for -a normal developer who wants to test his new code. Even if it's quite fast, -it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) -(Or, well, at least single-digit seconds...)

- -

Q: I usually set a specific environment variable when building, but I can't -find the equivalent in the new build. What should I do?
-A: It might very well be that we have neglected to add support for an -option that was actually used from outside the build system. Email us and we -will add support for it!

- -

- -

Build Performance Tips

- -

Building OpenJDK requires a lot of horsepower. Some of the build tools can be -adjusted to utilize more or less of resources such as parallel threads and -memory. The configure script analyzes your system and selects reasonable -values for such options based on your hardware. If you encounter resource -problems, such as out of memory conditions, you can modify the detected values -with:

- - - -

It might also be necessary to specify the JVM arguments passed to the Bootstrap -JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing -this will override the default JVM arguments passed to the Bootstrap JDK.

- -

One of the top goals of the new build system is to improve the build -performance and decrease the time needed to build. This will soon also apply to -the java compilation when the Smart Javac wrapper is fully supported.

- -

At the end of a successful execution of configure, you will get a performance -summary, indicating how well the build will perform. Here you will also get -performance hints. If you want to build fast, pay attention to those!

- -

Building with ccache

- -

The OpenJDK build supports building with ccache when using gcc or clang. Using -ccache can radically speed up compilation of native code if you often rebuild -the same sources. Your milage may vary however so we recommend evaluating it -for yourself. To enable it, make sure it's on the path and configure with ---enable-ccache.

- -

Building on local disk

- -

If you are using network shares, e.g. via NFS, for your source code, make sure -the build directory is situated on local disk. The performance penalty is -extremely high for building on a network share, close to unusable.

- -

Building only one JVM

- -

The old build builds multiple JVMs on 32-bit systems (client and server; and on -Windows kernel as well). In the new build we have changed this default to only -build server when it's available. This improves build times for those not -interested in multiple JVMs. To mimic the old behavior on platforms that -support it, use --with-jvm-variants=client,server.

- -

Selecting the number of cores to build on

- -

By default, configure will analyze your machine and run the make process in -parallel with as many threads as you have cores. This behavior can be -overridden, either "permanently" (on a configure basis) using ---with-num-cores=N or for a single build only (on a make basis), using -make JOBS=N.

- -

If you want to make a slower build just this time, to save some CPU power for -other processes, you can run e.g. make JOBS=2. This will force the makefiles -to only run 2 parallel processes, or even make JOBS=1 which will disable -parallelism.

- -

If you want to have it the other way round, namely having slow builds default -and override with fast if you're impatient, you should call configure with ---with-num-cores=2, making 2 the default. If you want to run with more cores, -run make JOBS=8

- -

- -

Troubleshooting

- -

Solving build problems

- -

If the build fails (and it's not due to a compilation error in a source file -you've changed), the first thing you should do is to re-run the build with more -verbosity. Do this by adding LOG=debug to your make command line.

- -

The build log (with both stdout and stderr intermingled, basically the same as -you see on your console) can be found as build.log in your build directory.

- -

You can ask for help on build problems with the new build system on either the -build-dev or the -build-infra-dev -mailing lists. Please include the relevant parts of the build log.

- -

A build can fail for any number of reasons. Most failures are a result of -trying to build in an environment in which all the pre-build requirements have -not been met. The first step in troubleshooting a build failure is to recheck -that you have satisfied all the pre-build requirements for your platform. -Scanning the configure log is a good first step, making sure that what it -found makes sense for your system. Look for strange error messages or any -difficulties that configure had in finding things.

- -

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

- - - -
- -

- -

Appendix B: GNU make

- -

The Makefiles in the OpenJDK are only valid when used with the GNU version of -the utility command make (usually called gmake on Solaris). 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/.

- -

- -

Building GNU make

- -

First step is to get the GNU make 3.81 or newer source from -ftp.gnu.org/pub/gnu/make/. Building is a -little different depending on the OS but is basically done with:

- -
  bash ./configure
-  make
-
- -
- -

- -

Appendix C: Build Environments

- -

Minimum Build Environments

- -

This file often describes specific requirements for what we call the "minimum -build environments" (MBE) for this specific release of the JDK. What is listed -below is what the Oracle Release Engineering Team will use to build the Oracle -JDK product. Building with the MBE will hopefully generate the most compatible -bits that install on, and run correctly on, the most variations of the same -base OS and hardware architecture. In some cases, these represent what is often -called the least common denominator, but each Operating System has different -aspects to it.

- -

In all cases, the Bootstrap JDK version minimum is critical, we cannot -guarantee builds will work with older Bootstrap JDK's. Also in all cases, more -RAM and more processors is better, the minimums listed below are simply -recommendations.

- -

With Solaris and Mac OS X, the version listed below is the oldest release we -can guarantee builds and works, and the specific version of the compilers used -could be critical.

- -

With Windows the critical aspect is the Visual Studio compiler used, which due -to it's runtime, generally dictates what Windows systems can do the builds and -where the resulting bits can be used.

- -

NOTE: We expect a change here off these older Windows OS releases and to a -'less older' one, probably Windows 2008R2 X64.

- -

With Linux, it was just a matter of picking a stable distribution that is a -good representative for Linux in general.

- -

It is understood that most developers will NOT be using these specific -versions, and in fact creating these specific versions may be difficult due to -the age of some of this software. It is expected that developers are more often -using the more recent releases and distributions of these operating systems.

- -

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 common problem with older, -newer, or unreleased OS versions. Please report these types of problems as bugs -so that they can be dealt with accordingly.

- -
-

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Oracle Enterprise Linux 6.4gcc 4.9.2 JDK 82 or more1 GB6 GB
Solaris SPARCV9 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patchesJDK 84 or more4 GB8 GB
Solaris X64 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patchesJDK 84 or more4 GB8 GB
Windows X86 (32-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional EditionJDK 82 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional EditionJDK 82 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.9 "Mavericks"Xcode 6.3 or newerJDK 82 or more4 GB6 GB

-
- -
- -

- -

Specific Developer Build Environments

- -

We won't be listing all the possible environments, but we will try to provide -what information we have available to us.

- -

NOTE: The community can help out by updating this part of the document.

- -

Fedora

- -

After installing the latest Fedora 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.7.0-openjdk
-  yum install gcc gcc-c++
-
- -

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

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
-
- -

CentOS 5.5

- -

After installing CentOS 5.5 you need to make sure you -have the following Development bundles installed:

- - - -

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:

- -
  bash ./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.

- -

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-7
-  aptitude install openjdk-7-jdk libmotif-dev
-
- -

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

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
- -

Ubuntu 12.04

- -

After installing Ubuntu 12.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-7
-  sudo aptitude install openjdk-7-jdk
-
- -

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

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
-
- -

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_7_0-openjdk
-  sudo zypper install make
-
- -

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

- -
  export LANG=C
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
-
- -

Finally, you need to unset the JAVA_HOME environment variable:

- -
  export -n JAVA_HOME`
-
- -

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.7.0-openjdk-devel 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
-  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
-
- -

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 SUNWj7dev 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
-  export PATH="/opt/SunStudioExpress/bin:${PATH}"
-
- -
- -

End of the OpenJDK build README document.

- -

Please come again!

- - diff --git a/common/autoconf/basics.m4 b/common/autoconf/basics.m4 index 35e835c3994..0bce558c1c7 100644 --- a/common/autoconf/basics.m4 +++ b/common/autoconf/basics.m4 @@ -530,6 +530,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_FUNDAMENTAL_TOOLS], BASIC_PATH_PROGS(DF, df) BASIC_PATH_PROGS(CPIO, [cpio bsdcpio]) BASIC_PATH_PROGS(NICE, nice) + BASIC_PATH_PROGS(PANDOC, pandoc) ]) # Setup basic configuration paths, and platform-specific stuff related to PATHs. @@ -1094,9 +1095,11 @@ AC_DEFUN_ONCE([BASIC_SETUP_COMPLEX_TOOLS], OTOOL="true" fi BASIC_PATH_PROGS(READELF, [greadelf readelf]) + BASIC_PATH_PROGS(DOT, dot) BASIC_PATH_PROGS(HG, hg) BASIC_PATH_PROGS(STAT, stat) BASIC_PATH_PROGS(TIME, time) + BASIC_PATH_PROGS(FLOCK, flock) # Dtrace is usually found in /usr/sbin on Solaris, but that directory may not # be in the user path. BASIC_PATH_PROGS(DTRACE, dtrace, $PATH:/usr/sbin) @@ -1202,6 +1205,18 @@ AC_DEFUN_ONCE([BASIC_TEST_USABILITY_ISSUES], # Check for support for specific options in bash AC_DEFUN_ONCE([BASIC_CHECK_BASH_OPTIONS], [ + # Check bash version + # Extra [ ] to stop m4 mangling + [ BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` ] + AC_MSG_CHECKING([bash version]) + AC_MSG_RESULT([$BASH_VER]) + + BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` + BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` + if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then + AC_MSG_ERROR([bash version 3.2 or better is required]) + fi + # Test if bash supports pipefail. AC_MSG_CHECKING([if bash supports pipefail]) if ${BASH} -c 'set -o pipefail'; then diff --git a/common/autoconf/basics_windows.m4 b/common/autoconf/basics_windows.m4 index 1a79bf8fc86..2ae6e34a556 100644 --- a/common/autoconf/basics_windows.m4 +++ b/common/autoconf/basics_windows.m4 @@ -329,8 +329,8 @@ AC_DEFUN([BASIC_CHECK_PATHS_WINDOWS], AC_MSG_ERROR([Something is wrong with your cygwin installation since I cannot find cygpath.exe in your path]) fi AC_MSG_CHECKING([cygwin root directory as unix-style path]) - # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away - cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"` + # The cmd output ends with Windows line endings (CR/LF) + cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'` # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` AC_MSG_RESULT([$CYGWIN_ROOT_PATH]) diff --git a/common/autoconf/flags.m4 b/common/autoconf/flags.m4 index ca7f625664c..a96b74be793 100644 --- a/common/autoconf/flags.m4 +++ b/common/autoconf/flags.m4 @@ -355,7 +355,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" fi - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' @@ -375,7 +375,7 @@ AC_DEFUN([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS], # Linking is different on MacOSX PICFLAG='' SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or [$]1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,[$]1' diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh index 917181abf10..e74aee4df34 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh @@ -918,6 +918,7 @@ COMPRESS_JARS INCLUDE_SA UNLIMITED_CRYPTO CACERTS_FILE +ENABLE_FULL_DOCS ENABLE_HEADLESS_ONLY DEFAULT_MAKE_TARGET OS_VERSION_MICRO @@ -932,9 +933,11 @@ DSYMUTIL IS_GNU_TIME PATCH DTRACE +FLOCK TIME STAT HG +DOT READELF OTOOL LDD @@ -993,8 +996,8 @@ OPENJDK_TARGET_CPU_OSARCH OPENJDK_TARGET_CPU_ISADIR OPENJDK_TARGET_CPU_LEGACY_LIB OPENJDK_TARGET_CPU_LEGACY -REQUIRED_OS_VERSION -REQUIRED_OS_NAME +OPENJDK_MODULE_TARGET_OS_ARCH +OPENJDK_MODULE_TARGET_OS_NAME COMPILE_TYPE OPENJDK_TARGET_CPU_ENDIAN OPENJDK_TARGET_CPU_BITS @@ -1024,6 +1027,7 @@ build_os build_vendor build_cpu build +PANDOC NICE CPIO DF @@ -1136,6 +1140,7 @@ with_conf_name with_output_sync with_default_make_target enable_headless_only +enable_full_docs with_cacerts_file enable_unlimited_crypto with_copyright_year @@ -1281,15 +1286,18 @@ READLINK DF CPIO NICE +PANDOC MAKE UNZIP ZIPEXE LDD OTOOL READELF +DOT HG STAT TIME +FLOCK DTRACE PATCH DSYMUTIL @@ -1967,6 +1975,8 @@ Optional Features: --enable-debug set the debug level to fastdebug (shorthand for --with-debug-level=fastdebug) [disabled] --enable-headless-only only build headless (no GUI) support [disabled] + --enable-full-docs build complete documentation [enabled if all tools + found] --disable-unlimited-crypto Disable unlimited crypto policy [enabled] --disable-keep-packaged-modules @@ -2244,15 +2254,18 @@ Some influential environment variables: DF Override default value for DF CPIO Override default value for CPIO NICE Override default value for NICE + PANDOC Override default value for PANDOC MAKE Override default value for MAKE UNZIP Override default value for UNZIP ZIPEXE Override default value for ZIPEXE LDD Override default value for LDD OTOOL Override default value for OTOOL READELF Override default value for READELF + DOT Override default value for DOT HG Override default value for HG STAT Override default value for STAT TIME Override default value for TIME + FLOCK Override default value for FLOCK DTRACE Override default value for DTRACE PATCH Override default value for PATCH DSYMUTIL Override default value for DSYMUTIL @@ -5043,7 +5056,7 @@ TOOLCHAIN_MINIMUM_VERSION_xlc="" # # $1 = compiler to test (CC or CXX) # $2 = human readable name of compiler (C or C++) -# $3 = list of compiler names to search for +# $3 = compiler name to search for # Detect the core components of the toolchain, i.e. the compilers (CC and CXX), @@ -5170,7 +5183,7 @@ VS_SDK_PLATFORM_NAME_2013= #CUSTOM_AUTOCONF_INCLUDE # Do not change or remove the following line, it is needed for consistency checks: -DATE_WHEN_GENERATED=1486175373 +DATE_WHEN_GENERATED=1492975963 ############################################################################### # @@ -15358,6 +15371,203 @@ $as_echo "$tool_specified" >&6; } + # Publish this variable in the help. + + + if [ -z "${PANDOC+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !PANDOC! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!PANDOC!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xPANDOC" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of PANDOC from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in pandoc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PANDOC" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$PANDOC" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool PANDOC= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool PANDOC= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 +$as_echo_n "checking for PANDOC... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$PANDOC" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool PANDOC=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool PANDOC=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PANDOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PANDOC in + [\\/]* | ?:[\\/]*) + ac_cv_path_PANDOC="$PANDOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PANDOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PANDOC=$ac_cv_path_PANDOC +if test -n "$PANDOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PANDOC" >&5 +$as_echo "$PANDOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$PANDOC" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool PANDOC=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool PANDOC=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PANDOC" >&5 +$as_echo_n "checking for PANDOC... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool PANDOC=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + + + # Now we can determine OpenJDK build and target platforms. This is required to # have early on. # Make sure we can run config.sub. @@ -15821,29 +16031,16 @@ $as_echo_n "checking compilation type... " >&6; } $as_echo "$COMPILE_TYPE" >&6; } - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - REQUIRED_OS_NAME=SunOS - REQUIRED_OS_VERSION=5.10 + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_MODULE_TARGET_OS_NAME="macos" + else + OPENJDK_MODULE_TARGET_OS_NAME="$OPENJDK_TARGET_OS" fi - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then - REQUIRED_OS_NAME=Linux - REQUIRED_OS_VERSION=2.6 - fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - REQUIRED_OS_NAME=Windows - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - REQUIRED_OS_VERSION=5.2 - else - REQUIRED_OS_VERSION=5.1 - fi - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin - REQUIRED_OS_VERSION=11.2 - fi - if test "x$OPENJDK_TARGET_OS" = "xaix"; then - REQUIRED_OS_NAME=AIX - REQUIRED_OS_VERSION=7.1 + + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_MODULE_TARGET_OS_ARCH="amd64" + else + OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU" fi @@ -16200,8 +16397,8 @@ $as_echo "$as_me: Your cygwin is too old. You are running $CYGWIN_VERSION, but a fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking cygwin root directory as unix-style path" >&5 $as_echo_n "checking cygwin root directory as unix-style path... " >&6; } - # The cmd output ends with Windows line endings (CR/LF), the grep command will strip that away - cygwin_winpath_root=`cd / ; cmd /c cd | $GREP ".*"` + # The cmd output ends with Windows line endings (CR/LF) + cygwin_winpath_root=`cd / ; cmd /c cd | $TR -d '\r\n'` # Force cygpath to report the proper root by including a trailing space, and then stripping it off again. CYGWIN_ROOT_PATH=`$CYGPATH -u "$cygwin_winpath_root " | $CUT -f 1 -d " "` { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CYGWIN_ROOT_PATH" >&5 @@ -22267,6 +22464,203 @@ $as_echo "$tool_specified" >&6; } + # Publish this variable in the help. + + + if [ -z "${DOT+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in dot +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DOT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOT="$DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DOT=$ac_cv_path_DOT +if test -n "$DOT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 +$as_echo "$DOT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DOT" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !DOT! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!DOT!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xDOT" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of DOT from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of DOT from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in dot +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DOT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOT="$DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DOT=$ac_cv_path_DOT +if test -n "$DOT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 +$as_echo "$DOT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DOT" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$DOT" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool DOT= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool DOT= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOT" >&5 +$as_echo_n "checking for DOT... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$DOT" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool DOT=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool DOT=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_DOT+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $DOT in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOT="$DOT" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_DOT="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +DOT=$ac_cv_path_DOT +if test -n "$DOT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DOT" >&5 +$as_echo "$DOT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$DOT" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool DOT=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool DOT=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DOT" >&5 +$as_echo_n "checking for DOT... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool DOT=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + + + # Publish this variable in the help. @@ -22856,6 +23250,203 @@ $as_echo "$tool_specified" >&6; } fi + + + # Publish this variable in the help. + + + if [ -z "${FLOCK+x}" ]; then + # The variable is not set by user, try to locate tool using the code snippet + for ac_prog in flock +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_FLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $FLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +FLOCK=$ac_cv_path_FLOCK +if test -n "$FLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 +$as_echo "$FLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$FLOCK" && break +done + + else + # The variable is set, but is it from the command line or the environment? + + # Try to remove the string !FLOCK! from our list. + try_remove_var=${CONFIGURE_OVERRIDDEN_VARIABLES//!FLOCK!/} + if test "x$try_remove_var" = "x$CONFIGURE_OVERRIDDEN_VARIABLES"; then + # If it failed, the variable was not from the command line. Ignore it, + # but warn the user (except for BASH, which is always set by the calling BASH). + if test "xFLOCK" != xBASH; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Ignoring value of FLOCK from the environment. Use command line variables instead." >&5 +$as_echo "$as_me: WARNING: Ignoring value of FLOCK from the environment. Use command line variables instead." >&2;} + fi + # Try to locate tool using the code snippet + for ac_prog in flock +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_FLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $FLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +FLOCK=$ac_cv_path_FLOCK +if test -n "$FLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 +$as_echo "$FLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$FLOCK" && break +done + + else + # If it succeeded, then it was overridden by the user. We will use it + # for the tool. + + # First remove it from the list of overridden variables, so we can test + # for unknown variables in the end. + CONFIGURE_OVERRIDDEN_VARIABLES="$try_remove_var" + + # Check if we try to supply an empty value + if test "x$FLOCK" = x; then + { $as_echo "$as_me:${as_lineno-$LINENO}: Setting user supplied tool FLOCK= (no value)" >&5 +$as_echo "$as_me: Setting user supplied tool FLOCK= (no value)" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLOCK" >&5 +$as_echo_n "checking for FLOCK... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: disabled" >&5 +$as_echo "disabled" >&6; } + else + # Check if the provided tool contains a complete path. + tool_specified="$FLOCK" + tool_basename="${tool_specified##*/}" + if test "x$tool_basename" = "x$tool_specified"; then + # A command without a complete path is provided, search $PATH. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will search for user supplied tool FLOCK=$tool_basename" >&5 +$as_echo "$as_me: Will search for user supplied tool FLOCK=$tool_basename" >&6;} + # Extract the first word of "$tool_basename", so it can be a program name with args. +set dummy $tool_basename; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_FLOCK+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $FLOCK in + [\\/]* | ?:[\\/]*) + ac_cv_path_FLOCK="$FLOCK" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_FLOCK="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +FLOCK=$ac_cv_path_FLOCK +if test -n "$FLOCK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FLOCK" >&5 +$as_echo "$FLOCK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test "x$FLOCK" = x; then + as_fn_error $? "User supplied tool $tool_basename could not be found" "$LINENO" 5 + fi + else + # Otherwise we believe it is a complete path. Use it as it is. + { $as_echo "$as_me:${as_lineno-$LINENO}: Will use user supplied tool FLOCK=$tool_specified" >&5 +$as_echo "$as_me: Will use user supplied tool FLOCK=$tool_specified" >&6;} + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for FLOCK" >&5 +$as_echo_n "checking for FLOCK... " >&6; } + if test ! -x "$tool_specified"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 +$as_echo "not found" >&6; } + as_fn_error $? "User supplied tool FLOCK=$tool_specified does not exist or is not executable" "$LINENO" 5 + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $tool_specified" >&5 +$as_echo "$tool_specified" >&6; } + fi + fi + fi + + fi + + # Dtrace is usually found in /usr/sbin on Solaris, but that directory may not # be in the user path. @@ -24092,6 +24683,20 @@ $as_echo "$tool_specified" >&6; } fi + # Check bash version + # Extra [ ] to stop m4 mangling + BASH_VER=`$BASH --version | $SED -n -e 's/^.*bash.*ersion *\([0-9.]*\).*$/\1/ p'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking bash version" >&5 +$as_echo_n "checking bash version... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $BASH_VER" >&5 +$as_echo "$BASH_VER" >&6; } + + BASH_MAJOR=`$ECHO $BASH_VER | $CUT -d . -f 1` + BASH_MINOR=`$ECHO $BASH_VER | $CUT -d . -f 2` + if test $BASH_MAJOR -lt 3 || (test $BASH_MAJOR -eq 3 && test $BASH_MINOR -lt 2); then + as_fn_error $? "bash version 3.2 or better is required" "$LINENO" 5 + fi + # Test if bash supports pipefail. { $as_echo "$as_me:${as_lineno-$LINENO}: checking if bash supports pipefail" >&5 $as_echo_n "checking if bash supports pipefail... " >&6; } @@ -24306,6 +24911,101 @@ $as_echo "no" >&6; } + # Should we build the complete docs, or just a lightweight version? + # Check whether --enable-full-docs was given. +if test "${enable_full_docs+set}" = set; then : + enableval=$enable_full_docs; +fi + + + # Verify dependencies + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for graphviz dot" >&5 +$as_echo_n "checking for graphviz dot... " >&6; } + if test "x$DOT" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cannot generate full docs" >&5 +$as_echo "no, cannot generate full docs" >&6; } + FULL_DOCS_DEP_MISSING=true + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pandoc" >&5 +$as_echo_n "checking for pandoc... " >&6; } + if test "x$PANDOC" != "x"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, cannot generate full docs" >&5 +$as_echo "no, cannot generate full docs" >&6; } + FULL_DOCS_DEP_MISSING=true + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking full docs" >&5 +$as_echo_n "checking full docs... " >&6; } + if test "x$enable_full_docs" = xyes; then + if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 +$as_echo "no, missing dependencies" >&6; } + + # Print a helpful message on how to acquire the necessary build dependency. + # dot is the help tag: freetype, cups, alsa etc + MISSING_DEPENDENCY=dot + + if test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.cygwin"; then + cygwin_help $MISSING_DEPENDENCY + elif test "x$OPENJDK_BUILD_OS_ENV" = "xwindows.msys"; then + msys_help $MISSING_DEPENDENCY + else + PKGHANDLER_COMMAND= + + case $PKGHANDLER in + apt-get) + apt_help $MISSING_DEPENDENCY ;; + yum) + yum_help $MISSING_DEPENDENCY ;; + brew) + brew_help $MISSING_DEPENDENCY ;; + port) + port_help $MISSING_DEPENDENCY ;; + pkgutil) + pkgutil_help $MISSING_DEPENDENCY ;; + pkgadd) + pkgadd_help $MISSING_DEPENDENCY ;; + esac + + if test "x$PKGHANDLER_COMMAND" != x; then + HELP_MSG="You might be able to fix this by running '$PKGHANDLER_COMMAND'." + fi + fi + + as_fn_error $? "Cannot enable full docs with missing dependencies. See above. $HELP_MSG" "$LINENO" 5 + else + ENABLE_FULL_DOCS=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 +$as_echo "yes, forced" >&6; } + fi + elif test "x$enable_full_docs" = xno; then + ENABLE_FULL_DOCS=false + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, forced" >&5 +$as_echo "no, forced" >&6; } + elif test "x$enable_full_docs" = x; then + # Check for prerequisites + if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then + ENABLE_FULL_DOCS=false + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, missing dependencies" >&5 +$as_echo "no, missing dependencies" >&6; } + else + ENABLE_FULL_DOCS=true + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, dependencies present" >&5 +$as_echo "yes, dependencies present" >&6; } + fi + else + as_fn_error $? "--enable-full-docs can only take yes or no" "$LINENO" 5 + fi + + + # Choose cacerts source file # Check whether --with-cacerts-file was given. @@ -33124,10 +33824,9 @@ done if test -n "$TOOLCHAIN_PATH"; then PATH_save="$PATH" PATH="$TOOLCHAIN_PATH" - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_TOOLCHAIN_PATH_CC+:} false; then : @@ -33166,20 +33865,73 @@ $as_echo "no" >&6; } fi - test -n "$TOOLCHAIN_PATH_CC" && break +fi +if test -z "$ac_cv_path_TOOLCHAIN_PATH_CC"; then + ac_pt_TOOLCHAIN_PATH_CC=$TOOLCHAIN_PATH_CC + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_TOOLCHAIN_PATH_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$ac_pt_TOOLCHAIN_PATH_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_TOOLCHAIN_PATH_CC=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CC +if test -n "$ac_pt_TOOLCHAIN_PATH_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CC" >&5 +$as_echo "$ac_pt_TOOLCHAIN_PATH_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_TOOLCHAIN_PATH_CC" = x; then + TOOLCHAIN_PATH_CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + TOOLCHAIN_PATH_CC=$ac_pt_TOOLCHAIN_PATH_CC + fi +else + TOOLCHAIN_PATH_CC="$ac_cv_path_TOOLCHAIN_PATH_CC" +fi CC=$TOOLCHAIN_PATH_CC PATH="$PATH_save" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, + # AC_PATH_TOOL can't be run multiple times with the same variable, # so create a new name for this run. if test "x$CC" = x; then - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_POTENTIAL_CC+:} false; then : @@ -33218,8 +33970,62 @@ $as_echo "no" >&6; } fi - test -n "$POTENTIAL_CC" && break +fi +if test -z "$ac_cv_path_POTENTIAL_CC"; then + ac_pt_POTENTIAL_CC=$POTENTIAL_CC + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_POTENTIAL_CC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_POTENTIAL_CC in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_POTENTIAL_CC="$ac_pt_POTENTIAL_CC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_POTENTIAL_CC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_POTENTIAL_CC=$ac_cv_path_ac_pt_POTENTIAL_CC +if test -n "$ac_pt_POTENTIAL_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CC" >&5 +$as_echo "$ac_pt_POTENTIAL_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_POTENTIAL_CC" = x; then + POTENTIAL_CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + POTENTIAL_CC=$ac_pt_POTENTIAL_CC + fi +else + POTENTIAL_CC="$ac_cv_path_POTENTIAL_CC" +fi CC=$POTENTIAL_CC fi @@ -34425,10 +35231,9 @@ done if test -n "$TOOLCHAIN_PATH"; then PATH_save="$PATH" PATH="$TOOLCHAIN_PATH" - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_TOOLCHAIN_PATH_CXX+:} false; then : @@ -34467,20 +35272,73 @@ $as_echo "no" >&6; } fi - test -n "$TOOLCHAIN_PATH_CXX" && break +fi +if test -z "$ac_cv_path_TOOLCHAIN_PATH_CXX"; then + ac_pt_TOOLCHAIN_PATH_CXX=$TOOLCHAIN_PATH_CXX + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_TOOLCHAIN_PATH_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$ac_pt_TOOLCHAIN_PATH_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_TOOLCHAIN_PATH_CXX=$ac_cv_path_ac_pt_TOOLCHAIN_PATH_CXX +if test -n "$ac_pt_TOOLCHAIN_PATH_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_TOOLCHAIN_PATH_CXX" >&5 +$as_echo "$ac_pt_TOOLCHAIN_PATH_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_TOOLCHAIN_PATH_CXX" = x; then + TOOLCHAIN_PATH_CXX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + TOOLCHAIN_PATH_CXX=$ac_pt_TOOLCHAIN_PATH_CXX + fi +else + TOOLCHAIN_PATH_CXX="$ac_cv_path_TOOLCHAIN_PATH_CXX" +fi CXX=$TOOLCHAIN_PATH_CXX PATH="$PATH_save" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, + # AC_PATH_TOOL can't be run multiple times with the same variable, # so create a new name for this run. if test "x$CXX" = x; then - for ac_prog in $SEARCH_LIST -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}$SEARCH_LIST", so it can be a program name with args. +set dummy ${ac_tool_prefix}$SEARCH_LIST; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_POTENTIAL_CXX+:} false; then : @@ -34519,8 +35377,62 @@ $as_echo "no" >&6; } fi - test -n "$POTENTIAL_CXX" && break +fi +if test -z "$ac_cv_path_POTENTIAL_CXX"; then + ac_pt_POTENTIAL_CXX=$POTENTIAL_CXX + # Extract the first word of "$SEARCH_LIST", so it can be a program name with args. +set dummy $SEARCH_LIST; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_POTENTIAL_CXX+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_POTENTIAL_CXX in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_POTENTIAL_CXX="$ac_pt_POTENTIAL_CXX" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_POTENTIAL_CXX="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_POTENTIAL_CXX=$ac_cv_path_ac_pt_POTENTIAL_CXX +if test -n "$ac_pt_POTENTIAL_CXX"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_POTENTIAL_CXX" >&5 +$as_echo "$ac_pt_POTENTIAL_CXX" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_POTENTIAL_CXX" = x; then + POTENTIAL_CXX="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + POTENTIAL_CXX=$ac_pt_POTENTIAL_CXX + fi +else + POTENTIAL_CXX="$ac_cv_path_POTENTIAL_CXX" +fi CXX=$POTENTIAL_CXX fi @@ -49060,7 +49972,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" JVM_CFLAGS="$JVM_CFLAGS $PICFLAG" fi - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1' @@ -49080,7 +49992,7 @@ $as_echo "$ac_cv_c_bigendian" >&6; } # Linking is different on MacOSX PICFLAG='' SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG" - SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.' + SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path$(or $1,/.)' SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN" SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/$1' SET_SHARED_LIBRARY_MAPFILE='-Wl,-exported_symbols_list,$1' @@ -52629,12 +53541,12 @@ $as_echo "no, forced" >&6; } # Only enable AOT on linux-X64. if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then - if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then + if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then ENABLE_AOT="true" else ENABLE_AOT="false" if test "x$enable_aot" = "xyes"; then - as_fn_error $? "Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot." "$LINENO" 5 + as_fn_error $? "Cannot build AOT without hotspot/src/jdk.internal.vm.compiler sources. Remove --enable-aot." "$LINENO" 5 fi fi else @@ -64365,8 +65277,8 @@ $as_echo "$JVM_FEATURES" >&6; } JVM_FEATURES_jvmci="" fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.vm.compiler should be built" >&5 -$as_echo_n "checking if jdk.vm.compiler should be built... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if jdk.internal.vm.compiler should be built" >&5 +$as_echo_n "checking if jdk.internal.vm.compiler should be built... " >&6; } if [[ " $JVM_FEATURES " =~ " graal " ]] ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, forced" >&5 $as_echo "yes, forced" >&6; } diff --git a/common/autoconf/hotspot.m4 b/common/autoconf/hotspot.m4 index b295b015a9f..acf2a5fe185 100644 --- a/common/autoconf/hotspot.m4 +++ b/common/autoconf/hotspot.m4 @@ -215,12 +215,12 @@ AC_DEFUN_ONCE([HOTSPOT_ENABLE_DISABLE_AOT], # Only enable AOT on linux-X64. if test "x$OPENJDK_TARGET_OS-$OPENJDK_TARGET_CPU" = "xlinux-x86_64"; then if test -e "$HOTSPOT_TOPDIR/src/jdk.aot"; then - if test -e "$HOTSPOT_TOPDIR/src/jdk.vm.compiler"; then + if test -e "$HOTSPOT_TOPDIR/src/jdk.internal.vm.compiler"; then ENABLE_AOT="true" else ENABLE_AOT="false" if test "x$enable_aot" = "xyes"; then - AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.vm.compiler sources. Remove --enable-aot.]) + AC_MSG_ERROR([Cannot build AOT without hotspot/src/jdk.internal.vm.compiler sources. Remove --enable-aot.]) fi fi else @@ -327,7 +327,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES], JVM_FEATURES_jvmci="" fi - AC_MSG_CHECKING([if jdk.vm.compiler should be built]) + AC_MSG_CHECKING([if jdk.internal.vm.compiler should be built]) if HOTSPOT_CHECK_JVM_FEATURE(graal); then AC_MSG_RESULT([yes, forced]) if test "x$JVM_FEATURES_jvmci" != "xjvmci" ; then diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 index bb2a49f4980..73e2d74ecd5 100644 --- a/common/autoconf/jdk-options.m4 +++ b/common/autoconf/jdk-options.m4 @@ -154,6 +154,55 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], AC_SUBST(ENABLE_HEADLESS_ONLY) + # Should we build the complete docs, or just a lightweight version? + AC_ARG_ENABLE([full-docs], [AS_HELP_STRING([--enable-full-docs], + [build complete documentation @<:@enabled if all tools found@:>@])]) + + # Verify dependencies + AC_MSG_CHECKING([for graphviz dot]) + if test "x$DOT" != "x"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no, cannot generate full docs]) + FULL_DOCS_DEP_MISSING=true + fi + + AC_MSG_CHECKING([for pandoc]) + if test "x$PANDOC" != "x"; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no, cannot generate full docs]) + FULL_DOCS_DEP_MISSING=true + fi + + AC_MSG_CHECKING([full docs]) + if test "x$enable_full_docs" = xyes; then + if test "x$FULL_DOCS_DEP_MISSING" = "xtrue"; then + AC_MSG_RESULT([no, missing dependencies]) + HELP_MSG_MISSING_DEPENDENCY([dot]) + AC_MSG_ERROR([Cannot enable full docs with missing dependencies. See above. $HELP_MSG]) + else + ENABLE_FULL_DOCS=true + AC_MSG_RESULT([yes, forced]) + fi + elif test "x$enable_full_docs" = xno; then + ENABLE_FULL_DOCS=false + AC_MSG_RESULT([no, forced]) + elif test "x$enable_full_docs" = x; then + # Check for prerequisites + if test "x$FULL_DOCS_DEP_MISSING" = xtrue; then + ENABLE_FULL_DOCS=false + AC_MSG_RESULT([no, missing dependencies]) + else + ENABLE_FULL_DOCS=true + AC_MSG_RESULT([yes, dependencies present]) + fi + else + AC_MSG_ERROR([--enable-full-docs can only take yes or no]) + fi + + AC_SUBST(ENABLE_FULL_DOCS) + # Choose cacerts source file AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file], [specify alternative cacerts file])]) diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 index 61010279a0e..c9c339decb3 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -433,35 +433,22 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER], ]) -AC_DEFUN([PLATFORM_SET_RELEASE_FILE_OS_VALUES], +AC_DEFUN([PLATFORM_SET_MODULE_TARGET_OS_VALUES], [ - if test "x$OPENJDK_TARGET_OS" = "xsolaris"; then - REQUIRED_OS_NAME=SunOS - REQUIRED_OS_VERSION=5.10 - fi - if test "x$OPENJDK_TARGET_OS" = "xlinux"; then - REQUIRED_OS_NAME=Linux - REQUIRED_OS_VERSION=2.6 - fi - if test "x$OPENJDK_TARGET_OS" = "xwindows"; then - REQUIRED_OS_NAME=Windows - if test "x$OPENJDK_TARGET_CPU_BITS" = "x64"; then - REQUIRED_OS_VERSION=5.2 - else - REQUIRED_OS_VERSION=5.1 - fi - fi - if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then - REQUIRED_OS_NAME=Darwin - REQUIRED_OS_VERSION=11.2 - fi - if test "x$OPENJDK_TARGET_OS" = "xaix"; then - REQUIRED_OS_NAME=AIX - REQUIRED_OS_VERSION=7.1 + if test "x$OPENJDK_TARGET_OS" = xmacosx; then + OPENJDK_MODULE_TARGET_OS_NAME="macos" + else + OPENJDK_MODULE_TARGET_OS_NAME="$OPENJDK_TARGET_OS" fi - AC_SUBST(REQUIRED_OS_NAME) - AC_SUBST(REQUIRED_OS_VERSION) + if test "x$OPENJDK_TARGET_CPU" = xx86_64; then + OPENJDK_MODULE_TARGET_OS_ARCH="amd64" + else + OPENJDK_MODULE_TARGET_OS_ARCH="$OPENJDK_TARGET_CPU" + fi + + AC_SUBST(OPENJDK_MODULE_TARGET_OS_NAME) + AC_SUBST(OPENJDK_MODULE_TARGET_OS_ARCH) ]) #%%% Build and target systems %%% @@ -478,7 +465,7 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_BUILD_AND_TARGET], PLATFORM_EXTRACT_TARGET_AND_BUILD PLATFORM_SETUP_TARGET_CPU_BITS - PLATFORM_SET_RELEASE_FILE_OS_VALUES + PLATFORM_SET_MODULE_TARGET_OS_VALUES PLATFORM_SETUP_LEGACY_VARS ]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in index bb6d2209c41..a600cd4873f 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -48,7 +48,7 @@ MAKE := @MAKE@ # The default make arguments MAKE_ARGS = $(MAKE_LOG_FLAGS) -r -R -I $(TOPDIR)/make/common SPEC=$(SPEC) \ - MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" LOG_LEVEL=$(LOG_LEVEL) + MAKE_LOG_FLAGS="$(MAKE_LOG_FLAGS)" $(MAKE_LOG_VARS) OUTPUT_SYNC_SUPPORTED:=@OUTPUT_SYNC_SUPPORTED@ OUTPUT_SYNC:=@OUTPUT_SYNC@ @@ -101,9 +101,9 @@ OPENJDK_BUILD_CPU_ARCH:=@OPENJDK_BUILD_CPU_ARCH@ OPENJDK_BUILD_CPU_BITS:=@OPENJDK_BUILD_CPU_BITS@ OPENJDK_BUILD_CPU_ENDIAN:=@OPENJDK_BUILD_CPU_ENDIAN@ -# Legacy OS values for use in release file. -REQUIRED_OS_NAME:=@REQUIRED_OS_NAME@ -REQUIRED_OS_VERSION:=@REQUIRED_OS_VERSION@ +# OS values for use in ModuleTarget class file attribute. +OPENJDK_MODULE_TARGET_OS_NAME:=@OPENJDK_MODULE_TARGET_OS_NAME@ +OPENJDK_MODULE_TARGET_OS_ARCH:=@OPENJDK_MODULE_TARGET_OS_ARCH@ LIBM:=@LIBM@ LIBDL:=@LIBDL@ @@ -244,6 +244,8 @@ USE_PRECOMPILED_HEADER := @USE_PRECOMPILED_HEADER@ # Only build headless support or not ENABLE_HEADLESS_ONLY := @ENABLE_HEADLESS_ONLY@ +ENABLE_FULL_DOCS := @ENABLE_FULL_DOCS@ + # JDK_OUTPUTDIR specifies where a working jvm is built. # You can run $(JDK_OUTPUTDIR)/bin/java # Though the layout of the contents of $(JDK_OUTPUTDIR) is not @@ -574,20 +576,31 @@ BUILD_JAVA=@FIXPATH@ $(BUILD_JDK)/bin/java $(BUILD_JAVA_FLAGS) # Use ?= as this can be overridden from bootcycle-spec.gmk BOOT_JDK_MODULAR ?= @BOOT_JDK_MODULAR@ -INTERIM_OVERRIDE_MODULES := java.compiler jdk.compiler \ - jdk.jdeps jdk.javadoc jdk.rmic +INTERIM_LANGTOOLS_OVERRIDE_MODULES := java.compiler jdk.compiler \ + jdk.jdeps jdk.javadoc +INTERIM_RMIC_OVERRIDE_MODULES := jdk.rmic ifeq ($(BOOT_JDK_MODULAR), true) - INTERIM_OVERRIDE_MODULES_ARGS = $(foreach m, $(INTERIM_OVERRIDE_MODULES), \ + INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = $(foreach m, \ + $(INTERIM_LANGTOOLS_OVERRIDE_MODULES), \ --patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m) - INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) + INTERIM_RMIC_OVERRIDE_MODULES_ARGS = $(foreach m, \ + $(INTERIM_LANGTOOLS_OVERRIDE_MODULES) \ + $(INTERIM_RMIC_OVERRIDE_MODULES), \ + --patch-module $m=$(BUILDTOOLS_OUTPUTDIR)/override_modules/$m) + INTERIM_LANGTOOLS_ARGS = $(INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS) JAVAC_MAIN_CLASS = -m jdk.compiler/com.sun.tools.javac.Main JAVADOC_MAIN_CLASS = -m jdk.javadoc/jdk.javadoc.internal.tool.Main else - INTERIM_OVERRIDE_MODULES_ARGS = \ + INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS = \ -Xbootclasspath/p:$(call PathList, \ $(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \ - $(INTERIM_OVERRIDE_MODULES))) - INTERIM_LANGTOOLS_ARGS = $(INTERIM_OVERRIDE_MODULES_ARGS) \ + $(INTERIM_LANGTOOLS_OVERRIDE_MODULES))) + INTERIM_RMIC_OVERRIDE_MODULES_ARGS = \ + -Xbootclasspath/p:$(call PathList, \ + $(addprefix $(BUILDTOOLS_OUTPUTDIR)/override_modules/, \ + $(INTERIM_LANGTOOLS_OVERRIDE_MODULES) \ + $(INTERIM_RMIC_OVERRIDE_MODULES))) + INTERIM_LANGTOOLS_ARGS = $(INTERIM_LANGTOOLS_OVERRIDE_MODULES_ARGS) \ -cp $(BUILDTOOLS_OUTPUTDIR)/override_modules/jdk.compiler JAVAC_MAIN_CLASS = com.sun.tools.javac.Main JAVADOC_MAIN_CLASS = jdk.javadoc.internal.tool.Main @@ -625,6 +638,7 @@ DIRNAME:=@DIRNAME@ DSYMUTIL:=@DSYMUTIL@ FIND:=@FIND@ FIND_DELETE:=@FIND_DELETE@ +FLOCK:=@FLOCK@ ECHO:=@ECHO@ EGREP:=@EGREP@ FGREP:=@FGREP@ @@ -637,6 +651,7 @@ MKDIR:=@MKDIR@ MV:=@MV@ NAWK:=@NAWK@ NICE:=@NICE@ +PANDOC:=@PANDOC@ PATCH:=@PATCH@ PRINTF:=@PRINTF@ RM:=@RM@ @@ -665,6 +680,7 @@ OTOOL:=@OTOOL@ READELF:=@READELF@ EXPR:=@EXPR@ FILE:=@FILE@ +DOT:=@DOT@ HG:=@HG@ OBJCOPY:=@OBJCOPY@ SETFILE:=@SETFILE@ @@ -828,11 +844,6 @@ JRE_COMPACT3_BUNDLE_NAME := \ jre-$(VERSION_SHORT)+$(VERSION_BUILD)-compact3_$(OPENJDK_TARGET_BUNDLE_PLATFORM)_bin$(DEBUG_PART).tar.gz JDK_SYMBOLS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz JRE_SYMBOLS_BUNDLE_NAME := jre-$(BASE_NAME)_bin$(DEBUG_PART)-symbols.tar.gz -ifeq ($(OPENJDK_TARGET_OS), windows) - DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).zip -else - DEMOS_BUNDLE_NAME := jdk-$(BASE_NAME)_demo$(DEBUG_PART).tar.gz -endif TEST_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-tests$(DEBUG_PART).tar.gz DOCS_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz @@ -840,7 +851,6 @@ JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME) JRE_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_BUNDLE_NAME) JDK_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_SYMBOLS_BUNDLE_NAME) JRE_SYMBOLS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JRE_SYMBOLS_BUNDLE_NAME) -DEMOS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DEMOS_BUNDLE_NAME) TEST_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(TEST_BUNDLE_NAME) DOCS_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(DOCS_BUNDLE_NAME) diff --git a/common/autoconf/toolchain.m4 b/common/autoconf/toolchain.m4 index 16b0df04b4f..29ebea9ccac 100644 --- a/common/autoconf/toolchain.m4 +++ b/common/autoconf/toolchain.m4 @@ -440,7 +440,7 @@ AC_DEFUN([TOOLCHAIN_EXTRACT_COMPILER_VERSION], # # $1 = compiler to test (CC or CXX) # $2 = human readable name of compiler (C or C++) -# $3 = list of compiler names to search for +# $3 = compiler name to search for AC_DEFUN([TOOLCHAIN_FIND_COMPILER], [ COMPILER_NAME=$2 @@ -482,15 +482,15 @@ AC_DEFUN([TOOLCHAIN_FIND_COMPILER], if test -n "$TOOLCHAIN_PATH"; then PATH_save="$PATH" PATH="$TOOLCHAIN_PATH" - AC_PATH_PROGS(TOOLCHAIN_PATH_$1, $SEARCH_LIST) + AC_PATH_TOOL(TOOLCHAIN_PATH_$1, $SEARCH_LIST) $1=$TOOLCHAIN_PATH_$1 PATH="$PATH_save" fi - # AC_PATH_PROGS can't be run multiple times with the same variable, + # AC_PATH_TOOL can't be run multiple times with the same variable, # so create a new name for this run. if test "x[$]$1" = x; then - AC_PATH_PROGS(POTENTIAL_$1, $SEARCH_LIST) + AC_PATH_TOOL(POTENTIAL_$1, $SEARCH_LIST) $1=$POTENTIAL_$1 fi diff --git a/common/autoconf/version-numbers b/common/autoconf/version-numbers index 4cb54671183..dc6e06253d7 100644 --- a/common/autoconf/version-numbers +++ b/common/autoconf/version-numbers @@ -1,5 +1,5 @@ # -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ # Default version numbers to use unless overridden by configure -DEFAULT_VERSION_MAJOR=9 +DEFAULT_VERSION_MAJOR=10 DEFAULT_VERSION_MINOR=0 DEFAULT_VERSION_SECURITY=0 DEFAULT_VERSION_PATCH=0 diff --git a/common/bin/compare_exceptions.sh.incl b/common/bin/compare_exceptions.sh.incl index 8aa1df11f8d..f3158f3b4e5 100644 --- a/common/bin/compare_exceptions.sh.incl +++ b/common/bin/compare_exceptions.sh.incl @@ -38,25 +38,9 @@ fi if [ "$OPENJDK_TARGET_OS" = "linux" ]; then STRIP_BEFORE_COMPARE=" - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so - ./demo/jvmti/gctest/lib/libgctest.so - ./demo/jvmti/heapTracker/lib/libheapTracker.so - ./demo/jvmti/heapViewer/lib/libheapViewer.so - ./demo/jvmti/minst/lib/libminst.so - ./demo/jvmti/mtrace/lib/libmtrace.so - ./demo/jvmti/versionCheck/lib/libversionCheck.so - ./demo/jvmti/waiters/lib/libwaiters.so " ACCEPTED_BIN_DIFF=" - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so - ./demo/jvmti/gctest/lib/libgctest.so - ./demo/jvmti/heapTracker/lib/libheapTracker.so - ./demo/jvmti/heapViewer/lib/libheapViewer.so - ./demo/jvmti/minst/lib/libminst.so - ./demo/jvmti/mtrace/lib/libmtrace.so - ./demo/jvmti/versionCheck/lib/libversionCheck.so - ./demo/jvmti/waiters/lib/libwaiters.so ./lib/client/libjsig.so ./lib/client/libjvm.so ./lib/libattach.so @@ -151,15 +135,6 @@ fi if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then STRIP_BEFORE_COMPARE=" - ./demo/jni/Poller/lib/libPoller.so - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so - ./demo/jvmti/gctest/lib/libgctest.so - ./demo/jvmti/heapTracker/lib/libheapTracker.so - ./demo/jvmti/heapViewer/lib/libheapViewer.so - ./demo/jvmti/minst/lib/libminst.so - ./demo/jvmti/mtrace/lib/libmtrace.so - ./demo/jvmti/versionCheck/lib/libversionCheck.so - ./demo/jvmti/waiters/lib/libwaiters.so " SORT_SYMBOLS=" @@ -174,15 +149,6 @@ if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; SKIP_BIN_DIFF="true" ACCEPTED_SMALL_SIZE_DIFF=" - ./demo/jni/Poller/lib/libPoller.so - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so - ./demo/jvmti/gctest/lib/libgctest.so - ./demo/jvmti/heapTracker/lib/libheapTracker.so - ./demo/jvmti/heapViewer/lib/libheapViewer.so - ./demo/jvmti/minst/lib/libminst.so - ./demo/jvmti/mtrace/lib/libmtrace.so - ./demo/jvmti/versionCheck/lib/libversionCheck.so - ./demo/jvmti/waiters/lib/libwaiters.so ./lib/jli/libjli.so ./lib/jspawnhelper ./lib/libJdbcOdbc.so @@ -279,19 +245,9 @@ fi if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparcv9" ]; then STRIP_BEFORE_COMPARE=" - ./demo/jni/Poller/lib/libPoller.so - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so - ./demo/jvmti/gctest/lib/libgctest.so - ./demo/jvmti/heapTracker/lib/libheapTracker.so - ./demo/jvmti/heapViewer/lib/libheapViewer.so - ./demo/jvmti/minst/lib/libminst.so - ./demo/jvmti/mtrace/lib/libmtrace.so - ./demo/jvmti/versionCheck/lib/libversionCheck.so - ./demo/jvmti/waiters/lib/libwaiters.so " SORT_SYMBOLS=" - ./demo/jvmti/waiters/lib/libwaiters.so ./lib/libjsig.so ./lib/libfontmanager.so ./lib/libjimage.so @@ -305,15 +261,6 @@ if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "sparcv9" ] SKIP_BIN_DIFF="true" ACCEPTED_SMALL_SIZE_DIFF=" - ./demo/jni/Poller/lib/libPoller.so - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.so - ./demo/jvmti/gctest/lib/libgctest.so - ./demo/jvmti/heapTracker/lib/libheapTracker.so - ./demo/jvmti/heapViewer/lib/libheapViewer.so - ./demo/jvmti/minst/lib/libminst.so - ./demo/jvmti/mtrace/lib/libmtrace.so - ./demo/jvmti/versionCheck/lib/libversionCheck.so - ./demo/jvmti/waiters/lib/libwaiters.so ./lib/client/libjvm.so ./lib/jli/libjli.so ./lib/jspawnhelper @@ -438,9 +385,6 @@ if [ "$OPENJDK_TARGET_OS" = "windows" ]; then # Probably should add all libs here ACCEPTED_SMALL_SIZE_DIFF=" - ./demo/jvmti/gctest/lib/gctest.dll - ./demo/jvmti/heapTracker/lib/heapTracker.dll - ./demo/jvmti/minst/lib/minst.dll ./bin/attach.dll ./bin/jsoundds.dll ./bin/client/jvm.dll @@ -579,14 +523,6 @@ if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then ./bin/wsgen ./bin/wsimport ./bin/xjc - ./demo/jvmti/compiledMethodLoad/lib/libcompiledMethodLoad.dylib - ./demo/jvmti/gctest/lib/libgctest.dylib - ./demo/jvmti/heapTracker/lib/libheapTracker.dylib - ./demo/jvmti/heapViewer/lib/libheapViewer.dylib - ./demo/jvmti/minst/lib/libminst.dylib - ./demo/jvmti/mtrace/lib/libmtrace.dylib - ./demo/jvmti/versionCheck/lib/libversionCheck.dylib - ./demo/jvmti/waiters/lib/libwaiters.dylib ./Contents/Home/bin/_javaws ./Contents/Home/bin/javaws ./Contents/Home/bin/idlj diff --git a/common/bin/shell-tracer.sh b/common/bin/shell-profiler.sh similarity index 52% rename from common/bin/shell-tracer.sh rename to common/bin/shell-profiler.sh index 5c7cc449f9c..d4a39dd8d1b 100644 --- a/common/bin/shell-tracer.sh +++ b/common/bin/shell-profiler.sh @@ -22,26 +22,48 @@ # questions. # -# Usage: sh shell-tracer.sh +# Usage: sh shell-tracer.sh # # This shell script is supposed to be set as a replacement for SHELL in make, # causing it to be called whenever make wants to execute shell commands. # The is suitable for passing on to the old shell, # typically beginning with -c. # -# This script will make sure the shell command line is executed with -# OLD_SHELL -x, and it will also store a simple log of the the time it takes to -# execute the command in the OUTPUT_FILE, using the "time" utility as pointed -# to by TIME_CMD. If TIME_CMD is "-", no timestamp will be stored. +# This script will run the shell command line and it will also store a simple +# log of the the time it takes to execute the command in the OUTPUT_FILE, using +# utility for time measure specified with TIME_CMD option. +# +# Type of time measure utility is specified with TIME_CMD_TYPE option. +# Recognized options values of TIME_CMD_TYPE option: "gnutime", "flock". -TIME_CMD="$1" -OUTPUT_FILE="$2" -OLD_SHELL="$3" +TIME_CMD_TYPE="$1" +TIME_CMD="$2" +OUTPUT_FILE="$3" shift shift shift -if [ "$TIME_CMD" != "-" ]; then -"$TIME_CMD" -f "[TIME:%E] $*" -a -o "$OUTPUT_FILE" "$OLD_SHELL" -x "$@" +if [ "$TIME_CMD_TYPE" = "gnutime" ]; then + # Escape backslashes (\) and percent chars (%). See man for GNU 'time'. + msg=${@//\\/\\\\} + msg=${msg//%/%%} + "$TIME_CMD" -f "[TIME:%E] $msg" -a -o "$OUTPUT_FILE" "$@" +elif [ "$TIME_CMD_TYPE" = "flock" ]; then + # Emulated GNU 'time' with 'flock' and 'date'. + ts=`date +%s%3N` + "$@" + status=$? + ts2=`date +%s%3N` + millis=$((ts2 - ts)) + ms=$(($millis % 1000)) + seconds=$((millis / 1000)) + ss=$(($seconds % 60)) + minutes=$(($seconds / 60)) + mm=$(($minutes % 60)) + hh=$(($minutes / 60)): + [ $hh != "0:" ] || hh= + # Synchronize on this script. + flock -w 10 "$0" printf "[TIME:${hh}${mm}:${ss}.%.2s] %s\n" $ms "$*" >> "$OUTPUT_FILE" || true + exit $status else -"$OLD_SHELL" -x "$@" + "$@" fi diff --git a/common/bin/unshuffle_list.txt b/common/bin/unshuffle_list.txt index e5fe5af121d..73ccb0a0136 100644 --- a/common/bin/unshuffle_list.txt +++ b/common/bin/unshuffle_list.txt @@ -361,8 +361,8 @@ jdk/src/java.base/share/native/libverify/check_code.c : jdk/src/share/native/com jdk/src/java.base/share/native/libverify/check_format.c : jdk/src/share/native/common/check_format.c jdk/src/java.base/share/native/libverify/opcodes.in_out : jdk/src/share/native/common/opcodes.in_out jdk/src/java.base/share/native/libzip : jdk/src/share/native/java/util/zip -jdk/src/java.base/share/native/libzip/zlib-1.2.8 : jdk/src/share/native/java/util/zip/zlib-1.2.8 -jdk/src/java.base/share/native/libzip/zlib-1.2.8/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib-1.2.8/patches/ChangeLog_java +jdk/src/java.base/share/native/libzip/zlib : jdk/src/share/native/java/util/zip/zlib +jdk/src/java.base/share/native/libzip/zlib/patches/ChangeLog_java : jdk/src/share/native/java/util/zip/zlib/patches/ChangeLog_java jdk/src/java.base/unix/classes/java/io : jdk/src/solaris/classes/java/io jdk/src/java.base/unix/classes/java/lang : jdk/src/solaris/classes/java/lang jdk/src/java.base/unix/classes/java/net : jdk/src/solaris/classes/java/net diff --git a/common/bin/update-build-readme.sh b/common/bin/update-build-readme.sh deleted file mode 100644 index 9d1968a4c60..00000000000 --- a/common/bin/update-build-readme.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# Get an absolute path to this script, since that determines the top-level -# directory. -this_script_dir=`dirname $0` -TOPDIR=`cd $this_script_dir/../.. > /dev/null && pwd` - -GREP=grep -MD_FILE=$TOPDIR/README-builds.md -HTML_FILE=$TOPDIR/README-builds.html - -# Locate the markdown processor tool and check that it is the correct version. -locate_markdown_processor() { - if [ -z "$MARKDOWN" ]; then - MARKDOWN=`which markdown 2> /dev/null` - if [ -z "$MARKDOWN" ]; then - echo "Error: Cannot locate markdown processor" 1>&2 - exit 1 - fi - fi - - # Test version - MARKDOWN_VERSION=`$MARKDOWN -version | $GREP version` - if [ "x$MARKDOWN_VERSION" != "xThis is Markdown, version 1.0.1." ]; then - echo "Error: Expected markdown version 1.0.1." 1>&2 - echo "Actual version found: $MARKDOWN_VERSION" 1>&2 - echo "Download markdown here: https://daringfireball.net/projects/markdown/" 1>&2 - exit 1 - fi - -} - -# Verify that the source markdown file looks sound. -verify_source_code() { - TOO_LONG_LINES=`$GREP -E -e '^.{80}.+$' $MD_FILE` - if [ "x$TOO_LONG_LINES" != x ]; then - echo "Warning: The following lines are longer than 80 characters:" - $GREP -E -e '^.{80}.+$' $MD_FILE - fi -} - -# Convert the markdown file to html format. -process_source() { - echo "Generating html file from markdown" - cat > $HTML_FILE << END - - - OpenJDK Build README - - -END - markdown $MD_FILE >> $HTML_FILE - cat >> $HTML_FILE < - -END - echo "Done" -} - -locate_markdown_processor -verify_source_code -process_source diff --git a/common/conf/jib-profiles.js b/common/conf/jib-profiles.js index ff86de23a31..dce28a6586b 100644 --- a/common/conf/jib-profiles.js +++ b/common/conf/jib-profiles.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -231,7 +231,8 @@ var getJibProfilesCommon = function (input, data) { // List of the main profile names used for iteration common.main_profile_names = [ "linux-x64", "linux-x86", "macosx-x64", "solaris-x64", - "solaris-sparcv9", "windows-x64", "windows-x86" + "solaris-sparcv9", "windows-x64", "windows-x86", + "linux-arm64", "linux-arm-vfp-hflt", "linux-arm-vfp-hflt-dyn" ]; // These are the base setttings for all the main build profiles. @@ -391,7 +392,7 @@ var getJibProfilesCommon = function (input, data) { // on such hardware. if (input.build_cpu == "sparcv9") { var cpu_brand = $EXEC("bash -c \"kstat -m cpu_info | grep brand | head -n1 | awk '{ print \$2 }'\""); - if (cpu_brand.trim() == 'SPARC-M7') { + if (cpu_brand.trim().match('SPARC-.7')) { boot_jdk_revision = "8u20"; boot_jdk_subdirpart = "1.8.0_20"; } @@ -401,6 +402,8 @@ var getJibProfilesCommon = function (input, data) { common.boot_jdk_home = input.get("boot_jdk", "home_path") + "/jdk" + common.boot_jdk_subdirpart + (input.build_os == "macosx" ? ".jdk/Contents/Home" : ""); + common.boot_jdk_platform = input.build_os + "-" + + (input.build_cpu == "x86" ? "i586" : input.build_cpu); return common; }; @@ -419,8 +422,9 @@ var getJibProfilesProfiles = function (input, common, data) { "linux-x64": { target_os: "linux", target_cpu: "x64", - dependencies: ["devkit"], - configure_args: concat(common.configure_args_64bit, "--with-zlib=system"), + dependencies: ["devkit", "graphviz", "pandoc"], + configure_args: concat(common.configure_args_64bit, + "--enable-full-docs", "--with-zlib=system"), default_make_targets: ["docs-bundles"], }, @@ -469,8 +473,43 @@ var getJibProfilesProfiles = function (input, common, data) { build_cpu: "x64", dependencies: ["devkit", "freetype"], configure_args: concat(common.configure_args_32bit), + }, + + "linux-arm64": { + target_os: "linux", + target_cpu: "aarch64", + build_cpu: "x64", + dependencies: ["devkit", "build_devkit", "cups", "headless_stubs"], + configure_args: [ + "--with-cpu-port=arm64", + "--with-jvm-variants=server", + "--openjdk-target=aarch64-linux-gnu", + "--enable-headless-only" + ], + }, + + "linux-arm-vfp-hflt": { + target_os: "linux", + target_cpu: "arm", + build_cpu: "x64", + dependencies: ["devkit", "build_devkit", "cups"], + configure_args: [ + "--with-jvm-variants=minimal1,client", + "--with-x=" + input.get("devkit", "install_path") + "/arm-linux-gnueabihf/libc/usr/X11R6-PI", + "--openjdk-target=arm-linux-gnueabihf", + "--with-abi-profile=arm-vfp-hflt" + ], + }, + + // Special version of the SE profile adjusted to be testable on arm64 hardware. + "linux-arm-vfp-hflt-dyn": { + configure_args: "--with-stdc++lib=dynamic" } }; + // Let linux-arm-vfp-hflt-dyn inherit everything from linux-arm-vfp-hflt + profiles["linux-arm-vfp-hflt-dyn"] = concatObjects( + profiles["linux-arm-vfp-hflt-dyn"], profiles["linux-arm-vfp-hflt"]); + // Add the base settings to all the main profiles common.main_profile_names.forEach(function (name) { profiles[name] = concatObjects(common.main_profile_base, profiles[name]); @@ -582,7 +621,7 @@ var getJibProfilesProfiles = function (input, common, data) { var testOnlyProfilesPrebuilt = { "run-test-prebuilt": { src: "src.conf", - dependencies: [ "jtreg", "gnumake", testedProfile + ".jdk", + dependencies: [ "jtreg", "gnumake", "boot_jdk", testedProfile + ".jdk", testedProfile + ".test", "src.full" ], work_dir: input.get("src.full", "install_path") + "/test", @@ -656,16 +695,28 @@ var getJibProfilesProfiles = function (input, common, data) { "windows-x86": { platform: "windows-x86", demo_ext: "zip" + }, + "linux-arm64": { + platform: "linux-arm64-vfp-hflt", + demo_ext: "tar.gz" + }, + "linux-arm-vfp-hflt": { + platform: "linux-arm32-vfp-hflt", + demo_ext: "tar.gz" + }, + "linux-arm-vfp-hflt-dyn": { + platform: "linux-arm32-vfp-hflt-dyn", + demo_ext: "tar.gz" } } // Generate common artifacts for all main profiles - common.main_profile_names.forEach(function (name) { + Object.keys(artifactData).forEach(function (name) { profiles[name] = concatObjects(profiles[name], common.main_profile_artifacts(artifactData[name].platform, artifactData[name].demo_ext)); }); // Generate common artifacts for all debug profiles - common.main_profile_names.forEach(function (name) { + Object.keys(artifactData).forEach(function (name) { var debugName = name + common.debug_suffix; profiles[debugName] = concatObjects(profiles[debugName], common.debug_profile_artifacts(artifactData[name].platform)); @@ -832,15 +883,16 @@ var getJibProfilesProfiles = function (input, common, data) { */ var getJibProfilesDependencies = function (input, common) { - var boot_jdk_platform = input.build_os + "-" - + (input.build_cpu == "x86" ? "i586" : input.build_cpu); - var devkit_platform_revisions = { linux_x64: "gcc4.9.2-OEL6.4+1.1", macosx_x64: "Xcode6.3-MacOSX10.9+1.0", solaris_x64: "SS12u4-Solaris11u1+1.0", solaris_sparcv9: "SS12u4-Solaris11u1+1.0", - windows_x64: "VS2013SP4+1.0" + windows_x64: "VS2013SP4+1.0", + linux_aarch64: "gcc-linaro-aarch64-linux-gnu-4.8-2013.11_linux+1.0", + linux_arm: (input.profile != null && input.profile.indexOf("hflt") >= 0 + ? "gcc-linaro-arm-linux-gnueabihf-raspbian-2012.09-20120921_linux+1.0" + : "arm-linaro-4.7+1.0") }; var devkit_platform = (input.target_cpu == "x86" @@ -853,9 +905,9 @@ var getJibProfilesDependencies = function (input, common) { server: "javare", module: "jdk", revision: common.boot_jdk_revision, - checksum_file: boot_jdk_platform + "/MD5_VALUES", - file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision - + "-" + boot_jdk_platform + ".tar.gz", + checksum_file: common.boot_jdk_platform + "/MD5_VALUES", + file: common.boot_jdk_platform + "/jdk-" + common.boot_jdk_revision + + "-" + common.boot_jdk_platform + ".tar.gz", configure_args: "--with-boot-jdk=" + common.boot_jdk_home, environment_path: common.boot_jdk_home + "/bin" }, @@ -883,7 +935,7 @@ var getJibProfilesDependencies = function (input, common) { jtreg: { server: "javare", revision: "4.2", - build_number: "b05", + build_number: "b07", checksum_file: "MD5_VALUES", file: "jtreg_bin-4.2.zip", environment_name: "JT_HOME", @@ -911,9 +963,25 @@ var getJibProfilesDependencies = function (input, common) { freetype: { organization: common.organization, ext: "tar.gz", - revision: "2.3.4+1.0", + revision: "2.7.1-v120+1.0", module: "freetype-" + input.target_platform - } + }, + + graphviz: { + organization: common.organization, + ext: "tar.gz", + revision: "2.38.0-1+1.1", + module: "graphviz-" + input.target_platform, + configure_args: "DOT=" + input.get("graphviz", "install_path") + "/dot" + }, + + pandoc: { + organization: common.organization, + ext: "tar.gz", + revision: "1.17.2+1.0", + module: "pandoc-" + input.target_platform, + configure_args: "PANDOC=" + input.get("pandoc", "install_path") + "/pandoc/pandoc" + }, }; return dependencies; @@ -1080,7 +1148,7 @@ var getVersion = function (major, minor, security, patch) { + "." + (minor != null ? minor : version_numbers.get("DEFAULT_VERSION_MINOR")) + "." + (security != null ? security : version_numbers.get("DEFAULT_VERSION_SECURITY")) + "." + (patch != null ? patch : version_numbers.get("DEFAULT_VERSION_PATCH")); - while (version.match(".*\.0$")) { + while (version.match(".*\\.0$")) { version = version.substring(0, version.length - 2); } return version; diff --git a/common/doc/building.html b/common/doc/building.html new file mode 100644 index 00000000000..f44bceba174 --- /dev/null +++ b/common/doc/building.html @@ -0,0 +1,749 @@ + + + + + + + OpenJDK Build README + + + + +
+OpenJDK +

OpenJDK

+
+
+

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 IS A MAJOR RE-WRITE of this document. !!!!!!!!!!!!!

+

Some Headlines:

+
    +
  • The build is now a "configure && make" style build
  • +
  • Any GNU make 3.81 or newer should work, except on Windows where 4.0 or newer is recommended.
  • +
  • The build should scale, i.e. more processors should cause the build to be done in less wall-clock time
  • +
  • Nested or recursive make invocations have been significantly reduced, as has the total fork/exec or spawning of sub processes during the build
  • +
  • Windows MKS usage is no longer supported
  • +
  • Windows Visual Studio vsvars*.bat and vcvars*.bat files are run automatically
  • +
  • Ant is no longer used when building the OpenJDK
  • +
  • Use of ALT_* environment variables for configuring the build is no longer supported
  • +
+
+

Contents

+ +
+ +
+

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.

+

Getting the Source

+

To get the entire set of OpenJDK Mercurial repositories use the script get_source.sh located in the root repository:

+
  hg clone http://hg.openjdk.java.net/jdk9/jdk9 YourOpenJDK
+  cd YourOpenJDK
+  bash ./get_source.sh
+

Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run ./get_source.sh anytime to pull over all the latest changesets in all the repositories. This set of nested repositories has been given the term "forest" and there are various ways to apply the same hg command to each of the repositories. For example, the script make/scripts/hgforest.sh can be used to repeat the same hg command on every repository, e.g.

+
  cd YourOpenJDK
+  bash ./make/scripts/hgforest.sh status
+

Repositories

+

The set of repositories and what they contain:

+
    +
  • . (root) contains common configure and makefile logic
  • +
  • hotspot contains source code and make files for building the OpenJDK Hotspot Virtual Machine
  • +
  • langtools contains source code for the OpenJDK javac and language tools
  • +
  • jdk contains source code and make files for building the OpenJDK runtime libraries and misc files
  • +
  • jaxp contains source code for the OpenJDK JAXP functionality
  • +
  • jaxws contains source code for the OpenJDK JAX-WS functionality
  • +
  • corba contains source code for the OpenJDK Corba functionality
  • +
  • nashorn contains source code for the OpenJDK JavaScript implementation
  • +
+

Repository Source Guidelines

+

There are some very basic guidelines:

+
    +
  • Use of whitespace in source files (.java, .c, .h, .cpp, and .hpp files) is restricted. No TABs, no trailing whitespace on lines, and files should not terminate in more than one blank line.
  • +
  • Files with execute permissions should not be added to the source repositories.
  • +
  • All generated files need to be kept isolated from the files maintained or managed by the source control system. The standard area for generated files is the top level build/ directory.
  • +
  • The default build process should be to build the product and nothing else, in one form, e.g. a product (optimized), debug (non-optimized, -g plus assert logic), or fastdebug (optimized, -g plus assert logic).
  • +
  • The .hgignore file in each repository must exist and should include ^build/, ^dist/ and optionally any nbproject/private directories. It should NEVER include anything in the src/ or test/ or any managed directory area of a repository.
  • +
  • Directory names and file names should never contain blanks or non-printing characters.
  • +
  • Generated source or binary files should NEVER be added to the repository (that includes javah output). There are some exceptions to this rule, in particular with some of the generated configure scripts.
  • +
  • Files not needed for typical building or testing of the repository should not be added to the repository.
  • +
+
+

Building

+

The very first step in building the OpenJDK is making sure the system itself has everything it needs to do OpenJDK builds. Once a system is setup, it generally doesn't need to be done again.

+

Building the OpenJDK is now done with running a configure script which will try and find and verify you have everything you need, followed by running make, e.g.

+
+

bash ./configure
+make all

+
+

Where possible the configure script will attempt to located the various components in the default locations or via component specific variable settings. When the normal defaults fail or components cannot be found, additional configure options may be necessary to help configure find the necessary tools for the build, or you may need to re-visit the setup of your system due to missing software packages.

+

NOTE: The configure script file does not have execute permissions and will need to be explicitly run with bash, see the source guidelines.

+
+

System Setup

+

Before even attempting to use a system to build the OpenJDK there are some very basic system setups needed. For all systems:

+
    +
  • Be sure the GNU make utility is version 3.81 (4.0 on windows) or newer, e.g. run "make -version"
  • +
+

* Install a Bootstrap JDK. All OpenJDK builds require access to a previously released JDK called the bootstrap JDK or boot JDK. The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level.

+

Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as the boot JDK, to ensure that JDK 9 dependencies are not introduced into the parts of the system that are built with JDK 8.

+

The JDK 8 binaries can be downloaded from Oracle's JDK 8 download site. For build performance reasons it is very important that this bootstrap JDK be made available on the local disk of the machine doing the build. You should add its bin directory to the PATH environment variable. If configure has any issues finding this JDK, you may need to use the configure option --with-boot-jdk.

+
    +
  • Ensure that GNU make, the Bootstrap JDK, and the compilers are all in your PATH environment variable.
  • +
+

And for specific systems:

+
    +
  • Linux
  • +
+

Install all the software development packages needed including alsa, freetype, cups, and xrender. See specific system packages.

+
    +
  • Solaris
  • +
+

Install all the software development packages needed including Studio Compilers, freetype, cups, and xrender. See specific system packages.

+ +

Install XCode 6.3

+

Linux

+

With Linux, try and favor the system packages over building your own or getting packages from other areas. Most Linux builds should be possible with the system's available packages.

+

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.

+

Solaris

+
Studio Compilers
+

At a minimum, the Studio 12 Update 4 Compilers (containing version 5.13 of the C and C++ compilers) is required, including specific patches.

+

The Solaris Studio installation should contain at least these packages:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PackageVersion
developer/solarisstudio-124/backend12.4-1.0.6.0
developer/solarisstudio-124/c++12.4-1.0.10.0
developer/solarisstudio-124/cc12.4-1.0.4.0
developer/solarisstudio-124/library/c++-libs12.4-1.0.10.0
developer/solarisstudio-124/library/math-libs12.4-1.0.0.1
developer/solarisstudio-124/library/studio-gccrt12.4-1.0.0.1
developer/solarisstudio-124/studio-common12.4-1.0.0.1
developer/solarisstudio-124/studio-ja12.4-1.0.0.1
developer/solarisstudio-124/studio-legal12.4-1.0.0.1
developer/solarisstudio-124/studio-zhCN12.4-1.0.0.1
+

In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc version.

+

Place the bin directory in 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.

+

Windows

+
Windows Unix Toolkit
+

Building on Windows requires a Unix-like environment, notably a Unix-like shell. There are several such environments available of which Cygwin and MinGW/MSYS are currently supported for the OpenJDK build. One of the differences of these systems from standard Windows tools is the way they handle Windows path names, particularly path names which contain spaces, backslashes as path separators and possibly drive letters. Depending on the use case and the specifics of each environment these path problems can be solved by a combination of quoting whole paths, translating backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their "8.3" version.

+
CYGWIN
+

CYGWIN is an open source, Linux-like environment which tries to emulate a complete POSIX layer on Windows. It tries to be smart about path names and can usually handle all kinds of paths if they are correctly quoted or escaped although internally it maps drive letters <drive>: to a virtual directory /cygdrive/<drive>.

+

You can always use the cygpath utility to map pathnames with spaces or the backslash character into the C:/ style of pathname (called 'mixed'), e.g. cygpath -s -m "<path>".

+

Note that the 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 use ":"). 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.

+

The OpenJDK build requires CYGWIN version 1.7.16 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.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
+

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).

+
MinGW/MSYS
+

MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this includes tools like bash and make. See MinGW/MSYS for more information.

+

Like Cygwin, MinGW/MSYS can handle different types of path formats. They are internally converted to paths with forward slashes and drive letters <drive>: replaced by a virtual directory /<drive>. Additionally, MSYS automatically detects binaries compiled for the MSYS environment and feeds them with the internal, Unix-style path names. If native Windows applications are called from within MSYS programs their path arguments are automatically converted back to Windows style path names with drive letters and backslashes as path separators. This may cause problems for Windows applications which use forward slashes as parameter separator (e.g. cl /nologo /I) because MSYS may wrongly replace such parameters by drive letters.

+

In addition to the tools which will be installed by default, you have to manually install the msys-zip and msys-unzip packages. This can be easily done with the MinGW command line installer:

+
  mingw-get.exe install msys-zip
+  mingw-get.exe install msys-unzip
+
Visual Studio 2013 Compilers
+

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

+

Only the C++ part of VS2013 is needed. Try to let the installation go to the default install directory. Always reboot your system after installing VS2013. The system environment variable VS120COMNTOOLS should be set in your environment.

+

Make sure that TMP and TEMP are also set in the environment and refer to Windows paths that exist, like C:\temp, not /tmp, not /cygdrive/c/temp, and not C:/temp. C:\temp is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables.

+

Mac OS X

+

Make sure you get the right XCode version.

+
+

Configure

+

The basic invocation of the configure script looks like:

+
+

bash ./configure [options]

+
+

This will create an output directory containing the "configuration" and setup an area for the build result. This directory typically looks like:

+
+

build/linux-x64-normal-server-release

+
+

configure will try to figure out what system you are running on and where all necessary build components are. If you have all prerequisites for building installed, it should find everything. If it fails to detect any component automatically, it will exit and inform you about the problem. When this happens, read more below in the configure options.

+

Some examples:

+
+

Windows 32bit build with freetype specified:
+bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32

+
+
+

Debug 64bit Build:
+bash ./configure --enable-debug --with-target-bits=64

+
+

Configure Options

+

Complete details on all the OpenJDK configure options can be seen with:

+
+

bash ./configure --help=short

+
+

Use -help to see all the configure options available. You can generate any number of different configurations, e.g. debug, release, 32, 64, etc.

+

Some of the more commonly used configure options are:

+
+

--enable-debug
+set the debug level to fastdebug (this is a shorthand for --with-debug-level=fastdebug)

+
+

+
+

--with-alsa=path
+select the location of the Advanced Linux Sound Architecture (ALSA)

+
+
+

Version 0.9.1 or newer of the ALSA files are required for building the OpenJDK on Linux. These Linux files are usually available from an "alsa" of "libasound" development package, and it's highly recommended that you try and use the package provided by the particular version of Linux that you are using.

+
+
+

--with-boot-jdk=path
+select the Bootstrap JDK

+
+
+

--with-boot-jdk-jvmargs="args"
+provide the JVM options to be used to run the Bootstrap JDK

+
+
+

--with-cacerts=path
+select the path to the cacerts file.

+
+
+

See Certificate Authority on Wikipedia for a better understanding of the Certificate Authority (CA). A certificates file named "cacerts" represents a system-wide keystore with CA certificates. In JDK and JRE binary bundles, the "cacerts" file contains root CA certificates from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source contain a cacerts file without CA root certificates. Formal JDK builders will need to secure permission from each public CA and include the certificates into their own custom cacerts file. Failure to provide a populated cacerts file will result in verification errors of a certificate chain during runtime. By default an empty cacerts file is provided and that should be fine for most JDK developers.

+
+

+
+

--with-cups=path
+select the CUPS install location

+
+
+

The Common UNIX Printing System (CUPS) Headers are required for building the OpenJDK on Solaris and Linux. The Solaris header files can be obtained by installing the package print/cups.

+
+
+

The CUPS header files can always be downloaded from www.cups.org.

+
+
+

--with-cups-include=path
+select the CUPS include directory location

+
+
+

--with-debug-level=level
+select the debug information level of release, fastdebug, or slowdebug

+
+
+

--with-dev-kit=path
+select location of the compiler install or developer install location

+
+

+
+

--with-freetype=path
+select the freetype files to use.

+
+
+

Expecting the freetype libraries under lib/ and the headers under include/.

+
+
+

Version 2.3 or newer of FreeType is required. On Unix systems required files can be available as part of your distribution (while you still may need to upgrade them). Note that you need development version of package that includes both the FreeType library and header files.

+
+
+

You can always download latest FreeType version from the FreeType website. 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.

+
+
+

--with-import-hotspot=path
+select the location to find hotspot binaries from a previous build to avoid building hotspot

+
+
+

--with-target-bits=arg
+select 32 or 64 bit build

+
+
+

--with-jvm-variants=variants
+select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark

+
+
+

--with-memory-size=size
+select the RAM size that GNU make will think this system has

+
+
+

--with-msvcr-dll=path
+select the msvcr100.dll file to include in the Windows builds (C/C++ runtime library for Visual Studio).

+
+
+

This is usually picked up automatically from the redist directories of Visual Studio 2013.

+
+
+

--with-num-cores=cores
+select the number of cores to use (processor count or CPU count)

+
+

+
+

--with-x=path
+select the location of the X11 and xrender files.

+
+
+

The XRender Extension Headers are required for building the OpenJDK on Solaris and 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. The Solaris XRender header files 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 or /usr/openwin/share/include/X11/extensions/Xrender.h

+
+
+

Make

+

The basic invocation of the make utility looks like:

+
+

make all

+
+

This will start the build to the output directory containing the "configuration" that was created by the configure script. Run make help for more information on the available targets.

+

There are some of the make targets that are of general interest:

+
+

empty
+build everything but no images

+
+
+

all
+build everything including images

+
+
+

all-conf
+build all configurations

+
+
+

images
+create complete j2sdk and j2re images

+
+
+

install
+install the generated images locally, typically in /usr/local

+
+
+

clean
+remove all files generated by make, but not those generated by configure

+
+
+

dist-clean
+remove all files generated by both and configure (basically killing the configuration)

+
+
+

help
+give some help on using make, including some interesting make targets

+
+
+

Testing

+

When the build is completed, you should see the generated binaries and associated files in the j2sdk-image directory in the output directory. In particular, the build/*/images/j2sdk-image/bin directory should contain executables for the OpenJDK tools and utilities for that configuration. The testing tool jtreg will be needed and can be found at: the jtreg site. The provided regression tests in the repositories can be run with the command:

+
+

cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all

+
+
+

Appendix A: Hints and Tips

+

FAQ

+

Q: The generated-configure.sh file looks horrible! How are you going to edit it?
+A: The generated-configure.sh file is generated (think "compiled") by the autoconf tools. The source code is in configure.ac and various .m4 files in common/autoconf, which are much more readable.

+

Q: Why is the generated-configure.sh file checked in, if it is generated?
+A: If it was not generated, every user would need to have the autoconf tools installed, and re-generate the configure file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required.

+

Q: Do you require a specific version of autoconf for regenerating generated-configure.sh?
+A: Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in generated-configure.sh.

+

Q: How do you regenerate generated-configure.sh after making changes to the input files?
+A: Regnerating generated-configure.sh should always be done using the script common/autoconf/autogen.sh to ensure that the correct files get updated. This script should also be run after mercurial tries to merge generated-configure.sh as a merge of the generated file is not guaranteed to be correct.

+

Q: What are the files in common/makefiles/support/* for? They look like gibberish.
+A: They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will not work properly. These helper files are part of an elaborate hack that will compress the command line in the makefile and then uncompress it safely. We're not proud of it, but it does fix the problem. If you have any better suggestions, we're all ears! :-)

+

Q: I want to see the output of the commands that make runs, like in the old build. How do I do that?
+A: You specify the LOG variable to make. There are several log levels:

+
    +
  • warn -- Default and very quiet.
  • +
  • info -- Shows more progress information than warn.
  • +
  • debug -- Echos all command lines and prints all macro calls for compilation definitions.
  • +
  • trace -- Echos all $(shell) command lines as well.
  • +
+

Q: When do I have to re-run configure?
+A: Normally you will run configure only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the configure script.

+

Q: I have added a new source file. Do I need to modify the makefiles?
+A: Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where the source files are spread over many directories which also contain sources for other libraries. In these cases it was simply easier to create include lists rather than excludes.

+

Q: When I run configure --help, I see many strange options, like --dvidir. What is this?
+A: Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use configure --help=short instead.

+

Q: configure provides OpenJDK-specific features such as --with-builddeps-server that are not described in this document. What about those?
+A: Try them out if you like! But be aware that most of these are experimental features. Many of them don't do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time.

+

Q: How will you make sure you don't break anything?
+A: We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, which might differ in a byte-by-byte comparison, even when building twice with the old build system. For these, we compare relevant aspects (e.g. the symbol table and file size). Note that we still don't have 100% equivalence, but we're close.

+

Q: I noticed this thing X in the build that looks very broken by design. Why don't you fix it?
+A: Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to obscurity, but in the new build system the weird stuff comes up to the surface. The plan is to attack these things at a later stage, after the new build system is established.

+

Q: The code in the new build system is not that well-structured. Will you fix this?
+A: Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after.

+

Q: Is anything able to use the results of the new build's default make target?
+A: Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you should only spend time recompiling what's changed (making it purely incremental) and only do the work that's needed to actually run and test your code. The packaging stuff that is part of the images target is not needed for a normal developer who wants to test his new code. Even if it's quite fast, it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds...)

+

Q: I usually set a specific environment variable when building, but I can't find the equivalent in the new build. What should I do?
+A: It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it!

+

Build Performance Tips

+

Building OpenJDK requires a lot of horsepower. Some of the build tools can be adjusted to utilize more or less of resources such as parallel threads and memory. The configure script analyzes your system and selects reasonable values for such options based on your hardware. If you encounter resource problems, such as out of memory conditions, you can modify the detected values with:

+
    +
  • --with-num-cores -- number of cores in the build system, e.g. --with-num-cores=8
  • +
  • --with-memory-size -- memory (in MB) available in the build system, e.g. --with-memory-size=1024
  • +
+

It might also be necessary to specify the JVM arguments passed to the Bootstrap JDK, using e.g. --with-boot-jdk-jvmargs="-Xmx8G -enableassertions". Doing this will override the default JVM arguments passed to the Bootstrap JDK.

+

One of the top goals of the new build system is to improve the build performance and decrease the time needed to build. This will soon also apply to the java compilation when the Smart Javac wrapper is fully supported.

+

At the end of a successful execution of configure, you will get a performance summary, indicating how well the build will perform. Here you will also get performance hints. If you want to build fast, pay attention to those!

+

Building with ccache

+

The OpenJDK build supports building with ccache when using gcc or clang. Using ccache can radically speed up compilation of native code if you often rebuild the same sources. Your milage may vary however so we recommend evaluating it for yourself. To enable it, make sure it's on the path and configure with --enable-ccache.

+

Building on local disk

+

If you are using network shares, e.g. via NFS, for your source code, make sure the build directory is situated on local disk. The performance penalty is extremely high for building on a network share, close to unusable.

+

Building only one JVM

+

The old build builds multiple JVMs on 32-bit systems (client and server; and on Windows kernel as well). In the new build we have changed this default to only build server when it's available. This improves build times for those not interested in multiple JVMs. To mimic the old behavior on platforms that support it, use --with-jvm-variants=client,server.

+

Selecting the number of cores to build on

+

By default, configure will analyze your machine and run the make process in parallel with as many threads as you have cores. This behavior can be overridden, either "permanently" (on a configure basis) using --with-num-cores=N or for a single build only (on a make basis), using make JOBS=N.

+

If you want to make a slower build just this time, to save some CPU power for other processes, you can run e.g. make JOBS=2. This will force the makefiles to only run 2 parallel processes, or even make JOBS=1 which will disable parallelism.

+

If you want to have it the other way round, namely having slow builds default and override with fast if you're impatient, you should call configure with --with-num-cores=2, making 2 the default. If you want to run with more cores, run make JOBS=8

+

Troubleshooting

+

Solving build problems

+

If the build fails (and it's not due to a compilation error in a source file you've changed), the first thing you should do is to re-run the build with more verbosity. Do this by adding LOG=debug to your make command line.

+

The build log (with both stdout and stderr intermingled, basically the same as you see on your console) can be found as build.log in your build directory.

+

You can ask for help on build problems with the new build system on either the build-dev or the build-infra-dev mailing lists. Please include the relevant parts of the build log.

+

A build can fail for any number of reasons. Most failures are a result of trying to build in an environment in which all the pre-build requirements have not been met. The first step in troubleshooting a build failure is to recheck that you have satisfied all the pre-build requirements for your platform. Scanning the configure log is a good first step, making sure that what it found makes sense for your system. Look for strange error messages or any difficulties that configure had in finding things.

+

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

+
    +
  • Corrupted Bundles on Windows:
    +Some virus scanning software has been known to corrupt the downloading of zip bundles. It may be necessary to disable the 'on access' or 'real time' virus scanning features to prevent this corruption. This type of 'real time' virus scanning can also slow down the build process significantly. Temporarily disabling the feature, or excluding the build output directory may be necessary to get correct and faster builds.

  • +
  • Slow Builds:
    +If your build machine seems to be overloaded from too many simultaneous C++ compiles, try setting the JOBS=1 on the make command line. Then try increasing the count slowly to an acceptable level for your system. Also:

  • +
+

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

+

Faster CPUs, more RAM, and a faster DISK usually helps. 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.

+
    +
  • File time issues:
    +If you see warnings that refer to file time stamps, e.g.
  • +
+
+

Warning message: File 'xxx' has modification time in the future.
+Warning message: Clock skew detected. Your build may 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 unrelated but in fact caused by the clock skew, can occur along with the clock skew warnings. These secondary errors may tend to obscure the fact that the true root cause of the problem is an out-of-sync clock.

+

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.

+
    +
  • Error message: Trouble writing out table to disk
    +Increase the amount of swap space on your build machine. This could be caused by overloading the system and it may be necessary to use:
  • +
+
+

make JOBS=1

+
+

to reduce the load on the system.

+
    +
  • Error Message: libstdc++ not found:
    +This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the libstdc++ package. Various parts of the JDK build require a static link of the C++ runtime libraries to allow for maximum portability of the built images.

  • +
  • Linux Error Message: cannot restore segment prot after reloc
    +This is probably an issue with SELinux (See SELinux on Wikipedia). 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. +
+

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 "Allow all unconfined executables to use libraries requiring text relocation ..."
  8. +
+
    +
  • Windows Error Messages:
    +*** fatal error - couldn't allocate heap, ...
    +rm fails with "Directory not empty"
    +unzip fails with "cannot create ... Permission denied"
    +unzip fails with "cannot create ... Error 50"
  • +
+

The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on BLODA (applications that interfere with CYGWIN).

+
    +
  • Windows Error Message: spawn failed
    +Try rebooting the system, or there could be some kind of issue with the disk or disk partition being used. Sometimes it comes with a "Permission Denied" message.
  • +
+
+

Appendix B: GNU make

+

The Makefiles in the OpenJDK are only valid when used with the GNU version of the utility command make (usually called gmake on Solaris). A few notes about using GNU make:

+
    +
  • You need GNU make version 3.81 or newer. On Windows 4.0 or newer is recommended. If the GNU make utility on your systems is not of a suitable version, see "Building GNU make".
  • +
  • Place the location of the GNU make binary in the PATH.
  • +
  • Solaris: Do NOT use /usr/bin/make on Solaris. If your Solaris system has the software from the Solaris Developer Companion CD installed, you should try and use /usr/bin/gmake or /usr/gnu/bin/make.
  • +
  • Windows: Make sure you start your build inside a bash shell.
  • +
  • Mac OS X: The XCode "command line tools" must be installed on your Mac.
  • +
+

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/.

+

Building GNU make

+

First step is to get the GNU make 3.81 or newer source from ftp.gnu.org/pub/gnu/make/. Building is a little different depending on the OS but is basically done with:

+
  bash ./configure
+  make
+
+

Appendix C: Build Environments

+

Minimum Build Environments

+

This file often describes specific requirements for what we call the "minimum build environments" (MBE) for this specific release of the JDK. What is listed below is what the Oracle Release Engineering Team will use to build the Oracle JDK product. Building with the MBE will hopefully generate the most compatible bits that install on, and run correctly on, the most variations of the same base OS and hardware architecture. In some cases, these represent what is often called the least common denominator, but each Operating System has different aspects to it.

+

In all cases, the Bootstrap JDK version minimum is critical, we cannot guarantee builds will work with older Bootstrap JDK's. Also in all cases, more RAM and more processors is better, the minimums listed below are simply recommendations.

+

With Solaris and Mac OS X, the version listed below is the oldest release we can guarantee builds and works, and the specific version of the compilers used could be critical.

+

With Windows the critical aspect is the Visual Studio compiler used, which due to it's runtime, generally dictates what Windows systems can do the builds and where the resulting bits can be used.

+

NOTE: We expect a change here off these older Windows OS releases and to a 'less older' one, probably Windows 2008R2 X64.

+

With Linux, it was just a matter of picking a stable distribution that is a good representative for Linux in general.

+

It is understood that most developers will NOT be using these specific versions, and in fact creating these specific versions may be difficult due to the age of some of this software. It is expected that developers are more often using the more recent releases and distributions of these operating systems.

+

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 common problem with older, newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly.

+

Bootstrap JDK: JDK 8

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Base OS and ArchitectureOSC/C++ CompilerProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Oracle Enterprise Linux 6.4gcc 4.9.22 or more1 GB6 GB
Solaris SPARCV9 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patches4 or more4 GB8 GB
Solaris X64 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patches4 or more4 GB8 GB
Windows X86 (32-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional Edition2 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional Edition2 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.9 "Mavericks"Xcode 6.3 or newer2 or more4 GB6 GB
+
+

Specific Developer Build Environments

+

We won't be listing all the possible environments, but we will try to provide what information we have available to us.

+

NOTE: The community can help out by updating this part of the document.

+

Fedora

+

After installing the latest Fedora 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.7.0-openjdk
+  yum install gcc gcc-c++
+

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

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-openjdk/bin:${PATH}"
+

CentOS 5.5

+

After installing CentOS 5.5 you need to make sure you have the following Development bundles installed:

+
    +
  • Development Libraries
  • +
  • Development Tools
  • +
  • Java Development
  • +
  • X Software Development (Including XFree86-devel)
  • +
+

Plus the following packages:

+
    +
  • cups devel: Cups Development Package
  • +
  • alsa devel: Alsa Development Package
  • +
  • Xi devel: libXi.so Development Package
  • +
+

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:

+
  bash ./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.

+

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-7
+  aptitude install openjdk-7-jdk libmotif-dev
+

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

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+

Ubuntu 12.04

+

After installing Ubuntu 12.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-7
+  sudo aptitude install openjdk-7-jdk
+

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

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-7-openjdk/bin:${PATH}"
+

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_7_0-openjdk
+  sudo zypper install make
+

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

+
  export LANG=C
+  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:$[PATH}"
+

Finally, you need to unset the JAVA_HOME environment variable:

+
  export -n JAVA_HOME`
+

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.7.0-openjdk-devel 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
+  export PATH="/usr/lib/jvm/java-1.7.0-openjdk/bin:${PATH}"
+

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 SUNWj7dev 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
+  export PATH="/opt/SunStudioExpress/bin:${PATH}"
+
+

End of the OpenJDK build README document.

+

Please come again!

+ + diff --git a/README-builds.md b/common/doc/building.md similarity index 77% rename from README-builds.md rename to common/doc/building.md index c6907cd7ab2..3eb96dfd6e1 100644 --- a/README-builds.md +++ b/common/doc/building.md @@ -1,9 +1,9 @@ +% OpenJDK Build README + ![OpenJDK](http://openjdk.java.net/images/openjdk.png) -# OpenJDK Build README -***** +-------------------------------------------------------------------------------- - ## Introduction This README file contains build instructions for the @@ -19,34 +19,34 @@ Some Headlines: is recommended. * The build should scale, i.e. more processors should cause the build to be done in less wall-clock time - * Nested or recursive make invocations have been significantly reduced, - as has the total fork/exec or spawning of sub processes during the build + * Nested or recursive make invocations have been significantly reduced, as + has the total fork/exec or spawning of sub processes during the build * Windows MKS usage is no longer supported * Windows Visual Studio `vsvars*.bat` and `vcvars*.bat` files are run automatically * Ant is no longer used when building the OpenJDK - * Use of ALT_* environment variables for configuring the build is no longer + * Use of ALT\_\* environment variables for configuring the build is no longer supported -***** +------------------------------------------------------------------------------- ## Contents * [Introduction](#introduction) * [Use of Mercurial](#hg) - * [Getting the Source](#get_source) - * [Repositories](#repositories) + * [Getting the Source](#get_source) + * [Repositories](#repositories) * [Building](#building) - * [System Setup](#setup) - * [Linux](#linux) - * [Solaris](#solaris) - * [Mac OS X](#macosx) - * [Windows](#windows) - * [Configure](#configure) - * [Make](#make) + * [System Setup](#setup) + * [Linux](#linux) + * [Solaris](#solaris) + * [Mac OS X](#macosx) + * [Windows](#windows) + * [Configure](#configure) + * [Make](#make) * [Testing](#testing) -***** +------------------------------------------------------------------------------- * [Appendix A: Hints and Tips](#hints) * [FAQ](#faq) @@ -55,23 +55,22 @@ Some Headlines: * [Appendix B: GNU Make Information](#gmake) * [Appendix C: Build Environments](#buildenvironments) -***** +------------------------------------------------------------------------------- - ## Use of Mercurial The OpenJDK sources are maintained with the revision control system [Mercurial](http://mercurial.selenic.com/wiki/Mercurial). If you are new to -Mercurial, please see the [Beginner Guides](http://mercurial.selenic.com/wiki/ -BeginnersGuides) or refer to the [Mercurial Book](http://hgbook.red-bean.com/). -The first few chapters of the book provide an excellent overview of Mercurial, -what it is and how it works. +Mercurial, please see the [Beginner +Guides](http://mercurial.selenic.com/wiki/BeginnersGuides) or refer to the +[Mercurial Book](http://hgbook.red-bean.com/). 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](http://openjdk.java.net/guide/ -repositories.html#installConfig) section for more information. +and Configuring +Mercurial](http://openjdk.java.net/guide/repositories.html#installConfig) +section for more information. - ### Getting the Source To get the entire set of OpenJDK Mercurial repositories use the script @@ -83,16 +82,15 @@ To get the entire set of OpenJDK Mercurial repositories use the script Once you have all the repositories, keep in mind that each repository is its own independent repository. You can also re-run `./get_source.sh` anytime to -pull over all the latest changesets in all the repositories. This set of -nested repositories has been given the term "forest" and there are various -ways to apply the same `hg` command to each of the repositories. For -example, the script `make/scripts/hgforest.sh` can be used to repeat the -same `hg` command on every repository, e.g. +pull over all the latest changesets in all the repositories. This set of nested +repositories has been given the term "forest" and there are various ways to +apply the same `hg` command to each of the repositories. For example, the +script `make/scripts/hgforest.sh` can be used to repeat the same `hg` command +on every repository, e.g. cd YourOpenJDK bash ./make/scripts/hgforest.sh status - ### Repositories The set of repositories and what they contain: @@ -135,9 +133,8 @@ There are some very basic guidelines: * Files not needed for typical building or testing of the repository should not be added to the repository. -***** +------------------------------------------------------------------------------- - ## Building The very first step in building the OpenJDK is making sure the system itself @@ -148,7 +145,7 @@ Building the OpenJDK is now done with running a `configure` script which will try and find and verify you have everything you need, followed by running `make`, e.g. -> **`bash ./configure`** +> **`bash ./configure`** \ > **`make all`** Where possible the `configure` script will attempt to located the various @@ -161,9 +158,8 @@ system due to missing software packages. **NOTE:** The `configure` script file does not have execute permissions and will need to be explicitly run with `bash`, see the source guidelines. -***** +------------------------------------------------------------------------------- - ### System Setup Before even attempting to use a system to build the OpenJDK there are some very @@ -174,14 +170,14 @@ basic system setups needed. For all systems: * Install a Bootstrap JDK. All OpenJDK builds require access to a previously - released JDK called the _bootstrap JDK_ or _boot JDK._ The general rule is + released JDK called the *bootstrap JDK* or *boot JDK.* The general rule is that the bootstrap JDK must be an instance of the previous major release of the JDK. In addition, there may be a requirement to use a release at or beyond a particular update level. - **_Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as + ***Building JDK 9 requires JDK 8. JDK 9 developers should not use JDK 9 as the boot JDK, to ensure that JDK 9 dependencies are not introduced into the - parts of the system that are built with JDK 8._** + parts of the system that are built with JDK 8.*** The JDK 8 binaries can be downloaded from Oracle's [JDK 8 download site](http://www.oracle.com/technetwork/java/javase/downloads/index.html). @@ -217,7 +213,6 @@ And for specific systems: Install [XCode 6.3](https://developer.apple.com/xcode/) - #### Linux With Linux, try and favor the system packages over building your own or getting @@ -231,69 +226,29 @@ refer to the JDK installed on your Linux system. You will need to unset you are getting from the default system settings make sense for building the OpenJDK. - #### Solaris - ##### Studio Compilers -At a minimum, the [Studio 12 Update 4 Compilers](http://www.oracle.com/ -technetwork/server-storage/solarisstudio/downloads/index.htm) (containing -version 5.13 of the C and C++ compilers) is required, including specific -patches. +At a minimum, the [Studio 12 Update 4 +Compilers](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm) +(containing version 5.13 of the C and C++ compilers) is required, including +specific patches. The Solaris Studio installation should contain at least these packages: -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
**Package****Version**
developer/solarisstudio-124/backend12.4-1.0.6.0
developer/solarisstudio-124/c++12.4-1.0.10.0
developer/solarisstudio-124/cc12.4-1.0.4.0
developer/solarisstudio-124/library/c++-libs12.4-1.0.10.0
developer/solarisstudio-124/library/math-libs12.4-1.0.0.1
developer/solarisstudio-124/library/studio-gccrt12.4-1.0.0.1
developer/solarisstudio-124/studio-common12.4-1.0.0.1
developer/solarisstudio-124/studio-ja12.4-1.0.0.1
developer/solarisstudio-124/studio-legal12.4-1.0.0.1
developer/solarisstudio-124/studio-zhCN12.4-1.0.0.1
+ Package Version + -------------------------------------------------- --------------- + developer/solarisstudio-124/backend 12.4-1.0.6.0 + developer/solarisstudio-124/c++ 12.4-1.0.10.0 + developer/solarisstudio-124/cc 12.4-1.0.4.0 + developer/solarisstudio-124/library/c++-libs 12.4-1.0.10.0 + developer/solarisstudio-124/library/math-libs 12.4-1.0.0.1 + developer/solarisstudio-124/library/studio-gccrt 12.4-1.0.0.1 + developer/solarisstudio-124/studio-common 12.4-1.0.0.1 + developer/solarisstudio-124/studio-ja 12.4-1.0.0.1 + developer/solarisstudio-124/studio-legal 12.4-1.0.0.1 + developer/solarisstudio-124/studio-zhCN 12.4-1.0.0.1 In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc version. @@ -301,11 +256,11 @@ version. Place the `bin` directory in `PATH`. The Oracle Solaris Studio Express compilers at: [Oracle Solaris Studio Express -Download site](http://www.oracle.com/technetwork/server-storage/solarisstudio/ -downloads/index-jsp-142582.html) are also an option, although these compilers -have not been extensively used yet. +Download +site](http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index-jsp-142582.html) +are also an option, although these compilers have not been extensively used +yet. - #### Windows ##### Windows Unix Toolkit @@ -323,7 +278,6 @@ backslashes to forward slashes, escaping backslashes with additional backslashes and translating the path names to their ["8.3" version](http://en.wikipedia.org/wiki/8.3_filename). - ###### CYGWIN CYGWIN is an open source, Linux-like environment which tries to emulate a @@ -351,80 +305,24 @@ 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. -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Binary NameCategoryPackageDescription
ar.exeDevelbinutilsThe GNU assembler, linker and binary utilities
make.exeDevelmakeThe GNU version of the 'make' utility built for CYGWIN
m4.exeInterpretersm4GNU implementation of the traditional Unix macro processor
cpio.exeUtilscpioA program to manage archives of files
gawk.exeUtilsawkPattern-directed scanning and processing language
file.exeUtilsfileDetermines file type using 'magic' numbers
zip.exeArchivezipPackage and compress (archive) files
unzip.exeArchiveunzipExtract compressed files in a ZIP archive
free.exeSystemprocpsDisplay amount of free and used memory in the system
+ Binary Name Category Package Description + ------------- -------------- ---------- ------------------------------------------------------------ + ar.exe Devel binutils The GNU assembler, linker and binary utilities + make.exe Devel make The GNU version of the 'make' utility built for CYGWIN + m4.exe Interpreters m4 GNU implementation of the traditional Unix macro processor + cpio.exe Utils cpio A program to manage archives of files + gawk.exe Utils awk Pattern-directed scanning and processing language + file.exe Utils file Determines file type using 'magic' numbers + zip.exe Archive zip Package and compress (archive) files + unzip.exe Archive unzip Extract compressed files in a ZIP archive + free.exe System procps Display amount of free and used memory in the system Note that the CYGWIN software can conflict with other non-CYGWIN software on -your Windows system. CYGWIN provides a [FAQ](http://cygwin.com/faq/ -faq.using.html) for known issues and problems, of particular interest is the -section on [BLODA (applications that interfere with -CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). +your Windows system. CYGWIN provides a +[FAQ](http://cygwin.com/faq/faq.using.html) for known issues and problems, +of particular interest is the section on [BLODA (applications that interfere +with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - ###### MinGW/MSYS MinGW ("Minimalist GNU for Windows") is a collection of free Windows specific @@ -432,20 +330,20 @@ header files and import libraries combined with GNU toolsets that allow one to produce native Windows programs that do not rely on any 3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building applications and programs which rely on traditional UNIX tools to be present. Among others this -includes tools like `bash` and `make`. See [MinGW/MSYS](http://www.mingw.org/ -wiki/MSYS) for more information. +includes tools like `bash` and `make`. See +[MinGW/MSYS](http://www.mingw.org/wiki/MSYS) for more information. Like Cygwin, MinGW/MSYS can handle different types of path formats. They are -internally converted to paths with forward slashes and drive letters -`:` replaced by a virtual directory `/`. Additionally, MSYS -automatically detects binaries compiled for the MSYS environment and feeds them -with the internal, Unix-style path names. If native Windows applications are -called from within MSYS programs their path arguments are automatically -converted back to Windows style path names with drive letters and backslashes -as path separators. This may cause problems for Windows applications which use -forward slashes as parameter separator (e.g. `cl /nologo /I`) because MSYS may -wrongly [replace such parameters by drive letters](http://mingw.org/wiki/ -Posix_path_conversion). +internally converted to paths with forward slashes and drive letters `:` +replaced by a virtual directory `/`. Additionally, MSYS automatically +detects binaries compiled for the MSYS environment and feeds them with the +internal, Unix-style path names. If native Windows applications are called from +within MSYS programs their path arguments are automatically converted back to +Windows style path names with drive letters and backslashes as path separators. +This may cause problems for Windows applications which use forward slashes as +parameter separator (e.g. `cl /nologo /I`) because MSYS may wrongly [replace +such parameters by drive +letters](http://mingw.org/wiki/Posix_path_conversion). In addition to the tools which will be installed by default, you have to manually install the `msys-zip` and `msys-unzip` packages. This can be easily @@ -454,7 +352,6 @@ done with the MinGW command line installer: mingw-get.exe install msys-zip mingw-get.exe install msys-unzip - ##### Visual Studio 2013 Compilers The 32-bit and 64-bit OpenJDK Windows build requires Microsoft Visual Studio @@ -473,14 +370,12 @@ and not `C:/temp`. `C:\temp` is just an example, it is assumed that this area is private to the user, so by default after installs you should see a unique user path in these variables. - #### Mac OS X Make sure you get the right XCode version. -***** +------------------------------------------------------------------------------- - ### Configure The basic invocation of the `configure` script looks like: @@ -500,14 +395,12 @@ happens, read more below in [the `configure` options](#configureoptions). Some examples: -> **Windows 32bit build with freetype specified:** -> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target- -bits=32` +> **Windows 32bit build with freetype specified:** \ +> `bash ./configure --with-freetype=/cygdrive/c/freetype-i586 --with-target-bits=32` -> **Debug 64bit Build:** +> **Debug 64bit Build:** \ > `bash ./configure --enable-debug --with-target-bits=64` - #### Configure Options Complete details on all the OpenJDK `configure` options can be seen with: @@ -519,12 +412,13 @@ number of different configurations, e.g. debug, release, 32, 64, etc. Some of the more commonly used `configure` options are: -> **`--enable-debug`** -> set the debug level to fastdebug (this is a shorthand for `--with-debug- - level=fastdebug`) +> **`--enable-debug`** \ +> set the debug level to fastdebug (this is a shorthand for +> `--with-debug-level=fastdebug`) -> **`--with-alsa=`**_path_ + +> **`--with-alsa=`**_path_ \ > select the location of the Advanced Linux Sound Architecture (ALSA) > Version 0.9.1 or newer of the ALSA files are required for building the @@ -533,29 +427,31 @@ Some of the more commonly used `configure` options are: and use the package provided by the particular version of Linux that you are using. -> **`--with-boot-jdk=`**_path_ +> **`--with-boot-jdk=`**_path_ \ > select the [Bootstrap JDK](#bootjdk) -> **`--with-boot-jdk-jvmargs=`**"_args_" +> **`--with-boot-jdk-jvmargs=`**"_args_" \ > provide the JVM options to be used to run the [Bootstrap JDK](#bootjdk) -> **`--with-cacerts=`**_path_ +> **`--with-cacerts=`**_path_ \ > select the path to the cacerts file. -> See [Certificate Authority on Wikipedia](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. In JDK and JRE binary bundles, the "cacerts" - file contains root CA certificates from several public CAs (e.g., VeriSign, - Thawte, and Baltimore). The source contain a cacerts file without CA root - certificates. Formal JDK builders will need to secure permission from each - public CA and include the certificates into their own custom cacerts file. - Failure to provide a populated cacerts file will result in verification - errors of a certificate chain during runtime. By default an empty cacerts - file is provided and that should be fine for most JDK developers. +> See [Certificate Authority on + Wikipedia](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. In + JDK and JRE binary bundles, the "cacerts" file contains root CA certificates + from several public CAs (e.g., VeriSign, Thawte, and Baltimore). The source + contain a cacerts file without CA root certificates. Formal JDK builders will + need to secure permission from each public CA and include the certificates + into their own custom cacerts file. Failure to provide a populated cacerts + file will result in verification errors of a certificate chain during + runtime. By default an empty cacerts file is provided and that should be fine + for most JDK developers. -> **`--with-cups=`**_path_ + +> **`--with-cups=`**_path_ \ > select the CUPS install location > The Common UNIX Printing System (CUPS) Headers are required for building the @@ -565,17 +461,18 @@ Some of the more commonly used `configure` options are: > The CUPS header files can always be downloaded from [www.cups.org](http://www.cups.org). -> **`--with-cups-include=`**_path_ +> **`--with-cups-include=`**_path_ \ > select the CUPS include directory location -> **`--with-debug-level=`**_level_ +> **`--with-debug-level=`**_level_ \ > select the debug information level of release, fastdebug, or slowdebug -> **`--with-dev-kit=`**_path_ +> **`--with-dev-kit=`**_path_ \ > select location of the compiler install or developer install location -> **`--with-freetype=`**_path_ + +> **`--with-freetype=`**_path_ \ > select the freetype files to use. > Expecting the freetype libraries under `lib/` and the headers under @@ -597,32 +494,33 @@ Some of the more commonly used `configure` options are: [SourceForge FreeType2 Home Page](http://freetype.sourceforge.net/freetype2) for more information. -> **`--with-import-hotspot=`**_path_ +> **`--with-import-hotspot=`**_path_ \ > select the location to find hotspot binaries from a previous build to avoid building hotspot -> **`--with-target-bits=`**_arg_ +> **`--with-target-bits=`**_arg_ \ > select 32 or 64 bit build -> **`--with-jvm-variants=`**_variants_ +> **`--with-jvm-variants=`**_variants_ \ > select the JVM variants to build from, comma separated list that can include: server, client, kernel, zero and zeroshark -> **`--with-memory-size=`**_size_ +> **`--with-memory-size=`**_size_ \ > select the RAM size that GNU make will think this system has -> **`--with-msvcr-dll=`**_path_ +> **`--with-msvcr-dll=`**_path_ \ > select the `msvcr100.dll` file to include in the Windows builds (C/C++ runtime library for Visual Studio). > This is usually picked up automatically from the redist directories of Visual Studio 2013. -> **`--with-num-cores=`**_cores_ +> **`--with-num-cores=`**_cores_ \ > select the number of cores to use (processor count or CPU count) -> **`--with-x=`**_path_ + +> **`--with-x=`**_path_ \ > select the location of the X11 and xrender files. > The XRender Extension Headers are required for building the OpenJDK on @@ -634,9 +532,8 @@ Some of the more commonly used `configure` options are: installed in `/usr/X11/include/X11/extensions/Xrender.h` or `/usr/openwin/share/include/X11/extensions/Xrender.h` -***** +------------------------------------------------------------------------------- - ### Make The basic invocation of the `make` utility looks like: @@ -649,34 +546,33 @@ more information on the available targets. There are some of the make targets that are of general interest: -> _empty_ +> _empty_ \ > build everything but no images -> **`all`** +> **`all`** \ > build everything including images -> **`all-conf`** +> **`all-conf`** \ > build all configurations -> **`images`** +> **`images`** \ > create complete j2sdk and j2re images -> **`install`** +> **`install`** \ > install the generated images locally, typically in `/usr/local` -> **`clean`** +> **`clean`** \ > remove all files generated by make, but not those generated by `configure` -> **`dist-clean`** +> **`dist-clean`** \ > remove all files generated by both and `configure` (basically killing the configuration) -> **`help`** +> **`help`** \ > give some help on using `make`, including some interesting make targets -***** +------------------------------------------------------------------------------- - ## Testing When the build is completed, you should see the generated binaries and @@ -689,35 +585,33 @@ repositories can be run with the command: > **``cd test && make PRODUCT_HOME=`pwd`/../build/*/images/j2sdk-image all``** -***** +------------------------------------------------------------------------------- - ## Appendix A: Hints and Tips - ### FAQ **Q:** The `generated-configure.sh` file looks horrible! How are you going to -edit it? +edit it? \ **A:** The `generated-configure.sh` file is generated (think "compiled") by the autoconf tools. The source code is in `configure.ac` and various .m4 files in common/autoconf, which are much more readable. -**Q:** Why is the `generated-configure.sh` file checked in, if it is -generated? +**Q:** Why is the `generated-configure.sh` file checked in, if it is +generated? \ **A:** If it was not generated, every user would need to have the autoconf tools installed, and re-generate the `configure` file as the first step. Our goal is to minimize the work needed to be done by the user to start building OpenJDK, and to minimize the number of external dependencies required. **Q:** Do you require a specific version of autoconf for regenerating -`generated-configure.sh`? +`generated-configure.sh`? \ **A:** Yes, version 2.69 is required and should be easy enough to aquire on all supported operating systems. The reason for this is to avoid large spurious changes in `generated-configure.sh`. **Q:** How do you regenerate `generated-configure.sh` after making changes to -the input files? +the input files? \ **A:** Regnerating `generated-configure.sh` should always be done using the script `common/autoconf/autogen.sh` to ensure that the correct files get updated. This script should also be run after mercurial tries to merge @@ -725,7 +619,7 @@ updated. This script should also be run after mercurial tries to merge be correct. **Q:** What are the files in `common/makefiles/support/*` for? They look like -gibberish. +gibberish. \ **A:** They are a somewhat ugly hack to compensate for command line length limitations on certain platforms (Windows, Solaris). Due to a combination of limitations in make and the shell, command lines containing too many files will @@ -735,21 +629,21 @@ not proud of it, but it does fix the problem. If you have any better suggestions, we're all ears! :-) **Q:** I want to see the output of the commands that make runs, like in the old -build. How do I do that? +build. How do I do that? \ **A:** You specify the `LOG` variable to make. There are several log levels: * **`warn`** -- Default and very quiet. * **`info`** -- Shows more progress information than warn. * **`debug`** -- Echos all command lines and prints all macro calls for compilation definitions. - * **`trace`** -- Echos all $(shell) command lines as well. + * **`trace`** -- Echos all \$(shell) command lines as well. -**Q:** When do I have to re-run `configure`? +**Q:** When do I have to re-run `configure`? \ **A:** Normally you will run `configure` only once for creating a configuration. You need to re-run configuration only if you want to change any configuration options, or if you pull down changes to the `configure` script. -**Q:** I have added a new source file. Do I need to modify the makefiles? +**Q:** I have added a new source file. Do I need to modify the makefiles? \ **A:** Normally, no. If you want to create e.g. a new native library, you will need to modify the makefiles. But for normal file additions or removals, no changes are needed. There are certan exceptions for some native libraries where @@ -758,20 +652,21 @@ for other libraries. In these cases it was simply easier to create include lists rather than excludes. **Q:** When I run `configure --help`, I see many strange options, like -`--dvidir`. What is this? +`--dvidir`. What is this? \ **A:** Configure provides a slew of options by default, to all projects that use autoconf. Most of them are not used in OpenJDK, so you can safely ignore them. To list only OpenJDK specific features, use `configure --help=short` instead. -**Q:** `configure` provides OpenJDK-specific features such as `--with- -builddeps-server` that are not described in this document. What about those? +**Q:** `configure` provides OpenJDK-specific features such as +`--with-builddeps-server` that are not described in this document. What about +those? \ **A:** Try them out if you like! But be aware that most of these are experimental features. Many of them don't do anything at all at the moment; the option is just a placeholder. Others depend on pieces of code or infrastructure that is currently not ready for prime time. -**Q:** How will you make sure you don't break anything? +**Q:** How will you make sure you don't break anything? \ **A:** We have a script that compares the result of the new build system with the result of the old. For most part, we aim for (and achieve) byte-by-byte identical output. There are however technical issues with e.g. native binaries, @@ -781,7 +676,7 @@ table and file size). Note that we still don't have 100% equivalence, but we're close. **Q:** I noticed this thing X in the build that looks very broken by design. -Why don't you fix it? +Why don't you fix it? \ **A:** Our goal is to produce a build output that is as close as technically possible to the old build output. If things were weird in the old build, they will be weird in the new build. Often, things were weird before due to @@ -790,14 +685,14 @@ The plan is to attack these things at a later stage, after the new build system is established. **Q:** The code in the new build system is not that well-structured. Will you -fix this? +fix this? \ **A:** Yes! The new build system has grown bit by bit as we converted the old system. When all of the old build system is converted, we can take a step back and clean up the structure of the new build system. Some of this we plan to do before replacing the old build system and some will need to wait until after. **Q:** Is anything able to use the results of the new build's default make -target? +target? \ **A:** Yes, this is the minimal (or roughly minimal) set of compiled output needed for a developer to actually execute the newly built JDK. The idea is that in an incremental development fashion, when doing a normal make, you @@ -809,12 +704,11 @@ it's still unnecessary. We're targeting sub-second incremental rebuilds! ;-) (Or, well, at least single-digit seconds...) **Q:** I usually set a specific environment variable when building, but I can't -find the equivalent in the new build. What should I do? +find the equivalent in the new build. What should I do? \ **A:** It might very well be that we have neglected to add support for an option that was actually used from outside the build system. Email us and we will add support for it! - ### Build Performance Tips Building OpenJDK requires a lot of horsepower. Some of the build tools can be @@ -881,7 +775,6 @@ and override with fast if you're impatient, you should call `configure` with `--with-num-cores=2`, making 2 the default. If you want to run with more cores, run `make JOBS=8` - ### Troubleshooting #### Solving build problems @@ -909,7 +802,7 @@ difficulties that `configure` had in finding things. Some of the more common problems with builds are briefly described below, with suggestions for remedies. - * **Corrupted Bundles on Windows:** + * **Corrupted Bundles on Windows:** \ Some virus scanning software has been known to corrupt the downloading of zip bundles. It may be necessary to disable the 'on access' or 'real time' virus scanning features to prevent this corruption. This type of 'real time' @@ -917,7 +810,7 @@ suggestions for remedies. Temporarily disabling the feature, or excluding the build output directory may be necessary to get correct and faster builds. - * **Slow Builds:** + * **Slow Builds:** \ If your build machine seems to be overloaded from too many simultaneous C++ compiles, try setting the `JOBS=1` on the `make` command line. Then try increasing the count slowly to an acceptable level for your system. Also: @@ -932,10 +825,10 @@ suggestions for remedies. Faster compiles are possible using a tool called [ccache](http://ccache.samba.org/). - * **File time issues:** + * **File time issues:** \ If you see warnings that refer to file time stamps, e.g. - > _Warning message:_ ` File 'xxx' has modification time in the future.` + > _Warning message:_ ` File 'xxx' has modification time in the future.` \ > _Warning message:_ ` Clock skew detected. Your build may be incomplete.` These warnings can occur when the clock on the build machine is out of sync @@ -948,7 +841,7 @@ suggestions for remedies. "`gmake clobber`" or delete the directory containing the build output, and restart the build from the beginning. - * **Error message: `Trouble writing out table to disk`** + * **Error message: `Trouble writing out table to disk`** \ Increase the amount of swap space on your build machine. This could be caused by overloading the system and it may be necessary to use: @@ -956,7 +849,7 @@ suggestions for remedies. to reduce the load on the system. - * **Error Message: `libstdc++ not found`:** + * **Error Message: `libstdc++ not found`:** \ This is caused by a missing libstdc++.a library. This is installed as part of a specific package (e.g. libstdc++.so.devel.386). By default some 64-bit Linux versions (e.g. Fedora) only install the 64-bit version of the @@ -964,7 +857,7 @@ suggestions for remedies. the C++ runtime libraries to allow for maximum portability of the built images. - * **Linux Error Message: `cannot restore segment prot after reloc`** + * **Linux Error Message: `cannot restore segment prot after reloc`** \ This is probably an issue with SELinux (See [SELinux on Wikipedia](http://en.wikipedia.org/wiki/SELinux)). Parts of the VM is built without the `-fPIC` for performance reasons. @@ -979,31 +872,30 @@ suggestions for remedies. Alternatively, instead of completely disabling it you could disable just this one check. - 1. Select System->Administration->SELinux Management + 1. Select System->Administration->SELinux Management 2. In the SELinux Management Tool which appears, select "Boolean" from the menu on the left 3. Expand the "Memory Protection" group 4. Check the first item, labeled "Allow all unconfined executables to use libraries requiring text relocation ..." - * **Windows Error Messages:** - `*** fatal error - couldn't allocate heap, ... ` - `rm fails with "Directory not empty"` - `unzip fails with "cannot create ... Permission denied"` + * **Windows Error Messages:** \ + `*** fatal error - couldn't allocate heap, ... ` \ + `rm fails with "Directory not empty"` \ + `unzip fails with "cannot create ... Permission denied"` \ `unzip fails with "cannot create ... Error 50"` The CYGWIN software can conflict with other non-CYGWIN software. See the CYGWIN FAQ section on [BLODA (applications that interfere with CYGWIN)](http://cygwin.com/faq/faq.using.html#faq.using.bloda). - * **Windows Error Message: `spawn failed`** + * **Windows Error Message: `spawn failed`** \ Try rebooting the system, or there could be some kind of issue with the disk or disk partition being used. Sometimes it comes with a "Permission Denied" message. -***** +------------------------------------------------------------------------------- - ## Appendix B: GNU make The Makefiles in the OpenJDK are only valid when used with the GNU version of @@ -1021,11 +913,10 @@ about using GNU make: * **Mac OS X:** The XCode "command line tools" must be installed on your Mac. Information on GNU make, and access to ftp download sites, are available on the -[GNU make web site ](http://www.gnu.org/software/make/make.html). The latest +[GNU make web site](http://www.gnu.org/software/make/make.html). The latest source to GNU make is available at [ftp.gnu.org/pub/gnu/make/](http://ftp.gnu.org/pub/gnu/make/). - ### Building GNU make First step is to get the GNU make 3.81 or newer source from @@ -1035,9 +926,8 @@ little different depending on the OS but is basically done with: bash ./configure make -***** +------------------------------------------------------------------------------- - ## Appendix C: Build Environments ### Minimum Build Environments @@ -1081,79 +971,19 @@ problem. Similarly, compilation problems related to changes to the newer, or unreleased OS versions. Please report these types of problems as bugs so that they can be dealt with accordingly. -> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Base OS and ArchitectureOSC/C++ CompilerBootstrap JDKProcessorsRAM MinimumDISK Needs
Linux X86 (32-bit) and X64 (64-bit)Oracle Enterprise Linux 6.4gcc 4.9.2 JDK 82 or more1 GB6 GB
Solaris SPARCV9 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patchesJDK 84 or more4 GB8 GB
Solaris X64 (64-bit)Solaris 11 Update 1Studio 12 Update 4 + patchesJDK 84 or more4 GB8 GB
Windows X86 (32-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional EditionJDK 82 or more2 GB6 GB
Windows X64 (64-bit)Windows Server 2012 R2 x64Microsoft Visual Studio C++ 2013 Professional EditionJDK 82 or more2 GB6 GB
Mac OS X X64 (64-bit)Mac OS X 10.9 "Mavericks"Xcode 6.3 or newerJDK 82 or more4 GB6 GB
+Bootstrap JDK: JDK 8 -***** + Base OS and Architecture OS C/C++ Compiler Processors RAM Minimum DISK Needs + ------------------------------------- ----------------------------- ------------------------------------------------------- ------------ ------------- ------------ + Linux X86 (32-bit) and X64 (64-bit) Oracle Enterprise Linux 6.4 gcc 4.9.2 2 or more 1 GB 6 GB + Solaris SPARCV9 (64-bit) Solaris 11 Update 1 Studio 12 Update 4 + patches 4 or more 4 GB 8 GB + Solaris X64 (64-bit) Solaris 11 Update 1 Studio 12 Update 4 + patches 4 or more 4 GB 8 GB + Windows X86 (32-bit) Windows Server 2012 R2 x64 Microsoft Visual Studio C++ 2013 Professional Edition 2 or more 2 GB 6 GB + Windows X64 (64-bit) Windows Server 2012 R2 x64 Microsoft Visual Studio C++ 2013 Professional Edition 2 or more 2 GB 6 GB + Mac OS X X64 (64-bit) Mac OS X 10.9 "Mavericks" Xcode 6.3 or newer 2 or more 4 GB 6 GB + +------------------------------------------------------------------------------- - ### Specific Developer Build Environments We won't be listing all the possible environments, but we will try to provide @@ -1278,7 +1108,7 @@ In addition, it is necessary to set a few environment variables for the build: export LANG=C export PATH="/opt/SunStudioExpress/bin:${PATH}" -***** +------------------------------------------------------------------------------- End of the OpenJDK build README document. diff --git a/common/doc/testing.html b/common/doc/testing.html new file mode 100644 index 00000000000..71965f3e336 --- /dev/null +++ b/common/doc/testing.html @@ -0,0 +1,112 @@ + + + + + + + Testing OpenJDK + + + + + + + + +

Using the run-test framework

+

This new way of running tests is developer-centric. It assumes that you have built a jdk locally and want to test it. Running common test targets is simple, and more complex ad-hoc combination of tests is possible. The user interface is forgiving, and clearly report errors it cannot resolve.

+

Some example command-lines:

+
$ make run-test-tier1
+$ make run-test-jdk_lang JTREG="JOBS=8"
+$ make run-test TEST=jdk_lang
+$ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1"
+$ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"
+$ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java"
+

Test selection

+

All functionality is available using the run-test make target. In this use case, the test or tests to be executed is controlled using the TEST variable. To speed up subsequent test runs with no source code changes, run-test-only can be used instead, which do not depend on the source and test image build.

+

For some common top-level tests, direct make targets have been generated. This includes all JTreg test groups, the hotspot gtest, and custom tests (if present). This means that make run-test-tier1 is equivalent to make run-test TEST="tier1", but the latter is more tab-completion friendly. For more complex test runs, the run-test TEST="x" solution needs to be used.

+

The test specifications given in TEST is parsed into fully qualified test descriptors, which clearly and unambigously show which tests will be run. As an example, :tier1 will expand to jtreg:jdk/test:tier1 jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1. You can always submit a list of fully qualified test descriptors in the TEST variable if you want to shortcut the parser.

+

JTreg

+

JTreg test groups can be specified either without a test root, e.g. :tier1 (or tier1, the initial colon is optional), or with, e.g. hotspot/test:tier1, jdk/test:jdk_util.

+

When specified without a test root, all matching groups from all tests roots will be added. Otherwise, only the group from the specified test root will be added.

+

Individual JTreg tests or directories containing JTreg tests can also be specified, like hotspot/test/native_sanity/JniVersion.java or hotspot/test/native_sanity. You can also specify an absolute path, to point to a JTreg test outside the source tree.

+

As long as the test groups or test paths can be uniquely resolved, you do not need to enter the jtreg: prefix. If this is not possible, or if you want to use a fully qualified test descriptor, add jtreg:, e.g. jtreg:hotspot/test/native_sanity.

+

Gtest

+

Since the Hotspot Gtest suite is so quick, the default is to run all tests. This is specified by just gtest, or as a fully qualified test descriptor gtest:all.

+

If you want, you can single out an individual test or a group of tests, for instance gtest:LogDecorations or gtest:LogDecorations.level_test_vm. This can be particularly useful if you want to run a shaky test repeatedly.

+

Test results and summary

+

At the end of the test run, a summary of all tests run will be presented. This will have a consistent look, regardless of what test suites were used. This is a sample summary:

+
==============================
+Test summary
+==============================
+   TEST                                          TOTAL  PASS  FAIL ERROR
+>> jtreg:jdk/test:tier1                           1867  1865     2     0 <<
+   jtreg:langtools/test:tier1                     4711  4711     0     0
+   jtreg:nashorn/test:tier1                        133   133     0     0
+==============================
+TEST FAILURE
+

Tests where the number of TOTAL tests does not equal the number of PASSed tests will be considered a test failure. These are marked with the >> ... << marker for easy identification.

+

The classification of non-passed tests differs a bit between test suites. In the summary, ERROR is used as a catch-all for tests that neither passed nor are classified as failed by the framework. This might indicate test framework error, timeout or other problems.

+

In case of test failures, make run-test will exit with a non-zero exit value.

+

All tests have their result stored in build/$BUILD/test-result/$TEST_ID, where TEST_ID is a path-safe conversion from the fully qualified test descriptor, e.g. for jtreg:jdk/test:tier1 the TEST_ID is jtreg_jdk_test_tier1. This path is also printed in the log at the end of the test run.

+

Additional work data is stored in build/$BUILD/test-support/$TEST_ID. For some frameworks, this directory might contain information that is useful in determining the cause of a failed test.

+

Test suite control

+

It is possible to control various aspects of the test suites using make control variables.

+

These variables use a keyword=value approach to allow multiple values to be set. So, for instance, JTREG="JOBS=1;TIMEOUT=8" will set the JTreg concurrency level to 1 and the timeout factor to 8. This is equivalent to setting JTREG_JOBS=1 JTREG_TIMEOUT=8, but using the keyword format means that the JTREG variable is parsed and verified for correctness, so JTREG="TMIEOUT=8" would give an error, while JTREG_TMIEOUT=8 would just pass unnoticed.

+

To separate multiple keyword=value pairs, use ; (semicolon). Since the shell normally eats ;, the recommended usage is to write the assignment inside qoutes, e.g. JTREG="...;...". This will also make sure spaces are preserved, as in JTREG="VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug".

+

(Other ways are possible, e.g. using backslash: JTREG=JOBS=1\;TIMEOUT=8. Also, as a special technique, the string %20 will be replaced with space for certain options, e.g. JTREG=VM_OTIONS=-XshowSettings%20-Xlog:gc+ref=debug. This can be useful if you have layers of scripts and have trouble getting proper quoting of command line arguments through.)

+

As far as possible, the names of the keywords have been standardized between test suites.

+

JTreg keywords

+

JOBS

+

The test concurrency (-concurrency).

+

Defaults to TEST_JOBS (if set by --with-test-jobs=), otherwise it defaults to JOBS, except for Hotspot, where the default is number of CPU cores/2, but never more than 12.

+

TIMEOUT

+

The timeout factor (-timeoutFactor).

+

Defaults to 4.

+

TEST_MODE

+

The test mode (-agentvm, -samevm or -othervm).

+

Defaults to -agentvm.

+

ASSERT

+

Enable asserts (-ea -esa, or none).

+

Set to true or false. If true, adds -ea -esa. Defaults to true, except for hotspot.

+

VERBOSE

+

The verbosity level (-verbose).

+

Defaults to fail,error,summary.

+

RETAIN

+

What test data to retain (-retain).

+

Defaults to fail,error.

+

MAX_MEM

+

Limit memory consumption (-Xmx and -vmoption:-Xmx, or none).

+

Limit memory consumption for JTreg test framework and VM under test. Set to 0 to disable the limits.

+

Defaults to 512m, except for hotspot, where it defaults to 0 (no limit).

+

OPTIONS

+

Additional options to the JTreg test framework.

+

Use JTREG="OPTIONS=--help all" to see all available JTreg options.

+

JAVA_OPTIONS

+

Additional Java options to JTreg (-javaoption).

+

VM_OPTIONS

+

Additional VM options to JTreg (-vmoption).

+

Gtest keywords

+

REPEAT

+

The number of times to repeat the tests (--gtest_repeat).

+

Default is 1. Set to -1 to repeat indefinitely. This can be especially useful combined with OPTIONS=--gtest_break_on_failure to reproduce an intermittent problem.

+

OPTIONS

+

Additional options to the Gtest test framework.

+

Use GTEST="OPTIONS=--help" to see all available Gtest options.

+ + diff --git a/common/doc/testing.md b/common/doc/testing.md new file mode 100644 index 00000000000..46f32f911e3 --- /dev/null +++ b/common/doc/testing.md @@ -0,0 +1,207 @@ +% Testing OpenJDK + +## Using the run-test framework + +This new way of running tests is developer-centric. It assumes that you have +built a jdk locally and want to test it. Running common test targets is simple, +and more complex ad-hoc combination of tests is possible. The user interface is +forgiving, and clearly report errors it cannot resolve. + +Some example command-lines: + + $ make run-test-tier1 + $ make run-test-jdk_lang JTREG="JOBS=8" + $ make run-test TEST=jdk_lang + $ make run-test-only TEST="gtest:LogTagSet gtest:LogTagSetDescriptions" GTEST="REPEAT=-1" + $ make run-test TEST="hotspot/test:hotspot_gc" JTREG="JOBS=1;TIMEOUT=8;VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug" + $ make run-test TEST="jtreg:hotspot/test:hotspot_gc hotspot/test/native_sanity/JniVersion.java" + +## Test selection + +All functionality is available using the run-test make target. In this use +case, the test or tests to be executed is controlled using the `TEST` variable. +To speed up subsequent test runs with no source code changes, run-test-only can +be used instead, which do not depend on the source and test image build. + +For some common top-level tests, direct make targets have been generated. This +includes all JTreg test groups, the hotspot gtest, and custom tests (if +present). This means that `make run-test-tier1` is equivalent to `make run-test +TEST="tier1"`, but the latter is more tab-completion friendly. For more complex +test runs, the `run-test TEST="x"` solution needs to be used. + +The test specifications given in `TEST` is parsed into fully qualified test +descriptors, which clearly and unambigously show which tests will be run. As an +example, `:tier1` will expand to `jtreg:jdk/test:tier1 +jtreg:langtools/test:tier1 jtreg:nashorn/test:tier1 jtreg:jaxp/test:tier1`. You +can always submit a list of fully qualified test descriptors in the `TEST` +variable if you want to shortcut the parser. + +### JTreg + +JTreg test groups can be specified either without a test root, e.g. `:tier1` +(or `tier1`, the initial colon is optional), or with, e.g. +`hotspot/test:tier1`, `jdk/test:jdk_util`. + +When specified without a test root, all matching groups from all tests roots +will be added. Otherwise, only the group from the specified test root will be +added. + +Individual JTreg tests or directories containing JTreg tests can also be +specified, like `hotspot/test/native_sanity/JniVersion.java` or +`hotspot/test/native_sanity`. You can also specify an absolute path, to point +to a JTreg test outside the source tree. + +As long as the test groups or test paths can be uniquely resolved, you do not +need to enter the `jtreg:` prefix. If this is not possible, or if you want to +use a fully qualified test descriptor, add `jtreg:`, e.g. +`jtreg:hotspot/test/native_sanity`. + +### Gtest + +Since the Hotspot Gtest suite is so quick, the default is to run all tests. +This is specified by just `gtest`, or as a fully qualified test descriptor +`gtest:all`. + +If you want, you can single out an individual test or a group of tests, for +instance `gtest:LogDecorations` or `gtest:LogDecorations.level_test_vm`. This +can be particularly useful if you want to run a shaky test repeatedly. + +## Test results and summary + +At the end of the test run, a summary of all tests run will be presented. This +will have a consistent look, regardless of what test suites were used. This is +a sample summary: + + ============================== + Test summary + ============================== + TEST TOTAL PASS FAIL ERROR + >> jtreg:jdk/test:tier1 1867 1865 2 0 << + jtreg:langtools/test:tier1 4711 4711 0 0 + jtreg:nashorn/test:tier1 133 133 0 0 + ============================== + TEST FAILURE + +Tests where the number of TOTAL tests does not equal the number of PASSed tests +will be considered a test failure. These are marked with the `>> ... <<` marker +for easy identification. + +The classification of non-passed tests differs a bit between test suites. In +the summary, ERROR is used as a catch-all for tests that neither passed nor are +classified as failed by the framework. This might indicate test framework +error, timeout or other problems. + +In case of test failures, `make run-test` will exit with a non-zero exit value. + +All tests have their result stored in `build/$BUILD/test-result/$TEST_ID`, +where TEST_ID is a path-safe conversion from the fully qualified test +descriptor, e.g. for `jtreg:jdk/test:tier1` the TEST_ID is +`jtreg_jdk_test_tier1`. This path is also printed in the log at the end of the +test run. + +Additional work data is stored in `build/$BUILD/test-support/$TEST_ID`. For +some frameworks, this directory might contain information that is useful in +determining the cause of a failed test. + +## Test suite control + +It is possible to control various aspects of the test suites using make control +variables. + +These variables use a keyword=value approach to allow multiple values to be +set. So, for instance, `JTREG="JOBS=1;TIMEOUT=8"` will set the JTreg +concurrency level to 1 and the timeout factor to 8. This is equivalent to +setting `JTREG_JOBS=1 JTREG_TIMEOUT=8`, but using the keyword format means that +the `JTREG` variable is parsed and verified for correctness, so +`JTREG="TMIEOUT=8"` would give an error, while `JTREG_TMIEOUT=8` would just +pass unnoticed. + +To separate multiple keyword=value pairs, use `;` (semicolon). Since the shell +normally eats `;`, the recommended usage is to write the assignment inside +qoutes, e.g. `JTREG="...;..."`. This will also make sure spaces are preserved, +as in `JTREG="VM_OTIONS=-XshowSettings -Xlog:gc+ref=debug"`. + +(Other ways are possible, e.g. using backslash: `JTREG=JOBS=1\;TIMEOUT=8`. +Also, as a special technique, the string `%20` will be replaced with space for +certain options, e.g. `JTREG=VM_OTIONS=-XshowSettings%20-Xlog:gc+ref=debug`. +This can be useful if you have layers of scripts and have trouble getting +proper quoting of command line arguments through.) + +As far as possible, the names of the keywords have been standardized between +test suites. + +### JTreg keywords + +#### JOBS +The test concurrency (`-concurrency`). + +Defaults to TEST_JOBS (if set by `--with-test-jobs=`), otherwise it defaults to +JOBS, except for Hotspot, where the default is *number of CPU cores/2*, but +never more than 12. + +#### TIMEOUT +The timeout factor (`-timeoutFactor`). + +Defaults to 4. + +#### TEST_MODE +The test mode (`-agentvm`, `-samevm` or `-othervm`). + +Defaults to `-agentvm`. + +#### ASSERT +Enable asserts (`-ea -esa`, or none). + +Set to `true` or `false`. If true, adds `-ea -esa`. Defaults to true, except +for hotspot. + +#### VERBOSE +The verbosity level (`-verbose`). + +Defaults to `fail,error,summary`. + +#### RETAIN +What test data to retain (`-retain`). + +Defaults to `fail,error`. + +#### MAX_MEM +Limit memory consumption (`-Xmx` and `-vmoption:-Xmx`, or none). + +Limit memory consumption for JTreg test framework and VM under test. Set to 0 +to disable the limits. + +Defaults to 512m, except for hotspot, where it defaults to 0 (no limit). + +#### OPTIONS +Additional options to the JTreg test framework. + +Use `JTREG="OPTIONS=--help all"` to see all available JTreg options. + +#### JAVA_OPTIONS +Additional Java options to JTreg (`-javaoption`). + +#### VM_OPTIONS +Additional VM options to JTreg (`-vmoption`). + +### Gtest keywords + +#### REPEAT +The number of times to repeat the tests (`--gtest_repeat`). + +Default is 1. Set to -1 to repeat indefinitely. This can be especially useful +combined with `OPTIONS=--gtest_break_on_failure` to reproduce an intermittent +problem. + +#### OPTIONS +Additional options to the Gtest test framework. + +Use `GTEST="OPTIONS=--help"` to see all available Gtest options. + +--- +# Override some definitions in http://openjdk.java.net/page.css that are +# unsuitable for this document. +header-includes: + - '' + - '' +--- diff --git a/common/nb_native/nbproject/configurations.xml b/common/nb_native/nbproject/configurations.xml index 170dc36b3b8..5aebfbd85a4 100644 --- a/common/nb_native/nbproject/configurations.xml +++ b/common/nb_native/nbproject/configurations.xml @@ -982,52 +982,6 @@ - - - - - agent_util.c - - - compiledMethodLoad.c - - - gctest.c - - - heapTracker.c - - - heapViewer.c - - - java_crw_demo.c - - - minst.c - - - mtrace.c - - - versionCheck.c - - - Agent.cpp - Monitor.cpp - Thread.cpp - waiters.cpp - - - - - - - Poller.c - - - - @@ -1223,7 +1177,7 @@ check_format.c - + compress.c deflate.c gzclose.c @@ -21533,89 +21487,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - DEBUG - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/demo/share/jvmti/waiters - ../../jdk/src/java.base/macosx/native/include - ../../jdk/make - - - DEBUG - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/macosx/native/include - ../../jdk/make - - - - - - - ../../jdk/src/demo/share/jvmti/compiledMethodLoad - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/macosx/native/include - ../../jdk/make - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/macosx/native/include - ../../jdk/src/demo/share/jvmti/gctest - ../../jdk/make - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/macosx/native/include - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/make - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/demo/share/jvmti/heapViewer - ../../jdk/src/java.base/macosx/native/include - ../../jdk/make - - - - - - - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/make - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/macosx/native/include - ../../jdk/src/demo/share/jvmti/minst - ../../jdk/make - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/macosx/native/include - ../../jdk/src/demo/share/jvmti/mtrace - ../../jdk/make - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/demo/share/jvmti/versionCheck - ../../jdk/src/java.base/macosx/native/include - ../../jdk/make - - - @@ -36906,106 +36670,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THIS_FILE="Monitor.cpp" - - - - - - - THIS_FILE="Thread.cpp" - - - - - - - THIS_FILE="waiters.cpp" - - - ../../jdk/src/java.base/unix/native/include ../../jdk/src/java.base/share/native/libjava ../../jdk/src/java.base/unix/native/libjava - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../build/support/headers/java.base ../../make @@ -38304,7 +37968,7 @@ ../../jdk/src/java.base/unix/native/include ../../jdk/src/java.base/share/native/libjava ../../jdk/src/java.base/unix/native/libjava - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../build/support/headers/java.base ../../make @@ -38325,7 +37989,7 @@ ../../jdk/src/java.base/unix/native/include ../../jdk/src/java.base/share/native/libjava ../../jdk/src/java.base/unix/native/libjava - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../build/support/headers/java.base ../../make @@ -38346,7 +38010,7 @@ ../../jdk/src/java.base/unix/native/include ../../jdk/src/java.base/share/native/libjava ../../jdk/src/java.base/unix/native/libjava - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../build/support/headers/java.base ../../make @@ -38367,7 +38031,7 @@ ../../jdk/src/java.base/unix/native/include ../../jdk/src/java.base/share/native/libjava ../../jdk/src/java.base/unix/native/libjava - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../build/support/headers/java.base ../../make @@ -38377,14 +38041,14 @@ - - @@ -38394,7 +38058,7 @@ - @@ -38404,7 +38068,7 @@ - @@ -38414,7 +38078,7 @@ - @@ -38424,7 +38088,7 @@ - @@ -38434,7 +38098,7 @@ - @@ -38444,7 +38108,7 @@ - @@ -38454,7 +38118,7 @@ - @@ -38464,7 +38128,7 @@ - @@ -38474,7 +38138,7 @@ - @@ -38484,7 +38148,7 @@ - @@ -38494,7 +38158,7 @@ - @@ -38504,7 +38168,7 @@ - @@ -38514,7 +38178,7 @@ - @@ -41203,7 +40867,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41232,7 +40896,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41261,7 +40925,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41290,7 +40954,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41319,7 +40983,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41348,7 +41012,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41377,7 +41041,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41406,7 +41070,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41435,7 +41099,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41464,7 +41128,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41493,7 +41157,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41522,7 +41186,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41551,7 +41215,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41580,7 +41244,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41609,7 +41273,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41638,7 +41302,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41667,7 +41331,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41696,7 +41360,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41725,7 +41389,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41754,7 +41418,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41783,7 +41447,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41812,7 +41476,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41841,7 +41505,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41870,7 +41534,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41899,7 +41563,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41928,7 +41592,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41957,7 +41621,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -41986,7 +41650,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42015,7 +41679,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42044,7 +41708,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42073,7 +41737,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42102,7 +41766,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42131,7 +41795,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42160,7 +41824,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42189,7 +41853,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42218,7 +41882,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42247,7 +41911,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42276,7 +41940,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42305,7 +41969,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42334,7 +41998,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42363,7 +42027,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42413,7 +42077,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42442,7 +42106,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -42471,7 +42135,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -46197,183 +45861,6 @@ - - - - DEBUG - - - - - ../../jdk/src/demo/share/jvmti/waiters - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - DEBUG - - - - - - - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - - - - - ../../jdk/src/demo/share/jvmti/compiledMethodLoad - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="compiledMethodLoad.c" - - - - - - - ../../jdk/src/demo/share/jvmti/gctest - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="gctest.c" - - - - - - - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="heapTracker.c" - - - - - - - ../../jdk/src/demo/share/jvmti/heapViewer - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="heapViewer.c" - - - - - - - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="java_crw_demo.c" - - - - - - - ../../jdk/src/demo/share/jvmti/minst - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="minst.c" - - - - - - - ../../jdk/src/demo/share/jvmti/mtrace - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="mtrace.c" - - - - - - - ../../jdk/src/demo/share/jvmti/versionCheck - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/linux/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="versionCheck.c" - - - @@ -46557,7 +46044,7 @@ ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/unix/native/libjli ../../jdk/src/java.base/share/native/libjli - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../make @@ -46639,7 +46126,7 @@ - + ../../jdk/src/java.desktop/share/native/libsplashscreen/giflib @@ -46647,7 +46134,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -46712,7 +46199,7 @@ ../../jdk/src/java.base/unix/native/libjli ../../jdk/src/java.base/share/native/libjli - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../make @@ -47250,7 +46737,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -47598,7 +47085,7 @@ ../../jdk/src/java.desktop/share/native/libsplashscreen ../../jdk/src/java.desktop/share/native/libsplashscreen/libpng ../../jdk/src/java.desktop/unix/native/libsplashscreen - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/linux/native/libjava ../../jdk/src/java.base/unix/native/libjava ../../jdk/src/java.base/share/native/libjava @@ -47996,7 +47483,7 @@ ../../jdk/src/jdk.pack/share/native/common-unpack ../../jdk/src/java.base/share/native/libjava ../../jdk/src/java.base/unix/native/libjava - ../../jdk/src/java.base/share/native/libzip/zlib-1.2.8 + ../../jdk/src/java.base/share/native/libzip/zlib ../../jdk/src/java.base/share/native/include ../../jdk/src/java.base/linux/native/include ../../jdk/src/java.base/unix/native/include @@ -55235,113 +54722,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - THIS_FILE="Monitor.cpp" - - - - - - - THIS_FILE="Thread.cpp" - - - - - - - THIS_FILE="waiters.cpp" - - - - - - - - ../../jdk/src/demo/share/jvmti/waiters - ../../jdk/src/demo/share/jvmti/agent_util ../../jdk/src/java.base/share/native/include ../../jdk/src/java.base/solaris/native/include ../../jdk/src/java.base/unix/native/include @@ -64699,189 +64077,6 @@ - - - - DEBUG - - - - - DEBUG - - - - - - - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - - - - - ../../jdk/src/demo/share/jvmti/compiledMethodLoad - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="compiledMethodLoad.c" - - - - - - - ../../jdk/src/demo/share/jvmti/gctest - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="gctest.c" - - - - - - - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="heapTracker.c" - - - - - - - ../../jdk/src/demo/share/jvmti/heapViewer - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="heapViewer.c" - - - - - - - ../../jdk/src/demo/share/jvmti/heapTracker - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="java_crw_demo.c" - - - - - - - ../../jdk/src/demo/share/jvmti/minst - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="minst.c" - - - - - - - ../../jdk/src/demo/share/jvmti/mtrace - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/demo/share/jvmti/java_crw_demo - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="mtrace.c" - - - - - - - ../../jdk/src/demo/share/jvmti/versionCheck - ../../jdk/src/demo/share/jvmti/agent_util - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../jdk/make - - - THIS_FILE="versionCheck.c" - - - - - - - ../../jdk/src/java.base/share/native/include - ../../jdk/src/java.base/solaris/native/include - ../../jdk/src/java.base/unix/native/include - ../../jdk/src/java.base/share/native/libjava - ../../jdk/src/java.base/unix/native/libjava - ../../build/support/demos/classes/jni/Poller - ../../jdk/make - - - THIS_FILE="Poller.c" - - - diff --git a/corba/.hgtags b/corba/.hgtags index 7a24e3f5f23..4fb5982fa26 100644 --- a/corba/.hgtags +++ b/corba/.hgtags @@ -396,5 +396,25 @@ f95cc86b6ac22ec1ade5d4f825dc7782adeea228 jdk-9+148 77f827f5bbad3ef795664bc675f72d98d156b9f8 jdk-9+151 ff8cb43c07c069b1debdee44cb88ca22db1ec757 jdk-9+152 68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153 +d66f97a610a6beac987740edc2bf6a70f46ba574 jdk-10+0 078ebe23b584466dc8346e620d7821d91751e5a9 jdk-9+154 a545f54babfa31aa7eb611f36031609acd617cbc jdk-9+155 +907c26240cd481579e919bfd23740797ff8ce1c8 jdk-9+156 +37c9962586a4d3498fa673d93eab1a336acd7652 jdk-10+1 +9383da04b385cca46b7ca67f3a39ac1b673e09fe jdk-9+157 +de6bdf38935fa753183ca288bed5c06a23c0bb12 jdk-9+158 +6feea77d2083c99e44aa3e272d07b7fb3b801683 jdk-9+159 +c7688f2fa07936b089ca0e9a0a0eff68ff37a542 jdk-9+160 +18f02bc43fe96aef36791d0df7aca748485210cc jdk-9+161 +18ffcf99a3b4a10457853d94190e825bdf07e39b jdk-9+162 +493011dee80e51c2a2b064d049183c047df36d80 jdk-9+163 +965bbae3072702f7c0d95c240523b65e6bb19261 jdk-9+164 +a510b2201154abdd12ede42788086b5283bfb9a6 jdk-9+165 +934c18145915b06d3fcc0de1a30f91f5aab8a192 jdk-9+166 +56a8bf5322684e9a31cda64c336c32bcdb592211 jdk-10+2 +3813c94c8585dd7507887916c6943f45051f1b55 jdk-10+3 +5d6d891bb36dbeeacaffa06b5a3e3b4e44b35fbd jdk-10+4 +7c5328012799923d45d1cf87e8725e725b3d298b jdk-10+5 +c7358d703e1282af3dcd8af6c037dc4342de9054 jdk-10+6 +43de67f51801b9e16507865fcb7e8344f4ca4aa9 jdk-9+167 +03a2cc9c8a1e8f87924c9863e917bc8b91770d5f jdk-9+168 diff --git a/corba/.jcheck/conf b/corba/.jcheck/conf index 5c6f62dc12c..b2581358014 100644 --- a/corba/.jcheck/conf +++ b/corba/.jcheck/conf @@ -1 +1 @@ -project=jdk9 +project=jdk10 diff --git a/corba/README b/corba/README deleted file mode 100644 index 56825f5ca08..00000000000 --- a/corba/README +++ /dev/null @@ -1,14 +0,0 @@ -README: - This file should be located at the top of the corba Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - - cd make && gnumake - - The files that will be imported into the jdk build will be in the "dist" - directory. - diff --git a/corba/src/java.corba/share/classes/module-info.java b/corba/src/java.corba/share/classes/module-info.java index 10a26f0bc21..0d3fbe284d3 100644 --- a/corba/src/java.corba/share/classes/module-info.java +++ b/corba/src/java.corba/share/classes/module-info.java @@ -25,6 +25,9 @@ /** * Defines the Java binding of the OMG CORBA APIs, and the RMI-IIOP API. + * + * @moduleGraph + * @since 9 */ @Deprecated(since="9", forRemoval=true) module java.corba { diff --git a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java index 8a75455da9f..ccbf4bc7032 100644 --- a/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java +++ b/corba/src/java.corba/share/classes/org/omg/CORBA/ORB.java @@ -106,13 +106,13 @@ import java.security.PrivilegedAction; * *
  • check in properties parameter, if any * - *
  • check in the System properties + *
  • check in the System properties, if any * *
  • check in the orb.properties file located in the user.home - * directory (if any) + * directory, if any * - *
  • check in the orb.properties file located in the java.home/lib - * directory (if any) + *
  • check in the orb.properties file located in the run-time image, + * if any * *
  • fall back on a hardcoded default behavior (use the Java IDL * implementation) @@ -170,9 +170,15 @@ import java.security.PrivilegedAction; * Thus, where appropriate, it is necessary that * the classes for this alternative ORBSingleton are available on the application's class path. * It should be noted that the singleton ORB is system wide. - * + *

    * When a per-application ORB is created via the 2-arg init methods, * then it will be located using the thread context class loader. + *

    + * The IDL to Java Language OMG specification documents the ${java.home}/lib directory as the location, + * in the Java run-time image, to search for orb.properties. + * This location is not intended for user editable configuration files. + * Therefore, the implementation first checks the ${java.home}/conf directory for orb.properties, + * and thereafter the ${java.home}/lib directory. * * @since JDK1.2 */ @@ -271,14 +277,25 @@ abstract public class ORB { } String javaHome = System.getProperty("java.home"); - fileName = javaHome + File.separator - + "lib" + File.separator + "orb.properties"; - props = getFileProperties( fileName ) ; + + fileName = javaHome + File.separator + "conf" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); + + if (props != null) { + String value = props.getProperty(name); + if (value != null) + return value; + } + + fileName = javaHome + File.separator + "lib" + + File.separator + "orb.properties"; + props = getFileProperties(fileName); if (props == null) - return null ; + return null; else - return props.getProperty( name ) ; + return props.getProperty(name); } } ); diff --git a/corba/src/java.corba/share/classes/sun/corba/Bridge.java b/corba/src/java.corba/share/classes/sun/corba/Bridge.java index 1b3a086c088..e22240e2a9f 100644 --- a/corba/src/java.corba/share/classes/sun/corba/Bridge.java +++ b/corba/src/java.corba/share/classes/sun/corba/Bridge.java @@ -59,10 +59,10 @@ import sun.reflect.ReflectionFactory; * * The code that calls Bridge.get() must have the following Permissions: *

      - *
    • RuntimePermission "reflectionFactoryAccess"
    • *
    • BridgePermission "getBridge"
    • *
    • ReflectPermission "suppressAccessChecks"
    • - *
    • StackFramePermission "retainClassReference"
    • + *
    • RuntimePermission "getStackWalkerWithClassReference"
    • + *
    • RuntimePermission "reflectionFactoryAccess"
    • *
    *

    * All of these permissions are required to obtain and correctly initialize @@ -105,10 +105,10 @@ public final class Bridge /** Fetch the Bridge singleton. This requires the following * permissions: *

      - *
    • RuntimePermission "reflectionFactoryAccess"
    • *
    • BridgePermission "getBridge"
    • *
    • ReflectPermission "suppressAccessChecks"
    • - *
    • StackFramePermission "retainClassReference"
    • + *
    • RuntimePermission "getStackWalkerWithClassReference"
    • + *
    • RuntimePermission "reflectionFactoryAccess"
    • *
    * @return The singleton instance of the Bridge class * @throws SecurityException if the caller does not have the diff --git a/hotspot/.hgignore b/hotspot/.hgignore index 0c053adb87c..db11ccf9c54 100644 --- a/hotspot/.hgignore +++ b/hotspot/.hgignore @@ -15,10 +15,10 @@ ^\.mx.jvmci/hotspot/eclipse/.* ^\.idea/ ^workingsets.xml -^src/jdk.vm.ci/share/classes/\w[\w\.]*/.*\.xml -^src/jdk.vm.ci/share/classes/\w[\w\.]*/.*\.iml -^src/jdk.vm.ci/share/classes/\w[\w\.]*/nbproject -^src/jdk.vm.ci/share/classes/\w[\w\.]*/\..* +^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/.*\.xml +^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/.*\.iml +^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/nbproject +^src/jdk.internal.vm.ci/share/classes/\w[\w\.]*/\..* ^test/compiler/jvmci/\w[\w\.]*/.*\.xml ^test/compiler/jvmci/\w[\w\.]*/.*\.iml ^test/compiler/jvmci/\w[\w\.]*/nbproject @@ -27,15 +27,15 @@ ^test/compiler/aot/\w[\w\.]*/.*\.iml ^test/compiler/aot/\w[\w\.]*/nbproject ^test/compiler/aot/\w[\w\.]*/\..* -^src/jdk.vm.compiler/\.mx.graal/env -^src/jdk.vm.compiler/\.mx.graal/.*\.pyc -^src/jdk.vm.compiler/\.mx.graal/eclipse-launches/.* +^src/jdk.internal.vm.compiler/\.mx.graal/env +^src/jdk.internal.vm.compiler/\.mx.graal/.*\.pyc +^src/jdk.internal.vm.compiler/\.mx.graal/eclipse-launches/.* ^src/jdk.aot/share/classes/\w[\w\.]*/.*\.xml ^src/jdk.aot/share/classes/\w[\w\.]*/.*\.iml ^src/jdk.aot/share/classes/\w[\w\.]*/nbproject ^src/jdk.aot/share/classes/\w[\w\.]*/\..* -^src/jdk.vm.compiler/share/classes/\w[\w\.]*/.*\.xml -^src/jdk.vm.compiler/share/classes/\w[\w\.]*/.*\.iml -^src/jdk.vm.compiler/share/classes/\w[\w\.]*/nbproject -^src/jdk.vm.compiler/share/classes/\w[\w\.]*/\..* +^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/.*\.xml +^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/.*\.iml +^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/nbproject +^src/jdk.internal.vm.compiler/share/classes/\w[\w\.]*/\..* diff --git a/hotspot/.hgtags b/hotspot/.hgtags index 66afb5ed54b..cb7283ad075 100644 --- a/hotspot/.hgtags +++ b/hotspot/.hgtags @@ -556,5 +556,25 @@ a82cb5350cad96a0b4de496afebe3ded89f27efa jdk-9+146 2a2ac7d9f52c8cb2b80077e515b5840b947e640c jdk-9+151 31f1d26c60df7b2e516a4f84160d76ba017d4e09 jdk-9+152 217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153 +fc7e94cb748507366b839e859f865f724467446a jdk-10+0 a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154 f3b3d77a1751897413aae43ac340a130b6fa2ae1 jdk-9+155 +43139c588ea48b6504e52b6c3dec530b17b1fdb4 jdk-9+156 +1ea217626ba0995dd03127f8322ba3687926a085 jdk-10+1 +b2d0a906afd73dcf27f572217eb1be0f196ec16c jdk-9+157 +4e78f30935229f13ce7c43089621cf7169f5abac jdk-9+158 +9211c2e89c1cd11ec2d5752b0f97131a7d7525c7 jdk-9+159 +94b4e2e5331d38eab6a3639c3511b2e0715df0e9 jdk-9+160 +191ffbdb3d7b734288daa7fb76b37a0a85dfe7eb jdk-9+161 +b01c519b715ef6f785d0631adee0a6537cf6c12e jdk-9+162 +983fe207555724d98f4876991e1cbafbcf2733e8 jdk-9+163 +0af429be8bbaeaaf0cb838e9af28c953dda6a9c8 jdk-9+164 +c92c6416ca03b1464d5ed99cf6201e52b5ba0a70 jdk-9+165 +560d7aa083a24b6a56443feb8de0f40435d33aa9 jdk-9+166 +48809c513ed5ebb4d4dbf2f454afcce2780db6db jdk-10+2 +6c3b6b3438c4a63e619f00bd5732d1260ffd5600 jdk-10+3 +8295ca08f5cb09c090eb048bbdd338d7e270c8bf jdk-10+4 +7b5ca2ff1f78873ca3ee99b6589d3cb4dde2e454 jdk-10+5 +762465099d938fd96cd1efda193bc1fa23d070d3 jdk-10+6 +1ca7ed1b17b5776930d641d1379834f3140a74e4 jdk-9+167 +fbb9c802649585d19f6d7e81b4a519d44806225a jdk-9+168 diff --git a/hotspot/.jcheck/conf b/hotspot/.jcheck/conf index 5c6f62dc12c..b2581358014 100644 --- a/hotspot/.jcheck/conf +++ b/hotspot/.jcheck/conf @@ -1 +1 @@ -project=jdk9 +project=jdk10 diff --git a/hotspot/.mx.jvmci/.pydevproject b/hotspot/.mx.jvmci/.pydevproject index b127d241c79..3f852ee834a 100644 --- a/hotspot/.mx.jvmci/.pydevproject +++ b/hotspot/.mx.jvmci/.pydevproject @@ -3,7 +3,7 @@ Default python 2.7 -/.mx.jvmci +/mx.jvmci /mx diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index daa27f5d607..b87bab712a2 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -158,8 +158,8 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot" # JDK9 must be bootstrapped with a JDK8 compliance = mx.JavaCompliance('8') jdk8 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value) - cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', - '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home] + cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', '--with-jvm-features=graal', + '--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home, '--with-jvm-features=graal'] mx.run(cmd, cwd=_jdkSourceRoot) cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel] if mx.get_opts().verbose: @@ -176,66 +176,6 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot" mx.run(cmd, cwd=_jdkSourceRoot) - if 'images' in cmd: - jdkImageDir = join(jdkBuildDir, 'images', 'jdk') - - # The OpenJDK build creates an empty cacerts file so copy one from - # the default JDK (which is assumed to be an OracleJDK) - srcCerts = join(mx.get_jdk(tag='default').home, 'lib', 'security', 'cacerts') - if not exists(srcCerts): - # Might be building with JDK8 which has cacerts under jre/ - srcCerts = join(mx.get_jdk(tag='default').home, 'jre', 'lib', 'security', 'cacerts') - dstCerts = join(jdkImageDir, 'lib', 'security', 'cacerts') - if srcCerts != dstCerts: - shutil.copyfile(srcCerts, dstCerts) - - _create_jdk_bundle(jdkBuildDir, _vm.debugLevel, jdkImageDir) - -def _get_jdk_bundle_arches(): - """ - Gets a list of names that will be the part of a JDK bundle's file name denoting the architecture. - The first element in the list is the canonical name. Symlinks should be created for the - remaining names. - """ - cpu = mx.get_arch() - if cpu == 'amd64': - return ['x64', 'x86_64', 'amd64'] - elif cpu == 'sparcv9': - return ['sparcv9'] - mx.abort('Unsupported JDK bundle arch: ' + cpu) - -def _create_jdk_bundle(jdkBuildDir, debugLevel, jdkImageDir): - """ - Creates a tar.gz JDK archive, an accompanying tar.gz.sha1 file with its - SHA1 signature plus symlinks to the archive for non-canonical architecture names. - """ - - arches = _get_jdk_bundle_arches() - jdkTgzPath = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arches[0])) - with mx.Archiver(jdkTgzPath, kind='tgz') as arc: - mx.log('Creating ' + jdkTgzPath) - for root, _, filenames in os.walk(jdkImageDir): - for name in filenames: - f = join(root, name) - arcname = 'jdk1.9.0/' + os.path.relpath(f, jdkImageDir) - arc.zf.add(name=f, arcname=arcname, recursive=False) - - with open(jdkTgzPath + '.sha1', 'w') as fp: - mx.log('Creating ' + jdkTgzPath + '.sha1') - fp.write(mx.sha1OfFile(jdkTgzPath)) - - def _create_link(source, link_name): - if exists(link_name): - os.remove(link_name) - mx.log('Creating ' + link_name + ' -> ' + source) - os.symlink(source, link_name) - - for arch in arches[1:]: - link_name = join(_suite.get_output_root(), 'jdk-bundles', 'jdk9-{}-{}-{}.tar.gz'.format(debugLevel, _get_openjdk_os(), arch)) - jdkTgzName = os.path.basename(jdkTgzPath) - _create_link(jdkTgzName, link_name) - _create_link(jdkTgzName + '.sha1', link_name + '.sha1') - def _runmultimake(args): """run the JDK make process for one or more configurations""" diff --git a/hotspot/.mx.jvmci/suite.py b/hotspot/.mx.jvmci/suite.py index 359c2b2ae3a..9415623d92b 100644 --- a/hotspot/.mx.jvmci/suite.py +++ b/hotspot/.mx.jvmci/suite.py @@ -43,7 +43,7 @@ suite = { # ------------- JVMCI:Service ------------- "jdk.vm.ci.services" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "javaCompliance" : "9", "workingSets" : "API,JVMCI", @@ -52,7 +52,7 @@ suite = { # ------------- JVMCI:API ------------- "jdk.vm.ci.common" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "9", @@ -60,7 +60,7 @@ suite = { }, "jdk.vm.ci.meta" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "checkstyle" : "jdk.vm.ci.services", "javaCompliance" : "9", @@ -68,7 +68,7 @@ suite = { }, "jdk.vm.ci.code" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.meta"], "checkstyle" : "jdk.vm.ci.services", @@ -92,7 +92,7 @@ suite = { }, "jdk.vm.ci.runtime" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ "jdk.vm.ci.code", @@ -119,7 +119,7 @@ suite = { # ------------- JVMCI:HotSpot ------------- "jdk.vm.ci.aarch64" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], "checkstyle" : "jdk.vm.ci.services", @@ -128,7 +128,7 @@ suite = { }, "jdk.vm.ci.amd64" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], "checkstyle" : "jdk.vm.ci.services", @@ -137,7 +137,7 @@ suite = { }, "jdk.vm.ci.sparc" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : ["jdk.vm.ci.code"], "checkstyle" : "jdk.vm.ci.services", @@ -146,7 +146,7 @@ suite = { }, "jdk.vm.ci.hotspot" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ "jdk.vm.ci.common", @@ -175,7 +175,7 @@ suite = { }, "jdk.vm.ci.hotspot.aarch64" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ "jdk.vm.ci.aarch64", @@ -187,7 +187,7 @@ suite = { }, "jdk.vm.ci.hotspot.amd64" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ "jdk.vm.ci.amd64", @@ -199,7 +199,7 @@ suite = { }, "jdk.vm.ci.hotspot.sparc" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "sourceDirs" : ["src"], "dependencies" : [ "jdk.vm.ci.sparc", @@ -221,12 +221,12 @@ suite = { # ------------- Distributions ------------- "JVMCI_SERVICES" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "dependencies" : ["jdk.vm.ci.services"], }, "JVMCI_API" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "dependencies" : [ "jdk.vm.ci.runtime", "jdk.vm.ci.common", @@ -240,7 +240,7 @@ suite = { }, "JVMCI_HOTSPOT" : { - "subDir" : "src/jdk.vm.ci/share/classes", + "subDir" : "src/jdk.internal.vm.ci/share/classes", "dependencies" : [ "jdk.vm.ci.hotspot.aarch64", "jdk.vm.ci.hotspot.amd64", diff --git a/hotspot/README b/hotspot/README deleted file mode 100644 index 19afb261fc3..00000000000 --- a/hotspot/README +++ /dev/null @@ -1,14 +0,0 @@ -README: - This file should be located at the top of the hotspot Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - - cd make && gnumake - - The files that will be imported into the jdk build will be in the "build" - directory. - diff --git a/hotspot/make/CompileTools.gmk b/hotspot/make/CompileTools.gmk index ea6c504e283..c80632226cf 100644 --- a/hotspot/make/CompileTools.gmk +++ b/hotspot/make/CompileTools.gmk @@ -38,9 +38,9 @@ TARGETS := $(eval $(call IncludeCustomExtension, hotspot, CompileTools.gmk)) ifeq ($(INCLUDE_GRAAL), true) - VM_CI_SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.ci/share/classes + VM_CI_SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.internal.vm.ci/share/classes - SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.vm.compiler/share/classes + SRC_DIR := $(HOTSPOT_TOPDIR)/src/jdk.internal.vm.compiler/share/classes ############################################################################## # Compile the annotation processors diff --git a/hotspot/make/gensrc/Gensrc-jdk.vm.compiler.gmk b/hotspot/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk similarity index 77% rename from hotspot/make/gensrc/Gensrc-jdk.vm.compiler.gmk rename to hotspot/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk index f12a2e9a5a2..a8e60309b1c 100644 --- a/hotspot/make/gensrc/Gensrc-jdk.vm.compiler.gmk +++ b/hotspot/make/gensrc/Gensrc-jdk.internal.vm.compiler.gmk @@ -28,7 +28,7 @@ default: all include $(SPEC) include MakeBase.gmk -$(eval $(call IncludeCustomExtension, hotspot, gensrc/Gensrc-jdk.vm.compiler.gmk)) +$(eval $(call IncludeCustomExtension, hotspot, gensrc/Gensrc-jdk.internal.vm.compiler.gmk)) GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/$(MODULE) SRC_DIR := $(HOTSPOT_TOPDIR)/src/$(MODULE)/share/classes @@ -81,23 +81,24 @@ PROCESSOR_JARS := \ PROCESSOR_PATH := $(call PathList, $(PROCESSOR_JARS)) ADD_EXPORTS := \ - --add-exports jdk.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.events=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.hotspotvmconfig=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.inittimer=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \ - --add-exports jdk.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \ + --add-modules jdk.internal.vm.ci \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.aarch64=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.amd64=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.code=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.site=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.code.stack=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.common=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.events=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.hotspotvmconfig=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.inittimer=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.meta=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.runtime=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.services=ALL-UNNAMED \ + --add-exports jdk.internal.vm.ci/jdk.vm.ci.sparc=ALL-UNNAMED \ # $(GENSRC_DIR)/_gensrc_proc_done: $(PROC_SRCS) $(PROCESSOR_JARS) @@ -138,7 +139,7 @@ $(GENSRC_DIR)/module-info.java.extra: $(GENSRC_DIR)/_gensrc_proc_done $(ECHO) "uses org.graalvm.compiler.options.OptionDescriptors;" >> $@; \ $(ECHO) "provides org.graalvm.compiler.options.OptionDescriptors with" >> $@; \ for i in $$($(FIND) $(GENSRC_DIR) -name '*_OptionDescriptors.java'); do \ - c=$$($(ECHO) $$i | $(SED) 's:.*/jdk\.vm\.compiler/\(.*\)\.java:\1:' | $(TR) '/' '.'); \ + c=$$($(ECHO) $$i | $(SED) 's:.*/jdk\.internal\.vm\.compiler/\(.*\)\.java:\1:' | $(TR) '/' '.'); \ $(ECHO) " $$c," >> $@; \ done; \ $(ECHO) " ;" >> $@; diff --git a/hotspot/make/ide/CreateVSProject.gmk b/hotspot/make/ide/CreateVSProject.gmk index db0aca87e28..2a9da913ab7 100644 --- a/hotspot/make/ide/CreateVSProject.gmk +++ b/hotspot/make/ide/CreateVSProject.gmk @@ -112,8 +112,10 @@ ifeq ($(OPENJDK_TARGET_OS), windows) -relativeSrcInclude src \ -hidePath .hg \ -hidePath .jcheck \ + -hidePath jdk.aot \ -hidePath jdk.hotspot.agent \ - -hidePath jdk.vm.ci \ + -hidePath jdk.internal.vm.ci \ + -hidePath jdk.internal.vm.compiler \ -hidePath jdk.jfr \ -compiler VC10 \ -jdkTargetRoot $(call FixPath, $(JDK_OUTPUTDIR)) \ diff --git a/hotspot/make/lib/CompileJvm.gmk b/hotspot/make/lib/CompileJvm.gmk index 36d955807ad..4eb2cbc1013 100644 --- a/hotspot/make/lib/CompileJvm.gmk +++ b/hotspot/make/lib/CompileJvm.gmk @@ -118,6 +118,12 @@ ifeq ($(OPENJDK_TARGET_CPU), x86_64) OPENJDK_TARGET_CPU_VM_VERSION := amd64 else ifeq ($(OPENJDK_TARGET_CPU), sparcv9) OPENJDK_TARGET_CPU_VM_VERSION := sparc +else ifeq ($(HOTSPOT_TARGET_CPU_ARCH), arm) + ifeq ($(OPENJDK_TARGET_CPU), aarch64) + # This sets the Oracle Aarch64 port to use arm64 + # while the original Aarch64 port uses aarch64 + OPENJDK_TARGET_CPU_VM_VERSION := arm64 + endif else OPENJDK_TARGET_CPU_VM_VERSION := $(OPENJDK_TARGET_CPU) endif diff --git a/hotspot/make/test/JtregNative.gmk b/hotspot/make/test/JtregNative.gmk index 7223733367a..42eb76af57e 100644 --- a/hotspot/make/test/JtregNative.gmk +++ b/hotspot/make/test/JtregNative.gmk @@ -1,5 +1,5 @@ # -# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. # 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,8 @@ BUILD_HOTSPOT_JTREG_NATIVE_SRC := \ $(HOTSPOT_TOPDIR)/test/runtime/jni/PrivateInterfaceMethods \ $(HOTSPOT_TOPDIR)/test/runtime/jni/ToStringInInterfaceTest \ $(HOTSPOT_TOPDIR)/test/runtime/jni/CalleeSavedRegisters \ + $(HOTSPOT_TOPDIR)/test/runtime/jni/CallWithJNIWeak \ + $(HOTSPOT_TOPDIR)/test/runtime/jni/ReturnJNIWeak \ $(HOTSPOT_TOPDIR)/test/runtime/modules/getModuleJNI \ $(HOTSPOT_TOPDIR)/test/runtime/SameObject \ $(HOTSPOT_TOPDIR)/test/runtime/BoolReturn \ diff --git a/hotspot/src/cpu/aarch64/vm/aarch64.ad b/hotspot/src/cpu/aarch64/vm/aarch64.ad index 37e63dc9aba..4360e8caac8 100644 --- a/hotspot/src/cpu/aarch64/vm/aarch64.ad +++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad @@ -15501,7 +15501,7 @@ instruct string_compareLU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 %} instruct string_indexofUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); @@ -15520,7 +15520,7 @@ instruct string_indexofUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 %} instruct string_indexofLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); @@ -15539,7 +15539,7 @@ instruct string_indexofLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 %} instruct string_indexofUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); @@ -15558,7 +15558,7 @@ instruct string_indexofUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 %} instruct string_indexofLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegI tmp1, iRegI tmp2, iRegI tmp3, iRegI tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LU); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); @@ -15577,8 +15577,8 @@ instruct string_indexofLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 %} instruct string_indexof_conUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, - immI_le_4 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2, - iRegI tmp3, iRegI tmp4, rFlagsReg cr) + immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, + iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); @@ -15598,8 +15598,8 @@ instruct string_indexof_conUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, %} instruct string_indexof_conLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, - immI_le_4 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2, - iRegI tmp3, iRegI tmp4, rFlagsReg cr) + immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, + iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); @@ -15619,8 +15619,8 @@ instruct string_indexof_conLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, %} instruct string_indexof_conUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, - immI_1 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2, - iRegI tmp3, iRegI tmp4, rFlagsReg cr) + immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, + iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); @@ -15640,8 +15640,8 @@ instruct string_indexof_conUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, %} instruct string_indexof_conLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, - immI_1 int_cnt2, iRegI_R0 result, iRegI tmp1, iRegI tmp2, - iRegI tmp3, iRegI tmp4, rFlagsReg cr) + immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, + iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LU); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); @@ -15661,8 +15661,8 @@ instruct string_indexof_conLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, %} instruct string_indexofU_char(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch, - iRegI_R0 result, iRegI tmp1, iRegI tmp2, - iRegI tmp3, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, + iRegINoSp tmp3, rFlagsReg cr) %{ match(Set result (StrIndexOfChar (Binary str1 cnt1) ch)); effect(USE_KILL str1, USE_KILL cnt1, USE_KILL ch, @@ -16101,7 +16101,7 @@ instruct replicate2D(vecX dst, vRegD src) // ====================REDUCTION ARITHMETIC==================================== -instruct reduce_add2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegI tmp, iRegI tmp2) +instruct reduce_add2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegINoSp tmp, iRegINoSp tmp2) %{ match(Set dst (AddReductionVI src1 src2)); ins_cost(INSN_COST); @@ -16120,7 +16120,7 @@ instruct reduce_add2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegI tmp, iReg ins_pipe(pipe_class_default); %} -instruct reduce_add4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegI tmp2) +instruct reduce_add4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegINoSp tmp2) %{ match(Set dst (AddReductionVI src1 src2)); ins_cost(INSN_COST); @@ -16138,7 +16138,7 @@ instruct reduce_add4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegI ins_pipe(pipe_class_default); %} -instruct reduce_mul2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegI tmp) +instruct reduce_mul2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegINoSp tmp) %{ match(Set dst (MulReductionVI src1 src2)); ins_cost(INSN_COST); @@ -16157,7 +16157,7 @@ instruct reduce_mul2I(iRegINoSp dst, iRegIorL2I src1, vecD src2, iRegI tmp) ins_pipe(pipe_class_default); %} -instruct reduce_mul4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegI tmp2) +instruct reduce_mul4I(iRegINoSp dst, iRegIorL2I src1, vecX src2, vecX tmp, iRegINoSp tmp2) %{ match(Set dst (MulReductionVI src1 src2)); ins_cost(INSN_COST); diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp index b139a44f9a1..0016aa9ba6a 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp @@ -1922,12 +1922,17 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, } if (opr2->is_constant()) { + bool is_32bit = false; // width of register operand jlong imm; + switch(opr2->type()) { + case T_INT: + imm = opr2->as_constant_ptr()->as_jint(); + is_32bit = true; + break; case T_LONG: imm = opr2->as_constant_ptr()->as_jlong(); break; - case T_INT: case T_ADDRESS: imm = opr2->as_constant_ptr()->as_jint(); break; @@ -1942,14 +1947,14 @@ void LIR_Assembler::comp_op(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, } if (Assembler::operand_valid_for_add_sub_immediate(imm)) { - if (type2aelembytes(opr1->type()) <= 4) + if (is_32bit) __ cmpw(reg1, imm); else __ cmp(reg1, imm); return; } else { __ mov(rscratch1, imm); - if (type2aelembytes(opr1->type()) <= 4) + if (is_32bit) __ cmpw(reg1, rscratch1); else __ cmp(reg1, rscratch1); diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp index 96793e632b9..0c25198c04f 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp @@ -1221,12 +1221,19 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { obj.load_item(); // info for exceptions - CodeEmitInfo* info_for_exception = state_for(x); + CodeEmitInfo* info_for_exception = + (x->needs_exception_state() ? state_for(x) : + state_for(x, x->state_before(), true /*ignore_xhandler*/)); CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + } else if (x->is_invokespecial_receiver_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new DeoptimizeStub(info_for_exception, + Deoptimization::Reason_class_check, + Deoptimization::Action_none); } else { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); } diff --git a/hotspot/src/cpu/aarch64/vm/c1_globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c1_globals_aarch64.hpp index 71d7819561e..3177a8980b9 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/c1_globals_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -45,10 +45,8 @@ define_pd_global(bool, TieredCompilation, false); // We compile very aggressively with the builtin simulator because // doing so greatly reduces run times and tests more code. define_pd_global(intx, CompileThreshold, 150 ); -define_pd_global(intx, BackEdgeThreshold, 500); #else define_pd_global(intx, CompileThreshold, 1500 ); -define_pd_global(intx, BackEdgeThreshold, 100000); #endif define_pd_global(intx, OnStackReplacePercentage, 933 ); @@ -76,6 +74,4 @@ define_pd_global(bool, OptimizeSinglePrecision, true ); define_pd_global(bool, CSEArrayLength, false); define_pd_global(bool, TwoOperandLIRForm, false ); -define_pd_global(intx, SafepointPollOffset, 0 ); - #endif // CPU_AARCH64_VM_C1_GLOBALS_AARCH64_HPP diff --git a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp index 9a16dd76967..5a5d8ac4f95 100644 --- a/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/c2_globals_aarch64.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,6 @@ define_pd_global(bool, UseOnStackReplacement, true); define_pd_global(bool, ProfileInterpreter, true); define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, CompileThreshold, 10000); -define_pd_global(intx, BackEdgeThreshold, 100000); define_pd_global(intx, OnStackReplacePercentage, 140); define_pd_global(intx, ConditionalMoveLimit, 3); diff --git a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp index 0d78e2da1fe..ad6b12de22d 100644 --- a/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/globalDefinitions_aarch64.hpp @@ -34,10 +34,6 @@ const bool CCallingConventionRequiresIntsAsLongs = false; #define SUPPORTS_NATIVE_CX8 -// The maximum B/BL offset range on AArch64 is 128MB. -#undef CODE_CACHE_DEFAULT_LIMIT -#define CODE_CACHE_DEFAULT_LIMIT (128*M) - // According to the ARMv8 ARM, "Concurrent modification and execution // of instructions can lead to the resulting instruction performing // any behavior that can be achieved by executing any sequence of diff --git a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp index b2f21031f18..a09c5230dc4 100644 --- a/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/jniFastGetField_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -82,6 +82,11 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { __ eor(robj, robj, rcounter); // obj, since // robj ^ rcounter ^ rcounter == robj // robj is address dependent on rcounter. + + // If mask changes we need to ensure that the inverse is still encodable as an immediate + STATIC_ASSERT(JNIHandles::weak_tag_mask == 1); + __ andr(robj, robj, ~JNIHandles::weak_tag_mask); + __ ldr(robj, Address(robj, 0)); // *obj __ lsr(roffset, c_rarg2, 2); // offset diff --git a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp index 01e0eeb1fc1..a286102e7b1 100644 --- a/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2015, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -2052,13 +2052,31 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ reset_last_Java_frame(false); - // Unpack oop result + // Unbox oop result, e.g. JNIHandles::resolve result. if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - Label L; - __ cbz(r0, L); - __ ldr(r0, Address(r0, 0)); - __ bind(L); - __ verify_oop(r0); + Label done, not_weak; + __ cbz(r0, done); // Use NULL as-is. + STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u); + __ tbz(r0, 0, not_weak); // Test for jweak tag. + // Resolve jweak. + __ ldr(r0, Address(r0, -JNIHandles::weak_tag_value)); + __ verify_oop(r0); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + __ g1_write_barrier_pre(noreg /* obj */, + r0 /* pre_val */, + rthread /* thread */, + rscratch1 /* tmp */, + true /* tosca_live */, + true /* expand_call */); + } +#endif // INCLUDE_ALL_GCS + __ b(done); + __ bind(not_weak); + // Resolve (untagged) jobject. + __ ldr(r0, Address(r0, 0)); + __ verify_oop(r0); + __ bind(done); } if (CheckJNICalls) { diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp index 90dcd6c1a2c..6f44292c55a 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreterGenerator_aarch64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -1399,13 +1399,32 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // and result handler will pick it up { - Label no_oop, store_result; + Label no_oop, not_weak, store_result; __ adr(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT))); __ cmp(t, result_handler); __ br(Assembler::NE, no_oop); - // retrieve result + // Unbox oop result, e.g. JNIHandles::resolve result. __ pop(ltos); - __ cbz(r0, store_result); + __ cbz(r0, store_result); // Use NULL as-is. + STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u); + __ tbz(r0, 0, not_weak); // Test for jweak tag. + // Resolve jweak. + __ ldr(r0, Address(r0, -JNIHandles::weak_tag_value)); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + __ enter(); // Barrier may call runtime. + __ g1_write_barrier_pre(noreg /* obj */, + r0 /* pre_val */, + rthread /* thread */, + t /* tmp */, + true /* tosca_live */, + true /* expand_call */); + __ leave(); + } +#endif // INCLUDE_ALL_GCS + __ b(store_result); + __ bind(not_weak); + // Resolve (untagged) jobject. __ ldr(r0, Address(r0, 0)); __ bind(store_result); __ str(r0, Address(rfp, frame::interpreter_frame_oop_temp_offset*wordSize)); diff --git a/hotspot/src/cpu/arm/vm/c1_LIRAssembler_arm.cpp b/hotspot/src/cpu/arm/vm/c1_LIRAssembler_arm.cpp index 4d45cfb0481..caf00718656 100644 --- a/hotspot/src/cpu/arm/vm/c1_LIRAssembler_arm.cpp +++ b/hotspot/src/cpu/arm/vm/c1_LIRAssembler_arm.cpp @@ -1453,10 +1453,11 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) { ciKlass* k = op->klass(); assert_different_registers(res, k_RInfo, klass_RInfo, Rtemp); + if (stub->is_simple_exception_stub()) { // TODO: ARM - Late binding is used to prevent confusion of register allocator assert(stub->is_exception_throw_stub(), "must be"); ((SimpleExceptionStub*)stub)->set_obj(op->result_opr()); - + } ciMethodData* md; ciProfileData* data; int mdo_offset_bias = 0; diff --git a/hotspot/src/cpu/arm/vm/c1_LIRGenerator_arm.cpp b/hotspot/src/cpu/arm/vm/c1_LIRGenerator_arm.cpp index 539a8faf880..c614e137091 100644 --- a/hotspot/src/cpu/arm/vm/c1_LIRGenerator_arm.cpp +++ b/hotspot/src/cpu/arm/vm/c1_LIRGenerator_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1412,12 +1412,20 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { obj.load_item(); - CodeEmitInfo* info_for_exception = state_for(x); + CodeEmitInfo* info_for_exception = + (x->needs_exception_state() ? state_for(x) : + state_for(x, x->state_before(), true /*ignore_xhandler*/)); + CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + } else if (x->is_invokespecial_receiver_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new DeoptimizeStub(info_for_exception, + Deoptimization::Reason_class_check, + Deoptimization::Action_none); } else { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, LIR_OprFact::illegalOpr, info_for_exception); diff --git a/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp b/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp index 9f17c8fc810..5e793e16bd7 100644 --- a/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp +++ b/hotspot/src/cpu/arm/vm/c1_Runtime1_arm.cpp @@ -618,7 +618,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { Address buffer(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() + DirtyCardQueue::byte_offset_of_buf())); - AddressLiteral cardtable((address)ct->byte_map_base); + AddressLiteral cardtable((address)ct->byte_map_base, relocInfo::none); assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); // save at least the registers that need saving if the runtime is called @@ -645,7 +645,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // Note: there is a comment in x86 code about not using // ExternalAddress / lea, due to relocation not working // properly for that address. Should be OK for arm, where we - // explicitly specify that 'cartable' has a relocInfo::none + // explicitly specify that 'cardtable' has a relocInfo::none // type. __ lea(r_card_base_1, cardtable); __ add(r_card_addr_0, r_card_base_1, AsmOperand(r_obj_0, lsr, CardTableModRefBS::card_shift)); diff --git a/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp b/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp index de7249f277a..abbd673b6ba 100644 --- a/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp +++ b/hotspot/src/cpu/arm/vm/compiledIC_arm.cpp @@ -85,17 +85,17 @@ address CompiledStaticCall::emit_to_interp_stub(CodeBuffer &cbuf, address mark) } #undef __ -// size of C2 call stub, compiled java to interpretor -int CompiledStaticCall::to_interp_stub_size() { - return 8 * NativeInstruction::instruction_size; -} - // Relocation entries for call stub, compiled java to interpreter. int CompiledStaticCall::reloc_to_interp_stub() { return 10; // 4 in emit_to_interp_stub + 1 in Java_Static_Call } #endif // COMPILER2 || JVMCI +// size of C2 call stub, compiled java to interpretor +int CompiledStaticCall::to_interp_stub_size() { + return 8 * NativeInstruction::instruction_size; +} + void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, address entry) { address stub = find_stub(/*is_aot*/ false); guarantee(stub != NULL, "stub not found"); @@ -125,6 +125,8 @@ void CompiledDirectStaticCall::set_to_interpreted(const methodHandle& callee, ad method_holder->set_data((intptr_t)callee()); jump->set_jump_destination(entry); + ICache::invalidate_range(stub, to_interp_stub_size()); + // Update jump to call. set_destination_mt_safe(stub); } diff --git a/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp b/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp index 2f41b102a85..96df37c275e 100644 --- a/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp +++ b/hotspot/src/cpu/arm/vm/interp_masm_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * 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,185 +476,6 @@ void InterpreterMacroAssembler::set_card(Register card_table_base, Address card_ } ////////////////////////////////////////////////////////////////////////////////// -#if INCLUDE_ALL_GCS - -// G1 pre-barrier. -// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). -// If store_addr != noreg, then previous value is loaded from [store_addr]; -// in such case store_addr and new_val registers are preserved; -// otherwise pre_val register is preserved. -void InterpreterMacroAssembler::g1_write_barrier_pre(Register store_addr, - Register new_val, - Register pre_val, - Register tmp1, - Register tmp2) { - Label done; - Label runtime; - - if (store_addr != noreg) { - assert_different_registers(store_addr, new_val, pre_val, tmp1, tmp2, noreg); - } else { - assert (new_val == noreg, "should be"); - assert_different_registers(pre_val, tmp1, tmp2, noreg); - } - - Address in_progress(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() + - SATBMarkQueue::byte_offset_of_active())); - Address index(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() + - SATBMarkQueue::byte_offset_of_index())); - Address buffer(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() + - SATBMarkQueue::byte_offset_of_buf())); - - // Is marking active? - assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "adjust this code"); - ldrb(tmp1, in_progress); - cbz(tmp1, done); - - // Do we need to load the previous value? - if (store_addr != noreg) { - load_heap_oop(pre_val, Address(store_addr, 0)); - } - - // Is the previous value null? - cbz(pre_val, done); - - // Can we store original value in the thread's buffer? - // Is index == 0? - // (The index field is typed as size_t.) - - ldr(tmp1, index); // tmp1 := *index_adr - ldr(tmp2, buffer); - - subs(tmp1, tmp1, wordSize); // tmp1 := tmp1 - wordSize - b(runtime, lt); // If negative, goto runtime - - str(tmp1, index); // *index_adr := tmp1 - - // Record the previous value - str(pre_val, Address(tmp2, tmp1)); - b(done); - - bind(runtime); - - // save the live input values -#ifdef AARCH64 - if (store_addr != noreg) { - raw_push(store_addr, new_val); - } else { - raw_push(pre_val, ZR); - } -#else - if (store_addr != noreg) { - // avoid raw_push to support any ordering of store_addr and new_val - push(RegisterSet(store_addr) | RegisterSet(new_val)); - } else { - push(pre_val); - } -#endif // AARCH64 - - if (pre_val != R0) { - mov(R0, pre_val); - } - mov(R1, Rthread); - - call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), R0, R1); - -#ifdef AARCH64 - if (store_addr != noreg) { - raw_pop(store_addr, new_val); - } else { - raw_pop(pre_val, ZR); - } -#else - if (store_addr != noreg) { - pop(RegisterSet(store_addr) | RegisterSet(new_val)); - } else { - pop(pre_val); - } -#endif // AARCH64 - - bind(done); -} - -// G1 post-barrier. -// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). -void InterpreterMacroAssembler::g1_write_barrier_post(Register store_addr, - Register new_val, - Register tmp1, - Register tmp2, - Register tmp3) { - - Address queue_index(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() + - DirtyCardQueue::byte_offset_of_index())); - Address buffer(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() + - DirtyCardQueue::byte_offset_of_buf())); - - BarrierSet* bs = Universe::heap()->barrier_set(); - CardTableModRefBS* ct = (CardTableModRefBS*)bs; - Label done; - Label runtime; - - // Does store cross heap regions? - - eor(tmp1, store_addr, new_val); -#ifdef AARCH64 - logical_shift_right(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes); - cbz(tmp1, done); -#else - movs(tmp1, AsmOperand(tmp1, lsr, HeapRegion::LogOfHRGrainBytes)); - b(done, eq); -#endif - - // crosses regions, storing NULL? - - cbz(new_val, done); - - // storing region crossing non-NULL, is card already dirty? - const Register card_addr = tmp1; - assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); - - mov_address(tmp2, (address)ct->byte_map_base, symbolic_Relocation::card_table_reference); - add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTableModRefBS::card_shift)); - - ldrb(tmp2, Address(card_addr)); - cmp(tmp2, (int)G1SATBCardTableModRefBS::g1_young_card_val()); - b(done, eq); - - membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad), tmp2); - - assert(CardTableModRefBS::dirty_card_val() == 0, "adjust this code"); - ldrb(tmp2, Address(card_addr)); - cbz(tmp2, done); - - // storing a region crossing, non-NULL oop, card is clean. - // dirty card and log. - - strb(zero_register(tmp2), Address(card_addr)); - - ldr(tmp2, queue_index); - ldr(tmp3, buffer); - - subs(tmp2, tmp2, wordSize); - b(runtime, lt); // go to runtime if now negative - - str(tmp2, queue_index); - - str(card_addr, Address(tmp3, tmp2)); - b(done); - - bind(runtime); - - if (card_addr != R0) { - mov(R0, card_addr); - } - mov(R1, Rthread); - call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), R0, R1); - - bind(done); -} - -#endif // INCLUDE_ALL_GCS -////////////////////////////////////////////////////////////////////////////////// // Java Expression Stack diff --git a/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp b/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp index 5c753753f95..39e60226bf6 100644 --- a/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp +++ b/hotspot/src/cpu/arm/vm/interp_masm_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,27 +146,6 @@ class InterpreterMacroAssembler: public MacroAssembler { void set_card(Register card_table_base, Address card_table_addr, Register tmp); -#if INCLUDE_ALL_GCS - // G1 pre-barrier. - // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). - // If store_addr != noreg, then previous value is loaded from [store_addr]; - // in such case store_addr and new_val registers are preserved; - // otherwise pre_val register is preserved. - void g1_write_barrier_pre(Register store_addr, - Register new_val, - Register pre_val, - Register tmp1, - Register tmp2); - - // G1 post-barrier. - // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). - void g1_write_barrier_post(Register store_addr, - Register new_val, - Register tmp1, - Register tmp2, - Register tmp3); -#endif // INCLUDE_ALL_GCS - void pop_ptr(Register r); void pop_i(Register r = R0_tos); #ifdef AARCH64 diff --git a/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp b/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp index f9bd9f37970..65f929b1025 100644 --- a/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp +++ b/hotspot/src/cpu/arm/vm/jniFastGetField_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,6 +119,14 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { __ ldr_s32(Rsafept_cnt, Address(Rsafepoint_counter_addr)); __ tbnz(Rsafept_cnt, 0, slow_case); +#ifdef AARCH64 + // If mask changes we need to ensure that the inverse is still encodable as an immediate + STATIC_ASSERT(JNIHandles::weak_tag_mask == 1); + __ andr(R1, R1, ~JNIHandles::weak_tag_mask); +#else + __ bic(R1, R1, JNIHandles::weak_tag_mask); +#endif + if (os::is_MP()) { // Address dependency restricts memory access ordering. It's cheaper than explicit LoadLoad barrier __ andr(Rtmp1, Rsafept_cnt, (unsigned)1); diff --git a/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp b/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp index ada7d3fc485..2eb2a551002 100644 --- a/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp +++ b/hotspot/src/cpu/arm/vm/macroAssembler_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2211,6 +2211,219 @@ void MacroAssembler::biased_locking_exit(Register obj_reg, Register tmp_reg, Lab b(done, eq); } + +void MacroAssembler::resolve_jobject(Register value, + Register tmp1, + Register tmp2) { + assert_different_registers(value, tmp1, tmp2); + Label done, not_weak; + cbz(value, done); // Use NULL as-is. + STATIC_ASSERT(JNIHandles::weak_tag_mask == 1u); + tbz(value, 0, not_weak); // Test for jweak tag. + // Resolve jweak. + ldr(value, Address(value, -JNIHandles::weak_tag_value)); + verify_oop(value); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + g1_write_barrier_pre(noreg, // store_addr + noreg, // new_val + value, // pre_val + tmp1, // tmp1 + tmp2); // tmp2 + } +#endif // INCLUDE_ALL_GCS + b(done); + bind(not_weak); + // Resolve (untagged) jobject. + ldr(value, Address(value)); + verify_oop(value); + bind(done); +} + + +////////////////////////////////////////////////////////////////////////////////// + +#if INCLUDE_ALL_GCS + +// G1 pre-barrier. +// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). +// If store_addr != noreg, then previous value is loaded from [store_addr]; +// in such case store_addr and new_val registers are preserved; +// otherwise pre_val register is preserved. +void MacroAssembler::g1_write_barrier_pre(Register store_addr, + Register new_val, + Register pre_val, + Register tmp1, + Register tmp2) { + Label done; + Label runtime; + + if (store_addr != noreg) { + assert_different_registers(store_addr, new_val, pre_val, tmp1, tmp2, noreg); + } else { + assert (new_val == noreg, "should be"); + assert_different_registers(pre_val, tmp1, tmp2, noreg); + } + + Address in_progress(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() + + SATBMarkQueue::byte_offset_of_active())); + Address index(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() + + SATBMarkQueue::byte_offset_of_index())); + Address buffer(Rthread, in_bytes(JavaThread::satb_mark_queue_offset() + + SATBMarkQueue::byte_offset_of_buf())); + + // Is marking active? + assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "adjust this code"); + ldrb(tmp1, in_progress); + cbz(tmp1, done); + + // Do we need to load the previous value? + if (store_addr != noreg) { + load_heap_oop(pre_val, Address(store_addr, 0)); + } + + // Is the previous value null? + cbz(pre_val, done); + + // Can we store original value in the thread's buffer? + // Is index == 0? + // (The index field is typed as size_t.) + + ldr(tmp1, index); // tmp1 := *index_adr + ldr(tmp2, buffer); + + subs(tmp1, tmp1, wordSize); // tmp1 := tmp1 - wordSize + b(runtime, lt); // If negative, goto runtime + + str(tmp1, index); // *index_adr := tmp1 + + // Record the previous value + str(pre_val, Address(tmp2, tmp1)); + b(done); + + bind(runtime); + + // save the live input values +#ifdef AARCH64 + if (store_addr != noreg) { + raw_push(store_addr, new_val); + } else { + raw_push(pre_val, ZR); + } +#else + if (store_addr != noreg) { + // avoid raw_push to support any ordering of store_addr and new_val + push(RegisterSet(store_addr) | RegisterSet(new_val)); + } else { + push(pre_val); + } +#endif // AARCH64 + + if (pre_val != R0) { + mov(R0, pre_val); + } + mov(R1, Rthread); + + call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), R0, R1); + +#ifdef AARCH64 + if (store_addr != noreg) { + raw_pop(store_addr, new_val); + } else { + raw_pop(pre_val, ZR); + } +#else + if (store_addr != noreg) { + pop(RegisterSet(store_addr) | RegisterSet(new_val)); + } else { + pop(pre_val); + } +#endif // AARCH64 + + bind(done); +} + +// G1 post-barrier. +// Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). +void MacroAssembler::g1_write_barrier_post(Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + Register tmp3) { + + Address queue_index(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() + + DirtyCardQueue::byte_offset_of_index())); + Address buffer(Rthread, in_bytes(JavaThread::dirty_card_queue_offset() + + DirtyCardQueue::byte_offset_of_buf())); + + BarrierSet* bs = Universe::heap()->barrier_set(); + CardTableModRefBS* ct = (CardTableModRefBS*)bs; + Label done; + Label runtime; + + // Does store cross heap regions? + + eor(tmp1, store_addr, new_val); +#ifdef AARCH64 + logical_shift_right(tmp1, tmp1, HeapRegion::LogOfHRGrainBytes); + cbz(tmp1, done); +#else + movs(tmp1, AsmOperand(tmp1, lsr, HeapRegion::LogOfHRGrainBytes)); + b(done, eq); +#endif + + // crosses regions, storing NULL? + + cbz(new_val, done); + + // storing region crossing non-NULL, is card already dirty? + const Register card_addr = tmp1; + assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); + + mov_address(tmp2, (address)ct->byte_map_base, symbolic_Relocation::card_table_reference); + add(card_addr, tmp2, AsmOperand(store_addr, lsr, CardTableModRefBS::card_shift)); + + ldrb(tmp2, Address(card_addr)); + cmp(tmp2, (int)G1SATBCardTableModRefBS::g1_young_card_val()); + b(done, eq); + + membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad), tmp2); + + assert(CardTableModRefBS::dirty_card_val() == 0, "adjust this code"); + ldrb(tmp2, Address(card_addr)); + cbz(tmp2, done); + + // storing a region crossing, non-NULL oop, card is clean. + // dirty card and log. + + strb(zero_register(tmp2), Address(card_addr)); + + ldr(tmp2, queue_index); + ldr(tmp3, buffer); + + subs(tmp2, tmp2, wordSize); + b(runtime, lt); // go to runtime if now negative + + str(tmp2, queue_index); + + str(card_addr, Address(tmp3, tmp2)); + b(done); + + bind(runtime); + + if (card_addr != R0) { + mov(R0, card_addr); + } + mov(R1, Rthread); + call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), R0, R1); + + bind(done); +} + +#endif // INCLUDE_ALL_GCS + +////////////////////////////////////////////////////////////////////////////////// + #ifdef AARCH64 void MacroAssembler::load_sized_value(Register dst, Address src, size_t size_in_bytes, bool is_signed) { diff --git a/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp b/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp index 770bba6c8a1..e6f73353cb9 100644 --- a/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp +++ b/hotspot/src/cpu/arm/vm/macroAssembler_arm.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -402,6 +402,29 @@ public: void biased_locking_enter_with_cas(Register obj_reg, Register old_mark_reg, Register new_mark_reg, Register tmp, Label& slow_case, int* counter_addr); + void resolve_jobject(Register value, Register tmp1, Register tmp2); + +#if INCLUDE_ALL_GCS + // G1 pre-barrier. + // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). + // If store_addr != noreg, then previous value is loaded from [store_addr]; + // in such case store_addr and new_val registers are preserved; + // otherwise pre_val register is preserved. + void g1_write_barrier_pre(Register store_addr, + Register new_val, + Register pre_val, + Register tmp1, + Register tmp2); + + // G1 post-barrier. + // Blows all volatile registers (R0-R3 on 32-bit ARM, R0-R18 on AArch64, Rtemp, LR). + void g1_write_barrier_post(Register store_addr, + Register new_val, + Register tmp1, + Register tmp2, + Register tmp3); +#endif // INCLUDE_ALL_GCS + #ifndef AARCH64 void nop() { mov(R0, R0); diff --git a/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp b/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp index 9b37b4fe6dc..48f096473c3 100644 --- a/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp +++ b/hotspot/src/cpu/arm/vm/sharedRuntime_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1732,14 +1732,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, case T_FLOAT : // fall through case T_DOUBLE : /* nothing to do */ break; case T_OBJECT : // fall through - case T_ARRAY : { - Label L; - __ cbz(R0, L); - __ ldr(R0, Address(R0)); - __ verify_oop(R0); - __ bind(L); - break; - } + case T_ARRAY : break; // See JNIHandles::resolve below default: ShouldNotReachHere(); } @@ -1748,14 +1741,15 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, if (CheckJNICalls) { __ str(__ zero_register(Rtemp), Address(Rthread, JavaThread::pending_jni_exception_check_fn_offset())); } - - // Unhandle the result - if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - __ cmp(R0, 0); - __ ldr(R0, Address(R0), ne); - } #endif // AARCH64 + // Unbox oop result, e.g. JNIHandles::resolve value in R0. + if (ret_type == T_OBJECT || ret_type == T_ARRAY) { + __ resolve_jobject(R0, // value + Rtemp, // tmp1 + R1_tmp); // tmp2 + } + // Any exception pending? __ ldr(Rtemp, Address(Rthread, Thread::pending_exception_offset())); __ mov(SP, FP); diff --git a/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp b/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp index 743510e09a7..7fda747ad48 100644 --- a/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp +++ b/hotspot/src/cpu/arm/vm/templateInterpreterGenerator_arm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1240,28 +1240,25 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { __ str(__ zero_register(Rtemp), Address(Rthread, JavaThread::pending_jni_exception_check_fn_offset())); } - // Unbox if the result is non-zero object -#ifdef AARCH64 + // Unbox oop result, e.g. JNIHandles::resolve result if it's an oop. { - Label L, Lnull; + Label Lnot_oop; +#ifdef AARCH64 __ mov_slow(Rtemp, AbstractInterpreter::result_handler(T_OBJECT)); __ cmp(Rresult_handler, Rtemp); - __ b(L, ne); - __ cbz(Rsaved_result, Lnull); - __ ldr(Rsaved_result, Address(Rsaved_result)); - __ bind(Lnull); - // Store oop on the stack for GC - __ str(Rsaved_result, Address(FP, frame::interpreter_frame_oop_temp_offset * wordSize)); - __ bind(L); + __ b(Lnot_oop, ne); +#else // !AARCH64 + // For ARM32, Rresult_handler is -1 for oop result, 0 otherwise. + __ cbz(Rresult_handler, Lnot_oop); +#endif // !AARCH64 + Register value = AARCH64_ONLY(Rsaved_result) NOT_AARCH64(Rsaved_result_lo); + __ resolve_jobject(value, // value + Rtemp, // tmp1 + R1_tmp); // tmp2 + // Store resolved result in frame for GC visibility. + __ str(value, Address(FP, frame::interpreter_frame_oop_temp_offset * wordSize)); + __ bind(Lnot_oop); } -#else - __ tst(Rsaved_result_lo, Rresult_handler); - __ ldr(Rsaved_result_lo, Address(Rsaved_result_lo), ne); - - // Store oop on the stack for GC - __ cmp(Rresult_handler, 0); - __ str(Rsaved_result_lo, Address(FP, frame::interpreter_frame_oop_temp_offset * wordSize), ne); -#endif // AARCH64 #ifdef AARCH64 // Restore SP (drop native parameters area), to keep SP in sync with extended_sp in frame diff --git a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp index 86eacda77f1..5bcd457e7e0 100644 --- a/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/c1_LIRGenerator_ppc.cpp @@ -1131,12 +1131,19 @@ 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); + CodeEmitInfo* info_for_exception = + (x->needs_exception_state() ? state_for(x) : + state_for(x, x->state_before(), true /*ignore_xhandler*/)); if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + } else if (x->is_invokespecial_receiver_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new DeoptimizeStub(info_for_exception, + Deoptimization::Reason_class_check, + Deoptimization::Action_none); } else { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); } diff --git a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp index 131a931c2c1..b6a538681f6 100644 --- a/hotspot/src/cpu/ppc/vm/frame_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/frame_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2015 SAP SE. All rights reserved. + * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -171,10 +171,7 @@ BasicType frame::interpreter_frame_result(oop* oop_result, jvalue* value_result) switch (method->result_type()) { case T_OBJECT: case T_ARRAY: { - oop* obj_p = *(oop**)lresult; - oop obj = (obj_p == NULL) ? (oop)NULL : *obj_p; - assert(obj == NULL || Universe::heap()->is_in(obj), "sanity check"); - *oop_result = obj; + *oop_result = JNIHandles::resolve(*(jobject*)lresult); break; } // We use std/stfd to store the values. diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp index a5d5613a414..6eb27c78f17 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 SAP SE. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3033,6 +3033,34 @@ void MacroAssembler::card_table_write(jbyte* byte_map_base, Register Rtmp, Regis stbx(R0, Rtmp, Robj); } +// Kills R31 if value is a volatile register. +void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame) { + Label done; + cmpdi(CCR0, value, 0); + beq(CCR0, done); // Use NULL as-is. + + clrrdi(tmp1, value, JNIHandles::weak_tag_size); +#if INCLUDE_ALL_GCS + if (UseG1GC) { andi_(tmp2, value, JNIHandles::weak_tag_mask); } +#endif + ld(value, 0, tmp1); // Resolve (untagged) jobject. + +#if INCLUDE_ALL_GCS + if (UseG1GC) { + Label not_weak; + beq(CCR0, not_weak); // Test for jweak tag. + verify_oop(value); + g1_write_barrier_pre(noreg, // obj + noreg, // offset + value, // pre_val + tmp1, tmp2, needs_frame); + bind(not_weak); + } +#endif // INCLUDE_ALL_GCS + verify_oop(value); + bind(done); +} + #if INCLUDE_ALL_GCS // General G1 pre-barrier generator. // Goal: record the previous value if it is not null. @@ -3094,7 +3122,7 @@ void MacroAssembler::g1_write_barrier_pre(Register Robj, RegisterOrConstant offs bind(runtime); - // VM call need frame to access(write) O register. + // May need to preserve LR. Also needed if current frame is not compatible with C calling convention. if (needs_frame) { save_LR_CR(Rtmp1); push_frame_reg_args(0, Rtmp2); diff --git a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp index 11b966a82c9..0b1b2a0befa 100644 --- a/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp +++ b/hotspot/src/cpu/ppc/vm/macroAssembler_ppc.hpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 SAP SE. All rights reserved. + * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -649,6 +649,8 @@ class MacroAssembler: public Assembler { void card_write_barrier_post(Register Rstore_addr, Register Rnew_val, Register Rtmp); void card_table_write(jbyte* byte_map_base, Register Rtmp, Register Robj); + void resolve_jobject(Register value, Register tmp1, Register tmp2, bool needs_frame); + #if INCLUDE_ALL_GCS // General G1 pre-barrier generator. void g1_write_barrier_pre(Register Robj, RegisterOrConstant offset, Register Rpre_val, diff --git a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp index 784595f11be..dc36aa77da2 100644 --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 SAP SE. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2477,16 +2477,11 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, __ reset_last_Java_frame(); - // Unpack oop result. + // Unbox oop result, e.g. JNIHandles::resolve value. // -------------------------------------------------------------------------- if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - Label skip_unboxing; - __ cmpdi(CCR0, R3_RET, 0); - __ beq(CCR0, skip_unboxing); - __ ld(R3_RET, 0, R3_RET); - __ bind(skip_unboxing); - __ verify_oop(R3_RET); + __ resolve_jobject(R3_RET, r_temp_1, r_temp_2, /* needs_frame */ false); // kills R31 } if (CheckJNICalls) { diff --git a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp index 56810938a53..ab87c204018 100644 --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2015, 2016 SAP SE. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017 SAP SE. All rights reserved. * 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,11 +401,8 @@ address TemplateInterpreterGenerator::generate_result_handler_for(BasicType type case T_LONG: break; case T_OBJECT: - // unbox result if not null - __ cmpdi(CCR0, R3_RET, 0); - __ beq(CCR0, done); - __ ld(R3_RET, 0, R3_RET); - __ verify_oop(R3_RET); + // JNIHandles::resolve result. + __ resolve_jobject(R3_RET, R11_scratch1, R12_scratch2, /* needs_frame */ true); // kills R31 break; case T_FLOAT: break; diff --git a/hotspot/src/cpu/s390/vm/c1_LIRGenerator_s390.cpp b/hotspot/src/cpu/s390/vm/c1_LIRGenerator_s390.cpp index 98489aa7371..0ec97da6230 100644 --- a/hotspot/src/cpu/s390/vm/c1_LIRGenerator_s390.cpp +++ b/hotspot/src/cpu/s390/vm/c1_LIRGenerator_s390.cpp @@ -993,12 +993,19 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { obj.load_item(); // info for exceptions - CodeEmitInfo* info_for_exception = state_for (x); + CodeEmitInfo* info_for_exception = + (x->needs_exception_state() ? state_for(x) : + state_for(x, x->state_before(), true /*ignore_xhandler*/)); CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + } else if (x->is_invokespecial_receiver_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new DeoptimizeStub(info_for_exception, + Deoptimization::Reason_class_check, + Deoptimization::Action_none); } else { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); } diff --git a/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp b/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp index 7b65476212f..4f3c0950ad2 100644 --- a/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp +++ b/hotspot/src/cpu/s390/vm/c1_Runtime1_s390.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2016 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * diff --git a/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp b/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp index 0f78e5a6250..d5776117436 100644 --- a/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp +++ b/hotspot/src/cpu/s390/vm/macroAssembler_s390.cpp @@ -3439,6 +3439,34 @@ void MacroAssembler::card_write_barrier_post(Register store_addr, Register tmp) z_mvi(0, store_addr, 0); // Store byte 0. } +void MacroAssembler::resolve_jobject(Register value, Register tmp1, Register tmp2) { + NearLabel Ldone; + z_ltgr(tmp1, value); + z_bre(Ldone); // Use NULL result as-is. + + z_nill(value, ~JNIHandles::weak_tag_mask); + z_lg(value, 0, value); // Resolve (untagged) jobject. + +#if INCLUDE_ALL_GCS + if (UseG1GC) { + NearLabel Lnot_weak; + z_tmll(tmp1, JNIHandles::weak_tag_mask); // Test for jweak tag. + z_braz(Lnot_weak); + verify_oop(value); + g1_write_barrier_pre(noreg /* obj */, + noreg /* offset */, + value /* pre_val */, + noreg /* val */, + tmp1 /* tmp1 */, + tmp2 /* tmp2 */, + true /* pre_val_needed */); + bind(Lnot_weak); + } +#endif // INCLUDE_ALL_GCS + verify_oop(value); + bind(Ldone); +} + #if INCLUDE_ALL_GCS //------------------------------------------------------ diff --git a/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp b/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp index 588bde6207e..2b4002a3bf4 100644 --- a/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp +++ b/hotspot/src/cpu/s390/vm/macroAssembler_s390.hpp @@ -726,6 +726,8 @@ class MacroAssembler: public Assembler { // Write to card table for modification at store_addr - register is destroyed afterwards. void card_write_barrier_post(Register store_addr, Register tmp); + void resolve_jobject(Register value, Register tmp1, Register tmp2); + #if INCLUDE_ALL_GCS // General G1 pre-barrier generator. // Purpose: record the previous value if it is not null. diff --git a/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp b/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp index ea498e3399c..89c3ae4032a 100644 --- a/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp +++ b/hotspot/src/cpu/s390/vm/sharedRuntime_s390.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2016 SAP SE. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2272,13 +2272,9 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm, __ reset_last_Java_frame(); - // Unpack oop result + // Unpack oop result, e.g. JNIHandles::resolve result. if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - NearLabel L; - __ compare64_and_branch(Z_RET, (RegisterOrConstant)0L, Assembler::bcondEqual, L); - __ z_lg(Z_RET, 0, Z_RET); - __ bind(L); - __ verify_oop(Z_RET); + __ resolve_jobject(Z_RET, /* tmp1 */ Z_R13, /* tmp2 */ Z_R7); } if (CheckJNICalls) { diff --git a/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp b/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp index 2084f36006f..20a9a3e9571 100644 --- a/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp +++ b/hotspot/src/cpu/s390/vm/templateInterpreterGenerator_s390.cpp @@ -1,6 +1,6 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2016 SAP SE. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1695,14 +1695,11 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // from the jni handle to z_ijava_state.oop_temp. This is // necessary, because we reset the jni handle block below. // NOTE: frame::interpreter_frame_result() depends on this, too. - { NearLabel no_oop_result, store_oop_result; + { NearLabel no_oop_result; __ load_absolute_address(Z_R1, AbstractInterpreter::result_handler(T_OBJECT)); __ compareU64_and_branch(Z_R1, Rresult_handler, Assembler::bcondNotEqual, no_oop_result); - __ compareU64_and_branch(Rlresult, (intptr_t)0L, Assembler::bcondEqual, store_oop_result); - __ z_lg(Rlresult, 0, Rlresult); // unbox - __ bind(store_oop_result); + __ resolve_jobject(Rlresult, /* tmp1 */ Rmethod, /* tmp2 */ Z_R1); __ z_stg(Rlresult, oop_tmp_offset, Z_fp); - __ verify_oop(Rlresult); __ bind(no_oop_result); } diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp index 36d3059739c..069b9a2f46e 100644 --- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp @@ -1196,11 +1196,18 @@ 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); + CodeEmitInfo* info_for_exception = + (x->needs_exception_state() ? state_for(x) : + state_for(x, x->state_before(), true /*ignore_xhandler*/)); if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + } else if (x->is_invokespecial_receiver_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new DeoptimizeStub(info_for_exception, + Deoptimization::Reason_class_check, + Deoptimization::Action_none); } else { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); } diff --git a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp index 6d3f05a2aab..ff9fcd69472 100644 --- a/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/jniFastGetField_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +68,7 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { __ andcc (G4, 1, G0); __ br (Assembler::notZero, false, Assembler::pn, label1); __ delayed()->srl (O2, 2, O4); + __ andn (O1, JNIHandles::weak_tag_mask, O1); __ ld_ptr (O1, 0, O5); assert(count < LIST_CAPACITY, "LIST_CAPACITY too small"); @@ -147,6 +148,7 @@ address JNI_FastGetField::generate_fast_get_long_field() { __ andcc (G4, 1, G0); __ br (Assembler::notZero, false, Assembler::pn, label1); __ delayed()->srl (O2, 2, O4); + __ andn (O1, JNIHandles::weak_tag_mask, O1); __ ld_ptr (O1, 0, O5); __ add (O5, O4, O5); @@ -219,6 +221,7 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { __ andcc (G4, 1, G0); __ br (Assembler::notZero, false, Assembler::pn, label1); __ delayed()->srl (O2, 2, O4); + __ andn (O1, JNIHandles::weak_tag_mask, O1); __ ld_ptr (O1, 0, O5); assert(count < LIST_CAPACITY, "LIST_CAPACITY too small"); diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp index 7b4dcf193d3..613e662d65c 100644 --- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2754,15 +2754,30 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ verify_thread(); // G2_thread must be correct __ reset_last_Java_frame(); - // Unpack oop result + // Unbox oop result, e.g. JNIHandles::resolve value in I0. if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - Label L; - __ addcc(G0, I0, G0); - __ brx(Assembler::notZero, true, Assembler::pt, L); - __ delayed()->ld_ptr(I0, 0, I0); - __ mov(G0, I0); - __ bind(L); - __ verify_oop(I0); + Label done, not_weak; + __ br_null(I0, false, Assembler::pn, done); // Use NULL as-is. + __ delayed()->andcc(I0, JNIHandles::weak_tag_mask, G0); // Test for jweak + __ brx(Assembler::zero, true, Assembler::pt, not_weak); + __ delayed()->ld_ptr(I0, 0, I0); // Maybe resolve (untagged) jobject. + // Resolve jweak. + __ ld_ptr(I0, -JNIHandles::weak_tag_value, I0); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + // Copy to O0 because macro doesn't allow pre_val in input reg. + __ mov(I0, O0); + __ g1_write_barrier_pre(noreg /* obj */, + noreg /* index */, + 0 /* offset */, + O0 /* pre_val */, + G3_scratch /* tmp */, + true /* preserve_o_regs */); + } +#endif // INCLUDE_ALL_GCS + __ bind(not_weak); + __ verify_oop(I0); + __ bind(done); } if (CheckJNICalls) { diff --git a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp index b677a1dd662..fd4e3ffd149 100644 --- a/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/templateInterpreterGenerator_sparc.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1516,11 +1516,23 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { __ set((intptr_t)AbstractInterpreter::result_handler(T_OBJECT), G3_scratch); __ cmp_and_brx_short(G3_scratch, Lscratch, Assembler::notEqual, Assembler::pt, no_oop); - __ addcc(G0, O0, O0); - __ brx(Assembler::notZero, true, Assembler::pt, store_result); // if result is not NULL: - __ delayed()->ld_ptr(O0, 0, O0); // unbox it - __ mov(G0, O0); - + // Unbox oop result, e.g. JNIHandles::resolve value in O0. + __ br_null(O0, false, Assembler::pn, store_result); // Use NULL as-is. + __ delayed()->andcc(O0, JNIHandles::weak_tag_mask, G0); // Test for jweak + __ brx(Assembler::zero, true, Assembler::pt, store_result); + __ delayed()->ld_ptr(O0, 0, O0); // Maybe resolve (untagged) jobject. + // Resolve jweak. + __ ld_ptr(O0, -JNIHandles::weak_tag_value, O0); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + __ g1_write_barrier_pre(noreg /* obj */, + noreg /* index */, + 0 /* offset */, + O0 /* pre_val */, + G3_scratch /* tmp */, + true /* preserve_o_regs */); + } +#endif // INCLUDE_ALL_GCS __ bind(store_result); // Store it where gc will look for it and result handler expects it. __ st_ptr(O0, FP, (frame::interpreter_frame_oop_temp_offset*wordSize) + STACK_BIAS); diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp index c819ffe9462..3c6d7b5cdd6 100644 --- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp @@ -917,7 +917,7 @@ address Assembler::locate_operand(address inst, WhichOperand which) { break; case 0x62: // EVEX_4bytes - assert((UseAVX > 0), "shouldn't have EVEX prefix"); + assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix"); assert(ip == inst+1, "no prefixes allowed"); // no EVEX collisions, all instructions that have 0x62 opcodes // have EVEX versions and are subopcodes of 0x66 diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index c5bec4b7e0b..39718a34acf 100644 --- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -1429,12 +1429,17 @@ void LIRGenerator::do_CheckCast(CheckCast* x) { obj.load_item(); // info for exceptions - CodeEmitInfo* info_for_exception = state_for(x); + CodeEmitInfo* info_for_exception = + (x->needs_exception_state() ? state_for(x) : + state_for(x, x->state_before(), true /*ignore_xhandler*/)); CodeStub* stub; if (x->is_incompatible_class_change_check()) { assert(patching_info == NULL, "can't patch this"); stub = new SimpleExceptionStub(Runtime1::throw_incompatible_class_change_error_id, LIR_OprFact::illegalOpr, info_for_exception); + } else if (x->is_invokespecial_receiver_check()) { + assert(patching_info == NULL, "can't patch this"); + stub = new DeoptimizeStub(info_for_exception, Deoptimization::Reason_class_check, Deoptimization::Action_none); } else { stub = new SimpleExceptionStub(Runtime1::throw_class_cast_exception_id, obj.result(), info_for_exception); } diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp index a45e0eb9aa3..719bf8ce560 100644 --- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { __ movptr (rdx, Address(rsp, 2*wordSize)); // obj } __ movptr(rax, Address(rsp, 3*wordSize)); // jfieldID + + __ clear_jweak_tag(rdx); + __ movptr(rdx, Address(rdx, 0)); // *obj __ shrptr (rax, 2); // offset @@ -202,6 +205,9 @@ address JNI_FastGetField::generate_fast_get_long_field() { __ movptr(rdx, Address(rsp, 3*wordSize)); // obj } __ movptr(rsi, Address(rsp, 4*wordSize)); // jfieldID + + __ clear_jweak_tag(rdx); + __ movptr(rdx, Address(rdx, 0)); // *obj __ shrptr(rsi, 2); // offset @@ -291,6 +297,9 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { __ movptr(rdx, Address(rsp, 2*wordSize)); // obj } __ movptr(rax, Address(rsp, 3*wordSize)); // jfieldID + + __ clear_jweak_tag(rdx); + __ movptr(rdx, Address(rdx, 0)); // *obj __ shrptr(rax, 2); // offset diff --git a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp index 7286fd124b8..f18aa684266 100644 --- a/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/jniFastGetField_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ address JNI_FastGetField::generate_fast_get_int_field0(BasicType type) { // robj ^ rcounter ^ rcounter == robj // robj is data dependent on rcounter. } + + __ clear_jweak_tag(robj); + __ movptr(robj, Address(robj, 0)); // *obj __ mov (roffset, c_rarg2); __ shrptr(roffset, 2); // offset @@ -178,6 +181,9 @@ address JNI_FastGetField::generate_fast_get_float_field0(BasicType type) { // robj ^ rcounter ^ rcounter == robj // robj is data dependent on rcounter. } + + __ clear_jweak_tag(robj); + __ movptr(robj, Address(robj, 0)); // *obj __ mov (roffset, c_rarg2); __ shrptr(roffset, 2); // offset diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp index b6d32631582..f2c8393fb12 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -5129,6 +5129,43 @@ void MacroAssembler::vxorps(XMMRegister dst, XMMRegister nds, AddressLiteral src } +void MacroAssembler::resolve_jobject(Register value, + Register thread, + Register tmp) { + assert_different_registers(value, thread, tmp); + Label done, not_weak; + testptr(value, value); + jcc(Assembler::zero, done); // Use NULL as-is. + testptr(value, JNIHandles::weak_tag_mask); // Test for jweak tag. + jcc(Assembler::zero, not_weak); + // Resolve jweak. + movptr(value, Address(value, -JNIHandles::weak_tag_value)); + verify_oop(value); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + g1_write_barrier_pre(noreg /* obj */, + value /* pre_val */, + thread /* thread */, + tmp /* tmp */, + true /* tosca_live */, + true /* expand_call */); + } +#endif // INCLUDE_ALL_GCS + jmp(done); + bind(not_weak); + // Resolve (untagged) jobject. + movptr(value, Address(value, 0)); + verify_oop(value); + bind(done); +} + +void MacroAssembler::clear_jweak_tag(Register possibly_jweak) { + const int32_t inverted_jweak_mask = ~static_cast(JNIHandles::weak_tag_mask); + STATIC_ASSERT(inverted_jweak_mask == -2); // otherwise check this code + // The inverted mask is sign-extended + andptr(possibly_jweak, inverted_jweak_mask); +} + ////////////////////////////////////////////////////////////////////////////////// #if INCLUDE_ALL_GCS diff --git a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp index a3e81e58dc5..39b2e1a5305 100644 --- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp +++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -297,6 +297,9 @@ class MacroAssembler: public Assembler { void store_check(Register obj); // store check for obj - register is destroyed afterwards void store_check(Register obj, Address dst); // same as above, dst is exact store location (reg. is destroyed) + void resolve_jobject(Register value, Register thread, Register tmp); + void clear_jweak_tag(Register possibly_jweak); + #if INCLUDE_ALL_GCS void g1_write_barrier_pre(Register obj, diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp index cb8c08f4652..fc7fcba2fc7 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.cpp @@ -365,6 +365,10 @@ int NativeMovRegMem::instruction_start() const { NOT_LP64(assert((0xC0 & ubyte_at(1)) == 0xC0, "shouldn't have LDS and LES instructions")); return 3; } + if (instr_0 == instruction_EVEX_prefix_4bytes) { + assert(VM_Version::supports_evex(), "shouldn't have EVEX prefix"); + return 4; + } // First check to see if we have a (prefixed or not) xor if (instr_0 >= instruction_prefix_wide_lo && // 0x40 diff --git a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp index 7db3ccb9d3c..ef87c17807c 100644 --- a/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp +++ b/hotspot/src/cpu/x86/vm/nativeInst_x86.hpp @@ -356,6 +356,7 @@ class NativeMovRegMem: public NativeInstruction { instruction_VEX_prefix_2bytes = Assembler::VEX_2bytes, instruction_VEX_prefix_3bytes = Assembler::VEX_3bytes, + instruction_EVEX_prefix_4bytes = Assembler::EVEX_4bytes, instruction_size = 4, instruction_offset = 0, diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp index ed317550e08..47b9fe5c627 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2226,14 +2226,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ reset_last_Java_frame(thread, false); - // Unpack oop result + // Unbox oop result, e.g. JNIHandles::resolve value. if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - Label L; - __ cmpptr(rax, (int32_t)NULL_WORD); - __ jcc(Assembler::equal, L); - __ movptr(rax, Address(rax, 0)); - __ bind(L); - __ verify_oop(rax); + __ resolve_jobject(rax /* value */, + thread /* thread */, + rcx /* tmp */); } if (CheckJNICalls) { diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp index 4587b8caba6..d81e965d05d 100644 --- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2579,14 +2579,11 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm, __ reset_last_Java_frame(false); - // Unpack oop result + // Unbox oop result, e.g. JNIHandles::resolve value. if (ret_type == T_OBJECT || ret_type == T_ARRAY) { - Label L; - __ testptr(rax, rax); - __ jcc(Assembler::zero, L); - __ movptr(rax, Address(rax, 0)); - __ bind(L); - __ verify_oop(rax); + __ resolve_jobject(rax /* value */, + r15_thread /* thread */, + rcx /* tmp */); } if (CheckJNICalls) { diff --git a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp index eb5661bee00..9c02d44cdb8 100644 --- a/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateInterpreterGenerator_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1193,16 +1193,16 @@ address TemplateInterpreterGenerator::generate_native_entry(bool synchronized) { // and result handler will pick it up { - Label no_oop, store_result; + Label no_oop, not_weak, store_result; __ lea(t, ExternalAddress(AbstractInterpreter::result_handler(T_OBJECT))); __ cmpptr(t, Address(rbp, frame::interpreter_frame_result_handler_offset*wordSize)); __ jcc(Assembler::notEqual, no_oop); // retrieve result __ pop(ltos); - __ testptr(rax, rax); - __ jcc(Assembler::zero, store_result); - __ movptr(rax, Address(rax, 0)); - __ bind(store_result); + // Unbox oop result, e.g. JNIHandles::resolve value. + __ resolve_jobject(rax /* value */, + thread /* thread */, + t /* tmp */); __ movptr(Address(rbp, frame::interpreter_frame_oop_temp_offset*wordSize), rax); // keep stack depth as expected by pushing oop which will eventually be discarded __ push(ltos); diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp index 5f1c935f944..3d2f57f37bc 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2210,7 +2210,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { // Out-of-line code to allocate method data oop. __ bind(profile_method); __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method)); - __ load_unsigned_byte(rbx, Address(rbcp, 0)); // restore target bytecode __ set_method_data_pointer_for_bcp(); __ jmp(dispatch); } @@ -2225,10 +2224,8 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { CAST_FROM_FN_PTR(address, InterpreterRuntime::frequency_counter_overflow), rdx); - __ load_unsigned_byte(rbx, Address(rbcp, 0)); // restore target bytecode // rax: osr nmethod (osr ok) or NULL (osr not possible) - // rbx: target bytecode // rdx: scratch // r14: locals pointer // r13: bcp @@ -2238,12 +2235,13 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { __ cmpb(Address(rax, nmethod::state_offset()), nmethod::in_use); __ jcc(Assembler::notEqual, dispatch); - // We have the address of an on stack replacement routine in rax - // We need to prepare to execute the OSR method. First we must - // migrate the locals and monitors off of the stack. + // We have the address of an on stack replacement routine in rax. + // In preparation of invoking it, first we must migrate the locals + // and monitors from off the interpreter frame on the stack. + // Ensure to save the osr nmethod over the migration call, + // it will be preserved in rbx. + __ mov(rbx, rax); - LP64_ONLY(__ mov(r13, rax)); // save the nmethod - NOT_LP64(__ mov(rbx, rax)); // save the nmethod NOT_LP64(__ get_thread(rcx)); call_VM(noreg, CAST_FROM_FN_PTR(address, SharedRuntime::OSR_migration_begin)); @@ -2258,7 +2256,6 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { const Register retaddr = LP64_ONLY(j_rarg2) NOT_LP64(rdi); const Register sender_sp = LP64_ONLY(j_rarg1) NOT_LP64(rdx); - // pop the interpreter frame __ movptr(sender_sp, Address(rbp, frame::interpreter_frame_sender_sp_offset * wordSize)); // get sender sp __ leave(); // remove frame anchor @@ -2274,8 +2271,7 @@ void TemplateTable::branch(bool is_jsr, bool is_wide) { __ push(retaddr); // and begin the OSR nmethod - LP64_ONLY(__ jmp(Address(r13, nmethod::osr_entry_point_offset()))); - NOT_LP64(__ jmp(Address(rbx, nmethod::osr_entry_point_offset()))); + __ jmp(Address(rbx, nmethod::osr_entry_point_offset())); } } } diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 7bed10749f7..197079ba1c7 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -763,12 +763,11 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseCRC32Intrinsics, false); } - if (supports_sse4_2()) { + if (supports_sse4_2() && supports_clmul()) { if (FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { UseCRC32CIntrinsics = true; } - } - else if (UseCRC32CIntrinsics) { + } else if (UseCRC32CIntrinsics) { if (!FLAG_IS_DEFAULT(UseCRC32CIntrinsics)) { warning("CRC32C intrinsics are not available on this CPU"); } @@ -850,6 +849,12 @@ void VM_Version::get_processor_features() { #if INCLUDE_RTM_OPT if (UseRTMLocking) { + if (is_client_compilation_mode_vm()) { + // Only C2 does RTM locking optimization. + // Can't continue because UseRTMLocking affects UseBiasedLocking flag + // setting during arguments processing. See use_biased_locking(). + vm_exit_during_initialization("RTM locking optimization is not supported in emulated client VM"); + } if (is_intel_family_core()) { if ((_model == CPU_MODEL_HASWELL_E3) || (_model == CPU_MODEL_HASWELL_E7 && _stepping < 3) || diff --git a/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp b/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp index 1fcf7d9984b..f7c51092c82 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, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * Copyright 2007, 2008, 2009, 2010, 2011 Red Hat, Inc. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -406,10 +406,12 @@ int CppInterpreter::native_entry(Method* method, intptr_t UNUSED, TRAPS) { // oop_temp where the garbage collector can see it before // we release the handle it might be protected by. if (handler->result_type() == &ffi_type_pointer) { - if (result[0]) - istate->set_oop_temp(*(oop *) result[0]); - else + if (result[0] == 0) { istate->set_oop_temp(NULL); + } else { + jobject handle = reinterpret_cast(result[0]); + istate->set_oop_temp(JNIHandles::resolve(handle)); + } } // Reset handle block diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java index b7ba5e87e72..1eabbdc3a78 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/AOTStub.java @@ -25,6 +25,7 @@ package jdk.tools.jaotc; import org.graalvm.compiler.code.CompilationResult; import org.graalvm.compiler.core.target.Backend; +import org.graalvm.compiler.hotspot.HotSpotCompiledCodeBuilder; import org.graalvm.compiler.hotspot.stubs.Stub; import jdk.vm.ci.hotspot.HotSpotCompiledCode; @@ -48,7 +49,7 @@ public class AOTStub implements JavaMethodInfo { } public HotSpotCompiledCode compiledCode(CompilationResult result) { - return stub.getCompiledCode(backend); + return HotSpotCompiledCodeBuilder.createCompiledCode(null, null, result); } } diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java index 68f86ef65e3..5fce078a470 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/CallSiteRelocationSymbol.java @@ -59,12 +59,6 @@ abstract class CallSiteRelocationSymbol { addExternalPltToGotRelocation(binaryContainer, symbol, relocationOffset); } - protected static void addMetaspaceGotRelocation(BinaryContainer binaryContainer, String symbolName, int symbolOffset, int relocationOffset) { - ByteContainer container = binaryContainer.getMetaspaceGotContainer(); - Symbol symbol = container.createGotSymbol(symbolOffset, symbolName); - addExternalPltToGotRelocation(binaryContainer, symbol, relocationOffset); - } - /** * Add an {@link RelocType#EXTERNAL_GOT_TO_PLT} relocation to the * {@link BinaryContainer#getExtLinkageGOTContainer()}. diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java index 350ee46921a..159955c6bda 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/DataBuilder.java @@ -70,8 +70,8 @@ class DataBuilder { */ private void fillVMAddresses(HotSpotVMConfigStore config) { for (VMField vmField : config.getFields().values()) { - if (vmField.value != null) { - final long address = vmField.value; + if (vmField.value != null && vmField.value instanceof Long) { + final long address = (Long) vmField.value; String value = vmField.name; /* * Some fields don't contain addresses but integer values. At least don't add zero diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java index a14049dd87f..f589610ded8 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/JavaCallSiteRelocationSymbol.java @@ -37,6 +37,7 @@ import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; final class JavaCallSiteRelocationSymbol extends CallSiteRelocationSymbol { private static final byte[] zeroSlot = new byte[8]; + // -1 represents Universe::non_oop_word() value private static final byte[] minusOneSlot = {-1, -1, -1, -1, -1, -1, -1, -1}; public JavaCallSiteRelocationSymbol(CompiledMethodInfo mi, Call call, CallSiteRelocationInfo callSiteRelocation, BinaryContainer binaryContainer) { @@ -79,30 +80,39 @@ final class JavaCallSiteRelocationSymbol extends CallSiteRelocationSymbol { } // Add relocation to GOT cell for call resolution jump. + // This GOT cell will be initialized during JVM startup with address + // of JVM runtime call resolution function. String gotSymbolName = "got." + getResolveSymbolName(binaryContainer, mi, call); Symbol gotSymbol = binaryContainer.getGotSymbol(gotSymbolName); addExternalPltToGotRelocation(binaryContainer, gotSymbol, stub.getResolveJumpOffset()); // Add relocation to resolve call jump instruction address for GOT cell. + // This GOT cell will be initialized with address of resolution jump instruction and + // will be updated with call destination address by JVM runtime call resolution code. String pltJmpSymbolName = relocationSymbolName("plt.jmp", mi, call, callSiteRelocation); addCodeContainerRelocation(binaryContainer, pltJmpSymbolName, stub.getResolveJumpStart(), gotStartOffset); // Add relocation to GOT cell for dispatch jump. + // The dispatch jump loads destination address from this GOT cell. String gotEntrySymbolName = relocationSymbolName("got.entry", mi, call, callSiteRelocation); addExtLinkageGotContainerRelocation(binaryContainer, gotEntrySymbolName, gotStartOffset, stub.getDispatchJumpOffset()); - // Virtual call needs initial -1 value. + // Virtual call needs initial -1 value for Klass pointer. + // Non virtual call needs initial 0 value for Method pointer to call c2i adapter. byte[] slot = isVirtualCall ? minusOneSlot : zeroSlot; - final int gotMetaOffset = binaryContainer.appendMetaspaceGotBytes(slot, 0, slot.length); + final int gotMetaOffset = binaryContainer.appendExtLinkageGotBytes(slot, 0, slot.length); // Add relocation to GOT cell for move instruction (Klass* for virtual, Method* otherwise). String gotMoveSymbolName = relocationSymbolName("got.move", mi, call, callSiteRelocation); - addMetaspaceGotRelocation(binaryContainer, gotMoveSymbolName, gotMetaOffset, stub.getMovOffset()); + addExtLinkageGotContainerRelocation(binaryContainer, gotMoveSymbolName, gotMetaOffset, stub.getMovOffset()); if (isVirtualCall) { // Nothing. } else { // Add relocation to GOT cell for c2i adapter jump. + // The c2i jump instruction loads destination address from this GOT cell. + // This GOT cell is initialized with -1 and will be updated + // by JVM runtime call resolution code. String gotC2ISymbolName = relocationSymbolName("got.c2i", mi, call, callSiteRelocation); addExtLinkageGotContainerRelocation(binaryContainer, gotC2ISymbolName, gotStartOffset + 8, stub.getC2IJumpOffset()); } diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java index a98dc8d2d81..933e91acaf4 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java @@ -625,7 +625,9 @@ public class Main implements LogPrinter { private void reportError(Throwable e) { log.println("Error: " + e.getMessage()); - e.printStackTrace(log); + if (options.info) { + e.printStackTrace(log); + } log.flush(); } diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java index 3fd63b2c0b8..603da038e80 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java @@ -77,7 +77,7 @@ public class ClassSearch { } if (found == null) { - throw new InternalError("Failed to find: " + searchFor.toString()); + throw new InternalError("Failed to find " + searchFor.getType() + " file: " + searchFor.getName()); } return found; } diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java index 49e0cdd9945..cf6a583ae61 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/SearchFor.java @@ -27,7 +27,7 @@ public class SearchFor { private final String type; public SearchFor(String name) { - this(name, "unknown"); + this(name, ""); } public SearchFor(String name, String type) { @@ -36,7 +36,7 @@ public class SearchFor { } public boolean isUnknown() { - return "unknown".equals(type); + return "".equals(type); } public String getType() { @@ -49,6 +49,6 @@ public class SearchFor { @Override public String toString() { - return type + ":" + name; + return type + ": " + name; } } diff --git a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java index b5bc2804ed4..e46060848fa 100644 --- a/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java +++ b/hotspot/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/classname/ClassNameSourceProvider.java @@ -31,7 +31,7 @@ import java.nio.file.Path; import java.nio.file.Paths; public class ClassNameSourceProvider implements SourceProvider { - public final static String TYPE = "classname"; + public final static String TYPE = "class"; private final ClassLoader classLoader; public ClassNameSourceProvider(FileSupport fileSupport) { @@ -47,6 +47,10 @@ public class ClassNameSourceProvider implements SourceProvider { @Override public ClassSource findSource(String name, SearchPath searchPath) { + Path path = Paths.get(name); + if (ClassSource.pathIsClassFile(path)) { + name = ClassSource.makeClassName(path); + } try { classLoader.loadClass(name); return new ClassNameSource(name, classLoader); diff --git a/hotspot/src/jdk.aot/share/classes/module-info.java b/hotspot/src/jdk.aot/share/classes/module-info.java index 3105d8b6bef..14d11197356 100644 --- a/hotspot/src/jdk.aot/share/classes/module-info.java +++ b/hotspot/src/jdk.aot/share/classes/module-info.java @@ -25,6 +25,6 @@ module jdk.aot { requires jdk.management; - requires jdk.vm.ci; - requires jdk.vm.compiler; + requires jdk.internal.vm.ci; + requires jdk.internal.vm.compiler; } diff --git a/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c b/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c index d6d69cb439a..b64bc2dfdbc 100644 --- a/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c +++ b/hotspot/src/jdk.aot/unix/native/libjelfshim/jdk_tools_jaotc_jnilibelf_JNILibELFAPI.c @@ -70,18 +70,17 @@ JNIEXPORT jint JNICALL Java_jdk_tools_jaotc_jnilibelf_JNILibELFAPI_elf_1version */ static jlong getNativeAddress(JNIEnv* env, jobject ptrObj) { - jclass ptrClass; - jfieldID fidNumber; jlong nativeAddress = -1; - assert (ptrObj != NULL); + assert (ptrObj != NULL); // Get a reference to ptr object's class - ptrClass = (*env)->GetObjectClass(env, ptrObj); - - // Get the Field ID of the instance variables "address" - fidNumber = (*env)->GetFieldID(env, ptrClass, "address", "J"); - if (fidNumber != NULL) { - // Get the long given the Field ID - nativeAddress = (*env)->GetLongField(env, ptrObj, fidNumber); + jclass ptrClass = (*env)->GetObjectClass(env, ptrObj); + if (ptrClass != NULL) { + // Get the Field ID of the instance variables "address" + jfieldID fidNumber = (*env)->GetFieldID(env, ptrClass, "address", "J"); + if (fidNumber != NULL) { + // Get the long given the Field ID + nativeAddress = (*env)->GetLongField(env, ptrObj, fidNumber); + } } // fprintf(stderr, "Native address : %lx\n", nativeAddress); return nativeAddress; @@ -91,10 +90,15 @@ static jlong getNativeAddress(JNIEnv* env, jobject ptrObj) { * Box the nativeAddress as a Pointer object. */ static jobject makePointerObject(JNIEnv* env, jlong nativeAddr) { + jobject retObj = NULL; jclass ptrClass = (*env)->FindClass(env, "jdk/tools/jaotc/jnilibelf/Pointer"); - // Call back constructor to allocate a Pointer object, with an int argument - jmethodID constructorId = (*env)->GetMethodID(env, ptrClass, "", "(J)V"); - jobject retObj = (*env)->NewObject(env, ptrClass, constructorId, nativeAddr); + if (ptrClass != NULL) { + // Call back constructor to allocate a Pointer object, with an int argument + jmethodID constructorId = (*env)->GetMethodID(env, ptrClass, "", "(J)V"); + if (constructorId != NULL) { + retObj = (*env)->NewObject(env, ptrClass, constructorId, nativeAddr); + } + } return retObj; } diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h index 15bf64032f7..2dc0b611c2e 100644 --- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h +++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/elfmacros.h @@ -33,6 +33,7 @@ #define ELF_NHDR Elf64_Nhdr #define ELF_DYN Elf64_Dyn #define ELF_ADDR Elf64_Addr +#define ELF_AUXV Elf64_auxv_t #define ELF_ST_TYPE ELF64_ST_TYPE @@ -45,6 +46,7 @@ #define ELF_NHDR Elf32_Nhdr #define ELF_DYN Elf32_Dyn #define ELF_ADDR Elf32_Addr +#define ELF_AUXV Elf32_auxv_t #define ELF_ST_TYPE ELF32_ST_TYPE diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c index c12f82d1bf6..3e3758b0cf6 100644 --- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c +++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/libproc_impl.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +50,7 @@ int pathmap_open(const char* name) { } - if (strlen(alt_root) + strlen(name) < PATH_MAX) { + if (strlen(alt_root) + strlen(name) > PATH_MAX) { // Buffer too small. return -1; } diff --git a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c index 6c39d0c43f5..12a6347b366 100644 --- a/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c +++ b/hotspot/src/jdk.hotspot.agent/linux/native/libsaproc/ps_core.c @@ -642,6 +642,18 @@ static bool core_handle_note(struct ps_prochandle* ph, ELF_PHDR* note_phdr) { if (core_handle_prstatus(ph, descdata, notep->n_descsz) != true) { return false; } + } else if (notep->n_type == NT_AUXV) { + // Get first segment from entry point + ELF_AUXV *auxv = (ELF_AUXV *)descdata; + while (auxv->a_type != AT_NULL) { + if (auxv->a_type == AT_ENTRY) { + // Set entry point address to address of dynamic section. + // We will adjust it in read_exec_segments(). + ph->core->dynamic_addr = auxv->a_un.a_val; + break; + } + auxv++; + } } p = descdata + ROUNDUP(notep->n_descsz, 4); } @@ -832,7 +844,13 @@ static bool read_exec_segments(struct ps_prochandle* ph, ELF_EHDR* exec_ehdr) { // from PT_DYNAMIC we want to read address of first link_map addr case PT_DYNAMIC: { - ph->core->dynamic_addr = exec_php->p_vaddr; + if (exec_ehdr->e_type == ET_EXEC) { + ph->core->dynamic_addr = exec_php->p_vaddr; + } else { // ET_DYN + // dynamic_addr has entry point of executable. + // Thus we should substract it. + ph->core->dynamic_addr += exec_php->p_vaddr - exec_ehdr->e_entry; + } print_debug("address of _DYNAMIC is 0x%lx\n", ph->core->dynamic_addr); break; } @@ -1030,8 +1048,9 @@ struct ps_prochandle* Pgrab_core(const char* exec_file, const char* core_file) { goto err; } - if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || exec_ehdr.e_type != ET_EXEC) { - print_debug("executable file is not a valid ELF ET_EXEC file\n"); + if (read_elf_header(ph->core->exec_fd, &exec_ehdr) != true || + ((exec_ehdr.e_type != ET_EXEC) && (exec_ehdr.e_type != ET_DYN))) { + print_debug("executable file is not a valid ELF file\n"); goto err; } diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AltHashing.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AltHashing.java new file mode 100644 index 00000000000..e3ff237815a --- /dev/null +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/AltHashing.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.jvm.hotspot.memory; + +public class AltHashing { + public static long murmur3_32(long seed, byte[] data) { + long h1 = seed; + int len = data.length; + int count = len; + + int offset = 0; + + // body + while (count >= 4) { + long k1 = (data[offset] & 0x0FF) + | (data[offset + 1] & 0x0FF) << 8 + | (data[offset + 2] & 0x0FF) << 16 + | data[offset + 3] << 24; + + count -= 4; + offset += 4; + + k1 *= 0xcc9e2d51; + k1 = Integer.rotateLeft((int)k1, 15); + k1 *= 0x1b873593; + k1 &= 0xFFFFFFFFL; + + h1 ^= k1; + h1 = Integer.rotateLeft((int)h1, 13); + h1 = h1 * 5 + 0xe6546b64; + h1 &= 0xFFFFFFFFL; + } + + //tail + if (count > 0) { + long k1 = 0; + + switch (count) { + case 3: + k1 ^= (data[offset + 2] & 0xff) << 16; + // fall through + case 2: + k1 ^= (data[offset + 1] & 0xff) << 8; + // fall through + case 1: + k1 ^= (data[offset] & 0xff); + // fall through + default: + k1 *= 0xcc9e2d51; + k1 = Integer.rotateLeft((int)k1, 15); + k1 *= 0x1b873593; + k1 &= 0xFFFFFFFFL; + h1 ^= k1; + h1 &= 0xFFFFFFFFL; + } + } + + // finalization + h1 ^= len; + + // finalization mix force all bits of a hash block to avalanche + h1 ^= h1 >> 16; + h1 *= 0x85ebca6b; + h1 &= 0xFFFFFFFFL; + h1 ^= h1 >> 13; + h1 *= 0xc2b2ae35; + h1 &= 0xFFFFFFFFL; + h1 ^= h1 >> 16; + + return h1 & 0xFFFFFFFFL; + } +} diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java index 46d087332ac..e2231b53ecb 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/memory/SymbolTable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. * 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,14 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { Type type = db.lookupType("SymbolTable"); theTableField = type.getAddressField("_the_table"); sharedTableField = type.getAddressField("_shared_table"); + type = db.lookupType("RehashableSymbolHashtable"); + seedField = type.getCIntegerField("_seed"); } // Fields private static AddressField theTableField; private static AddressField sharedTableField; + private static CIntegerField seedField; private CompactHashTable sharedTable; @@ -62,6 +65,17 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { return table; } + public static long getSeed() { + return (long) seedField.getValue(); + } + + public static boolean useAlternateHashcode() { + if (getSeed() != 0) { + return true; + } + return false; + } + public SymbolTable(Address addr) { super(addr); } @@ -86,11 +100,17 @@ public class SymbolTable extends sun.jvm.hotspot.utilities.Hashtable { public Symbol probe(byte[] name) { long hashValue = hashSymbol(name); + // shared table does not use alternate hashing algorithm, + // it always uses the same original hash code. Symbol s = sharedTable.probe(name, hashValue); if (s != null) { return s; } + if (useAlternateHashcode()) { + hashValue = AltHashing.murmur3_32(getSeed(), name); + } + for (HashtableEntry e = (HashtableEntry) bucket(hashToIndex(hashValue)); e != null; e = (HashtableEntry) e.next()) { if (e.hash() == hashValue) { Symbol sym = Symbol.create(e.literalValue()); diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java index 643109bc1e9..09a382f9439 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/tools/HeapSummary.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +150,7 @@ public class HeapSummary extends Tool { // Helper methods private void printGCAlgorithm(Map flagMap) { - // print about new generation - long l = getFlagValue("UseParNewGC", flagMap); - if (l == 1L) { - System.out.println("using parallel threads in the new generation."); - } - - l = getFlagValue("UseTLAB", flagMap); + long l = getFlagValue("UseTLAB", flagMap); if (l == 1L) { System.out.println("using thread-local object allocation."); } diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java index 5dbf8984158..eb3aad9495a 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/AbstractHeapGraphWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -114,6 +114,8 @@ public abstract class AbstractHeapGraphWriter implements HeapGraphWriter { } }); + writeHeapRecordPrologue(); + // write JavaThreads writeJavaThreads(); diff --git a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java index 9da43745388..5d23da01d51 100644 --- a/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java +++ b/hotspot/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +45,8 @@ import sun.jvm.hotspot.classfile.*; * WARNING: This format is still under development, and is subject to * change without notice. * - * header "JAVA PROFILE 1.0.1" or "JAVA PROFILE 1.0.2" (0-terminated) - * u4 size of identifiers. Identifiers are used to represent + * header "JAVA PROFILE 1.0.2" (0-terminated) + * u4 size of identifiers. Identifiers are used to represent * UTF8 strings, objects, stack traces, etc. They usually * have the same size as host pointers. For example, on * Solaris and Win32, the size is 4. @@ -294,10 +294,9 @@ import sun.jvm.hotspot.classfile.*; * u2 stack trace depth * * - * When the header is "JAVA PROFILE 1.0.2" a heap dump can optionally - * be generated as a sequence of heap dump segments. This sequence is - * terminated by an end record. The additional tags allowed by format - * "JAVA PROFILE 1.0.2" are: + * A heap dump can optionally be generated as a sequence of heap dump + * segments. This sequence is terminated by an end record. The additional + * tags allowed by format "JAVA PROFILE 1.0.2" are: * * HPROF_HEAP_DUMP_SEGMENT denote a heap dump segment * @@ -310,8 +309,6 @@ import sun.jvm.hotspot.classfile.*; public class HeapHprofBinWriter extends AbstractHeapGraphWriter { - // The heap size threshold used to determine if segmented format - // ("JAVA PROFILE 1.0.2") should be used. private static final long HPROF_SEGMENTED_HEAP_DUMP_THRESHOLD = 2L * 0x40000000; // The approximate size of a heap segment. Used to calculate when to create @@ -319,7 +316,6 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private static final long HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE = 1L * 0x40000000; // hprof binary file header - private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1"; private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2"; // constants in enum HprofTag @@ -380,6 +376,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private static final int JVM_SIGNATURE_ARRAY = '['; private static final int JVM_SIGNATURE_CLASS = 'L'; + private static final long MAX_U4_VALUE = 0xFFFFFFFFL; int serialNum = 1; public synchronized void write(String fileName) throws IOException { @@ -469,7 +466,6 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { // length later - hprof format requires length. out.flush(); currentSegmentStart = fos.getChannel().position(); - // write dummy length of 0 and we'll fix it later. out.writeInt(0); } @@ -479,7 +475,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { protected void writeHeapRecordEpilogue() throws IOException { if (useSegmentedHeapDump) { out.flush(); - if ((fos.getChannel().position() - currentSegmentStart - 4) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) { + if ((fos.getChannel().position() - currentSegmentStart - 4L) >= HPROF_SEGMENTED_HEAP_DUMP_SEGMENT_SIZE) { fillInHeapRecordLength(); currentSegmentStart = 0; } @@ -488,14 +484,14 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { private void fillInHeapRecordLength() throws IOException { - // now get current position to calculate length + // now get the current position to calculate length long dumpEnd = fos.getChannel().position(); - // calculate length of heap data + // calculate the length of heap data long dumpLenLong = (dumpEnd - currentSegmentStart - 4L); // Check length boundary, overflow could happen but is _very_ unlikely - if(dumpLenLong >= (4L * 0x40000000)){ + if (dumpLenLong >= (4L * 0x40000000)) { throw new RuntimeException("Heap segment size overflow."); } @@ -517,6 +513,71 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { fos.getChannel().position(currentPosition); } + // get the size in bytes for the requested type + private long getSizeForType(int type) throws IOException { + switch (type) { + case TypeArrayKlass.T_BOOLEAN: + return BOOLEAN_SIZE; + case TypeArrayKlass.T_INT: + return INT_SIZE; + case TypeArrayKlass.T_CHAR: + return CHAR_SIZE; + case TypeArrayKlass.T_SHORT: + return SHORT_SIZE; + case TypeArrayKlass.T_BYTE: + return BYTE_SIZE; + case TypeArrayKlass.T_LONG: + return LONG_SIZE; + case TypeArrayKlass.T_FLOAT: + return FLOAT_SIZE; + case TypeArrayKlass.T_DOUBLE: + return DOUBLE_SIZE; + default: + throw new RuntimeException( + "Should not reach here: Unknown type: " + type); + } + } + + private int getArrayHeaderSize(boolean isObjectAarray) { + return isObjectAarray? + ((int) BYTE_SIZE + 2 * (int) INT_SIZE + 2 * (int) OBJ_ID_SIZE): + (2 * (int) BYTE_SIZE + 2 * (int) INT_SIZE + (int) OBJ_ID_SIZE); + } + + // Check if we need to truncate an array + private int calculateArrayMaxLength(long originalArrayLength, + int headerSize, + long typeSize, + String typeName) throws IOException { + + long length = originalArrayLength; + + // now get the current position to calculate length + long dumpEnd = fos.getChannel().position(); + long originalLengthInBytes = originalArrayLength * typeSize; + + // calculate the length of heap data + long currentRecordLength = (dumpEnd - currentSegmentStart - 4L); + if (currentRecordLength > 0 && + (currentRecordLength + headerSize + originalLengthInBytes) > MAX_U4_VALUE) { + fillInHeapRecordLength(); + currentSegmentStart = 0; + writeHeapRecordPrologue(); + currentRecordLength = 0; + } + + // Calculate the max bytes we can use. + long maxBytes = (MAX_U4_VALUE - (headerSize + currentRecordLength)); + + if (originalLengthInBytes > maxBytes) { + length = maxBytes/typeSize; + System.err.println("WARNING: Cannot dump array of type " + typeName + + " with length " + originalArrayLength + + "; truncating to length " + length); + } + return (int) length; + } + private void writeClassDumpRecords() throws IOException { SystemDictionary sysDict = VM.getVM().getSystemDictionary(); ClassLoaderDataGraph cldGraph = VM.getVM().getClassLoaderDataGraph(); @@ -694,12 +755,16 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { } protected void writeObjectArray(ObjArray array) throws IOException { + int headerSize = getArrayHeaderSize(true); + final int length = calculateArrayMaxLength(array.getLength(), + headerSize, + OBJ_ID_SIZE, + "Object"); out.writeByte((byte) HPROF_GC_OBJ_ARRAY_DUMP); writeObjectID(array); out.writeInt(DUMMY_STACK_TRACE_ID); - out.writeInt((int) array.getLength()); + out.writeInt(length); writeObjectID(array.getKlass().getJavaMirror()); - final int length = (int) array.getLength(); for (int index = 0; index < length; index++) { OopHandle handle = array.getOopHandleAt(index); writeObjectID(getAddressValue(handle)); @@ -707,101 +772,101 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { } protected void writePrimitiveArray(TypeArray array) throws IOException { + int headerSize = getArrayHeaderSize(false); + TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); + final int type = (int) tak.getElementType(); + final String typeName = tak.getElementTypeName(); + final long typeSize = getSizeForType(type); + final int length = calculateArrayMaxLength(array.getLength(), + headerSize, + typeSize, + typeName); out.writeByte((byte) HPROF_GC_PRIM_ARRAY_DUMP); writeObjectID(array); out.writeInt(DUMMY_STACK_TRACE_ID); - out.writeInt((int) array.getLength()); - TypeArrayKlass tak = (TypeArrayKlass) array.getKlass(); - final int type = (int) tak.getElementType(); + out.writeInt(length); out.writeByte((byte) type); switch (type) { case TypeArrayKlass.T_BOOLEAN: - writeBooleanArray(array); + writeBooleanArray(array, length); break; case TypeArrayKlass.T_CHAR: - writeCharArray(array); + writeCharArray(array, length); break; case TypeArrayKlass.T_FLOAT: - writeFloatArray(array); + writeFloatArray(array, length); break; case TypeArrayKlass.T_DOUBLE: - writeDoubleArray(array); + writeDoubleArray(array, length); break; case TypeArrayKlass.T_BYTE: - writeByteArray(array); + writeByteArray(array, length); break; case TypeArrayKlass.T_SHORT: - writeShortArray(array); + writeShortArray(array, length); break; case TypeArrayKlass.T_INT: - writeIntArray(array); + writeIntArray(array, length); break; case TypeArrayKlass.T_LONG: - writeLongArray(array); + writeLongArray(array, length); break; default: - throw new RuntimeException("should not reach here"); + throw new RuntimeException( + "Should not reach here: Unknown type: " + type); } } - private void writeBooleanArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeBooleanArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = BOOLEAN_BASE_OFFSET + index * BOOLEAN_SIZE; out.writeBoolean(array.getHandle().getJBooleanAt(offset)); } } - private void writeByteArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeByteArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = BYTE_BASE_OFFSET + index * BYTE_SIZE; out.writeByte(array.getHandle().getJByteAt(offset)); } } - private void writeShortArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeShortArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = SHORT_BASE_OFFSET + index * SHORT_SIZE; out.writeShort(array.getHandle().getJShortAt(offset)); } } - private void writeIntArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeIntArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = INT_BASE_OFFSET + index * INT_SIZE; out.writeInt(array.getHandle().getJIntAt(offset)); } } - private void writeLongArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeLongArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = LONG_BASE_OFFSET + index * LONG_SIZE; out.writeLong(array.getHandle().getJLongAt(offset)); } } - private void writeCharArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeCharArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = CHAR_BASE_OFFSET + index * CHAR_SIZE; out.writeChar(array.getHandle().getJCharAt(offset)); } } - private void writeFloatArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeFloatArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = FLOAT_BASE_OFFSET + index * FLOAT_SIZE; out.writeFloat(array.getHandle().getJFloatAt(offset)); } } - private void writeDoubleArray(TypeArray array) throws IOException { - final int length = (int) array.getLength(); + private void writeDoubleArray(TypeArray array, int length) throws IOException { for (int index = 0; index < length; index++) { long offset = DOUBLE_BASE_OFFSET + index * DOUBLE_SIZE; out.writeDouble(array.getHandle().getJDoubleAt(offset)); @@ -996,12 +1061,7 @@ public class HeapHprofBinWriter extends AbstractHeapGraphWriter { // writes hprof binary file header private void writeFileHeader() throws IOException { // version string - if(useSegmentedHeapDump) { - out.writeBytes(HPROF_HEADER_1_0_2); - } - else { - out.writeBytes(HPROF_HEADER_1_0_1); - } + out.writeBytes(HPROF_HEADER_1_0_2); out.writeByte((byte)'\0'); // write identifier size. we use pointers as identifiers. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/overview.html b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/overview.html similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/overview.html rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/overview.html diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Architecture.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BailoutException.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodeFrame.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/BytecodePosition.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CallingConvention.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeCacheProvider.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequest.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompilationRequestResult.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CompiledCode.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/DebugInfo.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InstalledCode.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/InvalidInstalledCodeException.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Location.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/MemoryBarriers.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ReferenceMap.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/Register.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterAttributes.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterSaveLayout.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterValue.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackLockValue.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/StackSlot.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/SuppressFBWarnings.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/TargetDescription.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueKindFactory.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/ValueUtil.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/VirtualObject.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/package-info.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Call.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ConstantReference.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataPatch.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/DataSectionReference.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/ExceptionHandler.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Infopoint.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/InfopointReason.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Mark.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Reference.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/site/Site.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrame.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/InspectedFrameVisitor.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/stack/StackIntrospection.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/JVMCIError.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/SuppressFBWarnings.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotVMConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotRegisterConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotVMConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotRegisterConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotVMConfig.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java similarity index 97% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java index e0b5acb426f..a5c0c7c3b62 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java @@ -278,8 +278,10 @@ final class CompilerToVM { * {@code info} are: * *
    -     *     [(int) flags,   // only valid if field is resolved
    -     *      (int) offset]  // only valid if field is resolved
    +     *     [ flags,  // fieldDescriptor::access_flags()
    +     *       offset, // fieldDescriptor::offset()
    +     *       index   // fieldDescriptor::index()
    +     *     ]
          * 
    * * The behavior of this method is undefined if {@code cpi} does not denote a @@ -288,7 +290,7 @@ final class CompilerToVM { * @param info an array in which the details of the field are returned * @return the type defining the field if resolution is successful, 0 otherwise */ - native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, HotSpotResolvedJavaMethodImpl method, byte opcode, long[] info); + native HotSpotResolvedObjectTypeImpl resolveFieldInPool(HotSpotConstantPool constantPool, int cpi, HotSpotResolvedJavaMethodImpl method, byte opcode, int[] info); /** * Converts {@code cpci} from an index into the cache for {@code constantPool} to an index @@ -631,4 +633,15 @@ final class CompilerToVM { * {@code lambdaForm} (which must be a {@code java.lang.invoke.LambdaForm} instance). */ native void compileToBytecode(Object lambdaForm); + + /** + * Gets the value of the VM flag named {@code name}. + * + * @param name name of a VM option + * @return {@code this} if the named VM option doesn't exist, a {@link String} or {@code null} + * if its type is {@code ccstr} or {@code ccstrlist}, a {@link Double} if its type is + * {@code double}, a {@link Boolean} if its type is {@code bool} otherwise a + * {@link Long} + */ + native Object getFlagValue(String name); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java similarity index 98% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java index 0f46e5e4a07..2aa77349734 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EventProvider.java @@ -24,7 +24,6 @@ package jdk.vm.ci.hotspot; import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilationEvent; import jdk.vm.ci.hotspot.EmptyEventProvider.EmptyCompilerFailureEvent; -import jdk.vm.ci.services.JVMCIPermission; /** * Service-provider class for logging compiler related events. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCallingConventionType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java similarity index 99% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java index f5489fb18c5..b77ed14ca8e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java @@ -76,7 +76,7 @@ public class HotSpotCodeCacheProvider implements CodeCacheProvider { HotSpotVMConfigStore store = runtime.getConfigStore(); for (Map.Entry e : store.getFields().entrySet()) { VMField field = e.getValue(); - if (field.isStatic() && field.value != null && field.value == address) { + if (field.isStatic() && field.value != null && field.value instanceof Long && ((Long) field.value) == address) { return e.getValue() + ":0x" + Long.toHexString(address); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequest.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledCode.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompiledNmethod.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstant.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java similarity index 98% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java index 957f66516b9..d88a8468e73 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java @@ -298,7 +298,7 @@ final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject * @param index constant pool index * @return constant pool entry */ - private long getEntryAt(int index) { + long getEntryAt(int index) { assert checkBounds(index); int offset = index * runtime().getHostJVMCIBackend().getTarget().wordSize; return UNSAFE.getAddress(getMetaspaceConstantPool() + config().constantPoolSize + offset); @@ -605,8 +605,6 @@ final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject public JavaField lookupField(int cpi, ResolvedJavaMethod method, int opcode) { final int index = rawIndexToConstantPoolIndex(cpi, opcode); final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index); - final int nameIndex = getNameRefIndexAt(nameAndTypeIndex); - String name = lookupUtf8(nameIndex); final int typeIndex = getSignatureRefIndexAt(nameAndTypeIndex); String typeName = lookupUtf8(typeIndex); JavaType type = runtime().lookupType(typeName, getHolder(), false); @@ -615,7 +613,7 @@ final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject JavaType holder = lookupType(holderIndex, opcode); if (holder instanceof HotSpotResolvedObjectTypeImpl) { - long[] info = new long[2]; + int[] info = new int[3]; HotSpotResolvedObjectTypeImpl resolvedHolder; try { resolvedHolder = compilerToVM().resolveFieldInPool(this, index, (HotSpotResolvedJavaMethodImpl) method, (byte) opcode, info); @@ -624,14 +622,15 @@ final class HotSpotConstantPool implements ConstantPool, MetaspaceWrapperObject * If there was an exception resolving the field we give up and return an unresolved * field. */ - return new HotSpotUnresolvedField(holder, name, type); + return new HotSpotUnresolvedField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type); } - final int flags = (int) info[0]; - final long offset = info[1]; - HotSpotResolvedJavaField result = resolvedHolder.createField(name, type, offset, flags); + final int flags = info[0]; + final int offset = info[1]; + final int fieldIndex = info[2]; + HotSpotResolvedJavaField result = resolvedHolder.createField(type, offset, flags, fieldIndex); return result; } else { - return new HotSpotUnresolvedField(holder, name, type); + return new HotSpotUnresolvedField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type); } } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java similarity index 94% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java index e74027f2dd1..1256cf02584 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java @@ -179,11 +179,14 @@ public class HotSpotConstantReflectionProvider implements ConstantReflectionProv if (hotspotField.isStatic()) { HotSpotResolvedJavaType holder = (HotSpotResolvedJavaType) hotspotField.getDeclaringClass(); if (holder.isInitialized()) { - return memoryAccess.readUnsafeConstant(hotspotField.getJavaKind(), HotSpotObjectConstantImpl.forObject(holder.mirror()), hotspotField.offset()); + return memoryAccess.readFieldValue(hotspotField, holder.mirror()); } } else { - if (receiver.isNonNull() && hotspotField.isInObject(((HotSpotObjectConstantImpl) receiver).object())) { - return memoryAccess.readUnsafeConstant(hotspotField.getJavaKind(), receiver, hotspotField.offset()); + if (receiver.isNonNull()) { + Object object = ((HotSpotObjectConstantImpl) receiver).object(); + if (hotspotField.isInObject(object)) { + return memoryAccess.readFieldValue(hotspotField, object); + } } } return null; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotForeignCallTarget.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotInstalledCode.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java similarity index 83% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java index 366fe5f25a9..3f04f6ec2fe 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java @@ -28,9 +28,9 @@ import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; import jdk.vm.ci.runtime.JVMCIRuntime; -import jdk.vm.ci.services.JVMCIServiceLocator; import jdk.vm.ci.services.JVMCIPermission; -import jdk.vm.ci.services.Services; +import jdk.vm.ci.services.JVMCIServiceLocator; +import jdk.vm.ci.services.internal.ReflectionAccessJDK; final class HotSpotJVMCICompilerConfig { @@ -47,7 +47,7 @@ final class HotSpotJVMCICompilerConfig { @Override public String getCompilerName() { - return ""; + return "null"; } @Override @@ -73,19 +73,23 @@ final class HotSpotJVMCICompilerConfig { JVMCICompilerFactory factory = null; String compilerName = Option.Compiler.getString(); if (compilerName != null) { - for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) { - if (f.getCompilerName().equals(compilerName)) { - factory = f; + if (compilerName.isEmpty() || compilerName.equals("null")) { + factory = new DummyCompilerFactory(); + } else { + for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) { + if (f.getCompilerName().equals(compilerName)) { + factory = f; + } + } + if (factory == null) { + throw new JVMCIError("JVMCI compiler '%s' not found", compilerName); } - } - if (factory == null) { - throw new JVMCIError("JVMCI compiler '%s' not found", compilerName); } } else { // Auto select a single available compiler for (JVMCICompilerFactory f : JVMCIServiceLocator.getProviders(JVMCICompilerFactory.class)) { if (factory == null) { - Services.exportJVMCITo(f.getClass()); + ReflectionAccessJDK.openJVMCITo(f.getClass()); factory = f; } else { // Multiple factories seen - cancel auto selection diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java similarity index 88% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java index 529a561eb5e..cf5ef10ccf2 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java @@ -27,8 +27,6 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.util.Arrays; import java.util.Iterator; -import java.util.Map; -import java.util.WeakHashMap; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; @@ -147,21 +145,34 @@ public class HotSpotJVMCIMetaAccessContext { } } - private final Map, WeakReference> typeMap = new WeakHashMap<>(); + private final ClassValue> resolvedJavaType = new ClassValue>() { + @Override + protected WeakReference computeValue(Class type) { + return new WeakReference<>(createClass(type)); + } + }; /** * Gets the JVMCI mirror for a {@link Class} object. * * @return the {@link ResolvedJavaType} corresponding to {@code javaClass} */ - public synchronized ResolvedJavaType fromClass(Class javaClass) { - WeakReference typeRef = typeMap.get(javaClass); - ResolvedJavaType type = typeRef != null ? typeRef.get() : null; - if (type == null) { - type = createClass(javaClass); - typeMap.put(javaClass, new WeakReference<>(type)); + public ResolvedJavaType fromClass(Class javaClass) { + ResolvedJavaType javaType = null; + while (javaType == null) { + WeakReference type = resolvedJavaType.get(javaClass); + javaType = type.get(); + if (javaType == null) { + /* + * If the referent has become null, clear out the current value + * and let computeValue above create a new value. Reload the + * value in a loop because in theory the WeakReference referent + * can be reclaimed at any point. + */ + resolvedJavaType.remove(javaClass); + } } - return type; + return javaType; } /** diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java similarity index 96% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java index f6c97ecb07f..ab7dba465cc 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java @@ -32,6 +32,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.ServiceLoader; import java.util.TreeMap; import jdk.internal.misc.VM; @@ -50,7 +51,6 @@ import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; import jdk.vm.ci.services.JVMCIServiceLocator; -import jdk.vm.ci.services.Services; /** * HotSpot implementation of a JVMCI runtime. @@ -88,7 +88,10 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider { */ public enum Option { // @formatter:off - Compiler(String.class, null, "Selects the system compiler."), + Compiler(String.class, null, "Selects the system compiler. This must match the getCompilerName() value returned " + + "by a jdk.vm.ci.runtime.JVMCICompilerFactory provider. " + + "An empty string or the value \"null\" selects a compiler " + + "that will raise an exception upon receiving a compilation request."), // Note: The following one is not used (see InitTimer.ENABLED). It is added here // so that -XX:+JVMCIPrintProperties shows the option. InitTimer(Boolean.class, false, "Specifies if initialization timing is enabled."), @@ -208,7 +211,7 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider { } public static HotSpotJVMCIBackendFactory findFactory(String architecture) { - for (HotSpotJVMCIBackendFactory factory : Services.load(HotSpotJVMCIBackendFactory.class)) { + for (HotSpotJVMCIBackendFactory factory : ServiceLoader.load(HotSpotJVMCIBackendFactory.class, ClassLoader.getSystemClassLoader())) { if (factory.getArchitecture().equalsIgnoreCase(architecture)) { return factory; } @@ -497,7 +500,7 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider { if (!field.isStatic()) { printConfigLine(vm, "[vmconfig:instance field] %s %s {offset=%d[0x%x]}%n", field.type, field.name, field.offset, field.offset); } else { - String value = field.value == null ? "null" : String.format("%d[0x%x]", field.value, field.value); + String value = field.value == null ? "null" : field.value instanceof Boolean ? field.value.toString() : String.format("%d[0x%x]", field.value, field.value); printConfigLine(vm, "[vmconfig:static field] %s %s = %s {address=0x%x}%n", field.type, field.name, value, field.address); } } @@ -513,10 +516,6 @@ public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider { for (Map.Entry e : constants.entrySet()) { printConfigLine(vm, "[vmconfig:constant] %s = %d[0x%x]%n", e.getKey(), e.getValue(), e.getValue()); } - TreeMap typeSizes = new TreeMap<>(store.getTypeSizes()); - for (Map.Entry e : typeSizes.entrySet()) { - printConfigLine(vm, "[vmconfig:type size] %s = %d%n", e.getKey(), e.getValue()); - } for (VMIntrinsicMethod e : store.getIntrinsics()) { printConfigLine(vm, "[vmconfig:intrinsic] %d = %s.%s %s%n", e.id, e.declaringClass, e.name, e.descriptor); } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJavaType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java similarity index 89% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java index a4d68b56f19..15250e2c7d1 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProvider.java @@ -31,6 +31,10 @@ import jdk.vm.ci.meta.MemoryAccessProvider; */ public interface HotSpotMemoryAccessProvider extends MemoryAccessProvider { + /** + * @throws IllegalArgumentException if the address computed from {@code base} and + * {@code displacement} does not denote a location holding a narrow oop + */ JavaConstant readNarrowOopConstant(Constant base, long displacement); Constant readKlassPointerConstant(Constant base, long displacement); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java similarity index 55% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java index be8e3a32067..e3ad9c834c2 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java @@ -22,13 +22,21 @@ */ package jdk.vm.ci.hotspot; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; +import java.lang.reflect.Array; + +import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MemoryAccessProvider; +import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PrimitiveConstant; +import jdk.vm.ci.meta.ResolvedJavaField; +import jdk.vm.ci.meta.ResolvedJavaType; /** * HotSpot implementation of {@link MemoryAccessProvider}. @@ -41,12 +49,93 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { this.runtime = runtime; } - private static Object asObject(Constant base) { + /** + * Gets the object boxed by {@code base} that is about to have a value of kind {@code kind} read + * from it at the offset {@code displacement}. + * + * @param base constant value containing the base address for a pending read + * @return {@code null} if {@code base} does not box an object otherwise the object boxed in + * {@code base} + */ + private Object asObject(Constant base, JavaKind kind, long displacement) { if (base instanceof HotSpotObjectConstantImpl) { - return ((HotSpotObjectConstantImpl) base).object(); - } else { - return null; + HotSpotObjectConstantImpl constant = (HotSpotObjectConstantImpl) base; + HotSpotResolvedObjectType type = constant.getType(); + Object object = constant.object(); + checkRead(kind, displacement, type, object); + return object; } + return null; + } + + /** + * Offset of injected {@code java.lang.Class::oop_size} field. No need to make {@code volatile} + * as initialization is idempotent. + */ + private long oopSizeOffset; + + private static int computeOopSizeOffset(HotSpotJVMCIRuntimeProvider runtime) { + MetaAccessProvider metaAccess = runtime.getHostJVMCIBackend().getMetaAccess(); + ResolvedJavaType staticType = metaAccess.lookupJavaType(Class.class); + for (ResolvedJavaField f : staticType.getInstanceFields(false)) { + if (f.getName().equals("oop_size")) { + int offset = ((HotSpotResolvedJavaField) f).offset(); + assert offset != 0 : "not expecting offset of java.lang.Class::oop_size to be 0"; + return offset; + } + } + throw new JVMCIError("Could not find injected java.lang.Class::oop_size field"); + } + + private boolean checkRead(JavaKind kind, long displacement, HotSpotResolvedObjectType type, Object object) { + if (type.isArray()) { + ResolvedJavaType componentType = type.getComponentType(); + JavaKind componentKind = componentType.getJavaKind(); + final int headerSize = getArrayBaseOffset(componentKind); + int sizeOfElement = getArrayIndexScale(componentKind); + int length = Array.getLength(object); + long arrayEnd = headerSize + (sizeOfElement * length); + boolean aligned = ((displacement - headerSize) % sizeOfElement) == 0; + if (displacement < 0 || displacement > (arrayEnd - sizeOfElement) || (kind == JavaKind.Object && !aligned)) { + int index = (int) ((displacement - headerSize) / sizeOfElement); + throw new IllegalArgumentException("Unsafe array access: reading element of kind " + kind + + " at offset " + displacement + " (index ~ " + index + ") in " + + type.toJavaName() + " object of length " + length); + } + } else if (kind != JavaKind.Object) { + long size; + if (object instanceof Class) { + if (oopSizeOffset == 0) { + oopSizeOffset = computeOopSizeOffset(runtime); + } + int wordSize = runtime.getHostJVMCIBackend().getCodeCache().getTarget().wordSize; + size = UNSAFE.getInt(object, oopSizeOffset) * wordSize; + } else { + size = Math.abs(type.instanceSize()); + } + int bytesToRead = kind.getByteCount(); + if (displacement + bytesToRead > size || displacement < 0) { + throw new IllegalArgumentException("Unsafe access: reading " + bytesToRead + " bytes at offset " + displacement + " in " + + type.toJavaName() + " object of size " + size); + } + } else { + ResolvedJavaField field = type.findInstanceFieldWithOffset(displacement, JavaKind.Object); + if (field == null && object instanceof Class) { + // Read of a static field + MetaAccessProvider metaAccess = runtime.getHostJVMCIBackend().getMetaAccess(); + HotSpotResolvedObjectTypeImpl staticFieldsHolder = (HotSpotResolvedObjectTypeImpl) metaAccess.lookupJavaType((Class) object); + field = staticFieldsHolder.findStaticFieldWithOffset(displacement, JavaKind.Object); + } + if (field == null) { + throw new IllegalArgumentException("Unsafe object access: field not found for read of kind Object" + + " at offset " + displacement + " in " + type.toJavaName() + " object"); + } + if (field.getJavaKind() != JavaKind.Object) { + throw new IllegalArgumentException("Unsafe object access: field " + field.format("%H.%n:%T") + " not of expected kind Object" + + " at offset " + displacement + " in " + type.toJavaName() + " object"); + } + } + return true; } private boolean isValidObjectFieldDisplacement(Constant base, long displacement) { @@ -77,8 +166,8 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { throw new IllegalArgumentException(String.valueOf(base)); } - private static long readRawValue(Constant baseConstant, long displacement, int bits) { - Object base = asObject(baseConstant); + private long readRawValue(Constant baseConstant, long displacement, JavaKind kind, int bits) { + Object base = asObject(baseConstant, kind, displacement); if (base != null) { switch (bits) { case Byte.SIZE: @@ -123,9 +212,8 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { private Object readRawObject(Constant baseConstant, long initialDisplacement, boolean compressed) { long displacement = initialDisplacement; - Object ret; - Object base = asObject(baseConstant); + Object base = asObject(baseConstant, JavaKind.Object, displacement); if (base == null) { assert !compressed; displacement += asRawPointer(baseConstant); @@ -138,34 +226,43 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { return ret; } - /** - * Reads a value of this kind using a base address and a displacement. No bounds checking or - * type checking is performed. Returns {@code null} if the value is not available at this point. - * - * @param baseConstant the base address from which the value is read. - * @param displacement the displacement within the object in bytes - * @return the read value encapsulated in a {@link JavaConstant} object, or {@code null} if the - * value cannot be read. - * @throws IllegalArgumentException if {@code kind} is {@code null}, {@link JavaKind#Void}, not - * {@link JavaKind#Object} or not {@linkplain JavaKind#isPrimitive() primitive} kind - */ - JavaConstant readUnsafeConstant(JavaKind kind, JavaConstant baseConstant, long displacement) { - if (kind == null) { - throw new IllegalArgumentException("null JavaKind"); - } - if (kind == JavaKind.Object) { - Object o = readRawObject(baseConstant, displacement, runtime.getConfig().useCompressedOops); + JavaConstant readFieldValue(HotSpotResolvedJavaField field, Object obj) { + assert obj != null; + assert !field.isStatic() || obj instanceof Class; + long displacement = field.offset(); + assert checkRead(field.getJavaKind(), displacement, (HotSpotResolvedObjectType) runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(obj.getClass()), obj); + if (field.getJavaKind() == JavaKind.Object) { + Object o = UNSAFE.getObject(obj, displacement); return HotSpotObjectConstantImpl.forObject(o); } else { - int bits = kind.getByteCount() * Byte.SIZE; - return readPrimitiveConstant(kind, baseConstant, displacement, bits); + JavaKind kind = field.getJavaKind(); + switch (kind) { + case Boolean: + return JavaConstant.forBoolean(UNSAFE.getBoolean(obj, displacement)); + case Byte: + return JavaConstant.forByte(UNSAFE.getByte(obj, displacement)); + case Char: + return JavaConstant.forChar(UNSAFE.getChar(obj, displacement)); + case Short: + return JavaConstant.forShort(UNSAFE.getShort(obj, displacement)); + case Int: + return JavaConstant.forInt(UNSAFE.getInt(obj, displacement)); + case Long: + return JavaConstant.forLong(UNSAFE.getLong(obj, displacement)); + case Float: + return JavaConstant.forFloat(UNSAFE.getFloat(obj, displacement)); + case Double: + return JavaConstant.forDouble(UNSAFE.getDouble(obj, displacement)); + default: + throw new IllegalArgumentException("Unsupported kind: " + kind); + } } } @Override public JavaConstant readPrimitiveConstant(JavaKind kind, Constant baseConstant, long initialDisplacement, int bits) { try { - long rawValue = readRawValue(baseConstant, initialDisplacement, bits); + long rawValue = readRawValue(baseConstant, initialDisplacement, kind, bits); switch (kind) { case Boolean: return JavaConstant.forBoolean(rawValue != 0); @@ -193,6 +290,10 @@ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { @Override public JavaConstant readObjectConstant(Constant base, long displacement) { + if (base instanceof HotSpotObjectConstantImpl) { + Object o = readRawObject(base, displacement, runtime.getConfig().useCompressedOops); + return HotSpotObjectConstantImpl.forObject(o); + } if (!isValidObjectFieldDisplacement(base, displacement)) { return null; } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaData.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstant.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java similarity index 94% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java index da04107bc1a..aca3b3ddb4d 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java @@ -59,23 +59,12 @@ abstract class HotSpotMethod implements JavaMethod, Formattable { return res; } - protected String name; - /** * Controls whether {@link #toString()} includes the qualified or simple name of the class in * which the method is declared. */ public static final boolean FULLY_QUALIFIED_METHOD_NAME = false; - protected HotSpotMethod(String name) { - this.name = name; - } - - @Override - public final String getName() { - return name; - } - @Override public final String toString() { char h = FULLY_QUALIFIED_METHOD_NAME ? 'H' : 'h'; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodData.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodDataAccessor.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java similarity index 94% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java index e68c7fef8c1..7eb437929c3 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java @@ -31,15 +31,21 @@ import jdk.vm.ci.meta.Signature; */ final class HotSpotMethodUnresolved extends HotSpotMethod { + private final String name; private final Signature signature; protected JavaType holder; HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) { - super(name); + this.name = name; this.holder = holder; this.signature = signature; } + @Override + public String getName() { + return name; + } + @Override public Signature getSignature() { return signature; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotModifiers.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotNmethod.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotProfilingInfo.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotReferenceMap.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java similarity index 91% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java index 24287261984..737135a8e52 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * 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,19 +38,20 @@ import jdk.vm.ci.meta.ResolvedJavaType; class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField { private final HotSpotResolvedObjectTypeImpl holder; - private final String name; private JavaType type; private final int offset; + private final short index; /** * This value contains all flags as stored in the VM including internal ones. */ private final int modifiers; - HotSpotResolvedJavaFieldImpl(HotSpotResolvedObjectTypeImpl holder, String name, JavaType type, long offset, int modifiers) { + HotSpotResolvedJavaFieldImpl(HotSpotResolvedObjectTypeImpl holder, JavaType type, long offset, int modifiers, int index) { this.holder = holder; - this.name = name; this.type = type; + this.index = (short) index; + assert this.index == index; assert offset != -1; assert offset == (int) offset : "offset larger than int"; this.offset = (int) offset; @@ -67,7 +68,6 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField { if (that.offset != this.offset || that.isStatic() != this.isStatic()) { return false; } else if (this.holder.equals(that.holder)) { - assert this.name.equals(that.name) && this.type.equals(that.type); return true; } } @@ -76,7 +76,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField { @Override public int hashCode() { - return name.hashCode(); + return offset ^ modifiers; } @Override @@ -109,7 +109,7 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField { @Override public String getName() { - return name; + return holder.createFieldInfo(index).getName(); } @Override @@ -178,18 +178,12 @@ class HotSpotResolvedJavaFieldImpl implements HotSpotResolvedJavaField { return null; } - private Field toJavaCache; - private Field toJava() { - if (toJavaCache != null) { - return toJavaCache; - } - if (isInternal()) { return null; } try { - return toJavaCache = holder.mirror().getDeclaredField(name); + return holder.mirror().getDeclaredField(getName()); } catch (NoSuchFieldException | NoClassDefFoundError e) { return null; } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java similarity index 95% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java index 393b740a71e..f831db4c5f9 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +75,12 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp private byte[] code; private Executable toJavaCache; + /** + * Only 30% of {@link HotSpotResolvedJavaMethodImpl}s have their name accessed so compute it + * lazily and cache it. + */ + private String nameCache; + /** * Gets the holder of a HotSpot metaspace method native object. * @@ -106,8 +112,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp } HotSpotResolvedJavaMethodImpl(HotSpotResolvedObjectTypeImpl holder, long metaspaceMethod) { - // It would be too much work to get the method name here so we fill it in later. - super(null); this.metaspaceMethod = metaspaceMethod; this.holder = holder; @@ -126,9 +130,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp this.constantPool = compilerToVM().getConstantPool(this); } - final int nameIndex = UNSAFE.getChar(constMethod + config.constMethodNameIndexOffset); - this.name = constantPool.lookupUtf8(nameIndex); - final int signatureIndex = UNSAFE.getChar(constMethod + config.constMethodSignatureIndexOffset); this.signature = (HotSpotSignature) constantPool.lookupSignature(signatureIndex); } @@ -146,6 +147,15 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp return UNSAFE.getAddress(metaspaceMethod + config().methodConstMethodOffset); } + @Override + public String getName() { + if (nameCache == null) { + final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset); + nameCache = constantPool.lookupUtf8(nameIndex); + } + return nameCache; + } + @Override public boolean equals(Object obj) { if (this == obj) { @@ -326,12 +336,24 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp @Override public boolean isClassInitializer() { - return "".equals(name) && isStatic(); + if (isStatic()) { + final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset); + long nameSymbol = constantPool.getEntryAt(nameIndex); + long clinitSymbol = config().symbolClinit; + return nameSymbol == clinitSymbol; + } + return false; } @Override public boolean isConstructor() { - return "".equals(name) && !isStatic(); + if (!isStatic()) { + final int nameIndex = UNSAFE.getChar(getConstMethod() + config().constMethodNameIndexOffset); + long nameSymbol = constantPool.getEntryAt(nameIndex); + long initSymbol = config().symbolInit; + return nameSymbol == initSymbol; + } + return false; } @Override @@ -472,7 +494,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp @Override public Annotation[][] getParameterAnnotations() { Executable javaMethod = toJava(); - return javaMethod == null ? null : javaMethod.getParameterAnnotations(); + return javaMethod == null ? new Annotation[signature.getParameterCount(false)][0] : javaMethod.getParameterAnnotations(); } @Override @@ -513,9 +535,6 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp } public boolean isDefault() { - if (isConstructor()) { - return false; - } // Copied from java.lang.Method.isDefault() int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC; return ((getModifiers() & mask) == Modifier.PUBLIC) && getDeclaringClass().isInterface(); @@ -562,7 +581,7 @@ final class HotSpotResolvedJavaMethodImpl extends HotSpotMethod implements HotSp } else { // Do not use Method.getDeclaredMethod() as it can return a bridge method // when this.isBridge() is false and vice versa. - result = searchMethods(holder.mirror().getDeclaredMethods(), name, returnType, parameterTypes); + result = searchMethods(holder.mirror().getDeclaredMethods(), getName(), returnType, parameterTypes); } toJavaCache = result; return result; diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java similarity index 84% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java index a0a3bc7a7a5..a6d3428cccf 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +36,6 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.nio.ByteOrder; -import java.util.ArrayList; -import java.util.Arrays; import java.util.HashMap; import jdk.vm.ci.common.JVMCIError; @@ -59,12 +57,15 @@ import jdk.vm.ci.meta.ResolvedJavaType; */ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implements HotSpotResolvedObjectType, MetaspaceWrapperObject { + private static final HotSpotResolvedJavaField[] NO_FIELDS = new HotSpotResolvedJavaField[0]; + private static final int METHOD_CACHE_ARRAY_CAPACITY = 8; + /** * The Java class this type represents. */ private final Class javaClass; - private HashMap fieldCache; - private HashMap methodCache; + private HotSpotResolvedJavaMethodImpl[] methodCacheArray; + private HashMap methodCacheHashMap; private HotSpotResolvedJavaField[] instanceFields; private HotSpotResolvedObjectTypeImpl[] interfaces; private HotSpotConstantPool constantPool; @@ -255,7 +256,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem * @return true if the type is a leaf class */ private boolean isLeafClass() { - return getSubklass() == null; + return UNSAFE.getLong(this.getMetaspaceKlass() + config().subklassOffset) == 0; } /** @@ -484,18 +485,38 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem } synchronized HotSpotResolvedJavaMethod createMethod(long metaspaceMethod) { - HotSpotResolvedJavaMethodImpl method = null; - if (methodCache == null) { - methodCache = new HashMap<>(8); + // Maintain cache as array. + if (methodCacheArray == null) { + methodCacheArray = new HotSpotResolvedJavaMethodImpl[METHOD_CACHE_ARRAY_CAPACITY]; + } + + int i = 0; + for (; i < methodCacheArray.length; ++i) { + HotSpotResolvedJavaMethodImpl curMethod = methodCacheArray[i]; + if (curMethod == null) { + HotSpotResolvedJavaMethodImpl newMethod = new HotSpotResolvedJavaMethodImpl(this, metaspaceMethod); + methodCacheArray[i] = newMethod; + context.add(newMethod); + return newMethod; + } else if (curMethod.getMetaspacePointer() == metaspaceMethod) { + return curMethod; + } + } + + // Fall-back to hash table. + if (methodCacheHashMap == null) { + methodCacheHashMap = new HashMap<>(); + } + + HotSpotResolvedJavaMethodImpl lookupResult = methodCacheHashMap.get(metaspaceMethod); + if (lookupResult == null) { + HotSpotResolvedJavaMethodImpl newMethod = new HotSpotResolvedJavaMethodImpl(this, metaspaceMethod); + methodCacheHashMap.put(metaspaceMethod, newMethod); + context.add(lookupResult); + return newMethod; } else { - method = methodCache.get(metaspaceMethod); + return lookupResult; } - if (method == null) { - method = new HotSpotResolvedJavaMethodImpl(this, metaspaceMethod); - methodCache.put(metaspaceMethod, method); - context.add(method); - } - return method; } public int getVtableLength() { @@ -509,37 +530,8 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem return result; } - synchronized HotSpotResolvedJavaField createField(String fieldName, JavaType type, long offset, int rawFlags) { - HotSpotResolvedJavaField result = null; - - final int flags = rawFlags & HotSpotModifiers.jvmFieldModifiers(); - - final long id = offset + ((long) flags << 32); - - // Must cache the fields, because the local load elimination only works if the - // objects from two field lookups are identical. - if (fieldCache == null) { - fieldCache = new HashMap<>(8); - } else { - result = fieldCache.get(id); - } - - if (result == null) { - result = new HotSpotResolvedJavaFieldImpl(this, fieldName, type, offset, rawFlags); - fieldCache.put(id, result); - } else { - assert result.getName().equals(fieldName); - /* - * Comparing the types directly is too strict, because the type in the cache could be - * resolved while the incoming type is unresolved. The name comparison is sufficient - * because the type will always be resolved in the context of the holder. - */ - assert result.getType().getName().equals(type.getName()); - assert result.offset() == offset; - assert result.getModifiers() == flags; - } - - return result; + synchronized HotSpotResolvedJavaField createField(JavaType type, long offset, int rawFlags, int index) { + return new HotSpotResolvedJavaFieldImpl(this, type, offset, rawFlags, index); } @Override @@ -577,11 +569,15 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem return null; } + FieldInfo createFieldInfo(int index) { + return new FieldInfo(index); + } + /** * This class represents the field information for one field contained in the fields array of an * {@code InstanceKlass}. The implementation is similar to the native {@code FieldInfo} class. */ - private class FieldInfo { + class FieldInfo { /** * Native pointer into the array of Java shorts. */ @@ -666,61 +662,31 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem } } - @SuppressFBWarnings(value = "SE_COMPARATOR_SHOULD_BE_SERIALIZABLE", justification = "comparator is only used transiently") - private static class OffsetComparator implements java.util.Comparator { - @Override - public int compare(HotSpotResolvedJavaField o1, HotSpotResolvedJavaField o2) { - return o1.offset() - o2.offset(); - } - } - @Override public ResolvedJavaField[] getInstanceFields(boolean includeSuperclasses) { if (instanceFields == null) { if (isArray() || isInterface()) { - instanceFields = new HotSpotResolvedJavaField[0]; + instanceFields = NO_FIELDS; } else { - final int fieldCount = getFieldCount(); - ArrayList fieldsArray = new ArrayList<>(fieldCount); - - for (int i = 0; i < fieldCount; i++) { - FieldInfo field = new FieldInfo(i); - - // We are only interested in instance fields. - if (!field.isStatic()) { - HotSpotResolvedJavaField resolvedJavaField = createField(field.getName(), field.getType(), field.getOffset(), field.getAccessFlags()); - fieldsArray.add(resolvedJavaField); - } + HotSpotResolvedJavaField[] prepend = NO_FIELDS; + if (getSuperclass() != null) { + prepend = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true); } - - fieldsArray.sort(new OffsetComparator()); - - HotSpotResolvedJavaField[] myFields = fieldsArray.toArray(new HotSpotResolvedJavaField[0]); - - if (mirror() != Object.class) { - HotSpotResolvedJavaField[] superFields = (HotSpotResolvedJavaField[]) getSuperclass().getInstanceFields(true); - HotSpotResolvedJavaField[] fields = Arrays.copyOf(superFields, superFields.length + myFields.length); - System.arraycopy(myFields, 0, fields, superFields.length, myFields.length); - instanceFields = fields; - } else { - assert myFields.length == 0 : "java.lang.Object has fields!"; - instanceFields = myFields; - } - + instanceFields = getFields(false, prepend); } } - if (!includeSuperclasses) { - int myFieldsStart = 0; - while (myFieldsStart < instanceFields.length && !instanceFields[myFieldsStart].getDeclaringClass().equals(this)) { - myFieldsStart++; + if (!includeSuperclasses && getSuperclass() != null) { + int superClassFieldCount = getSuperclass().getInstanceFields(true).length; + if (superClassFieldCount == instanceFields.length) { + // This class does not have any instance fields of its own. + return NO_FIELDS; + } else if (superClassFieldCount != 0) { + HotSpotResolvedJavaField[] result = new HotSpotResolvedJavaField[instanceFields.length - superClassFieldCount]; + System.arraycopy(instanceFields, superClassFieldCount, result, 0, result.length); + return result; + } else { + // The super classes of this class do not have any instance fields. } - if (myFieldsStart == 0) { - return instanceFields; - } - if (myFieldsStart == instanceFields.length) { - return new HotSpotResolvedJavaField[0]; - } - return Arrays.copyOfRange(instanceFields, myFieldsStart, instanceFields.length); } return instanceFields; } @@ -730,45 +696,63 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem if (isArray()) { return new HotSpotResolvedJavaField[0]; } else { - final int fieldCount = getFieldCount(); - ArrayList fieldsArray = new ArrayList<>(fieldCount); - - for (int i = 0; i < fieldCount; i++) { - FieldInfo field = new FieldInfo(i); - - // We are only interested in static fields. - if (field.isStatic()) { - HotSpotResolvedJavaField resolvedJavaField = createField(field.getName(), field.getType(), field.getOffset(), field.getAccessFlags()); - fieldsArray.add(resolvedJavaField); - } - } - - fieldsArray.sort(new OffsetComparator()); - return fieldsArray.toArray(new HotSpotResolvedJavaField[fieldsArray.size()]); + return getFields(true, NO_FIELDS); } } /** - * Returns the actual field count of this class's internal {@code InstanceKlass::_fields} array - * by walking the array and discounting the generic signature slots at the end of the array. + * Gets the instance or static fields of this class. * - *

    - * See {@code FieldStreamBase::init_generic_signature_start_slot} + * @param retrieveStaticFields specifies whether to return instance or static fields + * @param prepend an array to be prepended to the returned result */ - private int getFieldCount() { + private HotSpotResolvedJavaField[] getFields(boolean retrieveStaticFields, HotSpotResolvedJavaField[] prepend) { HotSpotVMConfig config = config(); final long metaspaceFields = UNSAFE.getAddress(getMetaspaceKlass() + config.instanceKlassFieldsOffset); int metaspaceFieldsLength = UNSAFE.getInt(metaspaceFields + config.arrayU1LengthOffset); - int fieldCount = 0; - - for (int i = 0, index = 0; i < metaspaceFieldsLength; i += config.fieldInfoFieldSlots, index++) { + int resultCount = 0; + int index = 0; + for (int i = 0; i < metaspaceFieldsLength; i += config.fieldInfoFieldSlots, index++) { FieldInfo field = new FieldInfo(index); if (field.hasGenericSignature()) { metaspaceFieldsLength--; } - fieldCount++; + + if (field.isStatic() == retrieveStaticFields) { + resultCount++; + } } - return fieldCount; + + if (resultCount == 0) { + return prepend; + } + + int prependLength = prepend.length; + resultCount += prependLength; + + HotSpotResolvedJavaField[] result = new HotSpotResolvedJavaField[resultCount]; + if (prependLength != 0) { + System.arraycopy(prepend, 0, result, 0, prependLength); + } + + int resultIndex = prependLength; + for (int i = 0; i < index; ++i) { + FieldInfo field = new FieldInfo(i); + if (field.isStatic() == retrieveStaticFields) { + int offset = field.getOffset(); + HotSpotResolvedJavaField resolvedJavaField = createField(field.getType(), offset, field.getAccessFlags(), i); + + // Make sure the result is sorted by offset. + int j; + for (j = resultIndex - 1; j >= prependLength && result[j].offset() > offset; j--) { + result[j + 1] = result[j]; + } + result[j + 1] = resolvedJavaField; + resultIndex++; + } + } + + return result; } @Override @@ -817,8 +801,7 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem } if (elementType.getName().startsWith("Ljava/")) { // Classes in a java.* package can only be defined by the - // boot class loader. This is enforced by ClassLoader.preDefineClass() - assert mirror().getClassLoader() == null; + // boot or platform class loader. return true; } ClassLoader thisCl = mirror().getClassLoader(); @@ -863,6 +846,15 @@ final class HotSpotResolvedObjectTypeImpl extends HotSpotResolvedJavaType implem @Override public ResolvedJavaField findInstanceFieldWithOffset(long offset, JavaKind expectedEntryKind) { ResolvedJavaField[] declaredFields = getInstanceFields(true); + return findFieldWithOffset(offset, expectedEntryKind, declaredFields); + } + + public ResolvedJavaField findStaticFieldWithOffset(long offset, JavaKind expectedEntryKind) { + ResolvedJavaField[] declaredFields = getStaticFields(); + return findFieldWithOffset(offset, expectedEntryKind, declaredFields); + } + + private static ResolvedJavaField findFieldWithOffset(long offset, JavaKind expectedEntryKind, ResolvedJavaField[] declaredFields) { for (ResolvedJavaField field : declaredFields) { HotSpotResolvedJavaField resolvedField = (HotSpotResolvedJavaField) field; long resolvedFieldOffset = resolvedField.offset(); diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotRuntimeStub.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackFrameReference.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java similarity index 100% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java similarity index 96% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java index c598f8a6f3f..25f6153f54e 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java @@ -85,7 +85,7 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess { final int klassLayoutHelperNeutralValue = getConstant("Klass::_lh_neutral_value", Integer.class); final int klassLayoutHelperInstanceSlowPathBit = getConstant("Klass::_lh_instance_slow_path_bit", Integer.class); - final int vtableEntrySize = getTypeSize("vtableEntry"); + final int vtableEntrySize = getFieldValue("CompilerToVM::Data::sizeof_vtableEntry", Integer.class, "int"); final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*"); final int instanceKlassSourceFileNameIndexOffset = getFieldOffset("InstanceKlass::_source_file_name_index", Integer.class, "u2"); @@ -192,20 +192,20 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess { final int constMethodHasLocalVariableTable = getConstant("ConstMethod::_has_localvariable_table", Integer.class); final int constMethodHasExceptionTable = getConstant("ConstMethod::_has_exception_table", Integer.class); - final int exceptionTableElementSize = getTypeSize("ExceptionTableElement"); + final int exceptionTableElementSize = getFieldValue("CompilerToVM::Data::sizeof_ExceptionTableElement", Integer.class, "int"); final int exceptionTableElementStartPcOffset = getFieldOffset("ExceptionTableElement::start_pc", Integer.class, "u2"); final int exceptionTableElementEndPcOffset = getFieldOffset("ExceptionTableElement::end_pc", Integer.class, "u2"); final int exceptionTableElementHandlerPcOffset = getFieldOffset("ExceptionTableElement::handler_pc", Integer.class, "u2"); final int exceptionTableElementCatchTypeIndexOffset = getFieldOffset("ExceptionTableElement::catch_type_index", Integer.class, "u2"); - final int localVariableTableElementSize = getTypeSize("LocalVariableTableElement"); + final int localVariableTableElementSize = getFieldValue("CompilerToVM::Data::sizeof_LocalVariableTableElement", Integer.class, "int"); final int localVariableTableElementStartBciOffset = getFieldOffset("LocalVariableTableElement::start_bci", Integer.class, "u2"); final int localVariableTableElementLengthOffset = getFieldOffset("LocalVariableTableElement::length", Integer.class, "u2"); final int localVariableTableElementNameCpIndexOffset = getFieldOffset("LocalVariableTableElement::name_cp_index", Integer.class, "u2"); final int localVariableTableElementDescriptorCpIndexOffset = getFieldOffset("LocalVariableTableElement::descriptor_cp_index", Integer.class, "u2"); final int localVariableTableElementSlotOffset = getFieldOffset("LocalVariableTableElement::slot", Integer.class, "u2"); - final int constantPoolSize = getTypeSize("ConstantPool"); + final int constantPoolSize = getFieldValue("CompilerToVM::Data::sizeof_ConstantPool", Integer.class, "int"); final int constantPoolTagsOffset = getFieldOffset("ConstantPool::_tags", Integer.class, "Array*"); final int constantPoolHolderOffset = getFieldOffset("ConstantPool::_pool_holder", Integer.class, "InstanceKlass*"); final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length", Integer.class, "int"); @@ -237,12 +237,15 @@ class HotSpotVMConfig extends HotSpotVMConfigAccess { final int heapWordSize = getConstant("HeapWordSize", Integer.class); - final int symbolPointerSize = getTypeSize("Symbol*"); + final int symbolPointerSize = getFieldValue("CompilerToVM::Data::sizeof_SymbolPointer", Integer.class, "int"); final long vmSymbolsSymbols = getFieldAddress("vmSymbols::_symbols[0]", "Symbol*"); final int vmSymbolsFirstSID = getConstant("vmSymbols::FIRST_SID", Integer.class); final int vmSymbolsSIDLimit = getConstant("vmSymbols::SID_LIMIT", Integer.class); + final long symbolInit = getFieldValue("CompilerToVM::Data::symbol_init", Long.class); + final long symbolClinit = getFieldValue("CompilerToVM::Data::symbol_clinit", Long.class); + /** * Returns the symbol in the {@code vmSymbols} table at position {@code index} as a * {@link String}. diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java similarity index 94% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java index 9bb538d587b..33a07bcb9a9 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigAccess.java @@ -66,21 +66,6 @@ public class HotSpotVMConfigAccess { return getAddress(name, null); } - /** - * Gets the size of a C++ type. - * - * @param name name of the type - * @return the size in bytes of the requested field - * @throws JVMCIError if the field is not present and {@code notPresent} is null - */ - public int getTypeSize(String name) { - Long entry = store.vmTypeSizes.get(name); - if (entry == null) { - throw new JVMCIError("expected VM type not found: " + name); - } - return (int) (long) entry; - } - /** * Gets the value of a C++ constant. * @@ -291,13 +276,24 @@ public class HotSpotVMConfigAccess { */ public T getFlag(String name, Class type, T notPresent) { VMFlag entry = store.vmFlags.get(name); + Object value; + String cppType; if (entry == null) { - if (notPresent != null) { - return notPresent; + // Fall back to VM call + value = store.compilerToVm.getFlagValue(name); + if (value == store.compilerToVm) { + if (notPresent != null) { + return notPresent; + } + throw new JVMCIError("expected VM flag not found: " + name); + } else { + cppType = null; } - throw new JVMCIError("expected VM flag not found: " + name); + } else { + value = entry.value; + cppType = entry.type; } - return type.cast(convertValue(name, type, entry.value, entry.type)); + return type.cast(convertValue(name, type, value, cppType)); } private static Object convertValue(String name, Class toType, Object value, String cppType) throws JVMCIError { @@ -319,6 +315,10 @@ public class HotSpotVMConfigAccess { } else if (value instanceof Long) { return (int) (long) value; } + } else if (toType == String.class) { + if (value == null || value instanceof String) { + return value; + } } else if (toType == Long.class) { return value; } diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java similarity index 83% rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java index e6f074d948f..c388bbfa7c4 100644 --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfigStore.java @@ -46,15 +46,6 @@ public final class HotSpotVMConfigStore { return Collections.unmodifiableMap(vmAddresses); } - /** - * Gets the C++ type sizes exposed by this object. - * - * @return an unmodifiable map from C++ type names to their sizes in bytes - */ - public Map getTypeSizes() { - return Collections.unmodifiableMap(vmTypeSizes); - } - /** * Gets the C++ constants exposed by this object. * @@ -90,11 +81,11 @@ public final class HotSpotVMConfigStore { } final HashMap vmFields; - final HashMap vmTypeSizes; final HashMap vmConstants; final HashMap vmAddresses; final HashMap vmFlags; final List vmIntrinsics; + final CompilerToVM compilerToVm; /** * Reads the database of VM info. The return value encodes the info in a nested object array @@ -103,7 +94,6 @@ public final class HotSpotVMConfigStore { *

          *     info = [
          *         VMField[] vmFields,
    -     *         [String name, Long size, ...] vmTypeSizes,
          *         [String name, Long value, ...] vmConstants,
          *         [String name, Long value, ...] vmAddresses,
          *         VMFlag[] vmFlags
    @@ -113,25 +103,24 @@ public final class HotSpotVMConfigStore {
          */
         @SuppressWarnings("try")
         HotSpotVMConfigStore(CompilerToVM compilerToVm) {
    +        this.compilerToVm = compilerToVm;
             Object[] data;
             try (InitTimer t = timer("CompilerToVm readConfiguration")) {
                 data = compilerToVm.readConfiguration();
             }
    -        assert data.length == 6 : data.length;
    +        assert data.length == 5 : data.length;
     
             // @formatter:off
             VMField[] vmFieldsInfo    = (VMField[]) data[0];
    -        Object[] vmTypesSizesInfo = (Object[])  data[1];
    -        Object[] vmConstantsInfo  = (Object[])  data[2];
    -        Object[] vmAddressesInfo  = (Object[])  data[3];
    -        VMFlag[] vmFlagsInfo      = (VMFlag[])  data[4];
    +        Object[] vmConstantsInfo  = (Object[])  data[1];
    +        Object[] vmAddressesInfo  = (Object[])  data[2];
    +        VMFlag[] vmFlagsInfo      = (VMFlag[])  data[3];
     
             vmFields     = new HashMap<>(vmFieldsInfo.length);
    -        vmTypeSizes  = new HashMap<>(vmTypesSizesInfo.length);
             vmConstants  = new HashMap<>(vmConstantsInfo.length);
             vmAddresses  = new HashMap<>(vmAddressesInfo.length);
             vmFlags      = new HashMap<>(vmFlagsInfo.length);
    -        vmIntrinsics = Arrays.asList((VMIntrinsicMethod[]) data[5]);
    +        vmIntrinsics = Arrays.asList((VMIntrinsicMethod[]) data[4]);
             // @formatter:on
     
             try (InitTimer t = timer("HotSpotVMConfigStore fill maps")) {
    @@ -139,12 +128,6 @@ public final class HotSpotVMConfigStore {
                     vmFields.put(vmField.name, vmField);
                 }
     
    -            for (int i = 0; i < vmTypesSizesInfo.length / 2; i++) {
    -                String name = (String) vmTypesSizesInfo[i * 2];
    -                Long size = (Long) vmTypesSizesInfo[i * 2 + 1];
    -                vmTypeSizes.put(name, size);
    -            }
    -
                 for (int i = 0; i < vmConstantsInfo.length / 2; i++) {
                     String name = (String) vmConstantsInfo[i * 2];
                     Long value = (Long) vmConstantsInfo[i * 2 + 1];
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMEventListener.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/MetaspaceWrapperObject.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/SuppressFBWarnings.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/UnsafeAccess.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
    similarity index 81%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
    index 094d92cdd32..ce8b54139df 100644
    --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
    +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java
    @@ -38,22 +38,22 @@ public final class VMField {
         public final String type;
     
         /**
    -     * If represented field is non-static, this is its offset within the containing structure.
    +     * If the represented field is non-static, this is its offset within the containing structure.
          */
         public final long offset;
     
         /**
    -     * If represented field is static, this is its address. Otherwise, this field is 0.
    +     * If the represented field is static, this is its address. Otherwise, this is 0.
          */
         public final long address;
     
         /**
    -     * Value of the field represented as a boxed long; only valid for non-oop static fields. This
    -     * value is only captured once, during JVMCI initialization. If {@link #type} cannot be
    -     * meaningfully (e.g., a struct) or safely (e.g., an oop) expressed as a boxed long, this is
    -     * {@code null}.
    +     * Value of the field represented as a boxed boolean if its C++ type is bool otherwise as a
    +     * boxed long; only valid for non-oop static fields. This value is only captured once, during
    +     * JVMCI initialization. If {@link #type} cannot be meaningfully (e.g., a struct) or safely
    +     * (e.g., an oop) expressed as a boxed object, this is {@code null}.
          */
    -    public final Long value;
    +    public final Object value;
     
         /**
          * Determines if the represented field is static.
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMFlag.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMIntrinsicMethod.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/overview.html b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/overview.html
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/overview.html
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/overview.html
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractJavaProfile.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AbstractProfiledItem.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/AllocatableValue.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Constant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantPool.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ConstantReflectionProvider.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationAction.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DeoptimizationReason.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ExceptionHandler.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/InvokeTarget.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaField.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethod.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaMethodProfile.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaType.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaTypeProfile.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaValue.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LineNumberTable.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Local.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/LocalVariableTable.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
    similarity index 82%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
    index 81c5f395549..9eba9d0f8ac 100644
    --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
    +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MemoryAccessProvider.java
    @@ -35,9 +35,9 @@ public interface MemoryAccessProvider {
          * @param displacement the displacement within the object in bytes
          * @param bits the number of bits to read from memory
          * @return the read value encapsulated in a {@link JavaConstant} object of {@link JavaKind} kind
    -     * @throws IllegalArgumentException if {@code kind} is {@link JavaKind#Void} or not
    -     *             {@linkplain JavaKind#isPrimitive() primitive} kind or {@code bits} is not 8, 16,
    -     *             32 or 64
    +     * @throws IllegalArgumentException if the read is out of bounds of the object or {@code kind}
    +     *             is {@link JavaKind#Void} or not {@linkplain JavaKind#isPrimitive() primitive}
    +     *             kind or {@code bits} is not 8, 16, 32 or 64
          */
         JavaConstant readPrimitiveConstant(JavaKind kind, Constant base, long displacement, int bits) throws IllegalArgumentException;
     
    @@ -46,9 +46,9 @@ public interface MemoryAccessProvider {
          *
          * @param base the base address from which the value is read
          * @param displacement the displacement within the object in bytes
    -     * @return the read value encapsulated in a {@link Constant} object or {@code null} if the
    -     *         address computed from {@code base} and {@code displacement} does not denote a
    -     *         location holding an {@code Object} value
    +     * @return the read value encapsulated in a {@link Constant} object
    +     * @throws IllegalArgumentException if the address computed from {@code base} and
    +     *             {@code displacement} does not denote a location holding an {@code Object} value
          */
         JavaConstant readObjectConstant(Constant base, long displacement);
     }
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaUtil.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MethodHandleAccessProvider.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ModifiersProvider.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/NullConstant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PlatformKind.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/PrimitiveConstant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ProfilingInfo.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/RawConstant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SerializableConstant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Signature.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SuppressFBWarnings.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/TriState.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/VMConstant.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/package-info.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCI.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIBackend.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompiler.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCICompilerFactory.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.runtime/src/jdk/vm/ci/runtime/JVMCIRuntime.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/.checkstyle_checks.xml
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIPermission.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
    similarity index 72%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
    index 7d695ea27d7..530d6e0a033 100644
    --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
    +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/JVMCIServiceLocator.java
    @@ -24,12 +24,15 @@ package jdk.vm.ci.services;
     
     import java.util.ArrayList;
     import java.util.List;
    +import java.util.ServiceLoader;
    +
    +import jdk.vm.ci.services.internal.ReflectionAccessJDK;
     
     /**
      * Service-provider class for the runtime to locate providers of JVMCI services where the latter are
    - * not in packages exported by the JVMCI module. As part of instantiating
    - * {@link JVMCIServiceLocator}, all JVMCI packages will be {@linkplain Services#exportJVMCITo(Class)
    - * exported} to the module defining the class of the instantiated object.
    + * not in packages exported by the JVMCI module. As part of instantiating a
    + * {@link JVMCIServiceLocator}, all JVMCI packages will be opened to the module defining the class
    + * of the instantiated object.
      *
      * While the {@link #getProvider(Class)} method can be used directly, it's usually easier to use
      * {@link #getProviders(Class)}.
    @@ -49,30 +52,39 @@ public abstract class JVMCIServiceLocator {
         }
     
         /**
    -     * Creates a capability for accessing JVMCI. Once successfully instantiated, JVMCI exports all
    -     * its packages to the module defining the type of this object.
    +     * Creates a capability for accessing JVMCI. Once successfully instantiated, JVMCI opens all its
    +     * packages to the module defining the type of this object.
          *
          * @throws SecurityException if a security manager has been installed and it denies
          *             {@link JVMCIPermission}
          */
         protected JVMCIServiceLocator() {
             this(checkPermission());
    -        Services.exportJVMCITo(getClass());
    +        Services.checkJVMCIEnabled();
    +        ReflectionAccessJDK.openJVMCITo(getClass());
         }
     
         /**
          * Gets the provider of the service defined by {@code service} or {@code null} if this object
          * does not have a provider for {@code service}.
          */
    -    public abstract  S getProvider(Class service);
    +    protected abstract  S getProvider(Class service);
     
         /**
    -     * Gets the providers of the service defined by {@code service} by querying the
    -     * {@link JVMCIServiceLocator} providers obtained by {@link Services#load(Class)}.
    +     * Gets the providers of the service defined by {@code service} by querying the available
    +     * {@link JVMCIServiceLocator} providers.
    +     *
    +     * @throws SecurityException if a security manager is present and it denies
    +     *             {@link JVMCIPermission}
          */
         public static  List getProviders(Class service) {
    +        Services.checkJVMCIEnabled();
    +        SecurityManager sm = System.getSecurityManager();
    +        if (sm != null) {
    +            sm.checkPermission(new JVMCIPermission());
    +        }
             List providers = new ArrayList<>();
    -        for (JVMCIServiceLocator access : Services.load(JVMCIServiceLocator.class)) {
    +        for (JVMCIServiceLocator access : ServiceLoader.load(JVMCIServiceLocator.class, ClassLoader.getSystemClassLoader())) {
                 S provider = access.getProvider(service);
                 if (provider != null) {
                     providers.add(provider);
    diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
    new file mode 100644
    index 00000000000..6d59fe6eef9
    --- /dev/null
    +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
    @@ -0,0 +1,85 @@
    +/*
    + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute it and/or modify it
    + * under the terms of the GNU General Public License version 2 only, as
    + * published by the Free Software Foundation.
    + *
    + * This code is distributed in the hope that it will be useful, but WITHOUT
    + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    + * version 2 for more details (a copy is included in the LICENSE file that
    + * accompanied this code).
    + *
    + * You should have received a copy of the GNU General Public License version
    + * 2 along with this work; if not, write to the Free Software Foundation,
    + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    + *
    + * Please 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 jdk.vm.ci.services;
    +
    +import java.lang.reflect.Method;
    +import java.util.Map;
    +
    +/**
    + * Provides utilities needed by JVMCI clients.
    + */
    +public final class Services {
    +
    +    // This class must be compilable and executable on JDK 8 since it's used in annotation
    +    // processors while building JDK 9 so use of API added in JDK 9 is made via reflection.
    +
    +    private Services() {
    +    }
    +
    +    @SuppressWarnings("unchecked")
    +    private static Map initSavedProperties() throws InternalError {
    +        try {
    +            Class vmClass = Class.forName("jdk.internal.misc.VM");
    +            Method m = vmClass.getMethod("getSavedProperties");
    +            return (Map) m.invoke(null);
    +        } catch (Exception e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +
    +    static final Map SAVED_PROPERTIES = initSavedProperties();
    +    static final boolean JVMCI_ENABLED = Boolean.parseBoolean(SAVED_PROPERTIES.get("jdk.internal.vm.ci.enabled"));
    +
    +    /**
    +     * Checks that JVMCI is enabled in the VM and throws an error if it isn't.
    +     */
    +    static void checkJVMCIEnabled() {
    +        if (!JVMCI_ENABLED) {
    +            throw new Error("The EnableJVMCI VM option must be true (i.e., -XX:+EnableJVMCI) to use JVMCI");
    +        }
    +    }
    +
    +    /**
    +     * Gets an unmodifiable copy of the system properties saved when {@link System} is initialized.
    +     */
    +    public static Map getSavedProperties() {
    +        checkJVMCIEnabled();
    +        SecurityManager sm = System.getSecurityManager();
    +        if (sm != null) {
    +            sm.checkPermission(new JVMCIPermission());
    +        }
    +        return SAVED_PROPERTIES;
    +    }
    +
    +    /**
    +     * Causes the JVMCI subsystem to be initialized if it isn't already initialized.
    +     */
    +    public static void initializeJVMCI() {
    +        checkJVMCIEnabled();
    +        try {
    +            Class.forName("jdk.vm.ci.runtime.JVMCI");
    +        } catch (ClassNotFoundException e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +}
    diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java
    new file mode 100644
    index 00000000000..6cbf12273ab
    --- /dev/null
    +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/internal/ReflectionAccessJDK.java
    @@ -0,0 +1,91 @@
    +/*
    + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute it and/or modify it
    + * under the terms of the GNU General Public License version 2 only, as
    + * published by the Free Software Foundation.
    + *
    + * This code is distributed in the hope that it will be useful, but WITHOUT
    + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    + * version 2 for more details (a copy is included in the LICENSE file that
    + * accompanied this code).
    + *
    + * You should have received a copy of the GNU General Public License version
    + * 2 along with this work; if not, write to the Free Software Foundation,
    + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    + *
    + * Please 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 jdk.vm.ci.services.internal;
    +
    +import java.lang.reflect.Method;
    +import java.util.Set;
    +
    +import jdk.vm.ci.services.Services;
    +
    +/**
    + * Reflection based access to API introduced in JDK 9. This allows the API to be used in code that
    + * must be compiled (but not executed) on JDK 8.
    + */
    +public final class ReflectionAccessJDK {
    +
    +    /**
    +     * {@code Class.getModule()}.
    +     */
    +    private static final Method getModule;
    +
    +    /**
    +     * {@code java.lang.Module.addOpens(String, Module)}.
    +     */
    +    private static final Method addOpens;
    +
    +    /**
    +     * {@code java.lang.Module.getPackages(Module, String, Module)}.
    +     */
    +    private static final Method getPackages;
    +
    +    /**
    +     * {@code java.lang.Module.isOpen(String, Module)}.
    +     */
    +    private static final Method isOpenTo;
    +
    +    /**
    +     * Opens all JVMCI packages to the module of a given class.
    +     *
    +     * @param other all JVMCI packages will be opened to the module of this class
    +     */
    +    @SuppressWarnings("unchecked")
    +    public static void openJVMCITo(Class other) {
    +        try {
    +            Object jvmci = getModule.invoke(Services.class);
    +            Object otherModule = getModule.invoke(other);
    +            if (jvmci != otherModule) {
    +                Set packages = (Set) getPackages.invoke(jvmci);
    +                for (String pkg : packages) {
    +                    boolean opened = (Boolean) isOpenTo.invoke(jvmci, pkg, otherModule);
    +                    if (!opened) {
    +                        addOpens.invoke(jvmci, pkg, otherModule);
    +                    }
    +                }
    +            }
    +        } catch (Exception e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +
    +    static {
    +        try {
    +            getModule = Class.class.getMethod("getModule");
    +            Class moduleClass = getModule.getReturnType();
    +            getPackages = moduleClass.getMethod("getPackages");
    +            isOpenTo = moduleClass.getMethod("isOpen", String.class, moduleClass);
    +            addOpens = moduleClass.getDeclaredMethod("addOpens", String.class, moduleClass);
    +        } catch (NoSuchMethodException | SecurityException e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +}
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARC.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java b/hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java
    rename to hotspot/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java
    diff --git a/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java b/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java
    new file mode 100644
    index 00000000000..e6001b18f37
    --- /dev/null
    +++ b/hotspot/src/jdk.internal.vm.ci/share/classes/module-info.java
    @@ -0,0 +1,36 @@
    +/*
    + * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute 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.
    + */
    +
    +module jdk.internal.vm.ci {
    +    exports jdk.vm.ci.services to jdk.internal.vm.compiler;
    +
    +    uses jdk.vm.ci.services.JVMCIServiceLocator;
    +    uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
    +
    +    provides jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory with
    +        jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory,
    +        jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory,
    +        jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory;
    +}
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/.project b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.project
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/.project
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/.project
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/.pydevproject b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject
    similarity index 84%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/.pydevproject
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject
    index c2a81b0a6a5..10c514a61b2 100644
    --- a/hotspot/src/jdk.vm.compiler/.mx.graal/.pydevproject
    +++ b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/.pydevproject
    @@ -3,9 +3,9 @@
     Default
     python 2.7
     
    -/mx.graal
    -/mx.graal
    -/mx.graal
    +/.mx.graal
    +/.mx.graal
    +/.mx.graal
     
     
     
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/eclipse-settings/org.eclipse.jdt.core.prefs
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal.py
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal.py
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal.py
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_9.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_9.py
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_9.py
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_bench.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_bench.py
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/mx_graal_bench.py
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/mx_graal_bench.py
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/outputparser.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/outputparser.py
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/outputparser.py
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/outputparser.py
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/sanitycheck.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/sanitycheck.py
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/sanitycheck.py
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/sanitycheck.py
    diff --git a/hotspot/src/jdk.vm.compiler/.mx.graal/suite.py b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py
    similarity index 95%
    rename from hotspot/src/jdk.vm.compiler/.mx.graal/suite.py
    rename to hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py
    index dda989acedf..b7f897c0862 100644
    --- a/hotspot/src/jdk.vm.compiler/.mx.graal/suite.py
    +++ b/hotspot/src/jdk.internal.vm.compiler/.mx.graal/suite.py
    @@ -8,6 +8,36 @@ suite = {
       # (e.g., macosx-x86_64-normal-server-release).
       "outputRoot" : "../../../build/mx/hotspot",
     
    +  "jdklibraries" : {
    +    "JVMCI_SERVICES" : {
    +      "path" : "lib/jvmci-services.jar",
    +      "sourcePath" : "lib/jvmci-services.src.zip",
    +      "optional" : False,
    +      "jdkStandardizedSince" : "9",
    +      "module" : "jdk.internal.vm.ci"
    +    },
    +    "JVMCI_API" : {
    +      "path" : "lib/jvmci/jvmci-api.jar",
    +      "sourcePath" : "lib/jvmci/jvmci-api.src.zip",
    +      "dependencies" : [
    +        "JVMCI_SERVICES",
    +      ],
    +      "optional" : False,
    +      "jdkStandardizedSince" : "9",
    +      "module" : "jdk.internal.vm.ci"
    +    },
    +    "JVMCI_HOTSPOT" : {
    +      "path" : "lib/jvmci/jvmci-hotspot.jar",
    +      "sourcePath" : "lib/jvmci/jvmci-hotspot.src.zip",
    +      "dependencies" : [
    +        "JVMCI_API",
    +      ],
    +      "optional" : False,
    +      "jdkStandardizedSince" : "9",
    +      "module" : "jdk.internal.vm.ci"
    +    },
    +  },
    +
       "libraries" : {
     
         # ------------- Libraries -------------
    @@ -17,6 +47,16 @@ suite = {
           "sha1" : "476d9a44cd19d6b55f81571077dfa972a4f8a083",
           "bootClassPathAgent" : "true",
         },
    +    "ASM5" : {
    +      "sha1" : "0da08b8cce7bbf903602a25a3a163ae252435795",
    +      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar"],
    +    },
    +
    +    "ASM_TREE5" : {
    +      "sha1" : "396ce0c07ba2b481f25a70195c7c94922f0d1b0b",
    +      "urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar"],
    +      "dependencies" : ["ASM5"],
    +    },
       },
     
       "projects" : {
    @@ -32,6 +72,7 @@ suite = {
     
         "org.graalvm.compiler.serviceprovider" : {
           "subDir" : "share/classes",
    +      "dependencies" : ["JVMCI_SERVICES"],
           "sourceDirs" : ["src"],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
    @@ -49,6 +90,7 @@ suite = {
     
         "org.graalvm.compiler.options" : {
           "subDir" : "share/classes",
    +      "dependencies" : ["JVMCI_SERVICES", "JVMCI_API"],
           "sourceDirs" : ["src"],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
    @@ -83,6 +125,7 @@ suite = {
           "sourceDirs" : ["src"],
           "checkstyle" : "org.graalvm.compiler.graph",
           "dependencies" : [
    +        "JVMCI_API",
             "org.graalvm.compiler.serviceprovider",
             "org.graalvm.compiler.options"
           ],
    @@ -137,6 +180,7 @@ suite = {
           "sourceDirs" : ["src"],
           "checkstyle" : "org.graalvm.compiler.graph",
           "dependencies" : [
    +        "JVMCI_HOTSPOT",
             "org.graalvm.compiler.core.test",
           ],
           "javaCompliance" : "1.8",
    @@ -146,6 +190,9 @@ suite = {
         "org.graalvm.compiler.api.runtime" : {
           "subDir" : "share/classes",
           "sourceDirs" : ["src"],
    +      "dependencies" : [
    +        "JVMCI_API",
    +      ],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
           "workingSets" : "API,Graal",
    @@ -156,6 +203,7 @@ suite = {
           "sourceDirs" : ["src"],
           "dependencies" : [
             "mx:JUNIT",
    +        "JVMCI_SERVICES",
             "org.graalvm.compiler.api.runtime",
           ],
           "checkstyle" : "org.graalvm.compiler.graph",
    @@ -166,6 +214,7 @@ suite = {
         "org.graalvm.compiler.api.replacements" : {
           "subDir" : "share/classes",
           "sourceDirs" : ["src"],
    +      "dependencies" : ["JVMCI_API"],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
           "workingSets" : "API,Graal,Replacements",
    @@ -175,6 +224,7 @@ suite = {
           "subDir" : "share/classes",
           "sourceDirs" : ["src"],
           "dependencies" : [
    +        "JVMCI_HOTSPOT",
             "org.graalvm.compiler.api.runtime",
             "org.graalvm.compiler.replacements",
             "org.graalvm.compiler.runtime",
    @@ -261,6 +311,8 @@ suite = {
             "org.graalvm.compiler.hotspot",
             "org.graalvm.compiler.lir.jtt",
             "org.graalvm.compiler.lir.test",
    +        "JVMCI_API",
    +        "JVMCI_HOTSPOT",
           ],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
    @@ -347,6 +399,9 @@ suite = {
         "org.graalvm.compiler.asm" : {
           "subDir" : "share/classes",
           "sourceDirs" : ["src"],
    +      "dependencies" : [
    +        "JVMCI_API",
    +      ],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
           "workingSets" : "Graal,Assembler",
    @@ -403,6 +458,7 @@ suite = {
         "org.graalvm.compiler.bytecode" : {
           "subDir" : "share/classes",
           "sourceDirs" : ["src"],
    +      "dependencies" : ["JVMCI_API"],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
           "workingSets" : "Graal,Java",
    @@ -774,6 +830,7 @@ suite = {
           "dependencies" : [
             "org.graalvm.compiler.lir.jtt",
             "org.graalvm.compiler.lir.aarch64",
    +        "JVMCI_HOTSPOT"
           ],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
    @@ -803,6 +860,7 @@ suite = {
           "dependencies" : [
             "org.graalvm.compiler.lir.jtt",
             "org.graalvm.compiler.lir.amd64",
    +        "JVMCI_HOTSPOT"
           ],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
    @@ -831,6 +889,7 @@ suite = {
           "sourceDirs" : ["src"],
           "dependencies" : [
             "org.graalvm.compiler.lir.jtt",
    +        "JVMCI_HOTSPOT"
           ],
           "checkstyle" : "org.graalvm.compiler.graph",
           "javaCompliance" : "1.8",
    @@ -908,6 +967,7 @@ suite = {
             "org.graalvm.compiler.graph.test",
             "org.graalvm.compiler.printer",
             "JAVA_ALLOCATION_INSTRUMENTER",
    +        "ASM_TREE5",
           ],
           "annotationProcessors" : ["GRAAL_NODEINFO_PROCESSOR"],
           "checkstyle" : "org.graalvm.compiler.graph",
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/module-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/module-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
    index 7c456485659..783eef09fa5 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/module-info.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/module-info.java
    @@ -23,11 +23,11 @@
      * questions.
      */
     
    -module jdk.vm.compiler {
    +module jdk.internal.vm.compiler {
         requires java.instrument;
         requires java.management;
         requires jdk.management;
    -    requires jdk.vm.ci;
    +    requires jdk.internal.vm.ci;
     
         // sun.misc.Unsafe is used
         requires jdk.unsupported;
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/CollectionsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.collections/src/org/graalvm/compiler/api/collections/DefaultCollectionsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/AllocationInstrumentationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IsMethodInlineDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/LockInstrumentationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/RootNameDirectiveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/TinyInstrumentor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
    index 01746c74bf8..82268194cbd 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java
    @@ -40,7 +40,7 @@ public class Graal {
         private static final GraalRuntime runtime = initializeRuntime();
     
         private static GraalRuntime initializeRuntime() {
    -        Services.exportJVMCITo(Graal.class);
    +        Services.initializeJVMCI();
             JVMCICompiler compiler = JVMCI.getRuntime().getCompiler();
             if (compiler instanceof GraalJVMCICompiler) {
                 GraalJVMCICompiler graal = (GraalJVMCICompiler) compiler;
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/NumUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/PermanentBailoutException.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.common/src/org/graalvm/compiler/common/RetryableBailoutException.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLowering.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CollectionsFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LinkedIdentityHashMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LocationIdentity.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArrayMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ArraySet.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
    similarity index 83%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
    index 240fdc07fb6..86e1bac530a 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ModuleAPI.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,27 +53,22 @@ public final class ModuleAPI {
         public static final ModuleAPI getModule;
     
         /**
    -     * {@code jdk.internal.module.Modules.addExports(Module, String, Module)}.
    -     */
    -    public static final ModuleAPI addExports;
    -
    -    /**
    -     * {@code java.lang.reflect.Module.getResourceAsStream(String)}.
    +     * {@code java.lang.Module.getResourceAsStream(String)}.
          */
         public static final ModuleAPI getResourceAsStream;
     
         /**
    -     * {@code java.lang.reflect.Module.canRead(Module)}.
    +     * {@code java.lang.Module.canRead(Module)}.
          */
         public static final ModuleAPI canRead;
     
         /**
    -     * {@code java.lang.reflect.Module.isExported(String)}.
    +     * {@code java.lang.Module.isExported(String)}.
          */
         public static final ModuleAPI isExported;
     
         /**
    -     * {@code java.lang.reflect.Module.isExported(String, Module)}.
    +     * {@code java.lang.Module.isExported(String, Module)}.
          */
         public static final ModuleAPI isExportedTo;
     
    @@ -116,13 +111,11 @@ public final class ModuleAPI {
                 try {
                     getModule = new ModuleAPI(Class.class.getMethod("getModule"));
                     Class moduleClass = getModule.method.getReturnType();
    -                Class modulesClass = Class.forName("jdk.internal.module.Modules");
                     getResourceAsStream = new ModuleAPI(moduleClass.getMethod("getResourceAsStream", String.class));
                     canRead = new ModuleAPI(moduleClass.getMethod("canRead", moduleClass));
                     isExported = new ModuleAPI(moduleClass.getMethod("isExported", String.class));
                     isExportedTo = new ModuleAPI(moduleClass.getMethod("isExported", String.class, moduleClass));
    -                addExports = new ModuleAPI(modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass));
    -            } catch (NoSuchMethodException | SecurityException | ClassNotFoundException e) {
    +            } catch (NoSuchMethodException | SecurityException e) {
                     throw new InternalError(e);
                 }
             } else {
    @@ -132,8 +125,6 @@ public final class ModuleAPI {
                 canRead = unavailable;
                 isExported = unavailable;
                 isExportedTo = unavailable;
    -            addExports = unavailable;
             }
    -
         }
     }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/META-INF/services/javax.annotation.processing.Processor
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
    index 8c8c74f3442..405652ed1e3 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java
    @@ -127,7 +127,7 @@ public class CheckGraalInvariants extends GraalTest {
             MetaAccessProvider metaAccess = providers.getMetaAccess();
     
             PhaseSuite graphBuilderSuite = new PhaseSuite<>();
    -        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +        Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
             HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationLoadFieldConstantFoldTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CooperativePhaseTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardEliminationCornerCasesTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
    similarity index 97%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
    index f580313a3fd..601fc26ad90 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java
    @@ -26,15 +26,14 @@ import java.lang.invoke.MethodHandle;
     import java.lang.invoke.MethodHandles;
     import java.lang.invoke.MethodType;
     
    -import org.junit.Test;
    -
     import org.graalvm.compiler.code.CompilationResult;
     import org.graalvm.compiler.test.ExportingClassLoader;
    +import org.junit.Test;
    +import org.objectweb.asm.ClassWriter;
    +import org.objectweb.asm.Label;
    +import org.objectweb.asm.MethodVisitor;
    +import org.objectweb.asm.Opcodes;
     
    -import jdk.internal.org.objectweb.asm.ClassWriter;
    -import jdk.internal.org.objectweb.asm.Label;
    -import jdk.internal.org.objectweb.asm.MethodVisitor;
    -import jdk.internal.org.objectweb.asm.Opcodes;
     import jdk.vm.ci.code.InstalledCode;
     import jdk.vm.ci.meta.ResolvedJavaMethod;
     
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
    similarity index 97%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
    index ea1de661d3f..ccd10019b0d 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java
    @@ -44,19 +44,17 @@ import java.util.Objects;
     import java.util.ServiceLoader;
     import java.util.Set;
     
    -import org.junit.Test;
    -
     import org.graalvm.compiler.options.OptionDescriptor;
     import org.graalvm.compiler.options.OptionDescriptors;
     import org.graalvm.compiler.options.OptionValue;
     import org.graalvm.compiler.test.GraalTest;
    -
    -import jdk.internal.org.objectweb.asm.ClassReader;
    -import jdk.internal.org.objectweb.asm.ClassVisitor;
    -import jdk.internal.org.objectweb.asm.Label;
    -import jdk.internal.org.objectweb.asm.MethodVisitor;
    -import jdk.internal.org.objectweb.asm.Opcodes;
    -import jdk.internal.org.objectweb.asm.Type;
    +import org.junit.Test;
    +import org.objectweb.asm.ClassReader;
    +import org.objectweb.asm.ClassVisitor;
    +import org.objectweb.asm.Label;
    +import org.objectweb.asm.MethodVisitor;
    +import org.objectweb.asm.Opcodes;
    +import org.objectweb.asm.Type;
     
     /**
      * Verifies a class declaring one or more {@linkplain OptionValue options} has a class initializer
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
    index 235f31292e6..27af889f90a 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java
    @@ -83,7 +83,7 @@ public class StaticInterfaceFieldTest extends GraalTest {
             MetaAccessProvider metaAccess = providers.getMetaAccess();
     
             PhaseSuite graphBuilderSuite = new PhaseSuite<>();
    -        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +        Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
             HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
    index 2c96072aa48..633441b981d 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java
    @@ -24,10 +24,10 @@ package org.graalvm.compiler.core.test;
     
     import jdk.vm.ci.code.BailoutException;
     import jdk.vm.ci.meta.ResolvedJavaMethod;
    -import jdk.internal.org.objectweb.asm.ClassWriter;
    -import jdk.internal.org.objectweb.asm.Label;
    -import jdk.internal.org.objectweb.asm.MethodVisitor;
    -import jdk.internal.org.objectweb.asm.Opcodes;
    +import org.objectweb.asm.ClassWriter;
    +import org.objectweb.asm.Label;
    +import org.objectweb.asm.MethodVisitor;
    +import org.objectweb.asm.Opcodes;
     
     import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID;
     
    @@ -86,7 +86,7 @@ public class UnbalancedMonitorsTest extends GraalCompilerTest implements Opcodes
             ResolvedJavaMethod method = getResolvedJavaMethod(LOADER.findClass(INNER_CLASS_NAME), name);
             try {
                 StructuredGraph graph = new StructuredGraph(method, AllowAssumptions.NO, INVALID_COMPILATION_ID);
    -            Plugins plugins = new Plugins(new InvocationPlugins(getMetaAccess()));
    +            Plugins plugins = new Plugins(new InvocationPlugins());
                 GraphBuilderConfiguration graphBuilderConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
                 OptimisticOptimizations optimisticOpts = OptimisticOptimizations.NONE;
     
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
    index 0a50d9192cf..ff82e1aabf2 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java
    @@ -122,7 +122,7 @@ public class VerifyBailoutUsageTest {
             Providers providers = rt.getHostBackend().getProviders();
             MetaAccessProvider metaAccess = providers.getMetaAccess();
             PhaseSuite graphBuilderSuite = new PhaseSuite<>();
    -        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +        Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
             HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
    index 00df7430a07..47aba0895c8 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java
    @@ -300,7 +300,7 @@ public class VerifyDebugUsageTest {
             Providers providers = rt.getHostBackend().getProviders();
             MetaAccessProvider metaAccess = providers.getMetaAccess();
             PhaseSuite graphBuilderSuite = new PhaseSuite<>();
    -        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +        Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
             HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
    index 855be893315..0b6669b70a5 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java
    @@ -267,7 +267,7 @@ public class VerifyVirtualizableTest {
             Providers providers = rt.getHostBackend().getProviders();
             MetaAccessProvider metaAccess = providers.getMetaAccess();
             PhaseSuite graphBuilderSuite = new PhaseSuite<>();
    -        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +        Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
             HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest5.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTest6.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/MethodMetricsTestInterception02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
    index ccfc04fd822..69826384295 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/debug/VerifyMethodMetricsTest.java
    @@ -249,7 +249,7 @@ public class VerifyMethodMetricsTest {
             Providers providers = rt.getHostBackend().getProviders();
             MetaAccessProvider metaAccess = providers.getMetaAccess();
             PhaseSuite graphBuilderSuite = new PhaseSuite<>();
    -        Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +        Plugins plugins = new Plugins(new InvocationPlugins());
             GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
             graphBuilderSuite.appendPhase(new GraphBuilderPhase(config));
             HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/RecursiveInliningTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
    index 92898acf01e..4f8a61e1901 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java
    @@ -253,7 +253,7 @@ public class StaticAnalysis {
                          * the code before static analysis, the classes would otherwise be not loaded
                          * yet and the bytecode parser would only create a graph.
                          */
    -                    Plugins plugins = new Plugins(new InvocationPlugins(metaAccess));
    +                    Plugins plugins = new Plugins(new InvocationPlugins());
                         GraphBuilderConfiguration graphBuilderConfig = GraphBuilderConfiguration.getDefault(plugins).withEagerResolving(true);
                         /*
                          * For simplicity, we ignore all exception handling during the static analysis.
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalDebugInitializationParticipant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugHistogramTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugTimerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Debug.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigCustomizer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigScope.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCounter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugEnvironment.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHistogram.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugInitializationParticipant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMethodMetrics.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugTimer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugValueFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DelegatingDebugConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Fingerprint.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalDebugConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Management.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TopLevelDebugConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/AccumulatedDebugValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CloseableCounterImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/CounterImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramAsciiPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugHistogramRPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugScope.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/DebugValuesPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/KeyRegistry.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/MemUseTrackerImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/TimerImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsInlineeScopeInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/internal/method/MethodMetricsRootScopeInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/.checkstyle_checks.xml
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/DefaultNodeCollectionsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeCollectionsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeNodeMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArchHotSpotNodeCostProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizationStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotArithmeticLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEnterUnpackFramesStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
    index 850faa1c525..bd87349a2d4 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -497,9 +497,8 @@ public class AMD64HotSpotLIRGenerator extends AMD64LIRGenerator implements HotSp
         }
     
         @Override
    -    public Value emitLoadConfigValue(int markId) {
    -        // Globals are always full-pointer width.
    -        Variable result = newVariable(LIRKind.value(target().arch.getWordKind()));
    +    public Value emitLoadConfigValue(int markId, LIRKind kind) {
    +        Variable result = newVariable(kind);
             append(new AMD64HotSpotLoadConfigValueOp(markId, result));
             return result;
         }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveUnpackFramesStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
    similarity index 70%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
    index 28e2c0d6ba6..24b11237bda 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,12 @@ package org.graalvm.compiler.hotspot.amd64;
     
     import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC;
     import static jdk.vm.ci.code.ValueUtil.asRegister;
    +
    +import jdk.vm.ci.amd64.AMD64Kind;
    +import jdk.vm.ci.code.Register;
     import jdk.vm.ci.meta.AllocatableValue;
     
    +import org.graalvm.compiler.asm.amd64.AMD64Address;
     import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler;
     import org.graalvm.compiler.debug.GraalError;
     import org.graalvm.compiler.lir.LIRInstructionClass;
    @@ -48,7 +52,25 @@ public final class AMD64HotSpotLoadConfigValueOp extends AMD64LIRInstruction {
         @Override
         public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) {
             if (GeneratePIC.getValue()) {
    -            masm.movq(asRegister(result), masm.getPlaceholder(-1));
    +            AMD64Kind kind = (AMD64Kind) result.getPlatformKind();
    +            Register reg = asRegister(result);
    +            AMD64Address placeholder = masm.getPlaceholder(-1);
    +            switch (kind) {
    +                case BYTE:
    +                    masm.movsbl(reg, placeholder);
    +                    break;
    +                case WORD:
    +                    masm.movswl(reg, placeholder);
    +                    break;
    +                case DWORD:
    +                    masm.movl(reg, placeholder);
    +                    break;
    +                case QWORD:
    +                    masm.movq(reg, placeholder);
    +                    break;
    +                default:
    +                    throw GraalError.unimplemented();
    +            }
             } else {
                 throw GraalError.unimplemented();
             }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeCostProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64RawNativeCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64UncommonTrapStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizationStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEnterUnpackFramesStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveUnpackFramesStackFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeCostProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCUncommonTrapStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
    similarity index 94%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
    index 42d4dd453c4..d070eb08fbc 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java
    @@ -29,15 +29,12 @@ import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Collection;
     import java.util.Collections;
    -import java.util.HashMap;
     import java.util.List;
     import java.util.Map;
     import java.util.Set;
     import java.util.TreeSet;
     import java.util.stream.Collectors;
     
    -import org.junit.Test;
    -
     import org.graalvm.compiler.api.test.Graal;
     import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig;
     import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
    @@ -45,12 +42,15 @@ import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
     import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
     import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
     import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
    +import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Binding;
     import org.graalvm.compiler.runtime.RuntimeProvider;
     import org.graalvm.compiler.test.GraalTest;
    +import org.junit.Test;
     
     import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
     import jdk.vm.ci.hotspot.VMIntrinsicMethod;
     import jdk.vm.ci.meta.MetaAccessProvider;
    +import jdk.vm.ci.meta.MetaUtil;
     import jdk.vm.ci.meta.MethodHandleAccessProvider.IntrinsicMethod;
     import jdk.vm.ci.meta.ResolvedJavaMethod;
     
    @@ -63,11 +63,10 @@ import jdk.vm.ci.meta.ResolvedJavaMethod;
      */
     public class CheckGraalIntrinsics extends GraalTest {
     
    -    public static boolean match(ResolvedJavaMethod method, VMIntrinsicMethod intrinsic) {
    -        if (intrinsic.name.equals(method.getName())) {
    -            if (intrinsic.descriptor.equals(method.getSignature().toMethodDescriptor())) {
    -                String declaringClass = method.getDeclaringClass().toClassName().replace('.', '/');
    -                if (declaringClass.equals(intrinsic.declaringClass)) {
    +    public static boolean match(String type, Binding binding, VMIntrinsicMethod intrinsic) {
    +        if (intrinsic.name.equals(binding.name)) {
    +            if (intrinsic.descriptor.startsWith(binding.argumentsDescriptor)) {
    +                if (type.equals(intrinsic.declaringClass)) {
                         return true;
                     }
                 }
    @@ -75,16 +74,20 @@ public class CheckGraalIntrinsics extends GraalTest {
             return false;
         }
     
    -    private static ResolvedJavaMethod findMethod(Set methods, VMIntrinsicMethod intrinsic) {
    -        for (ResolvedJavaMethod method : methods) {
    -            if (match(method, intrinsic)) {
    -                return method;
    +    public static InvocationPlugin findPlugin(Map> bindings, VMIntrinsicMethod intrinsic) {
    +        for (Map.Entry> e : bindings.entrySet()) {
    +            // Match format of VMIntrinsicMethod.declaringClass
    +            String type = MetaUtil.internalNameToJava(e.getKey(), true, false).replace('.', '/');
    +            for (Binding binding : e.getValue()) {
    +                if (match(type, binding, intrinsic)) {
    +                    return binding.plugin;
    +                }
                 }
             }
             return null;
         }
     
    -    private static ResolvedJavaMethod resolveIntrinsic(MetaAccessProvider metaAccess, VMIntrinsicMethod intrinsic) throws ClassNotFoundException {
    +    public static ResolvedJavaMethod resolveIntrinsic(MetaAccessProvider metaAccess, VMIntrinsicMethod intrinsic) throws ClassNotFoundException {
             Class c = Class.forName(intrinsic.declaringClass.replace('/', '.'), false, CheckGraalIntrinsics.class.getClassLoader());
             for (Method javaMethod : c.getDeclaredMethods()) {
                 if (javaMethod.getName().equals(intrinsic.name)) {
    @@ -425,28 +428,20 @@ public class CheckGraalIntrinsics extends GraalTest {
         public void test() throws ClassNotFoundException {
             HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
             HotSpotProviders providers = rt.getHostBackend().getProviders();
    -        Map impl = new HashMap<>();
             Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
             InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
    -        for (ResolvedJavaMethod method : invocationPlugins.getMethods()) {
    -            InvocationPlugin plugin = invocationPlugins.lookupInvocation(method);
    -            assert plugin != null;
    -            impl.put(method, plugin);
    -        }
     
    -        Set methods = invocationPlugins.getMethods();
             HotSpotVMConfigStore store = rt.getVMConfig().getStore();
             List intrinsics = store.getIntrinsics();
     
             List missing = new ArrayList<>();
    +        Map> bindings = invocationPlugins.getBindings(true);
             for (VMIntrinsicMethod intrinsic : intrinsics) {
    -            ResolvedJavaMethod method = findMethod(methods, intrinsic);
    -            if (method == null) {
    -                method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
    -
    -                IntrinsicMethod intrinsicMethod = null;
    +            InvocationPlugin plugin = findPlugin(bindings, intrinsic);
    +            if (plugin == null) {
    +                ResolvedJavaMethod method = resolveIntrinsic(providers.getMetaAccess(), intrinsic);
                     if (method != null) {
    -                    intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
    +                    IntrinsicMethod intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
                         if (intrinsicMethod != null) {
                             continue;
                         }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
    index 2585d36f861..3edc637a362 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java
    @@ -39,9 +39,9 @@ import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
     import org.junit.BeforeClass;
     import org.junit.Test;
     
    -import jdk.internal.org.objectweb.asm.ClassWriter;
    -import jdk.internal.org.objectweb.asm.MethodVisitor;
    -import jdk.internal.org.objectweb.asm.Opcodes;
    +import org.objectweb.asm.ClassWriter;
    +import org.objectweb.asm.MethodVisitor;
    +import org.objectweb.asm.Opcodes;
     import jdk.vm.ci.meta.ResolvedJavaMethod;
     
     public class ConstantPoolSubstitutionsTests extends GraalCompilerTest implements Opcodes {
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
    similarity index 66%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
    index 3185b44d826..0333f9a973f 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java
    @@ -22,13 +22,12 @@
      */
     package org.graalvm.compiler.hotspot.test;
     
    -import java.util.List;
    -import java.util.Set;
    +import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID;
     
    -import org.junit.Test;
    +import java.util.List;
    +import java.util.Map;
     
     import org.graalvm.compiler.api.test.Graal;
    -import org.graalvm.compiler.core.common.CompilationIdentifier;
     import org.graalvm.compiler.core.test.GraalCompilerTest;
     import org.graalvm.compiler.hotspot.HotSpotGraalCompiler;
     import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider;
    @@ -37,8 +36,10 @@ import org.graalvm.compiler.nodes.StructuredGraph;
     import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
     import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin;
     import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins;
    +import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Binding;
     import org.graalvm.compiler.nodes.graphbuilderconf.MethodSubstitutionPlugin;
     import org.graalvm.compiler.runtime.RuntimeProvider;
    +import org.junit.Test;
     
     import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
     import jdk.vm.ci.hotspot.VMIntrinsicMethod;
    @@ -50,46 +51,27 @@ import jdk.vm.ci.runtime.JVMCI;
      */
     public class TestIntrinsicCompiles extends GraalCompilerTest {
     
    -    private static boolean match(ResolvedJavaMethod method, VMIntrinsicMethod intrinsic) {
    -        if (intrinsic.name.equals(method.getName())) {
    -            if (intrinsic.descriptor.equals(method.getSignature().toMethodDescriptor())) {
    -                String declaringClass = method.getDeclaringClass().toClassName().replace('.', '/');
    -                if (declaringClass.equals(intrinsic.declaringClass)) {
    -                    return true;
    -                }
    -            }
    -        }
    -        return false;
    -    }
    -
    -    private static ResolvedJavaMethod findMethod(Set methods, VMIntrinsicMethod intrinsic) {
    -        for (ResolvedJavaMethod method : methods) {
    -            if (match(method, intrinsic)) {
    -                return method;
    -            }
    -        }
    -        return null;
    -    }
    -
         @Test
         @SuppressWarnings("try")
    -    public void test() {
    +    public void test() throws ClassNotFoundException {
             HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) JVMCI.getRuntime().getCompiler();
             HotSpotGraalRuntimeProvider rt = (HotSpotGraalRuntimeProvider) Graal.getRequiredCapability(RuntimeProvider.class);
             HotSpotProviders providers = rt.getHostBackend().getProviders();
             Plugins graphBuilderPlugins = providers.getGraphBuilderPlugins();
             InvocationPlugins invocationPlugins = graphBuilderPlugins.getInvocationPlugins();
     
    -        Set pluginMethods = invocationPlugins.getMethods();
    +        Map> bindings = invocationPlugins.getBindings(true);
             HotSpotVMConfigStore store = rt.getVMConfig().getStore();
             List intrinsics = store.getIntrinsics();
             for (VMIntrinsicMethod intrinsic : intrinsics) {
    -            ResolvedJavaMethod method = findMethod(pluginMethods, intrinsic);
    -            if (method != null) {
    -                InvocationPlugin plugin = invocationPlugins.lookupInvocation(method);
    -                if (plugin instanceof MethodSubstitutionPlugin && !method.isNative()) {
    -                    StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, CompilationIdentifier.INVALID_COMPILATION_ID);
    -                    getCode(method, graph);
    +            InvocationPlugin plugin = CheckGraalIntrinsics.findPlugin(bindings, intrinsic);
    +            if (plugin != null) {
    +                if (plugin instanceof MethodSubstitutionPlugin) {
    +                    ResolvedJavaMethod method = CheckGraalIntrinsics.resolveIntrinsic(getMetaAccess(), intrinsic);
    +                    if (!method.isNative()) {
    +                        StructuredGraph graph = compiler.getIntrinsicGraph(method, providers, INVALID_COMPILATION_ID);
    +                        getCode(method, graph);
    +                    }
                     }
                 }
             }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
    index fae52a2f352..b2542607a3f 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorld.java
    @@ -102,7 +102,6 @@ import jdk.vm.ci.meta.ConstantPool;
     import jdk.vm.ci.meta.MetaAccessProvider;
     import jdk.vm.ci.runtime.JVMCI;
     import jdk.vm.ci.runtime.JVMCICompiler;
    -import jdk.vm.ci.services.Services;
     
     /**
      * This class implements compile-the-world functionality with JVMCI.
    @@ -785,7 +784,6 @@ public final class CompileTheWorld {
         }
     
         public static void main(String[] args) throws Throwable {
    -        Services.exportJVMCITo(CompileTheWorld.class);
             HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) HotSpotJVMCIRuntime.runtime().getCompiler();
             compiler.compileTheWorld();
         }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompileTheWorldOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompressEncoding.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/FingerprintUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
    index 898d688747d..40cd58ce8c2 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java
    @@ -244,7 +244,7 @@ public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
             return (int) (Math.log(objectAlignment) / Math.log(2));
         }
     
    -    public final int narrowKlassSize = getTypeSize("narrowKlass");
    +    public final int narrowKlassSize = getFieldValue("CompilerToVM::Data::sizeof_narrowKlass", Integer.class, "int");
         public final long narrowKlassBase = getFieldValue("CompilerToVM::Data::Universe_narrow_klass_base", Long.class, "address");
         public final int narrowKlassShift = getFieldValue("CompilerToVM::Data::Universe_narrow_klass_shift", Integer.class, "int");
         public final int logKlassAlignment = getConstant("LogKlassAlignmentInBytes", Integer.class);
    @@ -290,7 +290,7 @@ public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
             return (layoutHelperArrayTagTypeValue & ~layoutHelperArrayTagObjectValue) << layoutHelperArrayTagShift;
         }
     
    -    public final int vtableEntrySize = getTypeSize("vtableEntry");
    +    public final int vtableEntrySize = getFieldValue("CompilerToVM::Data::sizeof_vtableEntry", Integer.class, "int");
         public final int vtableEntryMethodOffset = getFieldOffset("vtableEntry::_method", Integer.class, "Method*");
     
         public final int instanceKlassInitStateOffset = getFieldOffset("InstanceKlass::_init_state", Integer.class, "u1");
    @@ -302,7 +302,7 @@ public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
         public final int instanceKlassStateLinked = getConstant("InstanceKlass::linked", Integer.class);
         public final int instanceKlassStateFullyInitialized = getConstant("InstanceKlass::fully_initialized", Integer.class);
     
    -    public final int arrayOopDescSize = getTypeSize("arrayOopDesc");
    +    public final int arrayOopDescSize = getFieldValue("CompilerToVM::Data::sizeof_arrayOopDesc", Integer.class, "int");
     
         /**
          * The offset of the array length word in an array object's header.
    @@ -496,7 +496,7 @@ public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
         public final int compilationLevelFullOptimization = getConstant("CompLevel_full_optimization",
                         Integer.class);
     
    -    public final int constantPoolSize = getTypeSize("ConstantPool");
    +    public final int constantPoolSize = getFieldValue("CompilerToVM::Data::sizeof_ConstantPool", Integer.class, "int");
         public final int constantPoolLengthOffset = getFieldOffset("ConstantPool::_length",
                         Integer.class, "int");
     
    @@ -553,7 +553,7 @@ public class GraalHotSpotVMConfig extends HotSpotVMConfigAccess {
         public final int klassOffset = getFieldValue("java_lang_Class::_klass_offset", Integer.class, "int");
         public final int arrayKlassOffset = getFieldValue("java_lang_Class::_array_klass_offset", Integer.class, "int");
     
    -    public final int basicLockSize = getTypeSize("BasicLock");
    +    public final int basicLockSize = getFieldValue("CompilerToVM::Data::sizeof_BasicLock", Integer.class, "int");
         public final int basicLockDisplacedHeaderOffset = getFieldOffset("BasicLock::_displaced_header", Integer.class, "markOop");
     
         public final int threadAllocatedBytesOffset = getFieldOffset("Thread::_allocated_bytes", Integer.class, "jlong");
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
    similarity index 92%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
    index e7ca2262368..cab5141f0ad 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java
    @@ -22,21 +22,19 @@
      */
     package org.graalvm.compiler.hotspot;
     
    -import static org.graalvm.compiler.core.common.util.Util.Java8OrEarlier;
    -import static org.graalvm.compiler.options.OptionValue.PROFILE_OPTIONVALUE_PROPERTY_NAME;
     import static jdk.vm.ci.common.InitTimer.timer;
    +import static org.graalvm.compiler.options.OptionValue.PROFILE_OPTIONVALUE_PROPERTY_NAME;
     
     import java.io.File;
     import java.io.FileReader;
     import java.io.IOException;
     import java.io.PrintStream;
    -import java.lang.reflect.Field;
     import java.util.HashMap;
     import java.util.Map;
    +import java.util.Map.Entry;
     import java.util.Properties;
     import java.util.ServiceLoader;
     
    -import org.graalvm.compiler.debug.GraalError;
     import org.graalvm.compiler.debug.MethodFilter;
     import org.graalvm.compiler.options.Option;
     import org.graalvm.compiler.options.OptionDescriptors;
    @@ -46,10 +44,11 @@ import org.graalvm.compiler.options.OptionsParser;
     import org.graalvm.compiler.phases.tiers.CompilerConfiguration;
     
     import jdk.vm.ci.common.InitTimer;
    +import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory;
     import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
     import jdk.vm.ci.hotspot.HotSpotSignature;
    -import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory;
     import jdk.vm.ci.runtime.JVMCIRuntime;
    +import jdk.vm.ci.services.Services;
     
     public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFactory {
     
    @@ -135,8 +134,8 @@ public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFacto
             if (allOptionsSettings == null) {
                 try (InitTimer t = timer("InitializeOptions")) {
                     ServiceLoader loader = ServiceLoader.load(OptionDescriptors.class, OptionDescriptors.class.getClassLoader());
    -                Properties savedProps = getSavedProperties(Java8OrEarlier);
    -                String optionsFile = savedProps.getProperty(GRAAL_OPTIONS_FILE_PROPERTY_NAME);
    +                Map savedProps = Services.getSavedProperties();
    +                String optionsFile = savedProps.get(GRAAL_OPTIONS_FILE_PROPERTY_NAME);
     
                     if (optionsFile != null) {
                         File graalOptions = new File(optionsFile);
    @@ -165,15 +164,15 @@ public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFacto
                     }
     
                     Map optionSettings = new HashMap<>();
    -                for (Map.Entry e : savedProps.entrySet()) {
    -                    String name = (String) e.getKey();
    +                for (Entry e : savedProps.entrySet()) {
    +                    String name = e.getKey();
                         if (name.startsWith(GRAAL_OPTION_PROPERTY_PREFIX)) {
                             if (name.equals("graal.PrintFlags") || name.equals("graal.ShowFlags")) {
                                 System.err.println("The " + name + " option has been removed and will be ignored. Use -XX:+JVMCIPrintProperties instead.");
                             } else if (name.equals(GRAAL_OPTIONS_FILE_PROPERTY_NAME) || name.equals(GRAAL_VERSION_PROPERTY_NAME) || name.equals(PROFILE_OPTIONVALUE_PROPERTY_NAME)) {
                                 // Ignore well known properties that do not denote an option
                             } else {
    -                            String value = (String) e.getValue();
    +                            String value = e.getValue();
                                 optionSettings.put(name.substring(GRAAL_OPTION_PROPERTY_PREFIX.length()), value);
                             }
                         }
    @@ -206,18 +205,6 @@ public final class HotSpotGraalCompilerFactory extends HotSpotJVMCICompilerFacto
             }
         }
     
    -    private static Properties getSavedProperties(boolean jdk8OrEarlier) {
    -        try {
    -            String vmClassName = jdk8OrEarlier ? "sun.misc.VM" : "jdk.internal.misc.VM";
    -            Class vmClass = Class.forName(vmClassName);
    -            Field savedPropsField = vmClass.getDeclaredField("savedProps");
    -            savedPropsField.setAccessible(true);
    -            return (Properties) savedPropsField.get(null);
    -        } catch (Exception e) {
    -            throw new GraalError(e);
    -        }
    -    }
    -
         @Override
         public HotSpotGraalCompiler createCompiler(JVMCIRuntime runtime) {
             HotSpotGraalCompiler compiler = createCompiler(runtime, CompilerConfigurationFactory.selectFactory(null));
    diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
    new file mode 100644
    index 00000000000..7dbda3a164f
    --- /dev/null
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
    @@ -0,0 +1,75 @@
    +/*
    + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute it and/or modify it
    + * under the terms of the GNU General Public License version 2 only, as
    + * published by the Free Software Foundation.
    + *
    + * This code is distributed in the hope that it will be useful, but WITHOUT
    + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    + * version 2 for more details (a copy is included in the LICENSE file that
    + * accompanied this code).
    + *
    + * You should have received a copy of the GNU General Public License version
    + * 2 along with this work; if not, write to the Free Software Foundation,
    + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    + *
    + * Please 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 org.graalvm.compiler.hotspot;
    +
    +import org.graalvm.compiler.serviceprovider.ServiceProvider;
    +
    +import jdk.vm.ci.hotspot.HotSpotVMEventListener;
    +import jdk.vm.ci.runtime.JVMCICompilerFactory;
    +import jdk.vm.ci.services.JVMCIServiceLocator;
    +
    +@ServiceProvider(JVMCIServiceLocator.class)
    +public final class HotSpotGraalJVMCIServiceLocator extends JVMCIServiceLocator {
    +
    +    /**
    +     * Holds the state shared between all {@link HotSpotGraalJVMCIServiceLocator} instances. This is
    +     * necessary as a service provider instance is created each time the service is loaded.
    +     */
    +    private static final class Shared {
    +        static final Shared SINGLETON = new Shared();
    +
    +         T getProvider(Class service, HotSpotGraalJVMCIServiceLocator locator) {
    +            if (service == JVMCICompilerFactory.class) {
    +                return service.cast(new HotSpotGraalCompilerFactory(locator));
    +            } else if (service == HotSpotVMEventListener.class) {
    +                if (graalRuntime != null) {
    +                    return service.cast(new HotSpotGraalVMEventListener(graalRuntime));
    +                }
    +            }
    +            return null;
    +        }
    +
    +        private HotSpotGraalRuntime graalRuntime;
    +
    +        /**
    +         * Notifies this object of the compiler created via {@link HotSpotGraalJVMCIServiceLocator}.
    +         */
    +        void onCompilerCreation(HotSpotGraalCompiler compiler) {
    +            assert this.graalRuntime == null : "only expect a single JVMCICompiler to be created";
    +            this.graalRuntime = (HotSpotGraalRuntime) compiler.getGraalRuntime();
    +        }
    +    }
    +
    +    @Override
    +    public  T getProvider(Class service) {
    +        return Shared.SINGLETON.getProvider(service, this);
    +    }
    +
    +    /**
    +     * Notifies this object of the compiler created via {@link HotSpotGraalJVMCIServiceLocator}.
    +     */
    +    @SuppressWarnings("static-method")
    +    void onCompilerCreation(HotSpotGraalCompiler compiler) {
    +        Shared.SINGLETON.onCompilerCreation(compiler);
    +    }
    +}
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
    similarity index 92%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
    index d2c61d89a9d..f2f45e24fec 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java
    @@ -22,6 +22,7 @@
      */
     package org.graalvm.compiler.hotspot;
     
    +import org.graalvm.compiler.core.common.LIRKind;
     import org.graalvm.compiler.debug.GraalError;
     import org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction;
     import org.graalvm.compiler.hotspot.meta.HotSpotProviders;
    @@ -141,10 +142,10 @@ public interface HotSpotLIRGenerator extends LIRGeneratorTool {
         /**
          * Emits code for a {@link LoadConstantIndirectlyNode}.
          *
    -     * @param constant
    +     * @param constant original constant
    +     * @param action action to perform on the metaspace object
          * @return Value of loaded address in register
          */
    -    @SuppressWarnings("unused")
         default Value emitLoadMetaspaceAddress(Constant constant, HotSpotConstantLoadAction action) {
             throw GraalError.unimplemented();
         }
    @@ -152,21 +153,23 @@ public interface HotSpotLIRGenerator extends LIRGeneratorTool {
         /**
          * Emits code for a {@link GraalHotSpotVMConfigNode}.
          *
    -     * @param markId type of address to load
    +     * @param markId id of the value to load
    +     * @param kind type of the value to load
          * @return value of loaded global in register
          */
    -    default Value emitLoadConfigValue(int markId) {
    +    default Value emitLoadConfigValue(int markId, LIRKind kind) {
             throw GraalError.unimplemented();
         }
     
         /**
          * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotObjectConstant}.
          *
    +     * @param constant original constant
          * @param constantDescription a description of the string that need to be materialized (and
          *            interned) as java.lang.String, generated with {@link EncodedSymbolConstant}
    +     * @param frameState frame state for the runtime call
          * @return Returns the address of the requested constant.
          */
    -    @SuppressWarnings("unused")
         default Value emitObjectConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
             throw GraalError.unimplemented();
         }
    @@ -174,11 +177,12 @@ public interface HotSpotLIRGenerator extends LIRGeneratorTool {
         /**
          * Emits code for a {@link ResolveConstantNode} to resolve a {@link HotSpotMetaspaceConstant}.
          *
    +     * @param constant original constant
          * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
          *            generated by {@link EncodedSymbolConstant}
    +     * @param frameState frame state for the runtime call
          * @return Returns the address of the requested constant.
          */
    -    @SuppressWarnings("unused")
         default Value emitMetaspaceConstantRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
             throw GraalError.unimplemented();
         }
    @@ -188,12 +192,13 @@ public interface HotSpotLIRGenerator extends LIRGeneratorTool {
          * {@link HotSpotMetaspaceConstant} that represents a {@link ResolvedJavaMethod} and return the
          * corresponding MethodCounters object.
          *
    +     * @param method original constant
          * @param klassHint a klass in which the method is declared
          * @param methodDescription is symbolic description of the constant generated by
          *            {@link EncodedSymbolConstant}
    +     * @param frameState frame state for the runtime call
          * @return Returns the address of the requested constant.
          */
    -    @SuppressWarnings("unused")
         default Value emitResolveMethodAndLoadCounters(Constant method, Value klassHint, Value methodDescription, LIRFrameState frameState) {
             throw GraalError.unimplemented();
         }
    @@ -202,11 +207,13 @@ public interface HotSpotLIRGenerator extends LIRGeneratorTool {
          * Emits code for a {@link ResolveConstantNode} to resolve a klass
          * {@link HotSpotMetaspaceConstant} and run static initializer.
          *
    +     *
    +     * @param constant original constant
          * @param constantDescription a symbolic description of the {@link HotSpotMetaspaceConstant}
          *            generated by {@link EncodedSymbolConstant}
    +     * @param frameState frame state for the runtime call
          * @return Returns the address of the requested constant.
          */
    -    @SuppressWarnings("unused")
         default Value emitKlassInitializationAndRetrieval(Constant constant, Value constantDescription, LIRFrameState frameState) {
             throw GraalError.unimplemented();
         }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOption.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
    index 0fc8323be99..3f50151d1a0 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java
    @@ -128,7 +128,7 @@ public class HotSpotGraphBuilderPlugins {
          */
         public static Plugins create(GraalHotSpotVMConfig config, HotSpotWordTypes wordTypes, MetaAccessProvider metaAccess, ConstantReflectionProvider constantReflection,
                         SnippetReflectionProvider snippetReflection, ForeignCallsProvider foreignCalls, StampProvider stampProvider, ReplacementsImpl replacements) {
    -        InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config, metaAccess);
    +        InvocationPlugins invocationPlugins = new HotSpotInvocationPlugins(config);
     
             Plugins plugins = new Plugins(invocationPlugins);
             NodeIntrinsificationProvider nodeIntrinsificationProvider = new NodeIntrinsificationProvider(metaAccess, snippetReflection, foreignCalls, wordTypes);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
    similarity index 96%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
    index 6c7f0088cd5..244579972dd 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java
    @@ -38,7 +38,6 @@ import org.graalvm.compiler.nodes.type.StampTool;
     import org.graalvm.compiler.replacements.nodes.MacroNode;
     
     import jdk.vm.ci.meta.JavaKind;
    -import jdk.vm.ci.meta.MetaAccessProvider;
     import jdk.vm.ci.meta.ResolvedJavaType;
     
     /**
    @@ -47,8 +46,7 @@ import jdk.vm.ci.meta.ResolvedJavaType;
     final class HotSpotInvocationPlugins extends InvocationPlugins {
         final GraalHotSpotVMConfig config;
     
    -    HotSpotInvocationPlugins(GraalHotSpotVMConfig config, MetaAccessProvider metaAccess) {
    -        super(metaAccess);
    +    HotSpotInvocationPlugins(GraalHotSpotVMConfig config) {
             this.config = config;
         }
     
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CompressionNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizationFetchUnrollInfoCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DirectCompareAndSwapNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EnterUnpackFramesStackFrameNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
    similarity index 76%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
    index cdb8160632e..8d0575fe6b5 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,62 +55,86 @@ public class GraalHotSpotVMConfigNode extends FloatingNode implements LIRLowerab
         private final GraalHotSpotVMConfig config;
         protected final int markId;
     
    +    /**
    +     * Constructor for {@link #areConfigValuesConstant()}.
    +     *
    +     * @param config
    +     */
    +    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config) {
    +        super(TYPE, StampFactory.forKind(JavaKind.Boolean));
    +        this.config = config;
    +        this.markId = 0;
    +    }
    +
    +    /**
    +     * Constructor for node intrinsics below.
    +     *
    +     * @param config
    +     * @param markId id of the config value
    +     */
    +    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId) {
    +        super(TYPE, StampFactory.forNodeIntrinsic());
    +        this.config = config;
    +        this.markId = markId;
    +    }
    +
    +    /**
    +     * Constructor with explicit type specification.
    +     *
    +     * @param config
    +     * @param markId id of the config value
    +     * @param kind explicit type of the node
    +     */
         public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId, JavaKind kind) {
             super(TYPE, StampFactory.forKind(kind));
             this.config = config;
             this.markId = markId;
         }
     
    -    /**
    -     * Constructor selected by {@link #loadConfigValue(int, JavaKind)}.
    -     *
    -     * @param config
    -     * @param markId
    -     */
    -    public GraalHotSpotVMConfigNode(@InjectedNodeParameter GraalHotSpotVMConfig config, int markId) {
    -        super(TYPE, StampFactory.forKind(JavaKind.Boolean));
    -        this.config = config;
    -        this.markId = 0;
    -    }
    -
         @Override
         public void generate(NodeLIRBuilderTool generator) {
    -        Value res = ((HotSpotLIRGenerator) generator.getLIRGeneratorTool()).emitLoadConfigValue(markId);
    +        Value res = ((HotSpotLIRGenerator) generator.getLIRGeneratorTool()).emitLoadConfigValue(markId, generator.getLIRGeneratorTool().getLIRKind(stamp));
             generator.setResult(this, res);
         }
     
         @NodeIntrinsic
    -    private static native boolean isConfigValueConstant(@ConstantNodeParameter int markId);
    +    private static native boolean areConfigValuesConstant();
     
    -    @NodeIntrinsic
    -    private static native long loadConfigValue(@ConstantNodeParameter int markId, @ConstantNodeParameter JavaKind kind);
    +    @NodeIntrinsic(setStampFromReturnType = true)
    +    private static native long loadLongConfigValue(@ConstantNodeParameter int markId);
    +
    +    @NodeIntrinsic(setStampFromReturnType = true)
    +    private static native int loadIntConfigValue(@ConstantNodeParameter int markId);
    +
    +    @NodeIntrinsic(setStampFromReturnType = true)
    +    private static native byte loadByteConfigValue(@ConstantNodeParameter int markId);
     
         public static long cardTableAddress() {
    -        return loadConfigValue(cardTableAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
    +        return loadLongConfigValue(cardTableAddressMark(INJECTED_VMCONFIG));
         }
     
         public static boolean isCardTableAddressConstant() {
    -        return isConfigValueConstant(cardTableAddressMark(INJECTED_VMCONFIG));
    +        return areConfigValuesConstant();
         }
     
         public static long heapTopAddress() {
    -        return loadConfigValue(heapTopAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
    +        return loadLongConfigValue(heapTopAddressMark(INJECTED_VMCONFIG));
         }
     
         public static long heapEndAddress() {
    -        return loadConfigValue(heapEndAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
    +        return loadLongConfigValue(heapEndAddressMark(INJECTED_VMCONFIG));
         }
     
         public static long crcTableAddress() {
    -        return loadConfigValue(crcTableAddressMark(INJECTED_VMCONFIG), JavaKind.Long);
    +        return loadLongConfigValue(crcTableAddressMark(INJECTED_VMCONFIG));
         }
     
         public static int logOfHeapRegionGrainBytes() {
    -        return (int) loadConfigValue(logOfHeapRegionGrainBytesMark(INJECTED_VMCONFIG), JavaKind.Byte);
    +        return loadIntConfigValue(logOfHeapRegionGrainBytesMark(INJECTED_VMCONFIG));
         }
     
         public static boolean inlineContiguousAllocationSupported() {
    -        return loadConfigValue(inlineContiguousAllocationSupportedMark(INJECTED_VMCONFIG), JavaKind.Byte) > 0;
    +        return loadByteConfigValue(inlineContiguousAllocationSupportedMark(INJECTED_VMCONFIG)) != 0;
         }
     
         @Fold
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotNodeCostProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveCurrentStackFrameNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveDeoptimizedStackFrameNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LeaveUnpackFramesStackFrameNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PushInterpreterFrameNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SaveAllRegistersNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetAnchorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SnippetLocationProxyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/UncommonTrapCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotLIRKindTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/NarrowOopStamp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
    similarity index 99%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
    index 46d8be12171..caa04c2c979 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java
    @@ -28,9 +28,6 @@ import java.util.ArrayList;
     import java.util.HashMap;
     import java.util.Map.Entry;
     
    -import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
    -import jdk.vm.ci.meta.JavaConstant;
    -
     import org.graalvm.compiler.graph.Node;
     import org.graalvm.compiler.graph.iterators.NodeIterable;
     import org.graalvm.compiler.hotspot.nodes.aot.InitializeKlassNode;
    @@ -43,6 +40,9 @@ import org.graalvm.compiler.nodes.cfg.ControlFlowGraph;
     import org.graalvm.compiler.phases.BasePhase;
     import org.graalvm.compiler.phases.tiers.PhaseContext;
     
    +import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
    +import jdk.vm.ci.meta.Constant;
    +
     public class EliminateRedundantInitializationPhase extends BasePhase {
         /**
          * Find blocks with class initializing nodes for the class identified the by the constant node.
    @@ -202,7 +202,7 @@ public class EliminateRedundantInitializationPhase extends BasePhase redundantInits = new ArrayList<>();
             for (ConstantNode node : getConstantNodes(graph)) {
    -            JavaConstant constant = node.asJavaConstant();
    +            Constant constant = node.asConstant();
                 if (constant instanceof HotSpotMetaspaceConstant) {
                     redundantInits.addAll(processConstantNode(cfg, node));
                 }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
    similarity index 94%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
    index 3dfb4210356..2240b335ed3 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java
    @@ -29,8 +29,6 @@ import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.VERY_SLO
     import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability;
     import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset;
     
    -import java.lang.reflect.Field;
    -
     import org.graalvm.compiler.api.replacements.ClassSubstitution;
     import org.graalvm.compiler.api.replacements.MethodSubstitution;
     import org.graalvm.compiler.core.common.LocationIdentity;
    @@ -61,7 +59,7 @@ public class AESCryptSubstitutions {
         static final long kOffset;
         static final long lastKeyOffset;
         static final Class AESCryptClass;
    -    static final int AES_BLOCK_SIZE;
    +    static final int AES_BLOCK_SIZE_IN_BYTES;
     
         static {
             try {
    @@ -72,9 +70,9 @@ public class AESCryptSubstitutions {
                 AESCryptClass = Class.forName("com.sun.crypto.provider.AESCrypt", true, cl);
                 kOffset = UnsafeAccess.UNSAFE.objectFieldOffset(AESCryptClass.getDeclaredField("K"));
                 lastKeyOffset = UnsafeAccess.UNSAFE.objectFieldOffset(AESCryptClass.getDeclaredField("lastKey"));
    -            Field aesBlockSizeField = Class.forName("com.sun.crypto.provider.AESConstants", true, cl).getDeclaredField("AES_BLOCK_SIZE");
    -            aesBlockSizeField.setAccessible(true);
    -            AES_BLOCK_SIZE = aesBlockSizeField.getInt(null);
    +            // Thankfully the AES block size is a constant (128 bits) and so we don't need to
    +            // reflect on com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE.
    +            AES_BLOCK_SIZE_IN_BYTES = 16;
             } catch (Exception ex) {
                 throw new GraalError(ex);
             }
    @@ -141,7 +139,7 @@ public class AESCryptSubstitutions {
          * Perform null and array bounds checks for arguments to a cipher operation.
          */
         static void checkArgs(byte[] in, int inOffset, byte[] out, int outOffset) {
    -        if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE < outOffset)) {
    +        if (probability(VERY_SLOW_PATH_PROBABILITY, inOffset < 0 || in.length - AES_BLOCK_SIZE_IN_BYTES < inOffset || outOffset < 0 || out.length - AES_BLOCK_SIZE_IN_BYTES < outOffset)) {
                 DeoptimizeNode.deopt(DeoptimizationAction.None, DeoptimizationReason.RuntimeConstraint);
             }
         }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
    similarity index 97%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
    index 218b4f0508e..1c1447d913a 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java
    @@ -57,7 +57,7 @@ public class CRC32Substitutions {
             return config.crcTableAddress;
         }
     
    -    @MethodSubstitution
    +    @MethodSubstitution(optional = true)
         static int update(int crc, int b) {
             final long crcTableRawAddress = GraalHotSpotVMConfigNode.crcTableAddress();
     
    @@ -69,7 +69,7 @@ public class CRC32Substitutions {
             return ~result;
         }
     
    -    @MethodSubstitution
    +    @MethodSubstitution(optional = true)
         static int updateBytes(int crc, byte[] buf, int off, int len) {
             Word bufAddr = Word.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off));
             return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
    @@ -84,7 +84,7 @@ public class CRC32Substitutions {
             return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
         }
     
    -    @MethodSubstitution
    +    @MethodSubstitution(optional = true)
         static int updateByteBuffer(int crc, long addr, int off, int len) {
             Word bufAddr = Word.unsigned(addr).add(off);
             return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
    index 99fb04dde2d..e80bb98c19d 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java
    @@ -45,7 +45,7 @@ import org.graalvm.compiler.word.Word;
     @ClassSubstitution(Thread.class)
     public class ThreadSubstitutions {
     
    -    @MethodSubstitution(isStatic = false)
    +    @MethodSubstitution(isStatic = false, optional = true)
         public static boolean isInterrupted(final Thread thisObject, boolean clearInterrupted) {
             Word javaThread = CurrentJavaThreadNode.get();
             Object thread = javaThread.readObject(threadObjectOffset(INJECTED_VMCONFIG), JAVA_THREAD_THREAD_OBJECT_LOCATION);
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySlowPathNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyUnrollNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/UnsafeArrayCopySnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DeoptimizationStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
    similarity index 81%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
    index 5d2eb3ee74b..8857bd417a6 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java
    @@ -89,18 +89,11 @@ public abstract class Stub {
          */
         protected InstalledCode code;
     
    -    /**
    -     * Compilation result from which {@link #code} was created.
    -     */
    -    protected CompilationResult compResult;
    -
         /**
          * The registers destroyed by this stub (from the caller's perspective).
          */
         private Set destroyedCallerRegisters;
     
    -    private HotSpotCompiledCode compiledCode;
    -
         public void initDestroyedCallerRegisters(Set registers) {
             assert registers != null;
             assert destroyedCallerRegisters == null || registers.equals(destroyedCallerRegisters) : "cannot redefine";
    @@ -184,35 +177,13 @@ public abstract class Stub {
         public synchronized InstalledCode getCode(final Backend backend) {
             if (code == null) {
                 try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
    -                final StructuredGraph graph = getGraph(getStubCompilationId());
    -
    -                // Stubs cannot be recompiled so they cannot be compiled with assumptions
    -                assert graph.getAssumptions() == null;
    -
    -                if (!(graph.start() instanceof StubStartNode)) {
    -                    StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
    -                    newStart.setStateAfter(graph.start().stateAfter());
    -                    graph.replaceFixed(graph.start(), newStart);
    -                }
    -
                     CodeCacheProvider codeCache = providers.getCodeCache();
    -
    -                compResult = new CompilationResult(toString(), GeneratePIC.getValue());
    -                try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
    -                    Suites suites = createSuites();
    -                    emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
    -                    LIRSuites lirSuites = createLIRSuites();
    -                    emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
    -                    assert checkStubInvariants();
    -                } catch (Throwable e) {
    -                    throw Debug.handle(e);
    -                }
    -
    -                assert destroyedCallerRegisters != null;
    +                CompilationResult compResult = buildCompilationResult(backend);
                     try (Scope s = Debug.scope("CodeInstall", compResult)) {
    +                    assert destroyedCallerRegisters != null;
                         // Add a GeneratePIC check here later, we don't want to install
                         // code if we don't have a corresponding VM global symbol.
    -                    compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult);
    +                    HotSpotCompiledCode compiledCode = HotSpotCompiledCodeBuilder.createCompiledCode(null, null, compResult);
                         code = codeCache.installCode(null, compiledCode, null, null, false);
                     } catch (Throwable e) {
                         throw Debug.handle(e);
    @@ -226,6 +197,44 @@ public abstract class Stub {
             return code;
         }
     
    +    @SuppressWarnings("try")
    +    private CompilationResult buildCompilationResult(final Backend backend) {
    +        CompilationResult compResult = new CompilationResult(toString(), GeneratePIC.getValue());
    +        final StructuredGraph graph = getGraph(getStubCompilationId());
    +
    +        // Stubs cannot be recompiled so they cannot be compiled with assumptions
    +        assert graph.getAssumptions() == null;
    +
    +        if (!(graph.start() instanceof StubStartNode)) {
    +            StubStartNode newStart = graph.add(new StubStartNode(Stub.this));
    +            newStart.setStateAfter(graph.start().stateAfter());
    +            graph.replaceFixed(graph.start(), newStart);
    +        }
    +
    +        try (Scope s0 = Debug.scope("StubCompilation", graph, providers.getCodeCache())) {
    +            Suites suites = createSuites();
    +            emitFrontEnd(providers, backend, graph, providers.getSuites().getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, DefaultProfilingInfo.get(TriState.UNKNOWN), suites);
    +            LIRSuites lirSuites = createLIRSuites();
    +            emitBackEnd(graph, Stub.this, getInstalledCodeOwner(), backend, compResult, CompilationResultBuilderFactory.Default, getRegisterConfig(), lirSuites);
    +            assert checkStubInvariants(compResult);
    +        } catch (Throwable e) {
    +            throw Debug.handle(e);
    +        }
    +        return compResult;
    +    }
    +
    +    /**
    +     * Gets a {@link CompilationResult} that can be used for code generation. Required for AOT.
    +     */
    +    @SuppressWarnings("try")
    +    public CompilationResult getCompilationResult(final Backend backend) {
    +        try (Scope d = Debug.sandbox("CompilingStub", DebugScope.getConfig(), providers.getCodeCache(), debugScopeContext())) {
    +            return buildCompilationResult(backend);
    +        } catch (Throwable e) {
    +            throw Debug.handle(e);
    +        }
    +    }
    +
         public CompilationIdentifier getStubCompilationId() {
             return new StubCompilationIdentifier(this);
         }
    @@ -233,7 +242,7 @@ public abstract class Stub {
         /**
          * Checks the conditions a compilation must satisfy to be installed as a RuntimeStub.
          */
    -    private boolean checkStubInvariants() {
    +    private boolean checkStubInvariants(CompilationResult compResult) {
             assert compResult.getExceptionHandlers().isEmpty() : this;
     
             // Stubs cannot be recompiled so they cannot be compiled with
    @@ -278,24 +287,4 @@ public abstract class Stub {
             }
             return lirSuites;
         }
    -
    -    /**
    -     * Gets the HotSpotCompiledCode that was created during installation.
    -     */
    -    public synchronized HotSpotCompiledCode getCompiledCode(final Backend backend) {
    -        getCompilationResult(backend);
    -        assert compiledCode != null;
    -        return compiledCode;
    -    }
    -
    -    /**
    -     * Gets the compilation result for this stub, compiling it first if necessary, and installing it
    -     * in code.
    -     */
    -    public synchronized CompilationResult getCompilationResult(final Backend backend) {
    -        if (code == null) {
    -            getCode(backend);
    -        }
    -        return compResult;
    -    }
     }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UncommonTrapStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceIntervalWalker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/FastSSIBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIBuilderBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIConstructionPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssi/SSIVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/MathFunctionBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/micro/benchmarks/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMH.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/META-INF/services/javax.annotation.processing.Processor
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/DivNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationBeginNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationEndNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationInliningCallback.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/InstrumentationNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/IsMethodInlinedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/MonitorProxyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/instrumentation/RootNameNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWriteNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeLoadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeStoreNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
    index b2f6910c404..dac1acd0c94 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java
    @@ -40,8 +40,7 @@ public interface InvocationPlugin extends GraphBuilderPlugin {
     
         /**
          * The receiver in a non-static method. The class literal for this interface must be used with
    -     * {@link InvocationPlugins#put(InvocationPlugin, boolean, boolean, boolean, Class, String, Class...)}
    -     * to denote the receiver argument for such a non-static method.
    +     * {@link InvocationPlugins#put} to denote the receiver argument for such a non-static method.
          */
         public interface Receiver {
             /**
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
    similarity index 52%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
    index 74562c4a031..bc1686ae126 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java
    @@ -23,8 +23,9 @@
     package org.graalvm.compiler.nodes.graphbuilderconf;
     
     import static java.lang.String.format;
    +import static org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.LateClassPlugins.CLOSED_LATE_CLASS_PLUGIN;
     
    -import java.lang.reflect.Executable;
    +import java.lang.reflect.Constructor;
     import java.lang.reflect.Method;
     import java.lang.reflect.Modifier;
     import java.lang.reflect.Type;
    @@ -32,10 +33,8 @@ import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Collections;
     import java.util.HashMap;
    -import java.util.HashSet;
     import java.util.List;
     import java.util.Map;
    -import java.util.Set;
     
     import org.graalvm.compiler.api.replacements.MethodSubstitution;
     import org.graalvm.compiler.api.replacements.MethodSubstitutionRegistry;
    @@ -46,12 +45,24 @@ import org.graalvm.compiler.graph.iterators.NodeIterable;
     import org.graalvm.compiler.nodes.ValueNode;
     import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugin.Receiver;
     
    -import jdk.vm.ci.meta.MetaAccessProvider;
     import jdk.vm.ci.meta.MetaUtil;
     import jdk.vm.ci.meta.ResolvedJavaMethod;
    +import jdk.vm.ci.meta.ResolvedJavaType;
    +import jdk.vm.ci.meta.Signature;
     
     /**
      * Manages a set of {@link InvocationPlugin}s.
    + *
    + * Most plugins are registered during initialization (i.e., before
    + * {@link #lookupInvocation(ResolvedJavaMethod)} or {@link #getBindings} is called). These
    + * registrations can be made with {@link Registration},
    + * {@link #register(InvocationPlugin, String, String, Type...)},
    + * {@link #register(InvocationPlugin, Type, String, Type...)} or
    + * {@link #registerOptional(InvocationPlugin, Type, String, Type...)}. Initialization is not
    + * thread-safe and so must only be performed by a single thread.
    + *
    + * Plugins that are not guaranteed to be made during initialization must use
    + * {@link LateRegistration}.
      */
     public class InvocationPlugins {
     
    @@ -259,6 +270,26 @@ public class InvocationPlugins {
                 plugins.register(plugin, false, allowOverwrite, declaringType, name, arg1, arg2, arg3, arg4, arg5);
             }
     
    +        /**
    +         * Registers a plugin for a method with 6 arguments.
    +         *
    +         * @param name the name of the method
    +         * @param plugin the plugin to be registered
    +         */
    +        public void register6(String name, Type arg1, Type arg2, Type arg3, Type arg4, Type arg5, Type arg6, InvocationPlugin plugin) {
    +            plugins.register(plugin, false, allowOverwrite, declaringType, name, arg1, arg2, arg3, arg4, arg5, arg6);
    +        }
    +
    +        /**
    +         * Registers a plugin for a method with 7 arguments.
    +         *
    +         * @param name the name of the method
    +         * @param plugin the plugin to be registered
    +         */
    +        public void register7(String name, Type arg1, Type arg2, Type arg3, Type arg4, Type arg5, Type arg6, Type arg7, InvocationPlugin plugin) {
    +            plugins.register(plugin, false, allowOverwrite, declaringType, name, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
    +        }
    +
             /**
              * Registers a plugin for an optional method with no arguments.
              *
    @@ -337,168 +368,151 @@ public class InvocationPlugins {
              */
             @Override
             public void registerMethodSubstitution(Class substituteDeclaringClass, String name, String substituteName, Type... argumentTypes) {
    -            assert methodSubstitutionBytecodeProvider != null : "Registration used for method substitutions requires a non-null methodSubstitutionBytecodeProvider";
    -            MethodSubstitutionPlugin plugin = new MethodSubstitutionPlugin(methodSubstitutionBytecodeProvider, substituteDeclaringClass, substituteName, argumentTypes);
    +            MethodSubstitutionPlugin plugin = createMethodSubstitution(substituteDeclaringClass, substituteName, argumentTypes);
                 plugins.register(plugin, false, allowOverwrite, declaringType, name, argumentTypes);
             }
    +
    +        public MethodSubstitutionPlugin createMethodSubstitution(Class substituteDeclaringClass, String substituteName, Type... argumentTypes) {
    +            assert methodSubstitutionBytecodeProvider != null : "Registration used for method substitutions requires a non-null methodSubstitutionBytecodeProvider";
    +            MethodSubstitutionPlugin plugin = new MethodSubstitutionPlugin(methodSubstitutionBytecodeProvider, substituteDeclaringClass, substituteName, argumentTypes);
    +            return plugin;
    +        }
    +
         }
     
         /**
    -     * Key for a {@linkplain ClassPlugins#entries resolved} plugin registration. Due to the
    -     * possibility of class redefinition, we cannot directly use {@link ResolvedJavaMethod}s as
    -     * keys. A {@link ResolvedJavaMethod} implementation might implement {@code equals()} and
    -     * {@code hashCode()} based on internal representation subject to change by class redefinition.
    +     * Utility for registering plugins after Graal may have been initialized. Registrations made via
    +     * this class are not finalized until {@link #close} is called.
          */
    -    static final class ResolvedJavaMethodKey {
    -        private final ResolvedJavaMethod method;
    +    public static class LateRegistration implements AutoCloseable {
     
    -        ResolvedJavaMethodKey(ResolvedJavaMethod method) {
    -            this.method = method;
    +        private InvocationPlugins plugins;
    +        private final List bindings = new ArrayList<>();
    +        private final Type declaringType;
    +
    +        /**
    +         * Creates an object for registering {@link InvocationPlugin}s for methods declared by a
    +         * given class.
    +         *
    +         * @param plugins where to register the plugins
    +         * @param declaringType the class declaring the methods for which plugins will be registered
    +         *            via this object
    +         */
    +        public LateRegistration(InvocationPlugins plugins, Type declaringType) {
    +            this.plugins = plugins;
    +            this.declaringType = declaringType;
             }
     
    -        @Override
    -        public boolean equals(Object obj) {
    -            if (obj instanceof ResolvedJavaMethodKey) {
    -                ResolvedJavaMethodKey that = (ResolvedJavaMethodKey) obj;
    -                if (this.method.isStatic() == that.method.isStatic()) {
    -                    if (this.method.getDeclaringClass().equals(that.method.getDeclaringClass())) {
    -                        if (this.method.getName().equals(that.method.getName())) {
    -                            if (this.method.getSignature().equals(that.method.getSignature())) {
    -                                return true;
    -                            }
    -                        }
    -                    }
    -                }
    +        /**
    +         * Registers an invocation plugin for a given method. There must be no plugin currently
    +         * registered for {@code method}.
    +         *
    +         * @param argumentTypes the argument types of the method. Element 0 of this array must be
    +         *            the {@link Class} value for {@link InvocationPlugin.Receiver} iff the method
    +         *            is non-static. Upon returning, element 0 will have been rewritten to
    +         *            {@code declaringClass}
    +         */
    +        public void register(InvocationPlugin plugin, String name, Type... argumentTypes) {
    +            boolean isStatic = argumentTypes.length == 0 || argumentTypes[0] != InvocationPlugin.Receiver.class;
    +            if (!isStatic) {
    +                argumentTypes[0] = declaringType;
                 }
    -            return false;
    +
    +            assert isStatic || argumentTypes[0] == declaringType;
    +            Binding binding = new Binding(plugin, isStatic, name, argumentTypes);
    +            bindings.add(binding);
    +
    +            assert Checks.check(this.plugins, declaringType, binding);
    +            assert Checks.checkResolvable(false, declaringType, binding);
             }
     
             @Override
    -        public int hashCode() {
    -            return this.method.getName().hashCode();
    -        }
    -
    -        @Override
    -        public String toString() {
    -            return "ResolvedJavaMethodKey<" + method + ">";
    +        public void close() {
    +            assert plugins != null : String.format("Late registrations of invocation plugins for %s is already closed", declaringType);
    +            plugins.registerLate(declaringType, bindings);
    +            plugins = null;
             }
         }
     
         /**
    -     * Key for {@linkplain ClassPlugins#registrations registering} an {@link InvocationPlugin} for a
    -     * specific method.
    +     * Associates an {@link InvocationPlugin} with the details of a method it substitutes.
          */
    -    static class MethodKey {
    -        final boolean isStatic;
    +    public static class Binding {
    +        /**
    +         * The plugin this binding is for.
    +         */
    +        public final InvocationPlugin plugin;
     
             /**
    -         * This method is optional. This is used for new API methods not present in previous JDK
    -         * versions.
    +         * Specifies if the associated method is static.
              */
    -        final boolean isOptional;
    -
    -        final String name;
    -        final Type[] argumentTypes;
    -        final InvocationPlugin value;
    +        public final boolean isStatic;
     
             /**
    -         * Used to lazily initialize {@link #resolved}.
    +         * The name of the associated method.
              */
    -        private final MetaAccessProvider metaAccess;
    +        public final String name;
     
    -        private volatile ResolvedJavaMethod resolved;
    +        /**
    +         * A partial
    +         * method
    +         * descriptor for the associated method. The descriptor includes enclosing {@code '('}
    +         * and {@code ')'} characters but omits the return type suffix.
    +         */
    +        public final String argumentsDescriptor;
     
    -        MethodKey(MetaAccessProvider metaAccess, InvocationPlugin data, boolean isStatic, boolean isOptional, String name, Type... argumentTypes) {
    -            this.metaAccess = metaAccess;
    -            this.value = data;
    +        /**
    +         * Link in a list of bindings.
    +         */
    +        private Binding next;
    +
    +        Binding(InvocationPlugin data, boolean isStatic, String name, Type... argumentTypes) {
    +            this.plugin = data;
                 this.isStatic = isStatic;
    -            this.isOptional = isOptional;
                 this.name = name;
    -            this.argumentTypes = argumentTypes;
    -        }
    -
    -        @Override
    -        public boolean equals(Object obj) {
    -            if (obj instanceof MethodKey) {
    -                MethodKey that = (MethodKey) obj;
    -                boolean res = this.name.equals(that.name) && areEqual(this.argumentTypes, that.argumentTypes);
    -                assert !res || this.isStatic == that.isStatic;
    -                return res;
    +            StringBuilder buf = new StringBuilder();
    +            buf.append('(');
    +            for (int i = isStatic ? 0 : 1; i < argumentTypes.length; i++) {
    +                buf.append(MetaUtil.toInternalName(argumentTypes[i].getTypeName()));
                 }
    -            return false;
    +            buf.append(')');
    +            this.argumentsDescriptor = buf.toString();
    +            assert !name.equals("") || !isStatic : this;
             }
     
    -        private static boolean areEqual(Type[] args1, Type[] args2) {
    -            if (args1.length == args2.length) {
    -                for (int i = 0; i < args1.length; i++) {
    -                    if (!args1[i].getTypeName().equals(args2[i].getTypeName())) {
    -                        return false;
    -                    }
    -                }
    -                return true;
    -            }
    -            return false;
    -        }
    -
    -        public int getDeclaredParameterCount() {
    -            return isStatic ? argumentTypes.length : argumentTypes.length - 1;
    -        }
    -
    -        @Override
    -        public int hashCode() {
    -            return name.hashCode();
    -        }
    -
    -        private ResolvedJavaMethod resolve(Class declaringClass) {
    -            if (resolved == null) {
    -                Executable method = resolveJava(declaringClass);
    -                if (method == null) {
    -                    return null;
    -                }
    -                resolved = metaAccess.lookupJavaMethod(method);
    -            }
    -            return resolved;
    -        }
    -
    -        private Executable resolveJava(Class declaringClass) {
    -            try {
    -                Executable res;
    -                Class[] parameterTypes = resolveTypes(argumentTypes, isStatic ? 0 : 1, argumentTypes.length);
    -                if (name.equals("")) {
    -                    res = declaringClass.getDeclaredConstructor(parameterTypes);
    -                } else {
    -                    res = declaringClass.getDeclaredMethod(name, parameterTypes);
    -                }
    -                assert Modifier.isStatic(res.getModifiers()) == isStatic : res;
    -                return res;
    -            } catch (NoSuchMethodException | SecurityException e) {
    -                if (isOptional) {
    -                    return null;
    -                }
    -                throw new InternalError(e);
    -            }
    +        Binding(ResolvedJavaMethod resolved, InvocationPlugin data) {
    +            this.plugin = data;
    +            this.isStatic = resolved.isStatic();
    +            this.name = resolved.getName();
    +            Signature sig = resolved.getSignature();
    +            String desc = sig.toMethodDescriptor();
    +            assert desc.indexOf(')') != -1 : desc;
    +            this.argumentsDescriptor = desc.substring(0, desc.indexOf(')') + 1);
    +            assert !name.equals("") || !isStatic : this;
             }
     
             @Override
             public String toString() {
    -            StringBuilder sb = new StringBuilder(name).append('(');
    -            for (Type p : argumentTypes) {
    -                if (sb.charAt(sb.length() - 1) != '(') {
    -                    sb.append(", ");
    -                }
    -                sb.append(p.getTypeName());
    -            }
    -            return sb.append(')').toString();
    +            return name + argumentsDescriptor;
             }
         }
     
    -    private final MetaAccessProvider metaAccess;
    -
    -    private final Map registrations = new HashMap<>();
    +    /**
    +     * Plugin registrations for already resolved methods. If non-null, then {@link #registrations}
    +     * is null and no further registrations can be made.
    +     */
    +    private final Map resolvedRegistrations;
     
         /**
    -     * Deferred registrations as well as guard for initialization. The guard uses double-checked
    -     * locking which is why this field is {@code volatile}.
    +     * Map from class names in {@linkplain MetaUtil#toInternalName(String) internal} form to the
    +     * invocation plugin bindings for the class. Tf non-null, then {@link #resolvedRegistrations}
    +     * will be null.
    +     */
    +    private final Map registrations;
    +
    +    /**
    +     * Deferred registrations as well as the guard for delimiting the initial registration phase.
    +     * The guard uses double-checked locking which is why this field is {@code volatile}.
          */
         private volatile List deferredRegistrations = new ArrayList<>();
     
    @@ -512,119 +526,159 @@ public class InvocationPlugins {
         }
     
         /**
    -     * Per-class invocation plugins.
    +     * Support for registering plugins once this object may be accessed by multiple threads.
          */
    -    protected static class ClassPlugins {
    -        private final Type declaringType;
    +    private volatile LateClassPlugins lateRegistrations;
     
    -        private final List registrations = new ArrayList<>();
    -
    -        public ClassPlugins(Type declaringClass) {
    -            this.declaringType = declaringClass;
    -        }
    +    /**
    +     * Per-class bindings.
    +     */
    +    static class ClassPlugins {
     
             /**
    -         * Entry map that is initialized upon first call to {@link #get(ResolvedJavaMethod)}.
    -         *
    -         * Note: this must be volatile as threads may race to initialize it.
    +         * Maps method names to binding lists.
              */
    -        private volatile Map entries;
    +        private final Map bindings = new HashMap<>();
     
    -        void initializeMap() {
    -            if (!isClosed()) {
    -                if (registrations.isEmpty()) {
    -                    entries = Collections.emptyMap();
    -                } else {
    -                    Class declaringClass = resolveType(declaringType, true);
    -                    if (declaringClass == null) {
    -                        // An optional type that could not be resolved
    -                        entries = Collections.emptyMap();
    -                    } else {
    -                        Map newEntries = new HashMap<>();
    -                        for (MethodKey methodKey : registrations) {
    -                            ResolvedJavaMethod m = methodKey.resolve(declaringClass);
    -                            if (m != null) {
    -                                newEntries.put(new ResolvedJavaMethodKey(m), methodKey.value);
    -                                if (entries != null) {
    -                                    // Another thread finished initializing entries first
    -                                    return;
    -                                }
    -                            }
    -                        }
    -                        entries = newEntries;
    +        /**
    +         * Gets the invocation plugin for a given method.
    +         *
    +         * @return the invocation plugin for {@code method} or {@code null}
    +         */
    +        InvocationPlugin get(ResolvedJavaMethod method) {
    +            assert !method.isBridge();
    +            Binding binding = bindings.get(method.getName());
    +            while (binding != null) {
    +                if (method.isStatic() == binding.isStatic) {
    +                    if (method.getSignature().toMethodDescriptor().startsWith(binding.argumentsDescriptor)) {
    +                        return binding.plugin;
                         }
                     }
    +                binding = binding.next;
                 }
    +            return null;
             }
     
    -        public InvocationPlugin get(ResolvedJavaMethod method) {
    -            if (!isClosed()) {
    -                initializeMap();
    -            }
    -            return entries.get(new ResolvedJavaMethodKey(method));
    -        }
    -
    -        public void register(MethodKey methodKey, boolean allowOverwrite) {
    -            assert !isClosed() : "registration is closed: " + methodKey + " " + Arrays.toString(entries.keySet().toArray());
    +        public void register(Binding binding, boolean allowOverwrite) {
                 if (allowOverwrite) {
    -                int index = registrations.indexOf(methodKey);
    -                if (index >= 0) {
    -                    registrations.set(index, methodKey);
    +                if (lookup(binding) != null) {
    +                    register(binding);
                         return;
                     }
                 } else {
    -                assert !registrations.contains(methodKey) : "a value is already registered for " + declaringType + "." + methodKey;
    +                assert lookup(binding) == null : "a value is already registered for " + binding;
                 }
    -            registrations.add(methodKey);
    +            register(binding);
             }
     
    -        public boolean isClosed() {
    -            return entries != null;
    +        InvocationPlugin lookup(Binding binding) {
    +            Binding b = bindings.get(binding.name);
    +            while (b != null) {
    +                if (b.isStatic == binding.isStatic && b.argumentsDescriptor.equals(binding.argumentsDescriptor)) {
    +                    return b.plugin;
    +                }
    +                b = b.next;
    +            }
    +            return null;
    +        }
    +
    +        /**
    +         * Registers {@code binding}.
    +         */
    +        void register(Binding binding) {
    +            Binding head = bindings.get(binding.name);
    +            assert binding.next == null;
    +            binding.next = head;
    +            bindings.put(binding.name, binding);
    +        }
    +    }
    +
    +    static class LateClassPlugins extends ClassPlugins {
    +        static final String CLOSED_LATE_CLASS_PLUGIN = "-----";
    +        private final String className;
    +        private final LateClassPlugins next;
    +
    +        LateClassPlugins(LateClassPlugins next, String className) {
    +            assert next == null || next.className != CLOSED_LATE_CLASS_PLUGIN : "Late registration of invocation plugins is closed";
    +            this.next = next;
    +            this.className = className;
             }
         }
     
         /**
    -     * Adds an entry to this map for a specified method.
    +     * Registers a binding of a method to an invocation plugin.
          *
    -     * @param value value to be associated with the specified method
    +     * @param plugin invocation plugin to be associated with the specified method
          * @param isStatic specifies if the method is static
    -     * @param isOptional specifies if the method is optional
          * @param declaringClass the class declaring the method
          * @param name the name of the method
          * @param argumentTypes the argument types of the method. Element 0 of this array must be
          *            {@code declaringClass} iff the method is non-static.
          * @return an object representing the method
          */
    -    MethodKey put(InvocationPlugin value, boolean isStatic, boolean isOptional, boolean allowOverwrite, Type declaringClass, String name, Type... argumentTypes) {
    -        assert isStatic || argumentTypes[0] == declaringClass;
    -
    +    Binding put(InvocationPlugin plugin, boolean isStatic, boolean allowOverwrite, Type declaringClass, String name, Type... argumentTypes) {
    +        assert resolvedRegistrations == null : "registration is closed";
             String internalName = MetaUtil.toInternalName(declaringClass.getTypeName());
    +        assert isStatic || argumentTypes[0] == declaringClass;
    +        assert deferredRegistrations != null : "initial registration is closed - use " + LateRegistration.class.getName() + " for late registrations";
    +
             ClassPlugins classPlugins = registrations.get(internalName);
             if (classPlugins == null) {
    -            classPlugins = new ClassPlugins(declaringClass);
    +            classPlugins = new ClassPlugins();
                 registrations.put(internalName, classPlugins);
             }
    -        assert isStatic || argumentTypes[0] == declaringClass;
    -        MethodKey methodKey = new MethodKey(metaAccess, value, isStatic, isOptional, name, argumentTypes);
    -        classPlugins.register(methodKey, allowOverwrite);
    -        return methodKey;
    -    }
    -
    -    /**
    -     * Determines if a method denoted by a given {@link MethodKey} is in this map.
    -     */
    -    boolean containsKey(Type declaringType, MethodKey key) {
    -        String internalName = MetaUtil.toInternalName(declaringType.getTypeName());
    -        ClassPlugins classPlugins = registrations.get(internalName);
    -        return classPlugins != null && classPlugins.registrations.contains(key);
    +        Binding binding = new Binding(plugin, isStatic, name, argumentTypes);
    +        classPlugins.register(binding, allowOverwrite);
    +        return binding;
         }
     
         InvocationPlugin get(ResolvedJavaMethod method) {
    -        flushDeferrables();
    -        String internalName = method.getDeclaringClass().getName();
    -        ClassPlugins classPlugins = registrations.get(internalName);
    -        if (classPlugins != null) {
    -            return classPlugins.get(method);
    +        if (resolvedRegistrations != null) {
    +            return resolvedRegistrations.get(method);
    +        } else {
    +            if (!method.isBridge()) {
    +                ResolvedJavaType declaringClass = method.getDeclaringClass();
    +                flushDeferrables();
    +                String internalName = declaringClass.getName();
    +                ClassPlugins classPlugins = registrations.get(internalName);
    +                InvocationPlugin res = null;
    +                if (classPlugins != null) {
    +                    res = classPlugins.get(method);
    +                }
    +                if (res == null) {
    +                    LateClassPlugins lcp = findLateClassPlugins(internalName);
    +                    if (lcp != null) {
    +                        res = lcp.get(method);
    +                    }
    +                }
    +                if (res != null) {
    +                    if (canBeIntrinsified(declaringClass)) {
    +                        return res;
    +                    }
    +                }
    +            } else {
    +                // Supporting plugins for bridge methods would require including
    +                // the return type in the registered signature. Until needed,
    +                // this extra complexity is best avoided.
    +            }
    +        }
    +        return null;
    +    }
    +
    +    /**
    +     * Determines if methods in a given class can have invocation plugins.
    +     *
    +     * @param declaringClass the class to test
    +     */
    +    protected boolean canBeIntrinsified(ResolvedJavaType declaringClass) {
    +        return true;
    +    }
    +
    +    LateClassPlugins findLateClassPlugins(String internalClassName) {
    +        for (LateClassPlugins lcp = lateRegistrations; lcp != null; lcp = lcp.next) {
    +            if (lcp.className.equals(internalClassName)) {
    +                return lcp;
    +            }
             }
             return null;
         }
    @@ -639,25 +693,39 @@ public class InvocationPlugins {
                         deferredRegistrations = null;
                     }
                 }
    -            for (Map.Entry e : registrations.entrySet()) {
    -                e.getValue().initializeMap();
    -            }
             }
         }
     
    +    synchronized void registerLate(Type declaringType, List bindings) {
    +        String internalName = MetaUtil.toInternalName(declaringType.getTypeName());
    +        assert findLateClassPlugins(internalName) == null : "Cannot have more than one late registration of invocation plugins for " + internalName;
    +        LateClassPlugins lateClassPlugins = new LateClassPlugins(lateRegistrations, internalName);
    +        for (Binding b : bindings) {
    +            lateClassPlugins.register(b);
    +        }
    +        lateRegistrations = lateClassPlugins;
    +    }
    +
    +    private synchronized boolean closeLateRegistrations() {
    +        if (lateRegistrations == null || lateRegistrations.className != CLOSED_LATE_CLASS_PLUGIN) {
    +            lateRegistrations = new LateClassPlugins(lateRegistrations, CLOSED_LATE_CLASS_PLUGIN);
    +        }
    +        return true;
    +    }
    +
         /**
    -     * Disallows new registrations of new plugins, and creates the internal tables for method
    -     * lookup.
    +     * Processes deferred registrations and then closes this object for future registration.
          */
         public void closeRegistration() {
    +        assert closeLateRegistrations();
             flushDeferrables();
    -        for (Map.Entry e : registrations.entrySet()) {
    -            e.getValue().initializeMap();
    -        }
         }
     
    -    public int size() {
    -        return registrations.size();
    +    public boolean isEmpty() {
    +        if (resolvedRegistrations != null) {
    +            return resolvedRegistrations.isEmpty();
    +        }
    +        return registrations.size() == 0 && lateRegistrations == null;
         }
     
         /**
    @@ -666,47 +734,39 @@ public class InvocationPlugins {
          */
         protected final InvocationPlugins parent;
     
    -    private InvocationPlugins(InvocationPlugins parent, MetaAccessProvider metaAccess) {
    -        this.metaAccess = metaAccess;
    -        InvocationPlugins p = parent;
    -        this.parent = p;
    +    /**
    +     * Creates a set of invocation plugins with no parent.
    +     */
    +    public InvocationPlugins() {
    +        this(null);
         }
     
         /**
    -     * Creates a set of invocation plugins with a non-null {@linkplain #getParent() parent}.
    +     * Creates a set of invocation plugins.
    +     *
    +     * @param parent if non-null, this object will be searched first when looking up plugins
          */
         public InvocationPlugins(InvocationPlugins parent) {
    -        this(parent, parent.getMetaAccess());
    +        InvocationPlugins p = parent;
    +        this.parent = p;
    +        this.registrations = new HashMap<>();
    +        this.resolvedRegistrations = null;
         }
     
    -    public InvocationPlugins(Map plugins, InvocationPlugins parent, MetaAccessProvider metaAccess) {
    -        this.metaAccess = metaAccess;
    +    /**
    +     * Creates a closed set of invocation plugins for a set of resolved methods. Such an object
    +     * cannot have further plugins registered.
    +     */
    +    public InvocationPlugins(Map plugins, InvocationPlugins parent) {
             this.parent = parent;
    -
    +        this.registrations = null;
             this.deferredRegistrations = null;
    +        Map map = new HashMap<>(plugins.size());
     
             for (Map.Entry entry : plugins.entrySet()) {
    -            ResolvedJavaMethod method = entry.getKey();
    -            InvocationPlugin plugin = entry.getValue();
    -
    -            String internalName = method.getDeclaringClass().getName();
    -            ClassPlugins classPlugins = registrations.get(internalName);
    -            if (classPlugins == null) {
    -                classPlugins = new ClassPlugins(null);
    -                registrations.put(internalName, classPlugins);
    -                classPlugins.entries = new HashMap<>();
    -            }
    -
    -            classPlugins.entries.put(new ResolvedJavaMethodKey(method), plugin);
    +            map.put(entry.getKey(), entry.getValue());
             }
    -    }
    -
    -    public MetaAccessProvider getMetaAccess() {
    -        return metaAccess;
    -    }
    -
    -    public InvocationPlugins(MetaAccessProvider metaAccess) {
    -        this(null, metaAccess);
    +        this.resolvedRegistrations = map;
         }
     
         protected void register(InvocationPlugin plugin, boolean isOptional, boolean allowOverwrite, Type declaringClass, String name, Type... argumentTypes) {
    @@ -714,8 +774,9 @@ public class InvocationPlugins {
             if (!isStatic) {
                 argumentTypes[0] = declaringClass;
             }
    -        MethodKey methodKey = put(plugin, isStatic, isOptional, allowOverwrite, declaringClass, name, argumentTypes);
    -        assert Checker.check(this, declaringClass, methodKey, plugin);
    +        Binding binding = put(plugin, isStatic, allowOverwrite, declaringClass, name, argumentTypes);
    +        assert Checks.check(this, declaringClass, binding);
    +        assert Checks.checkResolvable(isOptional, declaringClass, binding);
         }
     
         /**
    @@ -765,23 +826,56 @@ public class InvocationPlugins {
         }
     
         /**
    -     * Gets the set of methods for which invocation plugins have been registered. Once this method
    -     * is called, no further registrations can be made.
    +     * Gets the set of registered invocation plugins.
    +     *
    +     * @return a map from class names in {@linkplain MetaUtil#toInternalName(String) internal} form
    +     *         to the invocation plugin bindings for methods in the class
          */
    -    public Set getMethods() {
    -        Set res = new HashSet<>();
    -        if (parent != null) {
    -            res.addAll(parent.getMethods());
    +    public Map> getBindings(boolean includeParents) {
    +        Map> res = new HashMap<>();
    +        if (parent != null && includeParents) {
    +            res.putAll(parent.getBindings(true));
             }
    -        flushDeferrables();
    -        for (ClassPlugins cp : registrations.values()) {
    -            for (ResolvedJavaMethodKey key : cp.entries.keySet()) {
    -                res.add(key.method);
    +        if (resolvedRegistrations != null) {
    +            for (Map.Entry e : resolvedRegistrations.entrySet()) {
    +                ResolvedJavaMethod method = e.getKey();
    +                InvocationPlugin plugin = e.getValue();
    +                String type = method.getDeclaringClass().getName();
    +                List bindings = res.get(type);
    +                if (bindings == null) {
    +                    bindings = new ArrayList<>();
    +                    res.put(type, bindings);
    +                }
    +                bindings.add(new Binding(method, plugin));
    +            }
    +        } else {
    +            flushDeferrables();
    +            for (Map.Entry e : registrations.entrySet()) {
    +                String type = e.getKey();
    +                ClassPlugins cp = e.getValue();
    +                collectBindingsTo(res, type, cp);
    +            }
    +            for (LateClassPlugins lcp = lateRegistrations; lcp != null; lcp = lcp.next) {
    +                String type = lcp.className;
    +                collectBindingsTo(res, type, lcp);
                 }
             }
             return res;
         }
     
    +    private static void collectBindingsTo(Map> res, String type, ClassPlugins cp) {
    +        for (Map.Entry e : cp.bindings.entrySet()) {
    +            List bindings = res.get(type);
    +            if (bindings == null) {
    +                bindings = new ArrayList<>();
    +                res.put(type, bindings);
    +            }
    +            for (Binding b = e.getValue(); b != null; b = b.next) {
    +                bindings.add(b);
    +            }
    +        }
    +    }
    +
         /**
          * Gets the invocation plugins {@linkplain #lookupInvocation(ResolvedJavaMethod) searched}
          * before searching in this object.
    @@ -792,17 +886,36 @@ public class InvocationPlugins {
     
         @Override
         public String toString() {
    -        StringBuilder buf = new StringBuilder();
    -        registrations.forEach((name, cp) -> buf.append(name).append('.').append(cp).append(", "));
    -        String s = buf.toString();
    -        if (buf.length() != 0) {
    -            s = s.substring(buf.length() - ", ".length());
    +        List all = new ArrayList<>();
    +        for (Map.Entry> e : getBindings(false).entrySet()) {
    +            String c = MetaUtil.internalNameToJava(e.getKey(), true, false);
    +            for (Binding b : e.getValue()) {
    +                all.add(c + '.' + b);
    +            }
             }
    -        return s + " / parent: " + this.parent;
    +        Collections.sort(all);
    +        StringBuilder buf = new StringBuilder();
    +        String nl = String.format("%n");
    +        for (String s : all) {
    +            if (buf.length() != 0) {
    +                buf.append(nl);
    +            }
    +            buf.append(s);
    +        }
    +        if (parent != null) {
    +            if (buf.length() != 0) {
    +                buf.append(nl);
    +            }
    +            buf.append("// parent").append(nl).append(parent);
    +        }
    +        return buf.toString();
         }
     
    -    private static class Checker {
    -        private static final int MAX_ARITY = 5;
    +    /**
    +     * Code only used in assertions. Putting this in a separate class reduces class load time.
    +     */
    +    private static class Checks {
    +        private static final int MAX_ARITY = 7;
             /**
              * The set of all {@link InvocationPlugin#apply} method signatures.
              */
    @@ -828,10 +941,17 @@ public class InvocationPlugins {
                 SIGS = sigs.toArray(new Class[sigs.size()][]);
             }
     
    -        public static boolean check(InvocationPlugins plugins, Type declaringType, MethodKey method, InvocationPlugin plugin) {
    +        static boolean containsBinding(InvocationPlugins p, Type declaringType, Binding key) {
    +            String internalName = MetaUtil.toInternalName(declaringType.getTypeName());
    +            ClassPlugins classPlugins = p.registrations.get(internalName);
    +            return classPlugins != null && classPlugins.lookup(key) != null;
    +        }
    +
    +        public static boolean check(InvocationPlugins plugins, Type declaringType, Binding binding) {
    +            InvocationPlugin plugin = binding.plugin;
                 InvocationPlugins p = plugins.parent;
                 while (p != null) {
    -                assert !p.containsKey(declaringType, method) : "a plugin is already registered for " + method;
    +                assert !containsBinding(p, declaringType, binding) : "a plugin is already registered for " + binding;
                     p = p.parent;
                 }
                 if (plugin instanceof ForeignCallPlugin || plugin instanceof GeneratedInvocationPlugin) {
    @@ -843,8 +963,8 @@ public class InvocationPlugins {
                     assert substitute.getAnnotation(MethodSubstitution.class) != null : format("Substitute method must be annotated with @%s: %s", MethodSubstitution.class.getSimpleName(), substitute);
                     return true;
                 }
    -            int arguments = method.getDeclaredParameterCount();
    -            assert arguments < SIGS.length : format("need to extend %s to support method with %d arguments: %s", InvocationPlugin.class.getSimpleName(), arguments, method);
    +            int arguments = parseParameters(binding.argumentsDescriptor).size();
    +            assert arguments < SIGS.length : format("need to extend %s to support method with %d arguments: %s", InvocationPlugin.class.getSimpleName(), arguments, binding);
                 for (Method m : plugin.getClass().getDeclaredMethods()) {
                     if (m.getName().equals("apply")) {
                         Class[] parameterTypes = m.getParameterTypes();
    @@ -853,7 +973,24 @@ public class InvocationPlugins {
                         }
                     }
                 }
    -            throw new AssertionError(format("graph builder plugin for %s not found", method));
    +            throw new AssertionError(format("graph builder plugin for %s not found", binding));
    +        }
    +
    +        static boolean checkResolvable(boolean isOptional, Type declaringType, Binding binding) {
    +            Class declaringClass = InvocationPlugins.resolveType(declaringType, isOptional);
    +            if (declaringClass == null) {
    +                return true;
    +            }
    +            if (binding.name.equals("")) {
    +                if (resolveConstructor(declaringClass, binding) == null && !isOptional) {
    +                    throw new AssertionError(String.format("Constructor not found: %s%s", declaringClass.getName(), binding.argumentsDescriptor));
    +                }
    +            } else {
    +                if (resolveMethod(declaringClass, binding) == null && !isOptional) {
    +                    throw new AssertionError(String.format("Method not found: %s.%s%s", declaringClass.getName(), binding.name, binding.argumentsDescriptor));
    +                }
    +            }
    +            return true;
             }
         }
     
    @@ -904,31 +1041,119 @@ public class InvocationPlugins {
             if (type instanceof Class) {
                 return (Class) type;
             }
    -        if (optional && type instanceof OptionalLazySymbol) {
    +        if (type instanceof OptionalLazySymbol) {
                 return ((OptionalLazySymbol) type).resolve();
             }
             return resolveClass(type.getTypeName(), optional);
         }
     
    -    private static final Class[] NO_CLASSES = {};
    +    private static List toInternalTypeNames(Class[] types) {
    +        String[] res = new String[types.length];
    +        for (int i = 0; i < types.length; i++) {
    +            res[i] = MetaUtil.toInternalName(types[i].getTypeName());
    +        }
    +        return Arrays.asList(res);
    +    }
     
         /**
    -     * Resolves an array of {@link Type}s to an array of {@link Class}es.
    +     * Resolves a given binding to a method in a given class. If more than one method with the
    +     * parameter types matching {@code binding} is found and the return types of all the matching
    +     * methods form an inheritance chain, the one with the most specific type is returned; otherwise
    +     * {@link NoSuchMethodError} is thrown.
          *
    -     * @param types the types to resolve
    -     * @param from the initial index of the range to be resolved, inclusive
    -     * @param to the final index of the range to be resolved, exclusive
    -     * @return the resolved class or null if resolution fails and {@code optional} is true
    +     * @param declaringClass the class to search for a method matching {@code binding}
    +     * @return the method (if any) in {@code declaringClass} matching binding
          */
    -    public static Class[] resolveTypes(Type[] types, int from, int to) {
    -        int length = to - from;
    -        if (length <= 0) {
    -            return NO_CLASSES;
    +    public static Method resolveMethod(Class declaringClass, Binding binding) {
    +        if (binding.name.equals("")) {
    +            return null;
             }
    -        Class[] classes = new Class[length];
    -        for (int i = 0; i < length; i++) {
    -            classes[i] = resolveType(types[i + from], false);
    +        Method[] methods = declaringClass.getDeclaredMethods();
    +        List parameterTypeNames = parseParameters(binding.argumentsDescriptor);
    +        for (int i = 0; i < methods.length; ++i) {
    +            Method m = methods[i];
    +            if (binding.isStatic == Modifier.isStatic(m.getModifiers()) && m.getName().equals(binding.name)) {
    +                if (parameterTypeNames.equals(toInternalTypeNames(m.getParameterTypes()))) {
    +                    for (int j = i + 1; j < methods.length; ++j) {
    +                        Method other = methods[j];
    +                        if (binding.isStatic == Modifier.isStatic(other.getModifiers()) && other.getName().equals(binding.name)) {
    +                            if (parameterTypeNames.equals(toInternalTypeNames(other.getParameterTypes()))) {
    +                                if (m.getReturnType().isAssignableFrom(other.getReturnType())) {
    +                                    // `other` has a more specific return type - choose it
    +                                    // (m is most likely a bridge method)
    +                                    m = other;
    +                                } else {
    +                                    if (!other.getReturnType().isAssignableFrom(m.getReturnType())) {
    +                                        throw new NoSuchMethodError(String.format(
    +                                                        "Found 2 methods with same name and parameter types but unrelated return types:%n %s%n %s", m, other));
    +                                    }
    +                                }
    +                            }
    +                        }
    +                    }
    +                    return m;
    +                }
    +            }
             }
    -        return classes;
    +        return null;
    +    }
    +
    +    /**
    +     * Resolves a given binding to a constructor in a given class.
    +     *
    +     * @param declaringClass the class to search for a constructor matching {@code binding}
    +     * @return the constructor (if any) in {@code declaringClass} matching binding
    +     */
    +    public static Constructor resolveConstructor(Class declaringClass, Binding binding) {
    +        if (!binding.name.equals("")) {
    +            return null;
    +        }
    +        Constructor[] constructors = declaringClass.getDeclaredConstructors();
    +        List parameterTypeNames = parseParameters(binding.argumentsDescriptor);
    +        for (int i = 0; i < constructors.length; ++i) {
    +            Constructor c = constructors[i];
    +            if (parameterTypeNames.equals(toInternalTypeNames(c.getParameterTypes()))) {
    +                return c;
    +            }
    +        }
    +        return null;
    +    }
    +
    +    private static List parseParameters(String argumentsDescriptor) {
    +        assert argumentsDescriptor.startsWith("(") && argumentsDescriptor.endsWith(")") : argumentsDescriptor;
    +        List res = new ArrayList<>();
    +        int cur = 1;
    +        int end = argumentsDescriptor.length() - 1;
    +        while (cur != end) {
    +            char first;
    +            int start = cur;
    +            do {
    +                first = argumentsDescriptor.charAt(cur++);
    +            } while (first == '[');
    +
    +            switch (first) {
    +                case 'L':
    +                    int endObject = argumentsDescriptor.indexOf(';', cur);
    +                    if (endObject == -1) {
    +                        throw new GraalError("Invalid object type at index %d in signature: %s", cur, argumentsDescriptor);
    +                    }
    +                    cur = endObject + 1;
    +                    break;
    +                case 'V':
    +                case 'I':
    +                case 'B':
    +                case 'C':
    +                case 'D':
    +                case 'F':
    +                case 'J':
    +                case 'S':
    +                case 'Z':
    +                    break;
    +                default:
    +                    throw new GraalError("Invalid character at index %d in signature: %s", cur, argumentsDescriptor);
    +            }
    +            res.add(argumentsDescriptor.substring(start, cur));
    +        }
    +        return res;
         }
     }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/CompareAndSwapNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredCompareAndSwapNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/RawAddressNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/DefaultNodeCostProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeCostProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/PiPushable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/META-INF/services/javax.annotation.processing.Processor
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionValueTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/DerivedOptionValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/StableOptionValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/UniquePathUtilities.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DominatorConditionalEliminationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/OptimizeGuardAnchorsPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PushThroughPiPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ValueAnchorCleanupPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/ExtractInstrumentationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/HighTierReconcileInstrumentationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/InlineInstrumentationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/instrumentation/MidTierReconcileInstrumentationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BasicIdealGraphPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugConfigCustomizer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
    similarity index 98%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
    index 6ef7a6143a3..a88c564b7c2 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java
    @@ -69,8 +69,7 @@ interface GraphPrinter extends Closeable {
         void close();
     
         /**
    -     * A JVMCI package {@linkplain Services#exportJVMCITo(Class) dynamically exported} to trusted
    -     * modules.
    +     * A JVMCI package dynamically exported to trusted modules.
          */
         String JVMCI_RUNTIME_PACKAGE = JVMCI.class.getPackage().getName();
     
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/IdealGraphPrinter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
    similarity index 96%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
    index 783c276711c..29d9e330654 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java
    @@ -30,10 +30,10 @@ import org.graalvm.compiler.test.ExportingClassLoader;
     import org.junit.Assert;
     import org.junit.Test;
     
    -import jdk.internal.org.objectweb.asm.ClassWriter;
    -import jdk.internal.org.objectweb.asm.Label;
    -import jdk.internal.org.objectweb.asm.MethodVisitor;
    -import jdk.internal.org.objectweb.asm.Opcodes;
    +import org.objectweb.asm.ClassWriter;
    +import org.objectweb.asm.Label;
    +import org.objectweb.asm.MethodVisitor;
    +import org.objectweb.asm.Opcodes;
     import jdk.vm.ci.meta.ResolvedJavaMethod;
     
     /**
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerMulExactFoldTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/META-INF/services/javax.annotation.processing.Processor
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/APHotSpotSignature.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/AbstractVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/ClassSubstitutionVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/FoldVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedFoldPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedNodeIntrinsicPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/GeneratedPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/InjectedDependencies.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/MethodSubstitutionVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/NodeIntrinsicVerifier.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/PluginGenerator.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.verifier/src/org/graalvm/compiler/replacements/verifier/VerifierAnnotationProcessor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineGraalDirectivesPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/WordOperationPlugin.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectObjectStoreNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/Salver.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverDebugConfigCustomizer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/SalverOptions.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataDict.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/data/DataList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractGraalDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractMethodScopeDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/AbstractSerializerDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/Dumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/dumper/GraphDumper.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractDumpHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/AbstractGraalDumpHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/DumpHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/handler/GraphDumpHandler.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/package-info.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/AbstractSerializer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/JSONSerializer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/serialize/Serializer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/ECIDUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/util/MethodContext.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/ChannelDumpWriter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.salver/src/org/graalvm/compiler/salver/writer/DumpWriter.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/META-INF/services/javax.annotation.processing.Processor
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
    similarity index 65%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
    index 483cf774822..1f0a4483b4b 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
    @@ -22,9 +22,17 @@
      */
     package org.graalvm.compiler.serviceprovider;
     
    +import static org.graalvm.compiler.serviceprovider.JDK9Method.Java8OrEarlier;
    +import static org.graalvm.compiler.serviceprovider.JDK9Method.addOpens;
    +import static org.graalvm.compiler.serviceprovider.JDK9Method.getModule;
    +import static org.graalvm.compiler.serviceprovider.JDK9Method.getPackages;
    +import static org.graalvm.compiler.serviceprovider.JDK9Method.isOpenTo;
    +
    +import java.lang.reflect.Method;
     import java.util.Iterator;
     import java.util.ServiceConfigurationError;
     import java.util.ServiceLoader;
    +import java.util.Set;
     
     import jdk.vm.ci.services.JVMCIPermission;
     import jdk.vm.ci.services.Services;
    @@ -32,14 +40,32 @@ import jdk.vm.ci.services.Services;
     /**
      * A mechanism for accessing service providers that abstracts over whether Graal is running on
      * JVMCI-8 or JVMCI-9. In JVMCI-8, a JVMCI specific mechanism is used to lookup services via the
    - * hidden JVMCI class loader. in JVMCI-9, the standard {@link ServiceLoader} mechanism is used.
    + * hidden JVMCI class loader. In JVMCI-9, the standard {@link ServiceLoader} mechanism is used.
      */
     public final class GraalServices {
     
         private GraalServices() {
         }
     
    -    public static final boolean Java8OrEarlier = System.getProperty("java.specification.version").compareTo("1.9") < 0;
    +    /**
    +     * Opens all JVMCI packages to the module of a given class. This relies on JVMCI already having
    +     * opened all its packages to the module defining {@link GraalServices}.
    +     *
    +     * @param other all JVMCI packages will be opened to the module defining this class
    +     */
    +    public static void openJVMCITo(Class other) {
    +        Object jvmci = getModule.invoke(Services.class);
    +        Object otherModule = getModule.invoke(other);
    +        if (jvmci != otherModule) {
    +            Set packages = getPackages.invoke(jvmci);
    +            for (String pkg : packages) {
    +                boolean opened = isOpenTo.invoke(jvmci, pkg, otherModule);
    +                if (!opened) {
    +                    addOpens.invoke(jvmci, pkg, otherModule);
    +                }
    +            }
    +        }
    +    }
     
         /**
          * Gets an {@link Iterable} of the providers available for a given service.
    @@ -50,9 +76,9 @@ public final class GraalServices {
         public static  Iterable load(Class service) {
             assert !service.getName().startsWith("jdk.vm.ci") : "JVMCI services must be loaded via " + Services.class.getName();
             if (Java8OrEarlier) {
    -            return Services.load(service);
    +            return load8(service);
             }
    -        ServiceLoader iterable = ServiceLoader.load(service);
    +        Iterable iterable = ServiceLoader.load(service);
             return new Iterable() {
                 @Override
                 public Iterator iterator() {
    @@ -66,8 +92,8 @@ public final class GraalServices {
                         @Override
                         public S next() {
                             S provider = iterator.next();
    -                        // Allow Graal extensions to access JVMCI assuming they have JVMCIPermission
    -                        Services.exportJVMCITo(provider.getClass());
    +                        // Allow Graal extensions to access JVMCI
    +                        openJVMCITo(provider.getClass());
                             return provider;
                         }
     
    @@ -80,6 +106,23 @@ public final class GraalServices {
             };
         }
     
    +    /**
    +     * {@code Services.load(Class)} is only defined in JVMCI-8.
    +     */
    +    private static volatile Method loadMethod;
    +
    +    @SuppressWarnings("unchecked")
    +    private static  Iterable load8(Class service) throws InternalError {
    +        try {
    +            if (loadMethod == null) {
    +                loadMethod = Services.class.getMethod("load", Class.class);
    +            }
    +            return (Iterable) loadMethod.invoke(null, service);
    +        } catch (Exception e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +
         /**
          * Gets the provider for a given service for which at most one provider must be available.
          *
    @@ -92,16 +135,14 @@ public final class GraalServices {
          */
         public static  S loadSingle(Class service, boolean required) {
             assert !service.getName().startsWith("jdk.vm.ci") : "JVMCI services must be loaded via " + Services.class.getName();
    -        if (Java8OrEarlier) {
    -            return Services.loadSingle(service, required);
    -        }
    -        Iterable providers = ServiceLoader.load(service);
    +        Iterable providers = load(service);
             S singleProvider = null;
             try {
                 for (Iterator it = providers.iterator(); it.hasNext();) {
                     singleProvider = it.next();
                     if (it.hasNext()) {
    -                    throw new InternalError(String.format("Multiple %s providers found", service.getName()));
    +                    S other = it.next();
    +                    throw new InternalError(String.format("Multiple %s providers found: %s, %s", service.getName(), singleProvider.getClass().getName(), other.getClass().getName()));
                     }
                 }
             } catch (ServiceConfigurationError e) {
    @@ -111,9 +152,6 @@ public final class GraalServices {
                 if (required) {
                     throw new InternalError(String.format("No provider for %s found", service.getName()));
                 }
    -        } else {
    -            // Allow Graal extensions to access JVMCI assuming they have JVMCIPermission
    -            Services.exportJVMCITo(singleProvider.getClass());
             }
             return singleProvider;
         }
    diff --git a/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/JDK9Method.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/JDK9Method.java
    new file mode 100644
    index 00000000000..17c8ae0dbbb
    --- /dev/null
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/JDK9Method.java
    @@ -0,0 +1,148 @@
    +/*
    + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute it and/or modify it
    + * under the terms of the GNU General Public License version 2 only, as
    + * published by the Free Software Foundation.
    + *
    + * This code is distributed in the hope that it will be useful, but WITHOUT
    + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    + * version 2 for more details (a copy is included in the LICENSE file that
    + * accompanied this code).
    + *
    + * You should have received a copy of the GNU General Public License version
    + * 2 along with this work; if not, write to the Free Software Foundation,
    + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    + *
    + * Please 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 org.graalvm.compiler.serviceprovider;
    +
    +import java.lang.reflect.InvocationTargetException;
    +import java.lang.reflect.Method;
    +import java.lang.reflect.Modifier;
    +
    +/**
    + * Reflection based access to API introduced by JDK 9. This allows the API to be used in code that
    + * must be compiled on a JDK prior to 9.
    + */
    +public final class JDK9Method {
    +
    +    private static int getJavaSpecificationVersion() {
    +        String value = System.getProperty("java.specification.version");
    +        if (value.startsWith("1.")) {
    +            value = value.substring(2);
    +        }
    +        return Integer.parseInt(value);
    +    }
    +
    +    /**
    +     * The integer value corresponding to the value of the {@code java.specification.version} system
    +     * property after any leading {@code "1."} has been stripped.
    +     */
    +    public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
    +
    +    public JDK9Method(Class declaringClass, String name, Class... parameterTypes) {
    +        try {
    +            this.method = declaringClass.getMethod(name, parameterTypes);
    +        } catch (Exception e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +
    +    /**
    +     * Determines if the Java runtime is version 8 or earlier.
    +     */
    +    public static final boolean Java8OrEarlier = JAVA_SPECIFICATION_VERSION <= 8;
    +
    +    public final Method method;
    +
    +    public Class getReturnType() {
    +        return method.getReturnType();
    +    }
    +
    +    /**
    +     * {@code Class.getModule()}.
    +     */
    +    public static final JDK9Method getModule;
    +
    +    /**
    +     * {@code java.lang.Module.getPackages()}.
    +     */
    +    public static final JDK9Method getPackages;
    +
    +    /**
    +     * {@code java.lang.Module.getResourceAsStream(String)}.
    +     */
    +    public static final JDK9Method getResourceAsStream;
    +
    +    /**
    +     * {@code java.lang.Module.addOpens(String, Module)}.
    +     */
    +    public static final JDK9Method addOpens;
    +
    +    /**
    +     * {@code java.lang.Module.isOpen(String, Module)}.
    +     */
    +    public static final JDK9Method isOpenTo;
    +
    +    /**
    +     * Invokes the static Module API method represented by this object.
    +     */
    +    @SuppressWarnings("unchecked")
    +    public  T invokeStatic(Object... args) {
    +        checkAvailability();
    +        assert Modifier.isStatic(method.getModifiers());
    +        try {
    +            return (T) method.invoke(null, args);
    +        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +
    +    /**
    +     * Invokes the non-static Module API method represented by this object.
    +     */
    +    @SuppressWarnings("unchecked")
    +    public  T invoke(Object receiver, Object... args) {
    +        checkAvailability();
    +        assert !Modifier.isStatic(method.getModifiers());
    +        try {
    +            return (T) method.invoke(receiver, args);
    +        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
    +            throw new InternalError(e);
    +        }
    +    }
    +
    +    private void checkAvailability() throws InternalError {
    +        if (method == null) {
    +            throw new InternalError("Cannot use Module API on JDK " + JAVA_SPECIFICATION_VERSION);
    +        }
    +    }
    +
    +    static {
    +        if (JAVA_SPECIFICATION_VERSION >= 9) {
    +            getModule = new JDK9Method(Class.class, "getModule");
    +            Class moduleClass = getModule.getReturnType();
    +            getPackages = new JDK9Method(moduleClass, "getPackages");
    +            addOpens = new JDK9Method(moduleClass, "addOpens", String.class, moduleClass);
    +            getResourceAsStream = new JDK9Method(moduleClass, "getResourceAsStream", String.class);
    +            isOpenTo = new JDK9Method(moduleClass, "isOpen", String.class, moduleClass);
    +        } else {
    +            JDK9Method unavailable = new JDK9Method();
    +            getModule = unavailable;
    +            getPackages = unavailable;
    +            addOpens = unavailable;
    +            getResourceAsStream = unavailable;
    +            isOpenTo = unavailable;
    +        }
    +    }
    +
    +    private JDK9Method() {
    +        method = null;
    +    }
    +}
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
    similarity index 88%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
    index e139b19c971..1c08964c696 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java
    @@ -29,14 +29,14 @@ package org.graalvm.compiler.test;
     public class ExportingClassLoader extends ClassLoader {
         public ExportingClassLoader() {
             if (!GraalTest.Java8OrEarlier) {
    -            JLRModule.fromClass(getClass()).exportAllPackagesTo(JLRModule.getUnnamedModuleFor(this));
    +            JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this));
             }
         }
     
         public ExportingClassLoader(ClassLoader parent) {
             super(parent);
             if (!GraalTest.Java8OrEarlier) {
    -            JLRModule.fromClass(getClass()).exportAllPackagesTo(JLRModule.getUnnamedModuleFor(this));
    +            JLModule.fromClass(getClass()).exportAllPackagesTo(JLModule.getUnnamedModuleFor(this));
             }
         }
     }
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLRModule.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
    similarity index 79%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLRModule.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
    index caa32231bd6..9f8c6e2014c 100644
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLRModule.java
    +++ b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java
    @@ -23,22 +23,23 @@
     package org.graalvm.compiler.test;
     
     import java.lang.reflect.Method;
    +import java.util.Set;
     
     /**
    - * Facade for the {@code java.lang.reflect.Module} class introduced in JDK9 that allows tests to be
    + * Facade for the {@code java.lang.Module} class introduced in JDK9 that allows tests to be
      * developed against JDK8 but use module logic if deployed on JDK9.
      */
    -public class JLRModule {
    +public class JLModule {
     
         static {
             if (GraalTest.Java8OrEarlier) {
    -            throw new AssertionError("Use of " + JLRModule.class + " only allowed if " + GraalTest.class.getName() + ".JDK8OrEarlier is false");
    +            throw new AssertionError("Use of " + JLModule.class + " only allowed if " + GraalTest.class.getName() + ".JDK8OrEarlier is false");
             }
         }
     
         private final Object realModule;
     
    -    public JLRModule(Object module) {
    +    public JLModule(Object module) {
             this.realModule = module;
         }
     
    @@ -51,7 +52,7 @@ public class JLRModule {
         private static final Method addExportsMethod;
         static {
             try {
    -            moduleClass = Class.forName("java.lang.reflect.Module");
    +            moduleClass = Class.forName("java.lang.Module");
                 getModuleMethod = Class.class.getMethod("getModule");
                 getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule");
                 getPackagesMethod = moduleClass.getMethod("getPackages");
    @@ -63,17 +64,17 @@ public class JLRModule {
             }
         }
     
    -    public static JLRModule fromClass(Class cls) {
    +    public static JLModule fromClass(Class cls) {
             try {
    -            return new JLRModule(getModuleMethod.invoke(cls));
    +            return new JLModule(getModuleMethod.invoke(cls));
             } catch (Exception e) {
                 throw new AssertionError(e);
             }
         }
     
    -    public static JLRModule getUnnamedModuleFor(ClassLoader cl) {
    +    public static JLModule getUnnamedModuleFor(ClassLoader cl) {
             try {
    -            return new JLRModule(getUnnamedModuleMethod.invoke(cl));
    +            return new JLModule(getUnnamedModuleMethod.invoke(cl));
             } catch (Exception e) {
                 throw new AssertionError(e);
             }
    @@ -82,7 +83,7 @@ public class JLRModule {
         /**
          * Exports all packages in this module to a given module.
          */
    -    public void exportAllPackagesTo(JLRModule module) {
    +    public void exportAllPackagesTo(JLModule module) {
             if (this != module) {
                 for (String pkg : getPackages()) {
                     // Export all JVMCI packages dynamically instead
    @@ -95,9 +96,10 @@ public class JLRModule {
             }
         }
     
    -    public String[] getPackages() {
    +    @SuppressWarnings("unchecked")
    +    public Set getPackages() {
             try {
    -            return (String[]) getPackagesMethod.invoke(realModule);
    +            return (Set) getPackagesMethod.invoke(realModule);
             } catch (Exception e) {
                 throw new AssertionError(e);
             }
    @@ -111,7 +113,7 @@ public class JLRModule {
             }
         }
     
    -    public boolean isExported(String pn, JLRModule other) {
    +    public boolean isExported(String pn, JLModule other) {
             try {
                 return (Boolean) isExported2Method.invoke(realModule, pn, other.realModule);
             } catch (Exception e) {
    @@ -119,7 +121,7 @@ public class JLRModule {
             }
         }
     
    -    public void addExports(String pn, JLRModule other) {
    +    public void addExports(String pn, JLModule other) {
             try {
                 addExportsMethod.invoke(realModule, pn, other.realModule);
             } catch (Exception e) {
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/.checkstyle.exclude
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicUnsigned.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/AtomicWord.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ComparableWord.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Pointer.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/PointerUtils.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Signed.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Unsigned.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsignedUtils.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordBase.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java b/hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java
    similarity index 100%
    rename from hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java
    rename to hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/nodes/WordCastNode.java
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
    deleted file mode 100644
    index dbeb7fbf6b0..00000000000
    --- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java
    +++ /dev/null
    @@ -1,187 +0,0 @@
    -/*
    - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
    - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    - *
    - * This code is free software; you can redistribute it and/or modify it
    - * under the terms of the GNU General Public License version 2 only, as
    - * published by the Free Software Foundation.
    - *
    - * This code is distributed in the hope that it will be useful, but WITHOUT
    - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    - * version 2 for more details (a copy is included in the LICENSE file that
    - * accompanied this code).
    - *
    - * You should have received a copy of the GNU General Public License version
    - * 2 along with this work; if not, write to the Free Software Foundation,
    - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    - *
    - * Please 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 jdk.vm.ci.services;
    -
    -import java.lang.reflect.InvocationTargetException;
    -import java.lang.reflect.Method;
    -import java.util.Formatter;
    -import java.util.Iterator;
    -import java.util.ServiceConfigurationError;
    -import java.util.ServiceLoader;
    -
    -/**
    - * A mechanism for accessing service providers via JVMCI.
    - */
    -public final class Services {
    -
    -    private Services() {
    -    }
    -
    -    private static int getJavaSpecificationVersion() {
    -        String value = System.getProperty("java.specification.version");
    -        if (value.startsWith("1.")) {
    -            value = value.substring(2);
    -        }
    -        return Integer.parseInt(value);
    -    }
    -
    -    /**
    -     * The integer value corresponding to the value of the {@code java.specification.version} system
    -     * property after any leading {@code "1."} has been stripped.
    -     */
    -    public static final int JAVA_SPECIFICATION_VERSION = getJavaSpecificationVersion();
    -
    -    // Use reflection so that this compiles on Java 8
    -    private static final Method getModule;
    -    private static final Method getPackages;
    -    private static final Method addUses;
    -    private static final Method isExported;
    -    private static final Method addExports;
    -
    -    static {
    -        if (JAVA_SPECIFICATION_VERSION >= 9) {
    -            try {
    -                getModule = Class.class.getMethod("getModule");
    -                Class moduleClass = getModule.getReturnType();
    -                getPackages = moduleClass.getMethod("getPackages");
    -                addUses = moduleClass.getMethod("addUses", Class.class);
    -                isExported = moduleClass.getMethod("isExported", String.class, moduleClass);
    -                addExports = moduleClass.getMethod("addExports", String.class, moduleClass);
    -            } catch (NoSuchMethodException | SecurityException e) {
    -                throw new InternalError(e);
    -            }
    -        } else {
    -            getModule = null;
    -            getPackages = null;
    -            addUses = null;
    -            isExported = null;
    -            addExports = null;
    -        }
    -    }
    -
    -    @SuppressWarnings("unchecked")
    -    static  T invoke(Method method, Object receiver, Object... args) {
    -        try {
    -            return (T) method.invoke(receiver, args);
    -        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
    -            throw new InternalError(e);
    -        }
    -    }
    -
    -    /**
    -     * Performs any required security checks and dynamic reconfiguration to allow the module of a
    -     * given class to access the classes in the JVMCI module.
    -     *
    -     * Note: This API uses {@link Class} instead of {@code Module} to provide backwards
    -     * compatibility for JVMCI clients compiled against a JDK release earlier than 9.
    -     *
    -     * @param requestor a class requesting access to the JVMCI module for its module
    -     * @throws SecurityException if a security manager is present and it denies
    -     *             {@link JVMCIPermission}
    -     */
    -    public static void exportJVMCITo(Class requestor) {
    -        SecurityManager sm = System.getSecurityManager();
    -        if (sm != null) {
    -            sm.checkPermission(new JVMCIPermission());
    -        }
    -        if (JAVA_SPECIFICATION_VERSION >= 9) {
    -            Object jvmci = invoke(getModule, Services.class);
    -            Object requestorModule = invoke(getModule, requestor);
    -            if (jvmci != requestorModule) {
    -                String[] packages = invoke(getPackages, jvmci);
    -                for (String pkg : packages) {
    -                    // Export all JVMCI packages dynamically instead
    -                    // of requiring a long list of --add-exports
    -                    // options on the JVM command line.
    -                    boolean exported = invoke(isExported, jvmci, pkg, requestorModule);
    -                    if (!exported) {
    -                        invoke(addExports, jvmci, pkg, requestorModule);
    -                    }
    -                }
    -            }
    -        }
    -    }
    -
    -    /**
    -     * Gets an {@link Iterable} of the JVMCI providers available for a given service.
    -     *
    -     * @throws SecurityException if a security manager is present and it denies
    -     *             {@link JVMCIPermission}
    -     */
    -    public static  Iterable load(Class service) {
    -        SecurityManager sm = System.getSecurityManager();
    -        if (sm != null) {
    -            sm.checkPermission(new JVMCIPermission());
    -        }
    -        if (JAVA_SPECIFICATION_VERSION >= 9) {
    -            Object jvmci = invoke(getModule, Services.class);
    -            invoke(addUses, jvmci, service);
    -        }
    -
    -        // Restrict JVMCI clients to be on the class path or module path
    -        return ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
    -    }
    -
    -    /**
    -     * Gets the JVMCI provider for a given service for which at most one provider must be available.
    -     *
    -     * @param service the service whose provider is being requested
    -     * @param required specifies if an {@link InternalError} should be thrown if no provider of
    -     *            {@code service} is available
    -     * @throws SecurityException if a security manager is present and it denies
    -     *             {@link JVMCIPermission}
    -     */
    -    public static  S loadSingle(Class service, boolean required) {
    -        SecurityManager sm = System.getSecurityManager();
    -        if (sm != null) {
    -            sm.checkPermission(new JVMCIPermission());
    -        }
    -        if (JAVA_SPECIFICATION_VERSION >= 9) {
    -            Object jvmci = invoke(getModule, Services.class);
    -            invoke(addUses, jvmci, service);
    -        }
    -        // Restrict JVMCI clients to be on the class path or module path
    -        Iterable providers = ServiceLoader.load(service, ClassLoader.getSystemClassLoader());
    -        S singleProvider = null;
    -        try {
    -            for (Iterator it = providers.iterator(); it.hasNext();) {
    -                singleProvider = it.next();
    -                if (it.hasNext()) {
    -                    throw new InternalError(String.format("Multiple %s providers found", service.getName()));
    -                }
    -            }
    -        } catch (ServiceConfigurationError e) {
    -            // If the service is required we will bail out below.
    -        }
    -        if (singleProvider == null && required) {
    -            String javaHome = System.getProperty("java.home");
    -            String vmName = System.getProperty("java.vm.name");
    -            Formatter errorMessage = new Formatter();
    -            errorMessage.format("The VM does not expose required service %s.%n", service.getName());
    -            errorMessage.format("Currently used Java home directory is %s.%n", javaHome);
    -            errorMessage.format("Currently used VM configuration is: %s", vmName);
    -            throw new UnsupportedOperationException(errorMessage.toString());
    -        }
    -        return singleProvider;
    -    }
    -}
    diff --git a/hotspot/src/jdk.vm.ci/share/classes/module-info.java b/hotspot/src/jdk.vm.ci/share/classes/module-info.java
    deleted file mode 100644
    index 744442b1cdb..00000000000
    --- a/hotspot/src/jdk.vm.ci/share/classes/module-info.java
    +++ /dev/null
    @@ -1,69 +0,0 @@
    -/*
    - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
    - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    - *
    - * This code is free software; you can redistribute 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.
    - */
    -
    -module jdk.vm.ci {
    -    exports jdk.vm.ci.services;
    -
    -    uses jdk.vm.ci.services.JVMCIServiceLocator;
    -    uses jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory;
    -
    -    provides jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory with
    -        jdk.vm.ci.hotspot.aarch64.AArch64HotSpotJVMCIBackendFactory,
    -        jdk.vm.ci.hotspot.amd64.AMD64HotSpotJVMCIBackendFactory,
    -        jdk.vm.ci.hotspot.sparc.SPARCHotSpotJVMCIBackendFactory;
    -
    -    exports jdk.vm.ci.aarch64 to
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.amd64 to
    -        jdk.aot,
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.code to
    -        jdk.aot,
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.code.site to
    -        jdk.aot,
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.code.stack to
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.common to
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.hotspot to
    -        jdk.aot,
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.hotspot.aarch64 to
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.hotspot.amd64 to
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.hotspot.sparc to
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.meta to
    -        jdk.aot,
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.runtime to
    -        jdk.aot,
    -        jdk.vm.compiler;
    -    exports jdk.vm.ci.sparc to
    -        jdk.vm.compiler;
    -}
    diff --git a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java b/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
    deleted file mode 100644
    index b33b0cf437f..00000000000
    --- a/hotspot/src/jdk.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java
    +++ /dev/null
    @@ -1,77 +0,0 @@
    -/*
    - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
    - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    - *
    - * This code is free software; you can redistribute it and/or modify it
    - * under the terms of the GNU General Public License version 2 only, as
    - * published by the Free Software Foundation.
    - *
    - * This code is distributed in the hope that it will be useful, but WITHOUT
    - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    - * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    - * version 2 for more details (a copy is included in the LICENSE file that
    - * accompanied this code).
    - *
    - * You should have received a copy of the GNU General Public License version
    - * 2 along with this work; if not, write to the Free Software Foundation,
    - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    - *
    - * Please 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 org.graalvm.compiler.hotspot;
    -
    -import static org.graalvm.compiler.core.common.util.ModuleAPI.addExports;
    -import static org.graalvm.compiler.core.common.util.ModuleAPI.getModule;
    -import static org.graalvm.compiler.core.common.util.Util.JAVA_SPECIFICATION_VERSION;
    -
    -import org.graalvm.compiler.serviceprovider.ServiceProvider;
    -
    -import jdk.vm.ci.hotspot.HotSpotVMEventListener;
    -import jdk.vm.ci.runtime.JVMCICompilerFactory;
    -import jdk.vm.ci.services.JVMCIServiceLocator;
    -
    -@ServiceProvider(JVMCIServiceLocator.class)
    -public final class HotSpotGraalJVMCIServiceLocator extends JVMCIServiceLocator {
    -
    -    private boolean exportsAdded;
    -
    -    /**
    -     * Dynamically exports various internal JDK packages to the Graal module. This requires only
    -     * {@code --add-exports=java.base/jdk.internal.module=org.graalvm.compiler.graal_core} on the VM
    -     * command line instead of a {@code --add-exports} instance for each JDK internal package used
    -     * by Graal.
    -     */
    -    private void addExports() {
    -        if (JAVA_SPECIFICATION_VERSION >= 9 && !exportsAdded) {
    -            Object javaBaseModule = getModule.invoke(String.class);
    -            Object graalModule = getModule.invoke(getClass());
    -            addExports.invokeStatic(javaBaseModule, "jdk.internal.misc", graalModule);
    -            addExports.invokeStatic(javaBaseModule, "jdk.internal.jimage", graalModule);
    -            addExports.invokeStatic(javaBaseModule, "com.sun.crypto.provider", graalModule);
    -            exportsAdded = true;
    -        }
    -    }
    -
    -    private HotSpotGraalRuntime graalRuntime;
    -
    -    @Override
    -    public  T getProvider(Class service) {
    -        if (service == JVMCICompilerFactory.class) {
    -            addExports();
    -            return service.cast(new HotSpotGraalCompilerFactory(this));
    -        } else if (service == HotSpotVMEventListener.class) {
    -            if (graalRuntime != null) {
    -                addExports();
    -                return service.cast(new HotSpotGraalVMEventListener(graalRuntime));
    -            }
    -        }
    -        return null;
    -    }
    -
    -    public void onCompilerCreation(HotSpotGraalCompiler compiler) {
    -        assert this.graalRuntime == null : "only expect a single JVMCICompiler to be created";
    -        this.graalRuntime = (HotSpotGraalRuntime) compiler.getGraalRuntime();
    -    }
    -}
    diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
    index 527246dcc3d..adbec4e459e 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, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -3050,15 +3050,12 @@ void os::naked_yield() {
       thr_yield();
     }
     
    -// Interface for setting lwp priorities.  If we are using T2 libthread,
    -// which forces the use of BoundThreads or we manually set UseBoundThreads,
    -// all of our threads will be assigned to real lwp's.  Using the thr_setprio
    -// function is meaningless in this mode so we must adjust the real lwp's priority
    +// Interface for setting lwp priorities.  We are using T2 libthread,
    +// which forces the use of bound threads, so all of our threads will
    +// be assigned to real lwp's.  Using the thr_setprio function is
    +// meaningless in this mode so we must adjust the real lwp's priority.
     // The routines below implement the getting and setting of lwp priorities.
     //
    -// Note: T2 is now the only supported libthread. UseBoundThreads flag is
    -//       being deprecated and all threads are now BoundThreads
    -//
     // Note: There are three priority scales used on Solaris.  Java priotities
     //       which range from 1 to 10, libthread "thr_setprio" scale which range
     //       from 0 to 127, and the current scheduling class of the process we
    diff --git a/hotspot/src/share/vm/Xusage.txt b/hotspot/src/share/vm/Xusage.txt
    index 3849f8f8e2c..8c8eba19ace 100644
    --- a/hotspot/src/share/vm/Xusage.txt
    +++ b/hotspot/src/share/vm/Xusage.txt
    @@ -12,7 +12,7 @@
         -Xms        set initial Java heap size
         -Xmx        set maximum Java heap size
         -Xss        set java thread stack size
    -    -Xprof            output cpu profiling data
    +    -Xprof            output cpu profiling data (deprecated)
         -Xfuture          enable strictest checks, anticipating future default
         -Xrs              reduce use of OS signals by Java/VM (see documentation)
         -Xcheck:jni       perform additional checks for JNI functions
    diff --git a/hotspot/src/share/vm/aot/aotCodeHeap.cpp b/hotspot/src/share/vm/aot/aotCodeHeap.cpp
    index 52e2c8d55b1..87d41f80777 100644
    --- a/hotspot/src/share/vm/aot/aotCodeHeap.cpp
    +++ b/hotspot/src/share/vm/aot/aotCodeHeap.cpp
    @@ -830,38 +830,19 @@ void AOTCodeHeap::oops_do(OopClosure* f) {
       }
     }
     
    -// Yes, this is faster than going through the relocations,
    -// but there are two problems:
    -// 1) GOT slots are sometimes patched with non-Metadata values
    -// 2) We don't want to scan metadata for dead methods
    -// Unfortunately we don't know if the metadata belongs to
    -// live aot methods or not, so process them all.  If this
    -// is for mark_on_stack, some old methods may stick around
    -// forever instead of getting cleaned up.
    +// Scan only metaspace_got cells which should have only Klass*,
    +// metadata_got cells are scanned only for alive AOT methods
    +// by AOTCompiledMethod::metadata_do().
     void AOTCodeHeap::got_metadata_do(void f(Metadata*)) {
       for (int i = 1; i < _metaspace_got_size; i++) {
         Metadata** p = &_metaspace_got[i];
         Metadata* md = *p;
         if (md == NULL)  continue;  // skip non-oops
    -    intptr_t meta = (intptr_t)md;
    -    if (meta == -1)  continue;  // skip non-oops
         if (Metaspace::contains(md)) {
           f(md);
    -    }
    -  }
    -  for (int i = 1; i < _metadata_got_size; i++) {
    -    Metadata** p = &_metadata_got[i];
    -    Metadata* md = *p;
    -    intptr_t meta = (intptr_t)md;
    -    if ((meta & 1) == 1) {
    -      // already resolved
    -      md = (Metadata*)(meta & ~1);
         } else {
    -      continue;
    -    }
    -    if (md == NULL)  continue;  // skip non-oops
    -    if (Metaspace::contains(md)) {
    -      f(md);
    +      intptr_t meta = (intptr_t)md;
    +      fatal("Invalid value in _metaspace_got[%d] = " INTPTR_FORMAT, i, meta);
         }
       }
     }
    @@ -910,8 +891,6 @@ void AOTCodeHeap::metadata_do(void f(Metadata*)) {
           aot->metadata_do(f);
         }
       }
    -#if 0
    -  // With the marking above, this call doesn't seem to be needed
    +  // Scan metaspace_got cells.
       got_metadata_do(f);
    -#endif
     }
    diff --git a/hotspot/src/share/vm/aot/aotCodeHeap.hpp b/hotspot/src/share/vm/aot/aotCodeHeap.hpp
    index 0e0d0038d10..5c803cc0903 100644
    --- a/hotspot/src/share/vm/aot/aotCodeHeap.hpp
    +++ b/hotspot/src/share/vm/aot/aotCodeHeap.hpp
    @@ -240,6 +240,11 @@ public:
         assert(result == CodeHeap::contains(p), "");
         return result;
       }
    +
    +  bool contains_blob(const CodeBlob* blob) const {
    +    return CodeHeap::contains(blob->code_begin());
    +  }
    +
       AOTCompiledMethod* find_aot(address p) const;
     
       virtual void* find_start(void* p)     const;
    diff --git a/hotspot/src/share/vm/aot/aotCompiledMethod.cpp b/hotspot/src/share/vm/aot/aotCompiledMethod.cpp
    index 1f40284da7e..c501ce12e69 100644
    --- a/hotspot/src/share/vm/aot/aotCompiledMethod.cpp
    +++ b/hotspot/src/share/vm/aot/aotCompiledMethod.cpp
    @@ -71,15 +71,6 @@ static void metadata_oops_do(Metadata** metadata_begin, Metadata **metadata_end,
     }
     #endif
     
    -void AOTCompiledMethod::oops_do(OopClosure* f) {
    -  if (_oop != NULL) {
    -    f->do_oop(&_oop);
    -  }
    -#if 0
    -  metadata_oops_do(metadata_begin(), metadata_end(), f);
    -#endif
    -}
    -
     bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive, bool unloading_occurred) {
       return false;
     }
    @@ -161,9 +152,6 @@ Metadata* AOTCompiledMethod::metadata_at(int index) const {
           *entry = (Metadata*)meta; // Should be atomic on x64
           return (Metadata*)m;
         }
    -    // need to resolve it here..., patching of GOT need to be CAS or atomic operation.
    -    // FIXIT: need methods for debuginfo.
    -    // return _method;
       }
       ShouldNotReachHere(); return NULL;
     }
    @@ -288,11 +276,19 @@ void AOTCompiledMethod::metadata_do(void f(Metadata*)) {
               f(cichk->holder_method());
               f(cichk->holder_klass());
             } else {
    +          // Get Klass* or NULL (if value is -1) from GOT cell of virtual call PLT stub.
               Metadata* ic_oop = ic->cached_metadata();
               if (ic_oop != NULL) {
                 f(ic_oop);
               }
             }
    +      } else if (iter.type() == relocInfo::static_call_type ||
    +                 iter.type() == relocInfo::opt_virtual_call_type){
    +        // Check Method* in AOT c2i stub for other calls.
    +        Metadata* meta = (Metadata*)nativeLoadGot_at(nativePltCall_at(iter.addr())->plt_c2i_stub())->data();
    +        if (meta != NULL) {
    +          f(meta);
    +        }
           }
         }
       }
    @@ -332,7 +328,12 @@ void AOTCompiledMethod::print_on(outputStream* st, const char* msg) const {
         st->print("%4d ", _aot_id);    // print compilation number
         st->print("    aot[%2d]", _heap->dso_id());
         // Stubs have _method == NULL
    -    st->print("   %s", (_method == NULL ? _name : _method->name_and_sig_as_C_string()));
    +    if (_method == NULL) {
    +      st->print("   %s", _name);
    +    } else {
    +      ResourceMark m;
    +      st->print("   %s", _method->name_and_sig_as_C_string());
    +    }
         if (Verbose) {
           st->print(" entry at " INTPTR_FORMAT, p2i(_code));
         }
    diff --git a/hotspot/src/share/vm/aot/aotCompiledMethod.hpp b/hotspot/src/share/vm/aot/aotCompiledMethod.hpp
    index 7fef6fdb433..723bbdb8d30 100644
    --- a/hotspot/src/share/vm/aot/aotCompiledMethod.hpp
    +++ b/hotspot/src/share/vm/aot/aotCompiledMethod.hpp
    @@ -257,8 +257,6 @@ private:
         return (int) (*_state_adr);
       }
     
    -  virtual void oops_do(OopClosure* f);
    -
       // inlined and non-virtual for AOTCodeHeap::oops_do
       void do_oops(OopClosure* f) {
         assert(_is_alive(), "");
    diff --git a/hotspot/src/share/vm/aot/aotLoader.cpp b/hotspot/src/share/vm/aot/aotLoader.cpp
    index 0dbf9ff72e4..bd2cc8f58f0 100644
    --- a/hotspot/src/share/vm/aot/aotLoader.cpp
    +++ b/hotspot/src/share/vm/aot/aotLoader.cpp
    @@ -113,8 +113,8 @@ static const char* modules[] = {
       "java.logging",
       "jdk.compiler",
       "jdk.scripting.nashorn",
    -  "jdk.vm.ci",
    -  "jdk.vm.compiler"
    +  "jdk.internal.vm.ci",
    +  "jdk.internal.vm.compiler"
     };
     
     void AOTLoader::initialize() {
    diff --git a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
    index e3a7af67742..095ac876292 100644
    --- a/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
    +++ b/hotspot/src/share/vm/c1/c1_Canonicalizer.cpp
    @@ -248,7 +248,9 @@ void Canonicalizer::do_ArrayLength    (ArrayLength*     x) {
       } else if ((lf = x->array()->as_LoadField()) != NULL) {
         ciField* field = lf->field();
         if (field->is_static_constant()) {
    -      assert(PatchALot || ScavengeRootsInCode < 2, "Constant field loads are folded during parsing");
    +      // Constant field loads are usually folded during parsing.
    +      // But it doesn't happen with PatchALot, ScavengeRootsInCode < 2, or when
    +      // holder class is being initialized during parsing (for static fields).
           ciObject* c = field->constant_value().as_object();
           if (!c->is_null_object()) {
             set_constant(c->as_array()->length());
    diff --git a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp
    index 457c9cc14eb..3f2dbde1939 100644
    --- a/hotspot/src/share/vm/c1/c1_CodeStubs.hpp
    +++ b/hotspot/src/share/vm/c1/c1_CodeStubs.hpp
    @@ -58,6 +58,7 @@ class CodeStub: public CompilationResourceObj {
       virtual bool is_exception_throw_stub() const   { return false; }
       virtual bool is_range_check_stub() const       { return false; }
       virtual bool is_divbyzero_stub() const         { return false; }
    +  virtual bool is_simple_exception_stub() const  { return false; }
     #ifndef PRODUCT
       virtual void print_name(outputStream* out) const = 0;
     #endif
    @@ -483,6 +484,7 @@ class SimpleExceptionStub: public CodeStub {
       virtual void emit_code(LIR_Assembler* e);
       virtual CodeEmitInfo* info() const             { return _info; }
       virtual bool is_exception_throw_stub() const   { return true; }
    +  virtual bool is_simple_exception_stub() const  { return true; }
       virtual void visit(LIR_OpVisitState* visitor) {
         if (_obj->is_valid()) visitor->do_input(_obj);
         visitor->do_slow_case(_info);
    diff --git a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
    index 1a0a5f63687..200a3fc782d 100644
    --- a/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
    +++ b/hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
    @@ -1540,7 +1540,7 @@ void GraphBuilder::method_return(Value x, bool ignore_return) {
             ciMethod* caller = state()->scope()->method();
             ciMethodData* md = caller->method_data_or_null();
             ciProfileData* data = md->bci_to_data(invoke_bci);
    -        if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
    +        if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
               bool has_return = data->is_CallTypeData() ? ((ciCallTypeData*)data)->has_return() : ((ciVirtualCallTypeData*)data)->has_return();
               // May not be true in case of an inlined call through a method handle intrinsic.
               if (has_return) {
    @@ -1758,7 +1758,7 @@ Values* GraphBuilder::args_list_for_profiling(ciMethod* target, int& start, bool
       start = has_receiver ? 1 : 0;
       if (profile_arguments()) {
         ciProfileData* data = method()->method_data()->bci_to_data(bci());
    -    if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
    +    if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
           n = data->is_CallTypeData() ? data->as_CallTypeData()->number_of_arguments() : data->as_VirtualCallTypeData()->number_of_arguments();
         }
       }
    @@ -1829,6 +1829,20 @@ void GraphBuilder::invoke(Bytecodes::Code code) {
                     log->identify(target),
                     Bytecodes::name(code));
     
    +  // invoke-special-super
    +  if (bc_raw == Bytecodes::_invokespecial && !target->is_object_initializer()) {
    +    ciInstanceKlass* sender_klass =
    +          calling_klass->is_anonymous() ? calling_klass->host_klass() :
    +                                          calling_klass;
    +    if (sender_klass->is_interface()) {
    +      int index = state()->stack_size() - (target->arg_size_no_receiver() + 1);
    +      Value receiver = state()->stack_at(index);
    +      CheckCast* c = new CheckCast(sender_klass, receiver, copy_state_before());
    +      c->set_invokespecial_receiver_check();
    +      state()->stack_at_put(index, append_split(c));
    +    }
    +  }
    +
       // Some methods are obviously bindable without any type checks so
       // convert them directly to an invokespecial or invokestatic.
       if (target->is_loaded() && !target->is_abstract() && target->can_be_statically_bound()) {
    @@ -3995,10 +4009,14 @@ bool GraphBuilder::try_method_handle_inline(ciMethod* callee, bool ignore_return
             ciMethod* target = type->as_ObjectType()->constant_value()->as_method_handle()->get_vmtarget();
             // We don't do CHA here so only inline static and statically bindable methods.
             if (target->is_static() || target->can_be_statically_bound()) {
    -          Bytecodes::Code bc = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual;
    -          ignore_return = ignore_return || (callee->return_type()->is_void() && !target->return_type()->is_void());
    -          if (try_inline(target, /*holder_known*/ true, ignore_return, bc)) {
    -            return true;
    +          if (ciMethod::is_consistent_info(callee, target)) {
    +            Bytecodes::Code bc = target->is_static() ? Bytecodes::_invokestatic : Bytecodes::_invokevirtual;
    +            ignore_return = ignore_return || (callee->return_type()->is_void() && !target->return_type()->is_void());
    +            if (try_inline(target, /*holder_known*/ true, ignore_return, bc)) {
    +              return true;
    +            }
    +          } else {
    +            print_inlining(target, "signatures mismatch", /*success*/ false);
               }
             } else {
               print_inlining(target, "not static or statically bindable", /*success*/ false);
    @@ -4026,6 +4044,8 @@ bool GraphBuilder::try_method_handle_inline(ciMethod* callee, bool ignore_return
               if (try_method_handle_inline(target, ignore_return)) {
                 return true;
               }
    +        } else if (!ciMethod::is_consistent_info(callee, target)) {
    +          print_inlining(target, "signatures mismatch", /*success*/ false);
             } else {
               ciSignature* signature = target->signature();
               const int receiver_skip = target->is_static() ? 0 : 1;
    @@ -4343,7 +4363,7 @@ void GraphBuilder::profile_return_type(Value ret, ciMethod* callee, ciMethod* m,
       }
       ciMethodData* md = m->method_data_or_null();
       ciProfileData* data = md->bci_to_data(invoke_bci);
    -  if (data->is_CallTypeData() || data->is_VirtualCallTypeData()) {
    +  if (data != NULL && (data->is_CallTypeData() || data->is_VirtualCallTypeData())) {
         append(new ProfileReturnType(m , invoke_bci, callee, ret));
       }
     }
    diff --git a/hotspot/src/share/vm/c1/c1_Instruction.hpp b/hotspot/src/share/vm/c1/c1_Instruction.hpp
    index 4b01069498c..c71b5619147 100644
    --- a/hotspot/src/share/vm/c1/c1_Instruction.hpp
    +++ b/hotspot/src/share/vm/c1/c1_Instruction.hpp
    @@ -372,6 +372,7 @@ class Instruction: public CompilationResourceObj {
         UnorderedIsTrueFlag,
         NeedsPatchingFlag,
         ThrowIncompatibleClassChangeErrorFlag,
    +    InvokeSpecialReceiverCheckFlag,
         ProfileMDOFlag,
         IsLinkedInBlockFlag,
         NeedsRangeCheckFlag,
    @@ -1454,6 +1455,16 @@ LEAF(CheckCast, TypeCheck)
       bool is_incompatible_class_change_check() const {
         return check_flag(ThrowIncompatibleClassChangeErrorFlag);
       }
    +  void set_invokespecial_receiver_check() {
    +    set_flag(InvokeSpecialReceiverCheckFlag, true);
    +  }
    +  bool is_invokespecial_receiver_check() const {
    +    return check_flag(InvokeSpecialReceiverCheckFlag);
    +  }
    +
    +  virtual bool needs_exception_state() const {
    +    return !is_invokespecial_receiver_check();
    +  }
     
       ciType* declared_type() const;
     };
    diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp
    index 05f39476849..e6cdb5e7c03 100644
    --- a/hotspot/src/share/vm/c1/c1_LIR.cpp
    +++ b/hotspot/src/share/vm/c1/c1_LIR.cpp
    @@ -1413,6 +1413,17 @@ void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr
       append(c);
     }
     
    +void LIR_List::null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null) {
    +  if (deoptimize_on_null) {
    +    // Emit an explicit null check and deoptimize if opr is null
    +    CodeStub* deopt = new DeoptimizeStub(info, Deoptimization::Reason_null_check, Deoptimization::Action_none);
    +    cmp(lir_cond_equal, opr, LIR_OprFact::oopConst(NULL));
    +    branch(lir_cond_equal, T_OBJECT, deopt);
    +  } else {
    +    // Emit an implicit null check
    +    append(new LIR_Op1(lir_null_check, opr, info));
    +  }
    +}
     
     void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value,
                             LIR_Opr t1, LIR_Opr t2, LIR_Opr result) {
    diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp
    index 79d298d4cdf..a9c073d32b0 100644
    --- a/hotspot/src/share/vm/c1/c1_LIR.hpp
    +++ b/hotspot/src/share/vm/c1/c1_LIR.hpp
    @@ -613,7 +613,7 @@ class LIR_OprFact: public AllStatic {
       // Platform dependant.
       static LIR_Opr double_fpu(int reg1, int reg2 = -1 /*fnoreg*/);
     
    -#ifdef __SOFTFP__
    +#ifdef ARM32
       static LIR_Opr single_softfp(int reg) {
         return (LIR_Opr)(intptr_t)((reg  << LIR_OprDesc::reg1_shift) |
                                    LIR_OprDesc::float_type           |
    @@ -627,7 +627,7 @@ class LIR_OprFact: public AllStatic {
                                    LIR_OprDesc::cpu_register         |
                                    LIR_OprDesc::double_size);
       }
    -#endif // __SOFTFP__
    +#endif // ARM32
     
     #if defined(X86)
       static LIR_Opr single_xmm(int reg) {
    @@ -2113,7 +2113,7 @@ class LIR_List: public CompilationResourceObj {
       void   pack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_pack64,   src, dst, T_LONG, lir_patch_none, NULL)); }
       void unpack64(LIR_Opr src, LIR_Opr dst) { append(new LIR_Op1(lir_unpack64, src, dst, T_LONG, lir_patch_none, NULL)); }
     
    -  void null_check(LIR_Opr opr, CodeEmitInfo* info)         { append(new LIR_Op1(lir_null_check, opr, info)); }
    +  void null_check(LIR_Opr opr, CodeEmitInfo* info, bool deoptimize_on_null = false);
       void throw_exception(LIR_Opr exceptionPC, LIR_Opr exceptionOop, CodeEmitInfo* info) {
         append(new LIR_Op2(lir_throw, exceptionPC, exceptionOop, LIR_OprFact::illegalOpr, info));
       }
    diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
    index 0c10e864e3f..8143eefb83d 100644
    --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
    +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
    @@ -1752,8 +1752,10 @@ void LIRGenerator::do_StoreField(StoreField* x) {
       if (x->needs_null_check() &&
           (needs_patching ||
            MacroAssembler::needs_explicit_null_check(x->offset()))) {
    -    // emit an explicit null check because the offset is too large
    -    __ null_check(object.result(), new CodeEmitInfo(info));
    +    // Emit an explicit null check because the offset is too large.
    +    // If the class is not loaded and the object is NULL, we need to deoptimize to throw a
    +    // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
    +    __ null_check(object.result(), new CodeEmitInfo(info), /* deoptimize */ needs_patching);
       }
     
       LIR_Address* address;
    @@ -1838,8 +1840,10 @@ void LIRGenerator::do_LoadField(LoadField* x) {
           obj = new_register(T_OBJECT);
           __ move(LIR_OprFact::oopConst(NULL), obj);
         }
    -    // emit an explicit null check because the offset is too large
    -    __ null_check(obj, new CodeEmitInfo(info));
    +    // Emit an explicit null check because the offset is too large.
    +    // If the class is not loaded and the object is NULL, we need to deoptimize to throw a
    +    // NoClassDefFoundError in the interpreter instead of an implicit NPE from compiled code.
    +    __ null_check(obj, new CodeEmitInfo(info), /* deoptimize */ needs_patching);
       }
     
       LIR_Opr reg = rlock_result(x, field_type);
    @@ -3258,50 +3262,52 @@ void LIRGenerator::profile_arguments(ProfileCall* x) {
         int bci = x->bci_of_invoke();
         ciMethodData* md = x->method()->method_data_or_null();
         ciProfileData* data = md->bci_to_data(bci);
    -    if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) ||
    -        (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) {
    -      ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset();
    -      int base_offset = md->byte_offset_of_slot(data, extra);
    -      LIR_Opr mdp = LIR_OprFact::illegalOpr;
    -      ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args();
    +    if (data != NULL) {
    +      if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) ||
    +          (data->is_VirtualCallTypeData() && data->as_VirtualCallTypeData()->has_arguments())) {
    +        ByteSize extra = data->is_CallTypeData() ? CallTypeData::args_data_offset() : VirtualCallTypeData::args_data_offset();
    +        int base_offset = md->byte_offset_of_slot(data, extra);
    +        LIR_Opr mdp = LIR_OprFact::illegalOpr;
    +        ciTypeStackSlotEntries* args = data->is_CallTypeData() ? ((ciCallTypeData*)data)->args() : ((ciVirtualCallTypeData*)data)->args();
     
    -      Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
    -      int start = 0;
    -      int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
    -      if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
    -        // first argument is not profiled at call (method handle invoke)
    -        assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected");
    -        start = 1;
    -      }
    -      ciSignature* callee_signature = x->callee()->signature();
    -      // method handle call to virtual method
    -      bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
    -      ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL);
    -
    -      bool ignored_will_link;
    -      ciSignature* signature_at_call = NULL;
    -      x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
    -      ciSignatureStream signature_at_call_stream(signature_at_call);
    -
    -      // if called through method handle invoke, some arguments may have been popped
    -      for (int i = 0; i < stop && i+start < x->nb_profiled_args(); i++) {
    -        int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset());
    -        ciKlass* exact = profile_type(md, base_offset, off,
    -                                      args->type(i), x->profiled_arg_at(i+start), mdp,
    -                                      !x->arg_needs_null_check(i+start),
    -                                      signature_at_call_stream.next_klass(), callee_signature_stream.next_klass());
    -        if (exact != NULL) {
    -          md->set_argument_type(bci, i, exact);
    +        Bytecodes::Code bc = x->method()->java_code_at_bci(bci);
    +        int start = 0;
    +        int stop = data->is_CallTypeData() ? ((ciCallTypeData*)data)->number_of_arguments() : ((ciVirtualCallTypeData*)data)->number_of_arguments();
    +        if (x->callee()->is_loaded() && x->callee()->is_static() && Bytecodes::has_receiver(bc)) {
    +          // first argument is not profiled at call (method handle invoke)
    +          assert(x->method()->raw_code_at_bci(bci) == Bytecodes::_invokehandle, "invokehandle expected");
    +          start = 1;
             }
    -      }
    -    } else {
    +        ciSignature* callee_signature = x->callee()->signature();
    +        // method handle call to virtual method
    +        bool has_receiver = x->callee()->is_loaded() && !x->callee()->is_static() && !Bytecodes::has_receiver(bc);
    +        ciSignatureStream callee_signature_stream(callee_signature, has_receiver ? x->callee()->holder() : NULL);
    +
    +        bool ignored_will_link;
    +        ciSignature* signature_at_call = NULL;
    +        x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
    +        ciSignatureStream signature_at_call_stream(signature_at_call);
    +
    +        // if called through method handle invoke, some arguments may have been popped
    +        for (int i = 0; i < stop && i+start < x->nb_profiled_args(); i++) {
    +          int off = in_bytes(TypeEntriesAtCall::argument_type_offset(i)) - in_bytes(TypeEntriesAtCall::args_data_offset());
    +          ciKlass* exact = profile_type(md, base_offset, off,
    +              args->type(i), x->profiled_arg_at(i+start), mdp,
    +              !x->arg_needs_null_check(i+start),
    +              signature_at_call_stream.next_klass(), callee_signature_stream.next_klass());
    +          if (exact != NULL) {
    +            md->set_argument_type(bci, i, exact);
    +          }
    +        }
    +      } else {
     #ifdef ASSERT
    -      Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke());
    -      int n = x->nb_profiled_args();
    -      assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() ||
    -                                                  (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))),
    -             "only at JSR292 bytecodes");
    +        Bytecodes::Code code = x->method()->raw_code_at_bci(x->bci_of_invoke());
    +        int n = x->nb_profiled_args();
    +        assert(MethodData::profile_parameters() && (MethodData::profile_arguments_jsr292_only() ||
    +            (x->inlined() && ((code == Bytecodes::_invokedynamic && n <= 1) || (code == Bytecodes::_invokehandle && n <= 2)))),
    +            "only at JSR292 bytecodes");
     #endif
    +      }
         }
       }
     }
    @@ -3392,24 +3398,26 @@ void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) {
       int bci = x->bci_of_invoke();
       ciMethodData* md = x->method()->method_data_or_null();
       ciProfileData* data = md->bci_to_data(bci);
    -  assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
    -  ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
    -  LIR_Opr mdp = LIR_OprFact::illegalOpr;
    +  if (data != NULL) {
    +    assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type");
    +    ciReturnTypeEntry* ret = data->is_CallTypeData() ? ((ciCallTypeData*)data)->ret() : ((ciVirtualCallTypeData*)data)->ret();
    +    LIR_Opr mdp = LIR_OprFact::illegalOpr;
     
    -  bool ignored_will_link;
    -  ciSignature* signature_at_call = NULL;
    -  x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
    +    bool ignored_will_link;
    +    ciSignature* signature_at_call = NULL;
    +    x->method()->get_method_at_bci(bci, ignored_will_link, &signature_at_call);
     
    -  // The offset within the MDO of the entry to update may be too large
    -  // to be used in load/store instructions on some platforms. So have
    -  // profile_type() compute the address of the profile in a register.
    -  ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0,
    -                                ret->type(), x->ret(), mdp,
    -                                !x->needs_null_check(),
    -                                signature_at_call->return_type()->as_klass(),
    -                                x->callee()->signature()->return_type()->as_klass());
    -  if (exact != NULL) {
    -    md->set_return_type(bci, exact);
    +    // The offset within the MDO of the entry to update may be too large
    +    // to be used in load/store instructions on some platforms. So have
    +    // profile_type() compute the address of the profile in a register.
    +    ciKlass* exact = profile_type(md, md->byte_offset_of_slot(data, ret->type_offset()), 0,
    +        ret->type(), x->ret(), mdp,
    +        !x->needs_null_check(),
    +        signature_at_call->return_type()->as_klass(),
    +        x->callee()->signature()->return_type()->as_klass());
    +    if (exact != NULL) {
    +      md->set_return_type(bci, exact);
    +    }
       }
     }
     
    diff --git a/hotspot/src/share/vm/c1/c1_ValueMap.hpp b/hotspot/src/share/vm/c1/c1_ValueMap.hpp
    index e2e1c1b15fe..5b1342ede66 100644
    --- a/hotspot/src/share/vm/c1/c1_ValueMap.hpp
    +++ b/hotspot/src/share/vm/c1/c1_ValueMap.hpp
    @@ -157,6 +157,12 @@ class ValueNumberingVisitor: public InstructionVisitor {
       void do_UnsafePutRaw   (UnsafePutRaw*    x) { kill_memory(); }
       void do_UnsafePutObject(UnsafePutObject* x) { kill_memory(); }
       void do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { kill_memory(); }
    +  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
    +  void do_UnsafeGetObject(UnsafeGetObject* x) {
    +    if (x->is_volatile()) { // the JMM requires this
    +      kill_memory();
    +    }
    +  }
       void do_Intrinsic      (Intrinsic*       x) { if (!x->preserves_state()) kill_memory(); }
     
       void do_Phi            (Phi*             x) { /* nothing to do */ }
    @@ -197,8 +203,6 @@ class ValueNumberingVisitor: public InstructionVisitor {
       void do_OsrEntry       (OsrEntry*        x) { /* nothing to do */ }
       void do_ExceptionObject(ExceptionObject* x) { /* nothing to do */ }
       void do_RoundFP        (RoundFP*         x) { /* nothing to do */ }
    -  void do_UnsafeGetRaw   (UnsafeGetRaw*    x) { /* nothing to do */ }
    -  void do_UnsafeGetObject(UnsafeGetObject* x) { /* nothing to do */ }
       void do_ProfileCall    (ProfileCall*     x) { /* nothing to do */ }
       void do_ProfileReturnType (ProfileReturnType*  x) { /* nothing to do */ }
       void do_ProfileInvoke  (ProfileInvoke*   x) { /* nothing to do */ };
    diff --git a/hotspot/src/share/vm/ci/ciEnv.cpp b/hotspot/src/share/vm/ci/ciEnv.cpp
    index 024909b1cbc..c7801a12dc4 100644
    --- a/hotspot/src/share/vm/ci/ciEnv.cpp
    +++ b/hotspot/src/share/vm/ci/ciEnv.cpp
    @@ -101,6 +101,7 @@ ciEnv::ciEnv(CompileTask* task, int system_dictionary_modification_counter)
       _debug_info = NULL;
       _dependencies = NULL;
       _failure_reason = NULL;
    +  _inc_decompile_count_on_failure = true;
       _compilable = MethodCompilable;
       _break_at_compile = false;
       _compiler_data = NULL;
    @@ -161,6 +162,7 @@ ciEnv::ciEnv(Arena* arena) : _ciEnv_arena(mtCompiler) {
       _debug_info = NULL;
       _dependencies = NULL;
       _failure_reason = NULL;
    +  _inc_decompile_count_on_failure = true;
       _compilable = MethodCompilable_never;
       _break_at_compile = false;
       _compiler_data = NULL;
    @@ -702,16 +704,17 @@ ciField* ciEnv::get_field_by_index(ciInstanceKlass* accessor,
     //
     // Perform an appropriate method lookup based on accessor, holder,
     // name, signature, and bytecode.
    -Method* ciEnv::lookup_method(InstanceKlass*  accessor,
    -                               InstanceKlass*  holder,
    -                               Symbol*       name,
    -                               Symbol*       sig,
    -                               Bytecodes::Code bc,
    -                               constantTag    tag) {
    -  EXCEPTION_CONTEXT;
    -  KlassHandle h_accessor(THREAD, accessor);
    -  KlassHandle h_holder(THREAD, holder);
    -  LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
    +Method* ciEnv::lookup_method(ciInstanceKlass* accessor,
    +                             ciKlass*         holder,
    +                             Symbol*          name,
    +                             Symbol*          sig,
    +                             Bytecodes::Code  bc,
    +                             constantTag      tag) {
    +  // Accessibility checks are performed in ciEnv::get_method_by_index_impl.
    +  assert(check_klass_accessibility(accessor, holder->get_Klass()), "holder not accessible");
    +
    +  KlassHandle h_accessor(accessor->get_instanceKlass());
    +  KlassHandle h_holder(holder->get_Klass());
       methodHandle dest_method;
       LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
       switch (bc) {
    @@ -770,7 +773,6 @@ ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
         const int holder_index = cpool->klass_ref_index_at(index);
         bool holder_is_accessible;
         ciKlass* holder = get_klass_by_index_impl(cpool, holder_index, holder_is_accessible, accessor);
    -    ciInstanceKlass* declared_holder = get_instance_klass_for_declared_method_holder(holder);
     
         // Get the method's name and signature.
         Symbol* name_sym = cpool->name_ref_at(index);
    @@ -798,10 +800,9 @@ ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
         }
     
         if (holder_is_accessible) {  // Our declared holder is loaded.
    -      InstanceKlass* lookup = declared_holder->get_instanceKlass();
           constantTag tag = cpool->tag_ref_at(index);
           assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
    -      Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc, tag);
    +      Method* m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
           if (m != NULL &&
               (bc == Bytecodes::_invokestatic
                ?  m->method_holder()->is_not_initialized()
    @@ -824,7 +825,7 @@ ciMethod* ciEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
         // lookup.
         ciSymbol* name      = get_symbol(name_sym);
         ciSymbol* signature = get_symbol(sig_sym);
    -    return get_unloaded_method(declared_holder, name, signature, accessor);
    +    return get_unloaded_method(holder, name, signature, accessor);
       }
     }
     
    @@ -902,7 +903,12 @@ void ciEnv::validate_compile_task_dependencies(ciMethod* target) {
         if (deps.is_klass_type())  continue;  // skip klass dependencies
         Klass* witness = deps.check_dependency();
         if (witness != NULL) {
    -      record_failure("invalid non-klass dependency");
    +      if (deps.type() == Dependencies::call_site_target_value) {
    +        _inc_decompile_count_on_failure = false;
    +        record_failure("call site target change");
    +      } else {
    +        record_failure("invalid non-klass dependency");
    +      }
           return;
         }
       }
    @@ -1017,7 +1023,7 @@ void ciEnv::register_method(ciMethod* target,
         if (failing()) {
           // While not a true deoptimization, it is a preemptive decompile.
           MethodData* mdo = method()->method_data();
    -      if (mdo != NULL) {
    +      if (mdo != NULL && _inc_decompile_count_on_failure) {
             mdo->inc_decompile_count();
           }
     
    diff --git a/hotspot/src/share/vm/ci/ciEnv.hpp b/hotspot/src/share/vm/ci/ciEnv.hpp
    index e5a99e1a96a..a7fbe0bd843 100644
    --- a/hotspot/src/share/vm/ci/ciEnv.hpp
    +++ b/hotspot/src/share/vm/ci/ciEnv.hpp
    @@ -55,6 +55,7 @@ private:
       DebugInformationRecorder* _debug_info;
       Dependencies*    _dependencies;
       const char*      _failure_reason;
    +  bool             _inc_decompile_count_on_failure;
       int              _compilable;
       bool             _break_at_compile;
       int              _num_inlined_bytecodes;
    @@ -152,12 +153,12 @@ private:
       // Helper methods
       bool       check_klass_accessibility(ciKlass* accessing_klass,
                                           Klass* resolved_klass);
    -  Method*    lookup_method(InstanceKlass*  accessor,
    -                           InstanceKlass*  holder,
    -                           Symbol*         name,
    -                           Symbol*         sig,
    -                           Bytecodes::Code bc,
    -                           constantTag     tag);
    +  Method*    lookup_method(ciInstanceKlass* accessor,
    +                           ciKlass*         holder,
    +                           Symbol*          name,
    +                           Symbol*          sig,
    +                           Bytecodes::Code  bc,
    +                           constantTag      tag);
     
       // Get a ciObject from the object factory.  Ensures uniqueness
       // of ciObjects.
    @@ -226,11 +227,12 @@ private:
       // Get a ciMethod representing either an unfound method or
       // a method with an unloaded holder.  Ensures uniqueness of
       // the result.
    -  ciMethod* get_unloaded_method(ciInstanceKlass* holder,
    +  ciMethod* get_unloaded_method(ciKlass*         holder,
                                     ciSymbol*        name,
                                     ciSymbol*        signature,
                                     ciInstanceKlass* accessor) {
    -    return _factory->get_unloaded_method(holder, name, signature, accessor);
    +    ciInstanceKlass* declared_holder = get_instance_klass_for_declared_method_holder(holder);
    +    return _factory->get_unloaded_method(declared_holder, name, signature, accessor);
       }
     
       // Get a ciKlass representing an unloaded klass.
    diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
    index b8133ab754e..9715b2987a1 100644
    --- a/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
    +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.cpp
    @@ -595,6 +595,16 @@ ciInstanceKlass* ciInstanceKlass::implementor() {
       return impl;
     }
     
    +ciInstanceKlass* ciInstanceKlass::host_klass() {
    +  assert(is_loaded(), "must be loaded");
    +  if (is_anonymous()) {
    +    VM_ENTRY_MARK
    +    Klass* host_klass = get_instanceKlass()->host_klass();
    +    return CURRENT_ENV->get_instance_klass(host_klass);
    +  }
    +  return NULL;
    +}
    +
     // Utility class for printing of the contents of the static fields for
     // use by compilation replay.  It only prints out the information that
     // could be consumed by the compiler, so for primitive types it prints
    diff --git a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
    index 1215c089ff4..02bf4b4641b 100644
    --- a/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
    +++ b/hotspot/src/share/vm/ci/ciInstanceKlass.hpp
    @@ -260,6 +260,8 @@ public:
         return NULL;
       }
     
    +  ciInstanceKlass* host_klass();
    +
       bool can_be_instantiated() {
         assert(is_loaded(), "must be loaded");
         return !is_interface() && !is_abstract();
    diff --git a/hotspot/src/share/vm/ci/ciMethod.cpp b/hotspot/src/share/vm/ci/ciMethod.cpp
    index 4860427786f..4590061166b 100644
    --- a/hotspot/src/share/vm/ci/ciMethod.cpp
    +++ b/hotspot/src/share/vm/ci/ciMethod.cpp
    @@ -951,6 +951,13 @@ bool ciMethod::is_compiled_lambda_form() const {
       return iid == vmIntrinsics::_compiledLambdaForm;
     }
     
    +// ------------------------------------------------------------------
    +// ciMethod::is_object_initializer
    +//
    +bool ciMethod::is_object_initializer() const {
    +   return name() == ciSymbol::object_initializer_name();
    +}
    +
     // ------------------------------------------------------------------
     // ciMethod::has_member_arg
     //
    @@ -1409,6 +1416,97 @@ void ciMethod::print_impl(outputStream* st) {
       }
     }
     
    +// ------------------------------------------------------------------
    +
    +static BasicType erase_to_word_type(BasicType bt) {
    +  if (is_subword_type(bt)) return T_INT;
    +  if (bt == T_ARRAY)       return T_OBJECT;
    +  return bt;
    +}
    +
    +static bool basic_types_match(ciType* t1, ciType* t2) {
    +  if (t1 == t2)  return true;
    +  return erase_to_word_type(t1->basic_type()) == erase_to_word_type(t2->basic_type());
    +}
    +
    +bool ciMethod::is_consistent_info(ciMethod* declared_method, ciMethod* resolved_method) {
    +  bool invoke_through_mh_intrinsic = declared_method->is_method_handle_intrinsic() &&
    +                                  !resolved_method->is_method_handle_intrinsic();
    +
    +  if (!invoke_through_mh_intrinsic) {
    +    // Method name & descriptor should stay the same.
    +    // Signatures may reference unloaded types and thus they may be not strictly equal.
    +    ciSymbol* declared_signature = declared_method->signature()->as_symbol();
    +    ciSymbol* resolved_signature = resolved_method->signature()->as_symbol();
    +
    +    return (declared_method->name()->equals(resolved_method->name())) &&
    +           (declared_signature->equals(resolved_signature));
    +  }
    +
    +  ciMethod* linker = declared_method;
    +  ciMethod* target = resolved_method;
    +  // Linkers have appendix argument which is not passed to callee.
    +  int has_appendix = MethodHandles::has_member_arg(linker->intrinsic_id()) ? 1 : 0;
    +  if (linker->arg_size() != (target->arg_size() + has_appendix)) {
    +    return false; // argument slot count mismatch
    +  }
    +
    +  ciSignature* linker_sig = linker->signature();
    +  ciSignature* target_sig = target->signature();
    +
    +  if (linker_sig->count() + (linker->is_static() ? 0 : 1) !=
    +      target_sig->count() + (target->is_static() ? 0 : 1) + has_appendix) {
    +    return false; // argument count mismatch
    +  }
    +
    +  int sbase = 0, rbase = 0;
    +  switch (linker->intrinsic_id()) {
    +    case vmIntrinsics::_linkToVirtual:
    +    case vmIntrinsics::_linkToInterface:
    +    case vmIntrinsics::_linkToSpecial: {
    +      if (target->is_static()) {
    +        return false;
    +      }
    +      if (linker_sig->type_at(0)->is_primitive_type()) {
    +        return false;  // receiver should be an oop
    +      }
    +      sbase = 1; // skip receiver
    +      break;
    +    }
    +    case vmIntrinsics::_linkToStatic: {
    +      if (!target->is_static()) {
    +        return false;
    +      }
    +      break;
    +    }
    +    case vmIntrinsics::_invokeBasic: {
    +      if (target->is_static()) {
    +        if (target_sig->type_at(0)->is_primitive_type()) {
    +          return false; // receiver should be an oop
    +        }
    +        rbase = 1; // skip receiver
    +      }
    +      break;
    +    }
    +  }
    +  assert(target_sig->count() - rbase == linker_sig->count() - sbase - has_appendix, "argument count mismatch");
    +  int arg_count = target_sig->count() - rbase;
    +  for (int i = 0; i < arg_count; i++) {
    +    if (!basic_types_match(linker_sig->type_at(sbase + i), target_sig->type_at(rbase + i))) {
    +      return false;
    +    }
    +  }
    +  // Only check the return type if the symbolic info has non-void return type.
    +  // I.e. the return value of the resolved method can be dropped.
    +  if (!linker->return_type()->is_void() &&
    +      !basic_types_match(linker->return_type(), target->return_type())) {
    +    return false;
    +  }
    +  return true; // no mismatch found
    +}
    +
    +// ------------------------------------------------------------------
    +
     #if INCLUDE_TRACE
     TraceStructCalleeMethod ciMethod::to_trace_struct() const {
       TraceStructCalleeMethod result;
    diff --git a/hotspot/src/share/vm/ci/ciMethod.hpp b/hotspot/src/share/vm/ci/ciMethod.hpp
    index f16948e71d7..2b81e682544 100644
    --- a/hotspot/src/share/vm/ci/ciMethod.hpp
    +++ b/hotspot/src/share/vm/ci/ciMethod.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -337,6 +337,7 @@ class ciMethod : public ciMetadata {
       bool has_reserved_stack_access() const         { return _has_reserved_stack_access; }
       bool is_boxing_method() const;
       bool is_unboxing_method() const;
    +  bool is_object_initializer() const;
     
       // Replay data methods
       void dump_name_as_ascii(outputStream* st);
    @@ -353,6 +354,8 @@ class ciMethod : public ciMetadata {
       void print_name(outputStream* st = tty);
       void print_short_name(outputStream* st = tty);
     
    +  static bool is_consistent_info(ciMethod* declared_method, ciMethod* resolved_method);
    +
     #if INCLUDE_TRACE
       TraceStructCalleeMethod to_trace_struct() const;
     #endif
    diff --git a/hotspot/src/share/vm/ci/ciMethodData.cpp b/hotspot/src/share/vm/ci/ciMethodData.cpp
    index 0ede3dfc31e..1e773c93062 100644
    --- a/hotspot/src/share/vm/ci/ciMethodData.cpp
    +++ b/hotspot/src/share/vm/ci/ciMethodData.cpp
    @@ -408,11 +408,13 @@ void ciMethodData::set_argument_type(int bci, int i, ciKlass* k) {
       MethodData* mdo = get_MethodData();
       if (mdo != NULL) {
         ProfileData* data = mdo->bci_to_data(bci);
    -    if (data->is_CallTypeData()) {
    -      data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
    -    } else {
    -      assert(data->is_VirtualCallTypeData(), "no arguments!");
    -      data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
    +    if (data != NULL) {
    +      if (data->is_CallTypeData()) {
    +        data->as_CallTypeData()->set_argument_type(i, k->get_Klass());
    +      } else {
    +        assert(data->is_VirtualCallTypeData(), "no arguments!");
    +        data->as_VirtualCallTypeData()->set_argument_type(i, k->get_Klass());
    +      }
         }
       }
     }
    @@ -430,11 +432,13 @@ void ciMethodData::set_return_type(int bci, ciKlass* k) {
       MethodData* mdo = get_MethodData();
       if (mdo != NULL) {
         ProfileData* data = mdo->bci_to_data(bci);
    -    if (data->is_CallTypeData()) {
    -      data->as_CallTypeData()->set_return_type(k->get_Klass());
    -    } else {
    -      assert(data->is_VirtualCallTypeData(), "no arguments!");
    -      data->as_VirtualCallTypeData()->set_return_type(k->get_Klass());
    +    if (data != NULL) {
    +      if (data->is_CallTypeData()) {
    +        data->as_CallTypeData()->set_return_type(k->get_Klass());
    +      } else {
    +        assert(data->is_VirtualCallTypeData(), "no arguments!");
    +        data->as_VirtualCallTypeData()->set_return_type(k->get_Klass());
    +      }
         }
       }
     }
    diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
    index 96ffac10af0..db813adf834 100644
    --- a/hotspot/src/share/vm/classfile/classFileParser.cpp
    +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,12 @@
     
     #define JAVA_9_VERSION                    53
     
    +void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
    +  assert((bad_constant == 19 || bad_constant == 20) && _major_version >= JAVA_9_VERSION,
    +         "Unexpected bad constant pool entry");
    +  if (_bad_constant_seen == 0) _bad_constant_seen = bad_constant;
    +}
    +
     void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const stream,
                                                       ConstantPool* cp,
                                                       const int length,
    @@ -302,6 +308,18 @@ void ClassFileParser::parse_constant_pool_entries(const ClassFileStream* const s
             }
             break;
           }
    +      case 19:
    +      case 20: {
    +        // Record that an error occurred in these two cases but keep parsing so
    +        // that ACC_Module can be checked for in the access_flags.  Need to
    +        // throw NoClassDefFoundError in that case.
    +        if (_major_version >= JAVA_9_VERSION) {
    +          cfs->guarantee_more(3, CHECK);
    +          cfs->get_u2_fast();
    +          set_class_bad_constant_seen(tag);
    +          break;
    +        }
    +      }
           default: {
             classfile_parse_error("Unknown constant tag %u in class file %s",
                                   tag,
    @@ -359,14 +377,18 @@ PRAGMA_DIAG_POP
     #endif
     
     void ClassFileParser::parse_constant_pool(const ClassFileStream* const stream,
    -                                          ConstantPool* const cp,
    -                                          const int length,
    -                                          TRAPS) {
    +                                         ConstantPool* const cp,
    +                                         const int length,
    +                                         TRAPS) {
       assert(cp != NULL, "invariant");
       assert(stream != NULL, "invariant");
     
       // parsing constant pool entries
       parse_constant_pool_entries(stream, cp, length, CHECK);
    +  if (class_bad_constant_seen() != 0) {
    +    // a bad CP entry has been detected previously so stop parsing and just return.
    +    return;
    +  }
     
       int index = 1;  // declared outside of loops for portability
     
    @@ -1244,6 +1266,10 @@ void ClassFileParser::parse_field_attributes(const ClassFileStream* const cfs,
           }
         } else if (_major_version >= JAVA_1_5_VERSION) {
           if (attribute_name == vmSymbols::tag_signature()) {
    +        if (generic_signature_index != 0) {
    +          classfile_parse_error(
    +            "Multiple Signature attributes for field in class file %s", CHECK);
    +        }
             if (attribute_length != 2) {
               classfile_parse_error(
                 "Wrong size %u for field's Signature attribute in class file %s",
    @@ -2565,6 +2591,11 @@ Method* ClassFileParser::parse_method(const ClassFileStream* const cfs,
           }
         } else if (_major_version >= JAVA_1_5_VERSION) {
           if (method_attribute_name == vmSymbols::tag_signature()) {
    +        if (generic_signature_index != 0) {
    +          classfile_parse_error(
    +            "Multiple Signature attributes for method in class file %s",
    +            CHECK_NULL);
    +        }
             if (method_attribute_length != 2) {
               classfile_parse_error(
                 "Invalid Signature attribute length %u in class file %s",
    @@ -3052,7 +3083,13 @@ u2 ClassFileParser::parse_classfile_inner_classes_attribute(const ClassFileStrea
                              "Class is both outer and inner class in class file %s", CHECK_0);
         }
         // Access flags
    -    jint flags = cfs->get_u2_fast() & RECOGNIZED_INNER_CLASS_MODIFIERS;
    +    jint flags;
    +    // JVM_ACC_MODULE is defined in JDK-9 and later.
    +    if (_major_version >= JAVA_9_VERSION) {
    +      flags = cfs->get_u2_fast() & (RECOGNIZED_INNER_CLASS_MODIFIERS | JVM_ACC_MODULE);
    +    } else {
    +      flags = cfs->get_u2_fast() & RECOGNIZED_INNER_CLASS_MODIFIERS;
    +    }
         if ((flags & JVM_ACC_INTERFACE) && _major_version < JAVA_6_VERSION) {
           // Set abstract bit for old class files for backward compatibility
           flags |= JVM_ACC_ABSTRACT;
    @@ -3278,6 +3315,10 @@ void ClassFileParser::parse_classfile_attributes(const ClassFileStream* const cf
           }
         } else if (_major_version >= JAVA_1_5_VERSION) {
           if (tag == vmSymbols::tag_signature()) {
    +        if (_generic_signature_index != 0) {
    +          classfile_parse_error(
    +            "Multiple Signature attributes in class file %s", CHECK);
    +        }
             if (attribute_length != 2) {
               classfile_parse_error(
                 "Wrong Signature attribute length %u in class file %s",
    @@ -4524,6 +4565,18 @@ static void check_illegal_static_method(const InstanceKlass* this_klass, TRAPS)
     // utility methods for format checking
     
     void ClassFileParser::verify_legal_class_modifiers(jint flags, TRAPS) const {
    +  const bool is_module = (flags & JVM_ACC_MODULE) != 0;
    +  assert(_major_version >= JAVA_9_VERSION || !is_module, "JVM_ACC_MODULE should not be set");
    +  if (is_module) {
    +    ResourceMark rm(THREAD);
    +    Exceptions::fthrow(
    +      THREAD_AND_LOCATION,
    +      vmSymbols::java_lang_NoClassDefFoundError(),
    +      "%s is not a class because access_flag ACC_MODULE is set",
    +      _class_name->as_C_string());
    +    return;
    +  }
    +
       if (!_need_verify) { return; }
     
       const bool is_interface  = (flags & JVM_ACC_INTERFACE)  != 0;
    @@ -4532,14 +4585,12 @@ void ClassFileParser::verify_legal_class_modifiers(jint flags, TRAPS) const {
       const bool is_super      = (flags & JVM_ACC_SUPER)      != 0;
       const bool is_enum       = (flags & JVM_ACC_ENUM)       != 0;
       const bool is_annotation = (flags & JVM_ACC_ANNOTATION) != 0;
    -  const bool is_module_info= (flags & JVM_ACC_MODULE)     != 0;
       const bool major_gte_15  = _major_version >= JAVA_1_5_VERSION;
     
       if ((is_abstract && is_final) ||
           (is_interface && !is_abstract) ||
           (is_interface && major_gte_15 && (is_super || is_enum)) ||
    -      (!is_interface && major_gte_15 && is_annotation) ||
    -      is_module_info) {
    +      (!is_interface && major_gte_15 && is_annotation)) {
         ResourceMark rm(THREAD);
         Exceptions::fthrow(
           THREAD_AND_LOCATION,
    @@ -5355,7 +5406,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
       ModuleEntry* module_entry = ik->module();
       assert(module_entry != NULL, "module_entry should always be set");
     
    -  // Obtain java.lang.reflect.Module
    +  // Obtain java.lang.Module
       Handle module_handle(THREAD, JNIHandles::resolve(module_entry->module()));
     
       // Allocate mirror and initialize static fields
    @@ -5542,6 +5593,7 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
       _protection_domain(protection_domain),
       _access_flags(),
       _pub_level(pub_level),
    +  _bad_constant_seen(0),
       _synthetic_flag(false),
       _sde_length(false),
       _sde_buffer(NULL),
    @@ -5734,16 +5786,29 @@ void ClassFileParser::parse_stream(const ClassFileStream* const stream,
       stream->guarantee_more(8, CHECK);  // flags, this_class, super_class, infs_len
     
       // Access flags
    -  jint flags = stream->get_u2_fast() & JVM_RECOGNIZED_CLASS_MODIFIERS;
    +  jint flags;
    +  // JVM_ACC_MODULE is defined in JDK-9 and later.
    +  if (_major_version >= JAVA_9_VERSION) {
    +    flags = stream->get_u2_fast() & (JVM_RECOGNIZED_CLASS_MODIFIERS | JVM_ACC_MODULE);
    +  } else {
    +    flags = stream->get_u2_fast() & JVM_RECOGNIZED_CLASS_MODIFIERS;
    +  }
     
       if ((flags & JVM_ACC_INTERFACE) && _major_version < JAVA_6_VERSION) {
         // Set abstract bit for old class files for backward compatibility
         flags |= JVM_ACC_ABSTRACT;
       }
     
    -  _access_flags.set_flags(flags);
    +  verify_legal_class_modifiers(flags, CHECK);
     
    -  verify_legal_class_modifiers((jint)_access_flags.as_int(), CHECK);
    +  short bad_constant = class_bad_constant_seen();
    +  if (bad_constant != 0) {
    +    // Do not throw CFE until after the access_flags are checked because if
    +    // ACC_MODULE is set in the access flags, then NCDFE must be thrown, not CFE.
    +    classfile_parse_error("Unknown constant tag %u in class file %s", bad_constant, CHECK);
    +  }
    +
    +  _access_flags.set_flags(flags);
     
       // This class and superclass
       _this_class_index = stream->get_u2_fast();
    diff --git a/hotspot/src/share/vm/classfile/classFileParser.hpp b/hotspot/src/share/vm/classfile/classFileParser.hpp
    index df9ff6848ab..031a7142375 100644
    --- a/hotspot/src/share/vm/classfile/classFileParser.hpp
    +++ b/hotspot/src/share/vm/classfile/classFileParser.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,6 +122,15 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
       // for tracing and notifications
       Publicity _pub_level;
     
    +  // Used to keep track of whether a constant pool item 19 or 20 is found.  These
    +  // correspond to CONSTANT_Module and CONSTANT_Package tags and are not allowed
    +  // in regular class files.  For class file version >= 53, a CFE cannot be thrown
    +  // immediately when these are seen because a NCDFE must be thrown if the class's
    +  // access_flags have ACC_MODULE set.  But, the access_flags haven't been looked
    +  // at yet.  So, the bad constant pool item is cached here.  A value of zero
    +  // means that no constant pool item 19 or 20 was found.
    +  short _bad_constant_seen;
    +
       // class attributes parsed before the instance klass is created:
       bool _synthetic_flag;
       int _sde_length;
    @@ -161,6 +170,8 @@ class ClassFileParser VALUE_OBJ_CLASS_SPEC {
       void fill_instance_klass(InstanceKlass* ik, bool cf_changed_in_CFLH, TRAPS);
       void set_klass(InstanceKlass* instance);
     
    +  void set_class_bad_constant_seen(short bad_constant);
    +  short class_bad_constant_seen() { return  _bad_constant_seen; }
       void set_class_synthetic_flag(bool x)        { _synthetic_flag = x; }
       void set_class_sourcefile_index(u2 x)        { _sourcefile_index = x; }
       void set_class_generic_signature_index(u2 x) { _generic_signature_index = x; }
    diff --git a/hotspot/src/share/vm/classfile/classLoaderData.cpp b/hotspot/src/share/vm/classfile/classLoaderData.cpp
    index d1e37d82761..c7b26613d07 100644
    --- a/hotspot/src/share/vm/classfile/classLoaderData.cpp
    +++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,7 +93,7 @@ ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous, Depen
       _keep_alive((is_anonymous || h_class_loader.is_null()) ? 1 : 0),
       _metaspace(NULL), _unloading(false), _klasses(NULL),
       _modules(NULL), _packages(NULL),
    -  _claimed(0), _jmethod_ids(NULL), _handles(NULL), _deallocate_list(NULL),
    +  _claimed(0), _jmethod_ids(NULL), _handles(), _deallocate_list(NULL),
       _next(NULL), _dependencies(dependencies),
       _metaspace_lock(new Mutex(Monitor::leaf+1, "Metaspace allocation lock", true,
                                 Monitor::_safepoint_check_never)) {
    @@ -112,6 +112,76 @@ void ClassLoaderData::Dependencies::init(TRAPS) {
       _list_head = oopFactory::new_objectArray(2, CHECK);
     }
     
    +ClassLoaderData::ChunkedHandleList::~ChunkedHandleList() {
    +  Chunk* c = _head;
    +  while (c != NULL) {
    +    Chunk* next = c->_next;
    +    delete c;
    +    c = next;
    +  }
    +}
    +
    +oop* ClassLoaderData::ChunkedHandleList::add(oop o) {
    +  if (_head == NULL || _head->_size == Chunk::CAPACITY) {
    +    Chunk* next = new Chunk(_head);
    +    OrderAccess::release_store_ptr(&_head, next);
    +  }
    +  oop* handle = &_head->_data[_head->_size];
    +  *handle = o;
    +  OrderAccess::release_store(&_head->_size, _head->_size + 1);
    +  return handle;
    +}
    +
    +inline void ClassLoaderData::ChunkedHandleList::oops_do_chunk(OopClosure* f, Chunk* c, const juint size) {
    +  for (juint i = 0; i < size; i++) {
    +    if (c->_data[i] != NULL) {
    +      f->do_oop(&c->_data[i]);
    +    }
    +  }
    +}
    +
    +void ClassLoaderData::ChunkedHandleList::oops_do(OopClosure* f) {
    +  Chunk* head = (Chunk*) OrderAccess::load_ptr_acquire(&_head);
    +  if (head != NULL) {
    +    // Must be careful when reading size of head
    +    oops_do_chunk(f, head, OrderAccess::load_acquire(&head->_size));
    +    for (Chunk* c = head->_next; c != NULL; c = c->_next) {
    +      oops_do_chunk(f, c, c->_size);
    +    }
    +  }
    +}
    +
    +#ifdef ASSERT
    +class VerifyContainsOopClosure : public OopClosure {
    +  oop* _target;
    +  bool _found;
    +
    + public:
    +  VerifyContainsOopClosure(oop* target) : _target(target), _found(false) {}
    +
    +  void do_oop(oop* p) {
    +    if (p == _target) {
    +      _found = true;
    +    }
    +  }
    +
    +  void do_oop(narrowOop* p) {
    +    // The ChunkedHandleList should not contain any narrowOop
    +    ShouldNotReachHere();
    +  }
    +
    +  bool found() const {
    +    return _found;
    +  }
    +};
    +
    +bool ClassLoaderData::ChunkedHandleList::contains(oop* p) {
    +  VerifyContainsOopClosure cl(p);
    +  oops_do(&cl);
    +  return cl.found();
    +}
    +#endif
    +
     bool ClassLoaderData::claim() {
       if (_claimed == 1) {
         return false;
    @@ -146,9 +216,9 @@ void ClassLoaderData::oops_do(OopClosure* f, KlassClosure* klass_closure, bool m
     
       f->do_oop(&_class_loader);
       _dependencies.oops_do(f);
    -  if (_handles != NULL) {
    -    _handles->oops_do(f);
    -  }
    +
    +  _handles.oops_do(f);
    +
       if (klass_closure != NULL) {
         classes_do(klass_closure);
       }
    @@ -484,12 +554,6 @@ ClassLoaderData::~ClassLoaderData() {
         _metaspace = NULL;
         delete m;
       }
    -  // release the handles
    -  if (_handles != NULL) {
    -    JNIHandleBlock::release_block(_handles);
    -    _handles = NULL;
    -  }
    -
       // Clear all the JNI handles for methods
       // These aren't deallocated and are going to look like a leak, but that's
       // needed because we can't really get rid of jmethodIDs because we don't
    @@ -563,19 +627,14 @@ Metaspace* ClassLoaderData::metaspace_non_null() {
       return metaspace;
     }
     
    -JNIHandleBlock* ClassLoaderData::handles() const           { return _handles; }
    -void ClassLoaderData::set_handles(JNIHandleBlock* handles) { _handles = handles; }
    -
     jobject ClassLoaderData::add_handle(Handle h) {
       MutexLockerEx ml(metaspace_lock(),  Mutex::_no_safepoint_check_flag);
    -  if (handles() == NULL) {
    -    set_handles(JNIHandleBlock::allocate_block());
    -  }
    -  return handles()->allocate_handle(h());
    +  return (jobject) _handles.add(h());
     }
     
    -void ClassLoaderData::remove_handle(jobject h) {
    -  _handles->release_handle(h);
    +void ClassLoaderData::remove_handle_unsafe(jobject h) {
    +  assert(_handles.contains((oop*) h), "Got unexpected handle " PTR_FORMAT, p2i((oop*) h));
    +  *((oop*) h) = NULL;
     }
     
     // Add this metadata pointer to be freed when it's safe.  This is only during
    @@ -645,7 +704,6 @@ void ClassLoaderData::dump(outputStream * const out) {
           p2i(class_loader() != NULL ? class_loader()->klass() : NULL), loader_name());
       if (claimed()) out->print(" claimed ");
       if (is_unloading()) out->print(" unloading ");
    -  out->print(" handles " INTPTR_FORMAT, p2i(handles()));
       out->cr();
       if (metaspace_or_null() != NULL) {
         out->print_cr("metaspace: " INTPTR_FORMAT, p2i(metaspace_or_null()));
    diff --git a/hotspot/src/share/vm/classfile/classLoaderData.hpp b/hotspot/src/share/vm/classfile/classLoaderData.hpp
    index 8c8df5187a7..3c0aba64992 100644
    --- a/hotspot/src/share/vm/classfile/classLoaderData.hpp
    +++ b/hotspot/src/share/vm/classfile/classLoaderData.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -52,7 +52,6 @@
     
     class ClassLoaderData;
     class JNIMethodBlock;
    -class JNIHandleBlock;
     class Metadebug;
     class ModuleEntry;
     class PackageEntry;
    @@ -160,6 +159,34 @@ class ClassLoaderData : public CHeapObj {
         void oops_do(OopClosure* f);
       };
     
    +  class ChunkedHandleList VALUE_OBJ_CLASS_SPEC {
    +    struct Chunk : public CHeapObj {
    +      static const size_t CAPACITY = 32;
    +
    +      oop _data[CAPACITY];
    +      volatile juint _size;
    +      Chunk* _next;
    +
    +      Chunk(Chunk* c) : _next(c), _size(0) { }
    +    };
    +
    +    Chunk* _head;
    +
    +    void oops_do_chunk(OopClosure* f, Chunk* c, const juint size);
    +
    +   public:
    +    ChunkedHandleList() : _head(NULL) {}
    +    ~ChunkedHandleList();
    +
    +    // Only one thread at a time can add, guarded by ClassLoaderData::metaspace_lock().
    +    // However, multiple threads can execute oops_do concurrently with add.
    +    oop* add(oop o);
    +#ifdef ASSERT
    +    bool contains(oop* p);
    +#endif
    +    void oops_do(OopClosure* f);
    +  };
    +
       friend class ClassLoaderDataGraph;
       friend class ClassLoaderDataGraphKlassIteratorAtomic;
       friend class ClassLoaderDataGraphMetaspaceIterator;
    @@ -185,8 +212,8 @@ class ClassLoaderData : public CHeapObj {
       volatile int _claimed;   // true if claimed, for example during GC traces.
                                // To avoid applying oop closure more than once.
                                // Has to be an int because we cas it.
    -  JNIHandleBlock* _handles; // Handles to constant pool arrays, Modules, etc, which
    -                            // have the same life cycle of the corresponding ClassLoader.
    +  ChunkedHandleList _handles; // Handles to constant pool arrays, Modules, etc, which
    +                              // have the same life cycle of the corresponding ClassLoader.
     
       Klass* volatile _klasses;              // The classes defined by the class loader.
       PackageEntryTable* volatile _packages; // The packages defined by the class loader.
    @@ -217,9 +244,6 @@ class ClassLoaderData : public CHeapObj {
       ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies);
       ~ClassLoaderData();
     
    -  JNIHandleBlock* handles() const;
    -  void set_handles(JNIHandleBlock* handles);
    -
       // GC interface.
       void clear_claimed()          { _claimed = 0; }
       bool claimed() const          { return _claimed == 1; }
    @@ -312,7 +336,7 @@ class ClassLoaderData : public CHeapObj {
       const char* loader_name();
     
       jobject add_handle(Handle h);
    -  void remove_handle(jobject h);
    +  void remove_handle_unsafe(jobject h);
       void add_class(Klass* k, bool publicize = true);
       void remove_class(Klass* k);
       bool contains_klass(Klass* k);
    diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp
    index b7fe590eee1..22c1e6cc34e 100644
    --- a/hotspot/src/share/vm/classfile/javaClasses.cpp
    +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -773,13 +773,13 @@ void java_lang_Class::initialize_mirror_fields(KlassHandle k,
       InstanceKlass::cast(k())->do_local_static_fields(&initialize_static_field, mirror, CHECK);
     }
     
    -// Set the java.lang.reflect.Module module field in the java_lang_Class mirror
    +// Set the java.lang.Module module field in the java_lang_Class mirror
     void java_lang_Class::set_mirror_module_field(KlassHandle k, Handle mirror, Handle module, TRAPS) {
       if (module.is_null()) {
         // During startup, the module may be NULL only if java.base has not been defined yet.
    -    // Put the class on the fixup_module_list to patch later when the java.lang.reflect.Module
    +    // Put the class on the fixup_module_list to patch later when the java.lang.Module
         // for java.base is known.
    -    assert(!Universe::is_module_initialized(), "Incorrect java.lang.reflect.Module pre module system initialization");
    +    assert(!Universe::is_module_initialized(), "Incorrect java.lang.Module pre module system initialization");
     
         bool javabase_was_defined = false;
         {
    @@ -810,7 +810,7 @@ void java_lang_Class::set_mirror_module_field(KlassHandle k, Handle mirror, Hand
         assert(Universe::is_module_initialized() ||
                (ModuleEntryTable::javabase_defined() &&
                 (module() == JNIHandles::resolve(ModuleEntryTable::javabase_moduleEntry()->module()))),
    -           "Incorrect java.lang.reflect.Module specification while creating mirror");
    +           "Incorrect java.lang.Module specification while creating mirror");
         set_module(mirror(), module());
       }
     }
    @@ -2269,6 +2269,7 @@ void java_lang_LiveStackFrameInfo::compute_offsets() {
       compute_offset(_monitors_offset,   k, vmSymbols::monitors_name(),    vmSymbols::object_array_signature());
       compute_offset(_locals_offset,     k, vmSymbols::locals_name(),      vmSymbols::object_array_signature());
       compute_offset(_operands_offset,   k, vmSymbols::operands_name(),    vmSymbols::object_array_signature());
    +  compute_offset(_mode_offset,       k, vmSymbols::mode_name(),        vmSymbols::int_signature());
     }
     
     void java_lang_reflect_AccessibleObject::compute_offsets() {
    @@ -2803,28 +2804,28 @@ void java_lang_reflect_Parameter::set_executable(oop param, oop value) {
     }
     
     
    -int java_lang_reflect_Module::loader_offset;
    -int java_lang_reflect_Module::name_offset;
    -int java_lang_reflect_Module::_module_entry_offset = -1;
    +int java_lang_Module::loader_offset;
    +int java_lang_Module::name_offset;
    +int java_lang_Module::_module_entry_offset = -1;
     
    -Handle java_lang_reflect_Module::create(Handle loader, Handle module_name, TRAPS) {
    +Handle java_lang_Module::create(Handle loader, Handle module_name, TRAPS) {
       assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
     
    -  Symbol* name = vmSymbols::java_lang_reflect_Module();
    +  Symbol* name = vmSymbols::java_lang_Module();
       Klass* k = SystemDictionary::resolve_or_fail(name, true, CHECK_NH);
       instanceKlassHandle klass (THREAD, k);
     
    -  Handle jlrmh = klass->allocate_instance_handle(CHECK_NH);
    +  Handle jlmh = klass->allocate_instance_handle(CHECK_NH);
       JavaValue result(T_VOID);
    -  JavaCalls::call_special(&result, jlrmh, KlassHandle(THREAD, klass()),
    +  JavaCalls::call_special(&result, jlmh, KlassHandle(THREAD, klass()),
                               vmSymbols::object_initializer_name(),
    -                          vmSymbols::java_lang_reflect_module_init_signature(),
    +                          vmSymbols::java_lang_module_init_signature(),
                               loader, module_name, CHECK_NH);
    -  return jlrmh;
    +  return jlmh;
     }
     
    -void java_lang_reflect_Module::compute_offsets() {
    -  Klass* k = SystemDictionary::reflect_Module_klass();
    +void java_lang_Module::compute_offsets() {
    +  Klass* k = SystemDictionary::Module_klass();
       if(NULL != k) {
         compute_offset(loader_offset,  k, vmSymbols::loader_name(),  vmSymbols::classloader_signature());
         compute_offset(name_offset,    k, vmSymbols::name_name(),    vmSymbols::string_signature());
    @@ -2833,27 +2834,27 @@ void java_lang_reflect_Module::compute_offsets() {
     }
     
     
    -oop java_lang_reflect_Module::loader(oop module) {
    +oop java_lang_Module::loader(oop module) {
       assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
       return module->obj_field(loader_offset);
     }
     
    -void java_lang_reflect_Module::set_loader(oop module, oop value) {
    +void java_lang_Module::set_loader(oop module, oop value) {
       assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
       module->obj_field_put(loader_offset, value);
     }
     
    -oop java_lang_reflect_Module::name(oop module) {
    +oop java_lang_Module::name(oop module) {
       assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
       return module->obj_field(name_offset);
     }
     
    -void java_lang_reflect_Module::set_name(oop module, oop value) {
    +void java_lang_Module::set_name(oop module, oop value) {
       assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
       module->obj_field_put(name_offset, value);
     }
     
    -ModuleEntry* java_lang_reflect_Module::module_entry(oop module, TRAPS) {
    +ModuleEntry* java_lang_Module::module_entry(oop module, TRAPS) {
       assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
       assert(module != NULL, "module can't be null");
       assert(module->is_oop(), "module must be oop");
    @@ -2862,7 +2863,7 @@ ModuleEntry* java_lang_reflect_Module::module_entry(oop module, TRAPS) {
       if (module_entry == NULL) {
         // If the inject field containing the ModuleEntry* is null then return the
         // class loader's unnamed module.
    -    oop loader = java_lang_reflect_Module::loader(module);
    +    oop loader = java_lang_Module::loader(module);
         Handle h_loader = Handle(THREAD, loader);
         ClassLoaderData* loader_cld = SystemDictionary::register_loader(h_loader, CHECK_NULL);
         return loader_cld->modules()->unnamed_module();
    @@ -2870,7 +2871,7 @@ ModuleEntry* java_lang_reflect_Module::module_entry(oop module, TRAPS) {
       return module_entry;
     }
     
    -void java_lang_reflect_Module::set_module_entry(oop module, ModuleEntry* module_entry) {
    +void java_lang_Module::set_module_entry(oop module, ModuleEntry* module_entry) {
       assert(_module_entry_offset != -1, "Uninitialized module_entry_offset");
       assert(module != NULL, "module can't be null");
       assert(module->is_oop(), "module must be oop");
    @@ -3246,6 +3247,15 @@ void java_lang_invoke_MemberName::set_vmindex(oop mname, intptr_t index) {
       mname->address_field_put(_vmindex_offset, (address) index);
     }
     
    +bool java_lang_invoke_MemberName::equals(oop mn1, oop mn2) {
    +  if (mn1 == mn2) {
    +     return true;
    +  }
    +  return (vmtarget(mn1) == vmtarget(mn2) && flags(mn1) == flags(mn2) &&
    +          vmindex(mn1) == vmindex(mn2) &&
    +          clazz(mn1) == clazz(mn2));
    +}
    +
     oop java_lang_invoke_LambdaForm::vmentry(oop lform) {
       assert(is_instance(lform), "wrong type");
       return lform->obj_field(_vmentry_offset);
    @@ -3658,6 +3668,7 @@ int java_lang_StackFrameInfo::_version_offset;
     int java_lang_LiveStackFrameInfo::_monitors_offset;
     int java_lang_LiveStackFrameInfo::_locals_offset;
     int java_lang_LiveStackFrameInfo::_operands_offset;
    +int java_lang_LiveStackFrameInfo::_mode_offset;
     int java_lang_AssertionStatusDirectives::classes_offset;
     int java_lang_AssertionStatusDirectives::classEnabled_offset;
     int java_lang_AssertionStatusDirectives::packages_offset;
    @@ -3728,6 +3739,10 @@ void java_lang_LiveStackFrameInfo::set_operands(oop element, oop value) {
       element->obj_field_put(_operands_offset, value);
     }
     
    +void java_lang_LiveStackFrameInfo::set_mode(oop element, int value) {
    +  element->int_field_put(_mode_offset, value);
    +}
    +
     // Support for java Assertions - java_lang_AssertionStatusDirectives.
     
     void java_lang_AssertionStatusDirectives::set_classes(oop o, oop val) {
    @@ -3862,7 +3877,7 @@ void JavaClasses::compute_offsets() {
       reflect_ConstantPool::compute_offsets();
       reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
       java_lang_reflect_Parameter::compute_offsets();
    -  java_lang_reflect_Module::compute_offsets();
    +  java_lang_Module::compute_offsets();
       java_lang_StackFrameInfo::compute_offsets();
       java_lang_LiveStackFrameInfo::compute_offsets();
     
    diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
    index f05db4c79b7..da5d4a67f2c 100644
    --- a/hotspot/src/share/vm/classfile/javaClasses.hpp
    +++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -755,9 +755,9 @@ class java_lang_reflect_Parameter {
     };
     
     #define MODULE_INJECTED_FIELDS(macro)                            \
    -  macro(java_lang_reflect_Module, module_entry, intptr_signature, false)
    +  macro(java_lang_Module, module_entry, intptr_signature, false)
     
    -class java_lang_reflect_Module {
    +class java_lang_Module {
       private:
         static int loader_offset;
         static int name_offset;
    @@ -1086,6 +1086,8 @@ class java_lang_invoke_MemberName: AllStatic {
       static int flags_offset_in_bytes()            { return _flags_offset; }
       static int vmtarget_offset_in_bytes()         { return _vmtarget_offset; }
       static int vmindex_offset_in_bytes()          { return _vmindex_offset; }
    +
    +  static bool equals(oop mt1, oop mt2);
     };
     
     
    @@ -1380,11 +1382,13 @@ class java_lang_LiveStackFrameInfo: AllStatic {
       static int _monitors_offset;
       static int _locals_offset;
       static int _operands_offset;
    +  static int _mode_offset;
     
      public:
       static void set_monitors(oop info, oop value);
       static void set_locals(oop info, oop value);
       static void set_operands(oop info, oop value);
    +  static void set_mode(oop info, int value);
     
       static void compute_offsets();
     
    diff --git a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp
    index b388bb157d3..a50113d1c61 100644
    --- a/hotspot/src/share/vm/classfile/javaClasses.inline.hpp
    +++ b/hotspot/src/share/vm/classfile/javaClasses.inline.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -162,8 +162,8 @@ inline bool java_lang_invoke_DirectMethodHandle::is_instance(oop obj) {
       return obj != NULL && is_subclass(obj->klass());
     }
     
    -inline bool java_lang_reflect_Module::is_instance(oop obj) {
    -  return obj != NULL && obj->klass() == SystemDictionary::reflect_Module_klass();
    +inline bool java_lang_Module::is_instance(oop obj) {
    +  return obj != NULL && obj->klass() == SystemDictionary::Module_klass();
     }
     
     inline int Backtrace::merge_bci_and_version(int bci, int version) {
    diff --git a/hotspot/src/share/vm/classfile/moduleEntry.cpp b/hotspot/src/share/vm/classfile/moduleEntry.cpp
    index 9402f5d91e1..2f07b10da3e 100644
    --- a/hotspot/src/share/vm/classfile/moduleEntry.cpp
    +++ b/hotspot/src/share/vm/classfile/moduleEntry.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,11 @@ Handle ModuleEntry::shared_protection_domain() {
     // Set the shared ProtectionDomain atomically
     void ModuleEntry::set_shared_protection_domain(ClassLoaderData *loader_data,
                                                    Handle pd_h) {
    -  // Create a JNI handle for the shared ProtectionDomain and save it atomically.
    -  // If someone beats us setting the _pd cache, the created JNI handle is destroyed.
    +  // Create a handle for the shared ProtectionDomain and save it atomically.
    +  // If someone beats us setting the _pd cache, the created handle is destroyed.
       jobject obj = loader_data->add_handle(pd_h);
       if (Atomic::cmpxchg_ptr(obj, &_pd, NULL) != NULL) {
    -    loader_data->remove_handle(obj);
    +    loader_data->remove_handle_unsafe(obj);
       }
     }
     
    @@ -266,19 +266,19 @@ void ModuleEntryTable::create_unnamed_module(ClassLoaderData* loader_data) {
     
       // Each ModuleEntryTable has exactly one unnamed module
       if (loader_data->is_the_null_class_loader_data()) {
    -    // For the boot loader, the java.lang.reflect.Module for the unnamed module
    +    // For the boot loader, the java.lang.Module for the unnamed module
         // is not known until a call to JVM_SetBootLoaderUnnamedModule is made. At
         // this point initially create the ModuleEntry for the unnamed module.
         _unnamed_module = new_entry(0, Handle(NULL), NULL, NULL, NULL, loader_data);
       } else {
    -    // For all other class loaders the java.lang.reflect.Module for their
    +    // For all other class loaders the java.lang.Module for their
         // corresponding unnamed module can be found in the java.lang.ClassLoader object.
         oop module = java_lang_ClassLoader::unnamedModule(loader_data->class_loader());
         _unnamed_module = new_entry(0, Handle(module), NULL, NULL, NULL, loader_data);
     
    -    // Store pointer to the ModuleEntry in the unnamed module's java.lang.reflect.Module
    +    // Store pointer to the ModuleEntry in the unnamed module's java.lang.Module
         // object.
    -    java_lang_reflect_Module::set_module_entry(module, _unnamed_module);
    +    java_lang_Module::set_module_entry(module, _unnamed_module);
       }
     
       // Add to bucket 0, no name to hash on
    @@ -388,27 +388,27 @@ void ModuleEntryTable::finalize_javabase(Handle module_handle, Symbol* version,
         fatal("Unable to finalize module definition for " JAVA_BASE_NAME);
       }
     
    -  // Set java.lang.reflect.Module, version and location for java.base
    +  // Set java.lang.Module, version and location for java.base
       ModuleEntry* jb_module = javabase_moduleEntry();
       assert(jb_module != NULL, JAVA_BASE_NAME " ModuleEntry not defined");
       jb_module->set_version(version);
       jb_module->set_location(location);
       // Once java.base's ModuleEntry _module field is set with the known
    -  // java.lang.reflect.Module, java.base is considered "defined" to the VM.
    +  // java.lang.Module, java.base is considered "defined" to the VM.
       jb_module->set_module(boot_loader_data->add_handle(module_handle));
     
    -  // Store pointer to the ModuleEntry for java.base in the java.lang.reflect.Module object.
    -  java_lang_reflect_Module::set_module_entry(module_handle(), jb_module);
    +  // Store pointer to the ModuleEntry for java.base in the java.lang.Module object.
    +  java_lang_Module::set_module_entry(module_handle(), jb_module);
     }
     
    -// Within java.lang.Class instances there is a java.lang.reflect.Module field
    -// that must be set with the defining module.  During startup, prior to java.base's
    -// definition, classes needing their module field set are added to the fixup_module_list.
    -// Their module field is set once java.base's java.lang.reflect.Module is known to the VM.
    +// Within java.lang.Class instances there is a java.lang.Module field that must
    +// be set with the defining module.  During startup, prior to java.base's definition,
    +// classes needing their module field set are added to the fixup_module_list.
    +// Their module field is set once java.base's java.lang.Module is known to the VM.
     void ModuleEntryTable::patch_javabase_entries(Handle module_handle) {
       if (module_handle.is_null()) {
         fatal("Unable to patch the module field of classes loaded prior to "
    -          JAVA_BASE_NAME "'s definition, invalid java.lang.reflect.Module");
    +          JAVA_BASE_NAME "'s definition, invalid java.lang.Module");
       }
     
       // Do the fixups for the basic primitive types
    diff --git a/hotspot/src/share/vm/classfile/moduleEntry.hpp b/hotspot/src/share/vm/classfile/moduleEntry.hpp
    index 85e898ea861..c50441a1739 100644
    --- a/hotspot/src/share/vm/classfile/moduleEntry.hpp
    +++ b/hotspot/src/share/vm/classfile/moduleEntry.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,8 +36,8 @@
     #include "utilities/ostream.hpp"
     
     #define UNNAMED_MODULE "Unnamed Module"
    -#define JAVAPKG "java/"
    -#define JAVAPKG_LEN 5
    +#define JAVAPKG "java"
    +#define JAVAPKG_LEN 4
     #define JAVA_BASE_NAME "java.base"
     
     class ModuleClosure;
    @@ -45,7 +45,7 @@ class ModuleClosure;
     // A ModuleEntry describes a module that has been defined by a call to JVM_DefineModule.
     // It contains:
     //   - Symbol* containing the module's name.
    -//   - pointer to the java.lang.reflect.Module for this module.
    +//   - pointer to the java.lang.Module for this module.
     //   - pointer to the java.security.ProtectionDomain shared by classes defined to this module.
     //   - ClassLoaderData*, class loader of this module.
     //   - a growable array containg other module entries that this module can read.
    @@ -55,7 +55,7 @@ class ModuleClosure;
     // data structure.
     class ModuleEntry : public HashtableEntry {
     private:
    -  jobject _module;                     // java.lang.reflect.Module
    +  jobject _module;                     // java.lang.Module
       jobject _pd;                         // java.security.ProtectionDomain, cached
                                            // for shared classes from this module
       ClassLoaderData* _loader_data;
    diff --git a/hotspot/src/share/vm/classfile/modules.cpp b/hotspot/src/share/vm/classfile/modules.cpp
    index afa3553af1c..39928498910 100644
    --- a/hotspot/src/share/vm/classfile/modules.cpp
    +++ b/hotspot/src/share/vm/classfile/modules.cpp
    @@ -62,7 +62,7 @@ bool Modules::verify_package_name(const char* package_name) {
     }
     
     static char* get_module_name(oop module, TRAPS) {
    -  oop name_oop = java_lang_reflect_Module::name(module);
    +  oop name_oop = java_lang_Module::name(module);
       if (name_oop == NULL) {
         THROW_MSG_NULL(vmSymbols::java_lang_NullPointerException(), "Null module name");
       }
    @@ -98,11 +98,11 @@ static PackageEntryTable* get_package_entry_table(Handle h_loader, TRAPS) {
     
     static ModuleEntry* get_module_entry(jobject module, TRAPS) {
       Handle module_h(THREAD, JNIHandles::resolve(module));
    -  if (!java_lang_reflect_Module::is_instance(module_h())) {
    +  if (!java_lang_Module::is_instance(module_h())) {
         THROW_MSG_NULL(vmSymbols::java_lang_IllegalArgumentException(),
    -                   "module is not an instance of type java.lang.reflect.Module");
    +                   "module is not an instance of type java.lang.Module");
       }
    -  return java_lang_reflect_Module::module_entry(module_h(), CHECK_NULL);
    +  return java_lang_Module::module_entry(module_h(), CHECK_NULL);
     }
     
     static PackageEntry* get_package_entry(ModuleEntry* module_entry, const char* package_name, TRAPS) {
    @@ -181,7 +181,7 @@ static void define_javabase_module(jobject module, jstring version,
       }
     
       // Validate java_base's loader is the boot loader.
    -  oop loader = java_lang_reflect_Module::loader(module_handle());
    +  oop loader = java_lang_Module::loader(module_handle());
       if (loader != NULL) {
         THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
                   "Class loader must be the boot class loader");
    @@ -234,7 +234,7 @@ static void define_javabase_module(jobject module, jstring version,
       // Only the thread that actually defined the base module will get here,
       // so no locking is needed.
     
    -  // Patch any previously loaded class's module field with java.base's java.lang.reflect.Module.
    +  // Patch any previously loaded class's module field with java.base's java.lang.Module.
       ModuleEntryTable::patch_javabase_entries(module_handle);
     
       log_debug(modules)("define_javabase_module(): Definition of module: "
    @@ -284,9 +284,9 @@ void Modules::define_module(jobject module, jstring version,
       }
     
       Handle module_handle(THREAD, JNIHandles::resolve(module));
    -  if (!java_lang_reflect_Module::is_instance(module_handle())) {
    +  if (!java_lang_Module::is_instance(module_handle())) {
         THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
    -              "module is not an instance of type java.lang.reflect.Module");
    +              "module is not an instance of type java.lang.Module");
       }
     
       char* module_name = get_module_name(module_handle(), CHECK);
    @@ -303,7 +303,7 @@ void Modules::define_module(jobject module, jstring version,
     
       const char* module_version = get_module_version(version);
     
    -  oop loader = java_lang_reflect_Module::loader(module_handle());
    +  oop loader = java_lang_Module::loader(module_handle());
       // Make sure loader is not the jdk.internal.reflect.DelegatingClassLoader.
       if (loader != java_lang_ClassLoader::non_reflection_class_loader(loader)) {
         THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
    @@ -325,7 +325,8 @@ void Modules::define_module(jobject module, jstring version,
         // Only modules defined to either the boot or platform class loader, can define a "java/" package.
         if (!h_loader.is_null() &&
             !SystemDictionary::is_platform_class_loader(h_loader) &&
    -        strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0) {
    +        (strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0 &&
    +          (package_name[JAVAPKG_LEN] == '/' || package_name[JAVAPKG_LEN] == '\0'))) {
           const char* class_loader_name = SystemDictionary::loader_name(h_loader());
           size_t pkg_len = strlen(package_name);
           char* pkg_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, pkg_len);
    @@ -423,8 +424,8 @@ void Modules::define_module(jobject module, jstring version,
               pkg_list->at(y)->decrement_refcount();
             }
     
    -        // Store pointer to ModuleEntry record in java.lang.reflect.Module object.
    -        java_lang_reflect_Module::set_module_entry(module_handle(), module_entry);
    +        // Store pointer to ModuleEntry record in java.lang.Module object.
    +        java_lang_Module::set_module_entry(module_handle(), module_entry);
           }
         }
       }  // Release the lock
    @@ -466,20 +467,20 @@ void Modules::set_bootloader_unnamed_module(jobject module, TRAPS) {
         THROW_MSG(vmSymbols::java_lang_NullPointerException(), "Null module object");
       }
       Handle module_handle(THREAD, JNIHandles::resolve(module));
    -  if (!java_lang_reflect_Module::is_instance(module_handle())) {
    +  if (!java_lang_Module::is_instance(module_handle())) {
         THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
    -              "module is not an instance of type java.lang.reflect.Module");
    +              "module is not an instance of type java.lang.Module");
       }
     
       // Ensure that this is an unnamed module
    -  oop name = java_lang_reflect_Module::name(module_handle());
    +  oop name = java_lang_Module::name(module_handle());
       if (name != NULL) {
         THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
    -              "boot loader's unnamed module's java.lang.reflect.Module has a name");
    +              "boot loader's unnamed module's java.lang.Module has a name");
       }
     
       // Validate java_base's loader is the boot loader.
    -  oop loader = java_lang_reflect_Module::loader(module_handle());
    +  oop loader = java_lang_Module::loader(module_handle());
       if (loader != NULL) {
         THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
                   "Class loader must be the boot class loader");
    @@ -491,12 +492,12 @@ void Modules::set_bootloader_unnamed_module(jobject module, TRAPS) {
       // Ensure the boot loader's PackageEntryTable has been created
       ModuleEntryTable* module_table = get_module_entry_table(h_loader, CHECK);
     
    -  // Set java.lang.reflect.Module for the boot loader's unnamed module
    +  // Set java.lang.Module for the boot loader's unnamed module
       ModuleEntry* unnamed_module = module_table->unnamed_module();
       assert(unnamed_module != NULL, "boot loader's unnamed ModuleEntry not defined");
       unnamed_module->set_module(ClassLoaderData::the_null_class_loader_data()->add_handle(module_handle));
    -  // Store pointer to the ModuleEntry in the unnamed module's java.lang.reflect.Module object.
    -  java_lang_reflect_Module::set_module_entry(module_handle(), unnamed_module);
    +  // Store pointer to the ModuleEntry in the unnamed module's java.lang.Module object.
    +  java_lang_Module::set_module_entry(module_handle(), unnamed_module);
     }
     
     void Modules::add_module_exports(jobject from_module, const char* package_name, jobject to_module, TRAPS) {
    @@ -626,13 +627,13 @@ jobject Modules::get_module(jclass clazz, TRAPS) {
       oop module = java_lang_Class::module(mirror);
     
       assert(module != NULL, "java.lang.Class module field not set");
    -  assert(java_lang_reflect_Module::is_instance(module), "module is not an instance of type java.lang.reflect.Module");
    +  assert(java_lang_Module::is_instance(module), "module is not an instance of type java.lang.Module");
     
       if (log_is_enabled(Debug, modules)) {
         ResourceMark rm(THREAD);
         outputStream* logst = Log(modules)::debug_stream();
         Klass* klass = java_lang_Class::as_Klass(mirror);
    -    oop module_name = java_lang_reflect_Module::name(module);
    +    oop module_name = java_lang_Module::name(module);
         if (module_name != NULL) {
           logst->print("get_module(): module ");
           java_lang_String::print(module_name, tty);
    @@ -748,7 +749,8 @@ void Modules::add_module_package(jobject module, const char* package_name, TRAPS
       // Only modules defined to either the boot or platform class loader, can define a "java/" package.
       if (!loader_data->is_the_null_class_loader_data() &&
           !loader_data->is_platform_class_loader_data() &&
    -      strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0) {
    +      (strncmp(package_name, JAVAPKG, JAVAPKG_LEN) == 0 &&
    +        (package_name[JAVAPKG_LEN] == '/' || package_name[JAVAPKG_LEN] == '\0'))) {
         const char* class_loader_name = SystemDictionary::loader_name(loader_data);
         size_t pkg_len = strlen(package_name);
         char* pkg_name = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, pkg_len);
    diff --git a/hotspot/src/share/vm/classfile/modules.hpp b/hotspot/src/share/vm/classfile/modules.hpp
    index 4f5e089a065..4dc752c95a4 100644
    --- a/hotspot/src/share/vm/classfile/modules.hpp
    +++ b/hotspot/src/share/vm/classfile/modules.hpp
    @@ -1,5 +1,5 @@
     /*
    -* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
    +* Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
     * 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,12 +55,12 @@ public:
                                 jstring location, const char* const* packages,
                                 jsize num_packages, TRAPS);
     
    -  // Provides the java.lang.reflect.Module for the unnamed module defined
    +  // Provides the java.lang.Module for the unnamed module defined
       // to the boot loader.
       //
       //  IllegalArgumentExceptions are thrown for the following :
       //  * Module has a name
    -  //  * Module is not a subclass of java.lang.reflect.Module
    +  //  * Module is not a subclass of java.lang.Module
       //  * Module's class loader is not the boot loader
       //  NullPointerExceptions are thrown if module is null.
       static void set_bootloader_unnamed_module(jobject module, TRAPS);
    @@ -96,10 +96,10 @@ public:
       // module does not exist.
       static void add_reads_module(jobject from_module, jobject to_module, TRAPS);
     
    -  // Return the java.lang.reflect.Module object for this class object.
    +  // Return the java.lang.Module object for this class object.
       static jobject get_module(jclass clazz, TRAPS);
     
    -  // Return the java.lang.reflect.Module object for this class loader and package.
    +  // Return the java.lang.Module object for this class loader and package.
       // Returns NULL if the class loader has not loaded any classes in the package.
       // The package should contain /'s, not .'s, as in java/lang, not java.lang.
       // NullPointerException is thrown if package is null.
    @@ -109,7 +109,7 @@ public:
       static jobject get_named_module(Handle h_loader, const char* package, TRAPS);
     
       // If package is defined by loader, return the
    -  // java.lang.reflect.Module object for the module in which the package is defined.
    +  // java.lang.Module object for the module in which the package is defined.
       // Returns NULL if package is invalid or not defined by loader.
       static jobject get_module(Symbol* package_name, Handle h_loader, TRAPS);
     
    diff --git a/hotspot/src/share/vm/classfile/stringTable.cpp b/hotspot/src/share/vm/classfile/stringTable.cpp
    index 24c72b7ccf1..05f6fd8be46 100644
    --- a/hotspot/src/share/vm/classfile/stringTable.cpp
    +++ b/hotspot/src/share/vm/classfile/stringTable.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,10 +96,14 @@ CompactHashtable StringTable::_shared_table;
     
     // Pick hashing algorithm
     unsigned int StringTable::hash_string(const jchar* s, int len) {
    -  return use_alternate_hashcode() ? AltHashing::murmur3_32(seed(), s, len) :
    +  return use_alternate_hashcode() ? alt_hash_string(s, len) :
                                         java_lang_String::hash_code(s, len);
     }
     
    +unsigned int StringTable::alt_hash_string(const jchar* s, int len) {
    +  return AltHashing::murmur3_32(seed(), s, len);
    +}
    +
     unsigned int StringTable::hash_string(oop string) {
       EXCEPTION_MARK;
       if (string == NULL) {
    @@ -117,11 +121,10 @@ unsigned int StringTable::hash_string(oop string) {
       }
     }
     
    -oop StringTable::lookup_shared(jchar* name, int len) {
    -  // java_lang_String::hash_code() was used to compute hash values in the shared table. Don't
    -  // use the hash value from StringTable::hash_string() as it might use alternate hashcode.
    -  return _shared_table.lookup((const char*)name,
    -                              java_lang_String::hash_code(name, len), len);
    +oop StringTable::lookup_shared(jchar* name, int len, unsigned int hash) {
    +  assert(hash == java_lang_String::hash_code(name, len),
    +         "hash must be computed using java_lang_String::hash_code");
    +  return _shared_table.lookup((const char*)name, hash, len);
     }
     
     oop StringTable::lookup_in_main_table(int index, jchar* name,
    @@ -156,7 +159,7 @@ oop StringTable::basic_add(int index_arg, Handle string, jchar* name,
       unsigned int hashValue;
       int index;
       if (use_alternate_hashcode()) {
    -    hashValue = hash_string(name, len);
    +    hashValue = alt_hash_string(name, len);
         index = hash_to_index(hashValue);
       } else {
         hashValue = hashValue_arg;
    @@ -199,12 +202,15 @@ static void ensure_string_alive(oop string) {
     }
     
     oop StringTable::lookup(jchar* name, int len) {
    -  oop string = lookup_shared(name, len);
    +  // shared table always uses java_lang_String::hash_code
    +  unsigned int hash = java_lang_String::hash_code(name, len);
    +  oop string = lookup_shared(name, len, hash);
       if (string != NULL) {
         return string;
       }
    -
    -  unsigned int hash = hash_string(name, len);
    +  if (use_alternate_hashcode()) {
    +    hash = alt_hash_string(name, len);
    +  }
       int index = the_table()->hash_to_index(hash);
       string = the_table()->lookup_in_main_table(index, name, len, hash);
     
    @@ -215,12 +221,15 @@ oop StringTable::lookup(jchar* name, int len) {
     
     oop StringTable::intern(Handle string_or_null, jchar* name,
                             int len, TRAPS) {
    -  oop found_string = lookup_shared(name, len);
    +  // shared table always uses java_lang_String::hash_code
    +  unsigned int hashValue = java_lang_String::hash_code(name, len);
    +  oop found_string = lookup_shared(name, len, hashValue);
       if (found_string != NULL) {
         return found_string;
       }
    -
    -  unsigned int hashValue = hash_string(name, len);
    +  if (use_alternate_hashcode()) {
    +    hashValue = alt_hash_string(name, len);
    +  }
       int index = the_table()->hash_to_index(hashValue);
       found_string = the_table()->lookup_in_main_table(index, name, len, hashValue);
     
    diff --git a/hotspot/src/share/vm/classfile/stringTable.hpp b/hotspot/src/share/vm/classfile/stringTable.hpp
    index 397cbbd6f9e..2c0afc8bca5 100644
    --- a/hotspot/src/share/vm/classfile/stringTable.hpp
    +++ b/hotspot/src/share/vm/classfile/stringTable.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,7 +56,7 @@ private:
                     unsigned int hashValue, TRAPS);
     
       oop lookup_in_main_table(int index, jchar* chars, int length, unsigned int hashValue);
    -  static oop lookup_shared(jchar* name, int len);
    +  static oop lookup_shared(jchar* name, int len, unsigned int hash);
     
       // Apply the give oop closure to the entries to the buckets
       // in the range [start_idx, end_idx).
    @@ -65,6 +65,13 @@ private:
       // in the range [start_idx, end_idx).
       static void buckets_unlink_or_oops_do(BoolObjectClosure* is_alive, OopClosure* f, int start_idx, int end_idx, int* processed, int* removed);
     
    +  // Hashing algorithm, used as the hash value used by the
    +  //     StringTable for bucket selection and comparison (stored in the
    +  //     HashtableEntry structures).  This is used in the String.intern() method.
    +  static unsigned int hash_string(const jchar* s, int len);
    +  static unsigned int hash_string(oop string);
    +  static unsigned int alt_hash_string(const jchar* s, int len);
    +
       StringTable() : RehashableHashtable((int)StringTableSize,
                                   sizeof (HashtableEntry)) {}
     
    @@ -109,12 +116,6 @@ public:
       }
       static void possibly_parallel_oops_do(OopClosure* f);
     
    -  // Hashing algorithm, used as the hash value used by the
    -  //     StringTable for bucket selection and comparison (stored in the
    -  //     HashtableEntry structures).  This is used in the String.intern() method.
    -  static unsigned int hash_string(const jchar* s, int len);
    -  static unsigned int hash_string(oop string);
    -
       // Internal test.
       static void test_alt_hash() PRODUCT_RETURN;
     
    diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp
    index e29fd131432..fd410851d33 100644
    --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp
    +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp
    @@ -1152,21 +1152,26 @@ Klass* SystemDictionary::resolve_from_stream(Symbol* class_name,
       Symbol* h_name = k->name();
       assert(class_name == NULL || class_name == h_name, "name mismatch");
     
    -  bool define_succeeded = false;
       // Add class just loaded
       // If a class loader supports parallel classloading handle parallel define requests
       // find_or_define_instance_class may return a different InstanceKlass
       if (is_parallelCapable(class_loader)) {
    -    instanceKlassHandle defined_k = find_or_define_instance_class(h_name, class_loader, k, CHECK_NULL);
    -    if (k() == defined_k()) {
    -      // we have won over other concurrent threads (if any) that are
    -      // competing to define the same class.
    -      define_succeeded = true;
    +    instanceKlassHandle defined_k = find_or_define_instance_class(h_name, class_loader, k, THREAD);
    +    if (!HAS_PENDING_EXCEPTION && defined_k() != k()) {
    +      // If a parallel capable class loader already defined this class, register 'k' for cleanup.
    +      assert(defined_k.not_null(), "Should have a klass if there's no exception");
    +      loader_data->add_to_deallocate_list(k());
    +      k = defined_k;
         }
    -    k = defined_k;
       } else {
    -    define_instance_class(k, CHECK_NULL);
    -    define_succeeded = true;
    +    define_instance_class(k, THREAD);
    +  }
    +
    +  // If defining the class throws an exception register 'k' for cleanup.
    +  if (HAS_PENDING_EXCEPTION) {
    +    assert(k.not_null(), "Must have an instance klass here!");
    +    loader_data->add_to_deallocate_list(k());
    +    return NULL;
       }
     
       // Make sure we have an entry in the SystemDictionary on success
    @@ -1518,8 +1523,16 @@ instanceKlassHandle SystemDictionary::load_instance_class(Symbol* class_name, Ha
         // find_or_define_instance_class may return a different InstanceKlass
         if (!k.is_null()) {
           instanceKlassHandle defined_k =
    -        find_or_define_instance_class(class_name, class_loader, k, CHECK_(nh));
    -      k = defined_k;
    +        find_or_define_instance_class(class_name, class_loader, k, THREAD);
    +      if (!HAS_PENDING_EXCEPTION && defined_k() != k()) {
    +        // If a parallel capable class loader already defined this class, register 'k' for cleanup.
    +        assert(defined_k.not_null(), "Should have a klass if there's no exception");
    +        loader_data->add_to_deallocate_list(k());
    +        k = defined_k;
    +      } else if (HAS_PENDING_EXCEPTION) {
    +        loader_data->add_to_deallocate_list(k());
    +        return nh;
    +      }
         }
         return k;
       } else {
    diff --git a/hotspot/src/share/vm/classfile/systemDictionary.hpp b/hotspot/src/share/vm/classfile/systemDictionary.hpp
    index 4cd5e40ffa8..f6ad7a4b347 100644
    --- a/hotspot/src/share/vm/classfile/systemDictionary.hpp
    +++ b/hotspot/src/share/vm/classfile/systemDictionary.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -133,9 +133,9 @@ class SymbolPropertyTable;
       do_klass(Thread_klass,                                java_lang_Thread,                          Pre                 ) \
       do_klass(ThreadGroup_klass,                           java_lang_ThreadGroup,                     Pre                 ) \
       do_klass(Properties_klass,                            java_util_Properties,                      Pre                 ) \
    +  do_klass(Module_klass,                                java_lang_Module,                          Pre                 ) \
       do_klass(reflect_AccessibleObject_klass,              java_lang_reflect_AccessibleObject,        Pre                 ) \
       do_klass(reflect_Field_klass,                         java_lang_reflect_Field,                   Pre                 ) \
    -  do_klass(reflect_Module_klass,                        java_lang_reflect_Module,                  Pre                 ) \
       do_klass(reflect_Parameter_klass,                     java_lang_reflect_Parameter,               Opt                 ) \
       do_klass(reflect_Method_klass,                        java_lang_reflect_Method,                  Pre                 ) \
       do_klass(reflect_Constructor_klass,                   java_lang_reflect_Constructor,             Pre                 ) \
    diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    index 0ef86447c4e..633bb8fd98a 100644
    --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp
    +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -56,6 +56,7 @@
       template(java_lang_Object,                          "java/lang/Object")                         \
       template(java_lang_Class,                           "java/lang/Class")                          \
       template(java_lang_Package,                         "java/lang/Package")                        \
    +  template(java_lang_Module,                          "java/lang/Module")                         \
       template(java_lang_String,                          "java/lang/String")                         \
       template(java_lang_StringLatin1,                    "java/lang/StringLatin1")                   \
       template(java_lang_StringUTF16,                     "java/lang/StringUTF16")                    \
    @@ -90,7 +91,6 @@
       template(java_lang_reflect_Method,                  "java/lang/reflect/Method")                 \
       template(java_lang_reflect_Constructor,             "java/lang/reflect/Constructor")            \
       template(java_lang_reflect_Field,                   "java/lang/reflect/Field")                  \
    -  template(java_lang_reflect_Module,                  "java/lang/reflect/Module")                 \
       template(java_lang_reflect_Parameter,               "java/lang/reflect/Parameter")              \
       template(java_lang_reflect_Array,                   "java/lang/reflect/Array")                  \
       template(java_lang_StringBuffer,                    "java/lang/StringBuffer")                   \
    @@ -136,7 +136,7 @@
       template(initPhase1_name,                           "initPhase1")                               \
       template(initPhase2_name,                           "initPhase2")                               \
       template(initPhase3_name,                           "initPhase3")                               \
    -  template(java_lang_reflect_module_init_signature,   "(Ljava/lang/ClassLoader;Ljava/lang/String;)V") \
    +  template(java_lang_module_init_signature,           "(Ljava/lang/ClassLoader;Ljava/lang/String;)V") \
                                                                                                       \
       /* class file format tags */                                                                    \
       template(tag_source_file,                           "SourceFile")                               \
    @@ -325,14 +325,8 @@
       template(java_lang_StackStreamFactory_AbstractStackWalker, "java/lang/StackStreamFactory$AbstractStackWalker") \
       template(doStackWalk_signature,                     "(JIIII)Ljava/lang/Object;")                \
       template(asPrimitive_name,                          "asPrimitive")                              \
    -  template(asPrimitive_int_signature,                 "(I)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_long_signature,                "(J)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_short_signature,               "(S)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_byte_signature,                "(B)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_char_signature,                "(C)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_float_signature,               "(F)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_double_signature,              "(D)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    -  template(asPrimitive_boolean_signature,             "(Z)Ljava/lang/LiveStackFrame$PrimitiveValue;") \
    +  template(asPrimitive_int_signature,                 "(I)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
    +  template(asPrimitive_long_signature,                "(J)Ljava/lang/LiveStackFrame$PrimitiveSlot;") \
                                                                                                       \
       /* common method and field names */                                                             \
       template(object_initializer_name,                   "")                                   \
    @@ -444,6 +438,7 @@
       template(monitors_name,                             "monitors")                                 \
       template(locals_name,                               "locals")                                   \
       template(operands_name,                             "operands")                                 \
    +  template(mode_name,                                 "mode")                                     \
       template(oop_size_name,                             "oop_size")                                 \
       template(static_oop_field_count_name,               "static_oop_field_count")                   \
       template(protection_domain_name,                    "protection_domain")                        \
    @@ -455,7 +450,7 @@
       template(getModule_name,                            "getModule")                                \
       template(input_stream_void_signature,               "(Ljava/io/InputStream;)V")                 \
       template(definePackage_name,                        "definePackage")                            \
    -  template(definePackage_signature,                   "(Ljava/lang/String;Ljava/lang/reflect/Module;)Ljava/lang/Package;") \
    +  template(definePackage_signature,                   "(Ljava/lang/String;Ljava/lang/Module;)Ljava/lang/Package;") \
       template(defineOrCheckPackage_name,                 "defineOrCheckPackage")                     \
       template(defineOrCheckPackage_signature,            "(Ljava/lang/String;Ljava/util/jar/Manifest;Ljava/net/URL;)Ljava/lang/Package;") \
       template(fileToEncodedURL_name,                     "fileToEncodedURL")                         \
    @@ -537,7 +532,7 @@
       template(void_class_signature,                      "()Ljava/lang/Class;")                                      \
       template(void_class_array_signature,                "()[Ljava/lang/Class;")                                     \
       template(void_string_signature,                     "()Ljava/lang/String;")                                     \
    -  template(void_module_signature,                     "()Ljava/lang/reflect/Module;")                             \
    +  template(void_module_signature,                     "()Ljava/lang/Module;")                                     \
       template(object_array_object_signature,             "([Ljava/lang/Object;)Ljava/lang/Object;")                  \
       template(object_object_array_object_signature,      "(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;")\
       template(exception_void_signature,                  "(Ljava/lang/Exception;)V")                                 \
    @@ -557,7 +552,7 @@
       template(reference_signature,                       "Ljava/lang/ref/Reference;")                                \
       template(sun_misc_Cleaner_signature,                "Lsun/misc/Cleaner;")                                       \
       template(executable_signature,                      "Ljava/lang/reflect/Executable;")                           \
    -  template(module_signature,                          "Ljava/lang/reflect/Module;")                               \
    +  template(module_signature,                          "Ljava/lang/Module;")                                       \
       template(concurrenthashmap_signature,               "Ljava/util/concurrent/ConcurrentHashMap;")                 \
       template(String_StringBuilder_signature,            "(Ljava/lang/String;)Ljava/lang/StringBuilder;")            \
       template(int_StringBuilder_signature,               "(I)Ljava/lang/StringBuilder;")                             \
    @@ -566,6 +561,7 @@
       template(int_StringBuffer_signature,                "(I)Ljava/lang/StringBuffer;")                              \
       template(char_StringBuffer_signature,               "(C)Ljava/lang/StringBuffer;")                              \
       template(int_String_signature,                      "(I)Ljava/lang/String;")                                    \
    +  template(boolean_boolean_int_signature,             "(ZZ)I")                                                    \
       template(codesource_permissioncollection_signature, "(Ljava/security/CodeSource;Ljava/security/PermissionCollection;)V") \
       /* signature symbols needed by intrinsics */                                                                    \
       VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, VM_SYMBOL_IGNORE, template, VM_ALIAS_IGNORE)            \
    @@ -646,16 +642,16 @@
       template(jdk_internal_module_Modules,                "jdk/internal/module/Modules")                             \
       template(jdk_internal_vm_VMSupport,                  "jdk/internal/vm/VMSupport")                               \
       template(addReads_name,                              "addReads")                                                \
    -  template(addReads_signature,                         "(Ljava/lang/reflect/Module;Ljava/lang/reflect/Module;)V") \
    +  template(addReads_signature,                         "(Ljava/lang/Module;Ljava/lang/Module;)V")                 \
       template(addExports_name,                            "addExports")                                              \
       template(addOpens_name,                              "addOpens")                                                \
    -  template(addExports_signature,                       "(Ljava/lang/reflect/Module;Ljava/lang/String;Ljava/lang/reflect/Module;)V") \
    +  template(addExports_signature,                       "(Ljava/lang/Module;Ljava/lang/String;Ljava/lang/Module;)V") \
       template(addUses_name,                               "addUses")                                                 \
    -  template(addUses_signature,                          "(Ljava/lang/reflect/Module;Ljava/lang/Class;)V")          \
    +  template(addUses_signature,                          "(Ljava/lang/Module;Ljava/lang/Class;)V")                  \
       template(addProvides_name,                           "addProvides")                                             \
    -  template(addProvides_signature,                      "(Ljava/lang/reflect/Module;Ljava/lang/Class;Ljava/lang/Class;)V") \
    +  template(addProvides_signature,                      "(Ljava/lang/Module;Ljava/lang/Class;Ljava/lang/Class;)V") \
       template(transformedByAgent_name,                    "transformedByAgent")                                      \
    -  template(transformedByAgent_signature,               "(Ljava/lang/reflect/Module;)V")                           \
    +  template(transformedByAgent_signature,               "(Ljava/lang/Module;)V")                                   \
       template(appendToClassPathForInstrumentation_name,   "appendToClassPathForInstrumentation")                     \
       do_alias(appendToClassPathForInstrumentation_signature, string_void_signature)                                  \
       template(serializePropertiesToByteArray_name,        "serializePropertiesToByteArray")                          \
    diff --git a/hotspot/src/share/vm/code/codeCache.cpp b/hotspot/src/share/vm/code/codeCache.cpp
    index bfe643ab683..549535b7aa0 100644
    --- a/hotspot/src/share/vm/code/codeCache.cpp
    +++ b/hotspot/src/share/vm/code/codeCache.cpp
    @@ -417,7 +417,7 @@ void CodeCache::add_heap(ReservedSpace rs, const char* name, int code_blob_type)
     CodeHeap* CodeCache::get_code_heap(const CodeBlob* cb) {
       assert(cb != NULL, "CodeBlob is null");
       FOR_ALL_HEAPS(heap) {
    -    if ((*heap)->contains(cb->code_begin())) {
    +    if ((*heap)->contains_blob(cb)) {
           return *heap;
         }
       }
    @@ -1211,7 +1211,7 @@ void CodeCache::make_marked_nmethods_not_entrant() {
       CompiledMethodIterator iter;
       while(iter.next_alive()) {
         CompiledMethod* nm = iter.method();
    -    if (nm->is_marked_for_deoptimization()) {
    +    if (nm->is_marked_for_deoptimization() && !nm->is_not_entrant()) {
           nm->make_not_entrant();
         }
       }
    diff --git a/hotspot/src/share/vm/code/codeCache.hpp b/hotspot/src/share/vm/code/codeCache.hpp
    index 99209dc3c66..469ac0af329 100644
    --- a/hotspot/src/share/vm/code/codeCache.hpp
    +++ b/hotspot/src/share/vm/code/codeCache.hpp
    @@ -304,11 +304,10 @@ template  class CodeBlobIterator : public StackObj {
         // If set to NULL, initialized by first call to next()
         _code_blob = (CodeBlob*)nm;
         if (nm != NULL) {
    -      address start = nm->code_begin();
    -      while(!(*_heap)->contains(start)) {
    +      while(!(*_heap)->contains_blob(_code_blob)) {
             ++_heap;
           }
    -      assert((*_heap)->contains(start), "match not found");
    +      assert((*_heap)->contains_blob(_code_blob), "match not found");
         }
       }
     
    diff --git a/hotspot/src/share/vm/code/nmethod.cpp b/hotspot/src/share/vm/code/nmethod.cpp
    index 71420040970..f82872baf1c 100644
    --- a/hotspot/src/share/vm/code/nmethod.cpp
    +++ b/hotspot/src/share/vm/code/nmethod.cpp
    @@ -1146,6 +1146,14 @@ bool nmethod::make_not_entrant_or_zombie(unsigned int state) {
       assert(state == zombie || state == not_entrant, "must be zombie or not_entrant");
       assert(!is_zombie(), "should not already be a zombie");
     
    +  if (_state == state) {
    +    // Avoid taking the lock if already in required state.
    +    // This is safe from races because the state is an end-state,
    +    // which the nmethod cannot back out of once entered.
    +    // No need for fencing either.
    +    return false;
    +  }
    +
       // Make sure neither the nmethod nor the method is flushed in case of a safepoint in code below.
       nmethodLocker nml(this);
       methodHandle the_method(method());
    diff --git a/hotspot/src/share/vm/compiler/compilerDefinitions.cpp b/hotspot/src/share/vm/compiler/compilerDefinitions.cpp
    index 00c2e64f851..bcec3ffa20d 100644
    --- a/hotspot/src/share/vm/compiler/compilerDefinitions.cpp
    +++ b/hotspot/src/share/vm/compiler/compilerDefinitions.cpp
    @@ -100,7 +100,9 @@ void set_client_compilation_mode() {
         FLAG_SET_ERGO(size_t, MetaspaceSize, 12*M);
       }
       if (FLAG_IS_DEFAULT(MaxRAM)) {
    -    FLAG_SET_ERGO(uint64_t, MaxRAM, 1ULL*G);
    +    // Do not use FLAG_SET_ERGO to update MaxRAM, as this will impact
    +    // heap setting done based on available phys_mem (see Arguments::set_heap_size).
    +    FLAG_SET_DEFAULT(MaxRAM, 1ULL*G);
       }
       if (FLAG_IS_DEFAULT(CompileThreshold)) {
         FLAG_SET_ERGO(intx, CompileThreshold, 1500);
    diff --git a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
    index 1cc6a5ea1e9..4effbf42d11 100644
    --- a/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
    +++ b/hotspot/src/share/vm/gc/cms/concurrentMarkSweepGeneration.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -488,9 +488,6 @@ CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
       _gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
       _cms_start_registered(false)
     {
    -  if (ExplicitGCInvokesConcurrentAndUnloadsClasses) {
    -    ExplicitGCInvokesConcurrent = true;
    -  }
       // Now expand the span and allocate the collection support structures
       // (MUT, marking bit map etc.) to cover both generations subject to
       // collection.
    @@ -2559,10 +2556,8 @@ void CMSCollector::verify_overflow_empty() const {
     // Decide if we want to enable class unloading as part of the
     // ensuing concurrent GC cycle. We will collect and
     // unload classes if it's the case that:
    -// (1) an explicit gc request has been made and the flag
    -//     ExplicitGCInvokesConcurrentAndUnloadsClasses is set, OR
    -// (2) (a) class unloading is enabled at the command line, and
    -//     (b) old gen is getting really full
    +//  (a) class unloading is enabled at the command line, and
    +//  (b) old gen is getting really full
     // NOTE: Provided there is no change in the state of the heap between
     // calls to this method, it should have idempotent results. Moreover,
     // its results should be monotonically increasing (i.e. going from 0 to 1,
    @@ -2575,11 +2570,7 @@ void CMSCollector::verify_overflow_empty() const {
     // below.
     void CMSCollector::update_should_unload_classes() {
       _should_unload_classes = false;
    -  // Condition 1 above
    -  if (_full_gc_requested && ExplicitGCInvokesConcurrentAndUnloadsClasses) {
    -    _should_unload_classes = true;
    -  } else if (CMSClassUnloadingEnabled) { // Condition 2.a above
    -    // Disjuncts 2.b.(i,ii,iii) above
    +  if (CMSClassUnloadingEnabled) {
         _should_unload_classes = (concurrent_cycles_since_last_unload() >=
                                   CMSClassUnloadingMaxInterval)
                                || _cmsGen->is_too_full();
    diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp
    index 7967d6cf001..6015b16c3e2 100644
    --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp
    +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,29 +711,6 @@ void HeapRegionRemSet::setup_remset_size() {
       guarantee(G1RSetSparseRegionEntries > 0 && G1RSetRegionEntries > 0 , "Sanity");
     }
     
    -#ifndef PRODUCT
    -void HeapRegionRemSet::print() {
    -  HeapRegionRemSetIterator iter(this);
    -  size_t card_index;
    -  while (iter.has_next(card_index)) {
    -    HeapWord* card_start = _bot->address_for_index(card_index);
    -    tty->print_cr("  Card " PTR_FORMAT, p2i(card_start));
    -  }
    -  if (iter.n_yielded() != occupied()) {
    -    tty->print_cr("Yielded disagrees with occupied:");
    -    tty->print_cr("  " SIZE_FORMAT_W(6) " yielded (" SIZE_FORMAT_W(6)
    -                  " coarse, " SIZE_FORMAT_W(6) " fine).",
    -                  iter.n_yielded(),
    -                  iter.n_yielded_coarse(), iter.n_yielded_fine());
    -    tty->print_cr("  " SIZE_FORMAT_W(6) " occ     (" SIZE_FORMAT_W(6)
    -                           " coarse, " SIZE_FORMAT_W(6) " fine).",
    -                  occupied(), occ_coarse(), occ_fine());
    -  }
    -  guarantee(iter.n_yielded() == occupied(),
    -            "We should have yielded all the represented cards.");
    -}
    -#endif
    -
     void HeapRegionRemSet::cleanup() {
       SparsePRT::cleanup_all();
     }
    @@ -917,10 +894,6 @@ bool HeapRegionRemSetIterator::has_next(size_t& card_index) {
         // Otherwise...
         break;
       }
    -  assert(ParallelGCThreads > 1 ||
    -         n_yielded() == _hrrs->occupied(),
    -         "Should have yielded all the cards in the rem set "
    -         "(in the non-par case).");
       return false;
     }
     
    diff --git a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp
    index 7f740b692c8..97c7e0643ea 100644
    --- a/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp
    +++ b/hotspot/src/share/vm/gc/g1/heapRegionRemSet.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -290,8 +290,6 @@ public:
       // consumed by the strong code roots.
       size_t strong_code_roots_mem_size();
     
    -  void print() PRODUCT_RETURN;
    -
       // Called during a stop-world phase to perform any deferred cleanups.
       static void cleanup();
     
    diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
    index 48eb3c4163d..e300f8c2309 100644
    --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
    +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,8 +54,26 @@ GCTaskThread::~GCTaskThread() {
       }
     }
     
    +void GCTaskThread::add_task_timestamp(const char* name, jlong t_entry, jlong t_exit) {
    +  if (_time_stamp_index < GCTaskTimeStampEntries) {
    +    GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index);
    +    time_stamp->set_name(name);
    +    time_stamp->set_entry_time(t_entry);
    +    time_stamp->set_exit_time(t_exit);
    +  } else {
    +    if (_time_stamp_index ==  GCTaskTimeStampEntries) {
    +      log_warning(gc, task, time)("GC-thread %u: Too many timestamps, ignoring future ones. "
    +                                  "Increase GCTaskTimeStampEntries to get more info.",
    +                                  id());
    +    }
    +    // Let _time_stamp_index keep counting to give the user an idea about how many
    +    // are needed.
    +  }
    +  _time_stamp_index++;
    +}
    +
     GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
    -  guarantee(index < GCTaskTimeStampEntries, "increase GCTaskTimeStampEntries");
    +  assert(index < GCTaskTimeStampEntries, "Precondition");
       if (_time_stamps == NULL) {
         // We allocate the _time_stamps array lazily since logging can be enabled dynamically
         GCTaskTimeStamp* time_stamps = NEW_C_HEAP_ARRAY(GCTaskTimeStamp, GCTaskTimeStampEntries, mtGC);
    @@ -65,7 +83,6 @@ GCTaskTimeStamp* GCTaskThread::time_stamp_at(uint index) {
           FREE_C_HEAP_ARRAY(GCTaskTimeStamp, time_stamps);
         }
       }
    -
       return &(_time_stamps[index]);
     }
     
    @@ -75,8 +92,11 @@ void GCTaskThread::print_task_time_stamps() {
       // Since _time_stamps is now lazily allocated we need to check that it
       // has in fact been allocated when calling this function.
       if (_time_stamps != NULL) {
    -    log_debug(gc, task, time)("GC-Thread %u entries: %d", id(), _time_stamp_index);
    -    for(uint i=0; i<_time_stamp_index; i++) {
    +    log_debug(gc, task, time)("GC-Thread %u entries: %d%s", id(),
    +                              _time_stamp_index,
    +                              _time_stamp_index >= GCTaskTimeStampEntries ? " (overflow)" : "");
    +    const uint max_index = MIN2(_time_stamp_index, GCTaskTimeStampEntries);
    +    for (uint i = 0; i < max_index; i++) {
           GCTaskTimeStamp* time_stamp = time_stamp_at(i);
           log_debug(gc, task, time)("\t[ %s " JLONG_FORMAT " " JLONG_FORMAT " ]",
                                     time_stamp->name(),
    @@ -144,16 +164,7 @@ void GCTaskThread::run() {
     
             if (log_is_enabled(Debug, gc, task, time)) {
               timer.update();
    -
    -          GCTaskTimeStamp* time_stamp = time_stamp_at(_time_stamp_index);
    -
    -          time_stamp->set_name(name);
    -          time_stamp->set_entry_time(entry_time);
    -          time_stamp->set_exit_time(timer.ticks());
    -
    -          // Update the index after we have set up the entry correctly since
    -          // GCTaskThread::print_task_time_stamps() may read this value concurrently.
    -          _time_stamp_index++;
    +          add_task_timestamp(name, entry_time, timer.ticks());
             }
           } else {
             // idle tasks complete outside the normal accounting
    diff --git a/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp b/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp
    index 59e6286f26e..d4fbe4b96b7 100644
    --- a/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp
    +++ b/hotspot/src/share/vm/gc/parallel/gcTaskThread.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,7 @@ private:
       uint _time_stamp_index;
     
       GCTaskTimeStamp* time_stamp_at(uint index);
    +  void add_task_timestamp(const char* name, jlong t_entry, jlong t_exit);
     
       bool _is_working;                     // True if participating in GC tasks
     
    @@ -92,16 +93,16 @@ class GCTaskTimeStamp : public CHeapObj
      private:
       jlong  _entry_time;
       jlong  _exit_time;
    -  char*  _name;
    +  const char*  _name;
     
      public:
       jlong entry_time()              { return _entry_time; }
       jlong exit_time()               { return _exit_time; }
    -  const char* name() const        { return (const char*)_name; }
    +  const char* name() const        { return _name; }
     
       void set_entry_time(jlong time) { _entry_time = time; }
       void set_exit_time(jlong time)  { _exit_time = time; }
    -  void set_name(char* name)       { _name = name; }
    +  void set_name(const char* name) { _name = name; }
     };
     
     #endif // SHARE_VM_GC_PARALLEL_GCTASKTHREAD_HPP
    diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
    index 573529f8cec..d053786f031 100644
    --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
    +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp
    @@ -720,7 +720,8 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte
       Thread* THREAD = thread;
       // extract receiver from the outgoing argument list if necessary
       Handle receiver(thread, NULL);
    -  if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface) {
    +  if (bytecode == Bytecodes::_invokevirtual || bytecode == Bytecodes::_invokeinterface ||
    +      bytecode == Bytecodes::_invokespecial) {
         ResourceMark rm(thread);
         methodHandle m (thread, method(thread));
         Bytecode_invoke call(m, bci(thread));
    @@ -783,16 +784,25 @@ void InterpreterRuntime::resolve_invoke(JavaThread* thread, Bytecodes::Code byte
           int index = info.resolved_method()->itable_index();
           assert(info.itable_index() == index, "");
         }
    +  } else if (bytecode == Bytecodes::_invokespecial) {
    +    assert(info.call_kind() == CallInfo::direct_call, "must be direct call");
       } else {
         assert(info.call_kind() == CallInfo::direct_call ||
                info.call_kind() == CallInfo::vtable_call, "");
       }
     #endif
    +  // Get sender or sender's host_klass, and only set cpCache entry to resolved if
    +  // it is not an interface.  The receiver for invokespecial calls within interface
    +  // methods must be checked for every call.
    +  InstanceKlass* sender = pool->pool_holder();
    +  sender = sender->is_anonymous() ? sender->host_klass() : sender;
    +
       switch (info.call_kind()) {
       case CallInfo::direct_call:
         cp_cache_entry->set_direct_call(
           bytecode,
    -      info.resolved_method());
    +      info.resolved_method(),
    +      sender->is_interface());
         break;
       case CallInfo::vtable_call:
         cp_cache_entry->set_vtable_call(
    diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp
    index b062f2cc4bd..d7ae64effe6 100644
    --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp
    +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp
    @@ -1057,12 +1057,14 @@ methodHandle LinkResolver::linktime_resolve_static_method(const LinkInfo& link_i
     
     
     void LinkResolver::resolve_special_call(CallInfo& result,
    +                                        Handle recv,
                                             const LinkInfo& link_info,
                                             TRAPS) {
       methodHandle resolved_method = linktime_resolve_special_method(link_info, CHECK);
       runtime_resolve_special_method(result, resolved_method,
                                      link_info.resolved_klass(),
                                      link_info.current_klass(),
    +                                 recv,
                                      link_info.check_access(), CHECK);
     }
     
    @@ -1149,6 +1151,7 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result,
                                                       const methodHandle& resolved_method,
                                                       KlassHandle resolved_klass,
                                                       KlassHandle current_klass,
    +                                                  Handle recv,
                                                       bool check_access, TRAPS) {
     
       // resolved method is selected method unless we have an old-style lookup
    @@ -1157,21 +1160,19 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result,
       // no checks for shadowing
       methodHandle sel_method(THREAD, resolved_method());
     
    -  // check if this is an old-style super call and do a new lookup if so
    -  { KlassHandle method_klass  = KlassHandle(THREAD,
    -                                            resolved_method->method_holder());
    +  if (check_access &&
    +      // check if the method is not 
    +      resolved_method->name() != vmSymbols::object_initializer_name()) {
     
    -    if (check_access &&
    +  // check if this is an old-style super call and do a new lookup if so
             // a) check if ACC_SUPER flag is set for the current class
    -        (current_klass->is_super() || !AllowNonVirtualCalls) &&
    +    if ((current_klass->is_super() || !AllowNonVirtualCalls) &&
             // b) check if the class of the resolved_klass is a superclass
             // (not supertype in order to exclude interface classes) of the current class.
             // This check is not performed for super.invoke for interface methods
             // in super interfaces.
             current_klass->is_subclass_of(resolved_klass()) &&
    -        current_klass() != resolved_klass() &&
    -        // c) check if the method is not 
    -        resolved_method->name() != vmSymbols::object_initializer_name()) {
    +        current_klass() != resolved_klass()) {
           // Lookup super method
           KlassHandle super_klass(THREAD, current_klass->super());
           sel_method = lookup_instance_method_in_klasses(super_klass,
    @@ -1186,6 +1187,27 @@ void LinkResolver::runtime_resolve_special_method(CallInfo& result,
                                                 resolved_method->signature()));
           }
         }
    +
    +    // Check that the class of objectref (the receiver) is the current class or interface,
    +    // or a subtype of the current class or interface (the sender), otherwise invokespecial
    +    // throws IllegalAccessError.
    +    // The verifier checks that the sender is a subtype of the class in the I/MR operand.
    +    // The verifier also checks that the receiver is a subtype of the sender, if the sender is
    +    // a class.  If the sender is an interface, the check has to be performed at runtime.
    +    InstanceKlass* sender = InstanceKlass::cast(current_klass());
    +    sender = sender->is_anonymous() ? sender->host_klass() : sender;
    +    if (sender->is_interface() && recv.not_null()) {
    +      Klass* receiver_klass = recv->klass();
    +      if (!receiver_klass->is_subtype_of(sender)) {
    +        ResourceMark rm(THREAD);
    +        char buf[500];
    +        jio_snprintf(buf, sizeof(buf),
    +                     "Receiver class %s must be the current class or a subtype of interface %s",
    +                     receiver_klass->name()->as_C_string(),
    +                     sender->name()->as_C_string());
    +        THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), buf);
    +      }
    +    }
       }
     
       // check if not static
    @@ -1518,7 +1540,7 @@ methodHandle LinkResolver::resolve_static_call_or_null(const LinkInfo& link_info
     methodHandle LinkResolver::resolve_special_call_or_null(const LinkInfo& link_info) {
       EXCEPTION_MARK;
       CallInfo info;
    -  resolve_special_call(info, link_info, THREAD);
    +  resolve_special_call(info, Handle(), link_info, THREAD);
       if (HAS_PENDING_EXCEPTION) {
         CLEAR_PENDING_EXCEPTION;
         return methodHandle();
    @@ -1534,7 +1556,7 @@ methodHandle LinkResolver::resolve_special_call_or_null(const LinkInfo& link_inf
     void LinkResolver::resolve_invoke(CallInfo& result, Handle recv, const constantPoolHandle& pool, int index, Bytecodes::Code byte, TRAPS) {
       switch (byte) {
         case Bytecodes::_invokestatic   : resolve_invokestatic   (result,       pool, index, CHECK); break;
    -    case Bytecodes::_invokespecial  : resolve_invokespecial  (result,       pool, index, CHECK); break;
    +    case Bytecodes::_invokespecial  : resolve_invokespecial  (result, recv, pool, index, CHECK); break;
         case Bytecodes::_invokevirtual  : resolve_invokevirtual  (result, recv, pool, index, CHECK); break;
         case Bytecodes::_invokehandle   : resolve_invokehandle   (result,       pool, index, CHECK); break;
         case Bytecodes::_invokedynamic  : resolve_invokedynamic  (result,       pool, index, CHECK); break;
    @@ -1563,7 +1585,7 @@ void LinkResolver::resolve_invoke(CallInfo& result, Handle& recv,
           resolve_static_call(result, link_info, /*initialize_class=*/false, CHECK);
           break;
         case Bytecodes::_invokespecial:
    -      resolve_special_call(result, link_info, CHECK);
    +      resolve_special_call(result, recv, link_info, CHECK);
           break;
         default:
           fatal("bad call: %s", Bytecodes::name(byte));
    @@ -1576,9 +1598,10 @@ void LinkResolver::resolve_invokestatic(CallInfo& result, const constantPoolHand
     }
     
     
    -void LinkResolver::resolve_invokespecial(CallInfo& result, const constantPoolHandle& pool, int index, TRAPS) {
    +void LinkResolver::resolve_invokespecial(CallInfo& result, Handle recv,
    +                                         const constantPoolHandle& pool, int index, TRAPS) {
       LinkInfo link_info(pool, index, CHECK);
    -  resolve_special_call(result, link_info, CHECK);
    +  resolve_special_call(result, recv, link_info, CHECK);
     }
     
     
    diff --git a/hotspot/src/share/vm/interpreter/linkResolver.hpp b/hotspot/src/share/vm/interpreter/linkResolver.hpp
    index 1c02898b42d..2f14496bb01 100644
    --- a/hotspot/src/share/vm/interpreter/linkResolver.hpp
    +++ b/hotspot/src/share/vm/interpreter/linkResolver.hpp
    @@ -230,6 +230,7 @@ class LinkResolver: AllStatic {
                                                      const methodHandle& resolved_method,
                                                      KlassHandle resolved_klass,
                                                      KlassHandle current_klass,
    +                                                 Handle recv,
                                                      bool check_access, TRAPS);
       static void runtime_resolve_virtual_method    (CallInfo& result,
                                                      const methodHandle& resolved_method,
    @@ -256,7 +257,7 @@ class LinkResolver: AllStatic {
       // runtime resolving from constant pool
       static void resolve_invokestatic   (CallInfo& result,
                                           const constantPoolHandle& pool, int index, TRAPS);
    -  static void resolve_invokespecial  (CallInfo& result,
    +  static void resolve_invokespecial  (CallInfo& result, Handle recv,
                                           const constantPoolHandle& pool, int index, TRAPS);
       static void resolve_invokevirtual  (CallInfo& result, Handle recv,
                                           const constantPoolHandle& pool, int index, TRAPS);
    @@ -289,6 +290,7 @@ class LinkResolver: AllStatic {
                                          const LinkInfo& link_info,
                                          bool initialize_klass, TRAPS);
       static void resolve_special_call  (CallInfo& result,
    +                                     Handle recv,
                                          const LinkInfo& link_info,
                                          TRAPS);
       static void resolve_virtual_call  (CallInfo& result, Handle recv, KlassHandle recv_klass,
    diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
    index 2fe6b45b79e..6f02a6ce79e 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.cpp
    @@ -53,8 +53,34 @@
     #include "runtime/vframe.hpp"
     #include "runtime/vframe_hp.hpp"
     #include "runtime/vmStructs.hpp"
    +#include "utilities/resourceHash.hpp"
     
     
    +void JNIHandleMark::push_jni_handle_block() {
    +  JavaThread* thread = JavaThread::current();
    +  if (thread != NULL) {
    +    // Allocate a new block for JNI handles.
    +    // Inlined code from jni_PushLocalFrame()
    +    JNIHandleBlock* java_handles = ((JavaThread*)thread)->active_handles();
    +    JNIHandleBlock* compile_handles = JNIHandleBlock::allocate_block(thread);
    +    assert(compile_handles != NULL && java_handles != NULL, "should not be NULL");
    +    compile_handles->set_pop_frame_link(java_handles);
    +    thread->set_active_handles(compile_handles);
    +  }
    +}
    +
    +void JNIHandleMark::pop_jni_handle_block() {
    +  JavaThread* thread = JavaThread::current();
    +  if (thread != NULL) {
    +    // Release our JNI handle block
    +    JNIHandleBlock* compile_handles = thread->active_handles();
    +    JNIHandleBlock* java_handles = compile_handles->pop_frame_link();
    +    thread->set_active_handles(java_handles);
    +    compile_handles->set_pop_frame_link(NULL);
    +    JNIHandleBlock::release_block(compile_handles, thread); // may block
    +  }
    +}
    +
     // Entry to native method implementation that transitions current thread to '_thread_in_vm'.
     #define C2V_VMENTRY(result_type, name, signature) \
       JNIEXPORT result_type JNICALL c2v_ ## name signature { \
    @@ -88,6 +114,7 @@ oop CompilerToVM::get_jvmci_type(KlassHandle klass, TRAPS) {
       return NULL;
     }
     
    +
     int CompilerToVM::Data::Klass_vtable_start_offset;
     int CompilerToVM::Data::Klass_vtable_length_offset;
     
    @@ -120,6 +147,15 @@ int CompilerToVM::Data::cardtable_shift;
     
     int CompilerToVM::Data::vm_page_size;
     
    +int CompilerToVM::Data::sizeof_vtableEntry = sizeof(vtableEntry);
    +int CompilerToVM::Data::sizeof_ExceptionTableElement = sizeof(ExceptionTableElement);
    +int CompilerToVM::Data::sizeof_LocalVariableTableElement = sizeof(LocalVariableTableElement);
    +int CompilerToVM::Data::sizeof_ConstantPool = sizeof(ConstantPool);
    +int CompilerToVM::Data::sizeof_SymbolPointer = sizeof(Symbol*);
    +int CompilerToVM::Data::sizeof_narrowKlass = sizeof(narrowKlass);
    +int CompilerToVM::Data::sizeof_arrayOopDesc = sizeof(arrayOopDesc);
    +int CompilerToVM::Data::sizeof_BasicLock = sizeof(BasicLock);
    +
     address CompilerToVM::Data::dsin;
     address CompilerToVM::Data::dcos;
     address CompilerToVM::Data::dtan;
    @@ -128,7 +164,10 @@ address CompilerToVM::Data::dlog;
     address CompilerToVM::Data::dlog10;
     address CompilerToVM::Data::dpow;
     
    -void CompilerToVM::Data::initialize() {
    +address CompilerToVM::Data::symbol_init;
    +address CompilerToVM::Data::symbol_clinit;
    +
    +void CompilerToVM::Data::initialize(TRAPS) {
       Klass_vtable_start_offset = in_bytes(Klass::vtable_start_offset());
       Klass_vtable_length_offset = in_bytes(Klass::vtable_length_offset());
     
    @@ -160,6 +199,9 @@ void CompilerToVM::Data::initialize() {
       assert(OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index)), "should be valid");
       assert(!OopMapValue::legal_vm_reg_name(VMRegImpl::stack2reg(max_oop_map_stack_index + 1)), "should be invalid");
     
    +  symbol_init = (address) vmSymbols::object_initializer_name();
    +  symbol_clinit = (address) vmSymbols::class_initializer_name();
    +
       BarrierSet* bs = Universe::heap()->barrier_set();
       switch (bs->kind()) {
       case BarrierSet::CardTableModRef:
    @@ -179,7 +221,7 @@ void CompilerToVM::Data::initialize() {
         // No post barriers
         break;
       default:
    -    ShouldNotReachHere();
    +    JVMCI_ERROR("Unsupported BarrierSet kind %d", bs->kind());
         break;
       }
     
    @@ -237,13 +279,114 @@ objArrayHandle CompilerToVM::initialize_intrinsics(TRAPS) {
       return vmIntrinsics;
     }
     
    -C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
    -#define BOXED_LONG(name, value) oop name; do { jvalue p; p.j = (jlong) (value); name = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL);} while(0)
    +/**
    + * The set of VM flags known to be used.
    + */
    +#define PREDEFINED_CONFIG_FLAGS(do_bool_flag, do_intx_flag, do_uintx_flag) \
    +  do_intx_flag(AllocateInstancePrefetchLines)                              \
    +  do_intx_flag(AllocatePrefetchDistance)                                   \
    +  do_intx_flag(AllocatePrefetchInstr)                                      \
    +  do_intx_flag(AllocatePrefetchLines)                                      \
    +  do_intx_flag(AllocatePrefetchStepSize)                                   \
    +  do_intx_flag(AllocatePrefetchStyle)                                      \
    +  do_intx_flag(BciProfileWidth)                                            \
    +  do_bool_flag(BootstrapJVMCI)                                             \
    +  do_bool_flag(CITime)                                                     \
    +  do_bool_flag(CITimeEach)                                                 \
    +  do_uintx_flag(CodeCacheSegmentSize)                                      \
    +  do_intx_flag(CodeEntryAlignment)                                         \
    +  do_bool_flag(CompactFields)                                              \
    +  NOT_PRODUCT(do_intx_flag(CompileTheWorldStartAt))                        \
    +  NOT_PRODUCT(do_intx_flag(CompileTheWorldStopAt))                         \
    +  do_intx_flag(ContendedPaddingWidth)                                      \
    +  do_bool_flag(DontCompileHugeMethods)                                     \
    +  do_bool_flag(EnableContended)                                            \
    +  do_intx_flag(FieldsAllocationStyle)                                      \
    +  do_bool_flag(FoldStableValues)                                           \
    +  do_bool_flag(ForceUnreachable)                                           \
    +  do_intx_flag(HugeMethodLimit)                                            \
    +  do_bool_flag(Inline)                                                     \
    +  do_intx_flag(JVMCICounterSize)                                           \
    +  do_bool_flag(JVMCIPrintProperties)                                       \
    +  do_bool_flag(JVMCIUseFastLocking)                                        \
    +  do_intx_flag(MethodProfileWidth)                                         \
    +  do_intx_flag(ObjectAlignmentInBytes)                                     \
    +  do_bool_flag(PrintInlining)                                              \
    +  do_bool_flag(ReduceInitialCardMarks)                                     \
    +  do_bool_flag(RestrictContended)                                          \
    +  do_intx_flag(StackReservedPages)                                         \
    +  do_intx_flag(StackShadowPages)                                           \
    +  do_bool_flag(TLABStats)                                                  \
    +  do_uintx_flag(TLABWasteIncrement)                                        \
    +  do_intx_flag(TypeProfileWidth)                                           \
    +  do_bool_flag(UseAESIntrinsics)                                           \
    +  X86_ONLY(do_intx_flag(UseAVX))                                           \
    +  do_bool_flag(UseBiasedLocking)                                           \
    +  do_bool_flag(UseCRC32Intrinsics)                                         \
    +  do_bool_flag(UseCompressedClassPointers)                                 \
    +  do_bool_flag(UseCompressedOops)                                          \
    +  do_bool_flag(UseConcMarkSweepGC)                                         \
    +  X86_ONLY(do_bool_flag(UseCountLeadingZerosInstruction))                  \
    +  X86_ONLY(do_bool_flag(UseCountTrailingZerosInstruction))                 \
    +  do_bool_flag(UseG1GC)                                                    \
    +  COMPILER2_PRESENT(do_bool_flag(UseMontgomeryMultiplyIntrinsic))          \
    +  COMPILER2_PRESENT(do_bool_flag(UseMontgomerySquareIntrinsic))            \
    +  COMPILER2_PRESENT(do_bool_flag(UseMulAddIntrinsic))                      \
    +  COMPILER2_PRESENT(do_bool_flag(UseMultiplyToLenIntrinsic))               \
    +  do_bool_flag(UsePopCountInstruction)                                     \
    +  do_bool_flag(UseSHA1Intrinsics)                                          \
    +  do_bool_flag(UseSHA256Intrinsics)                                        \
    +  do_bool_flag(UseSHA512Intrinsics)                                        \
    +  do_intx_flag(UseSSE)                                                     \
    +  COMPILER2_PRESENT(do_bool_flag(UseSquareToLenIntrinsic))                 \
    +  do_bool_flag(UseStackBanging)                                            \
    +  do_bool_flag(UseTLAB)                                                    \
    +  do_bool_flag(VerifyOops)                                                 \
    +
    +#define BOXED_BOOLEAN(name, value) oop name = ((jboolean)(value) ? boxedTrue() : boxedFalse())
     #define BOXED_DOUBLE(name, value) oop name; do { jvalue p; p.d = (jdouble) (value); name = java_lang_boxing_object::create(T_DOUBLE, &p, CHECK_NULL);} while(0)
    +#define BOXED_LONG(name, value) \
    +  oop name; \
    +  do { \
    +    jvalue p; p.j = (jlong) (value); \
    +    Handle* e = longs.get(p.j); \
    +    if (e == NULL) { \
    +      Handle h = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL); \
    +      longs.put(p.j, h); \
    +      name = h(); \
    +    } else { \
    +      name = (*e)(); \
    +    } \
    +  } while (0)
    +
    +#define CSTRING_TO_JSTRING(name, value) \
    +  Handle name; \
    +  do { \
    +    if (value != NULL) { \
    +      Handle* e = strings.get(value); \
    +      if (e == NULL) { \
    +        Handle h = java_lang_String::create_from_str(value, CHECK_NULL); \
    +        strings.put(value, h); \
    +        name = h(); \
    +      } else { \
    +        name = (*e)(); \
    +      } \
    +    } \
    +  } while (0)
    +
    +C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
       ResourceMark rm;
       HandleMark hm;
     
    -  CompilerToVM::Data::initialize();
    +  // Used to canonicalize Long and String values.
    +  ResourceHashtable longs;
    +  ResourceHashtable strings;
    +
    +  jvalue prim;
    +  prim.z = true;  Handle boxedTrue =  java_lang_boxing_object::create(T_BOOLEAN, &prim, CHECK_NULL);
    +  prim.z = false; Handle boxedFalse = java_lang_boxing_object::create(T_BOOLEAN, &prim, CHECK_NULL);
    +
    +  CompilerToVM::Data::initialize(CHECK_NULL);
     
       VMField::klass()->initialize(CHECK_NULL);
       VMFlag::klass()->initialize(CHECK_NULL);
    @@ -257,31 +400,31 @@ C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
         size_t name_buf_len = strlen(vmField.typeName) + strlen(vmField.fieldName) + 2 /* "::" */;
         char* name_buf = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, name_buf_len + 1);
         sprintf(name_buf, "%s::%s", vmField.typeName, vmField.fieldName);
    -    Handle name = java_lang_String::create_from_str(name_buf, CHECK_NULL);
    -    Handle type = java_lang_String::create_from_str(vmField.typeString, CHECK_NULL);
    +    CSTRING_TO_JSTRING(name, name_buf);
    +    CSTRING_TO_JSTRING(type, vmField.typeString);
         VMField::set_name(vmFieldObj, name());
         VMField::set_type(vmFieldObj, type());
         VMField::set_offset(vmFieldObj, vmField.offset);
         VMField::set_address(vmFieldObj, (jlong) vmField.address);
    -    if (vmField.isStatic) {
    +    if (vmField.isStatic && vmField.typeString != NULL) {
           if (strcmp(vmField.typeString, "bool") == 0) {
    -        BOXED_LONG(value, *(jbyte*) vmField.address);
    -        VMField::set_value(vmFieldObj, value);
    +        BOXED_BOOLEAN(box, *(jbyte*) vmField.address);
    +        VMField::set_value(vmFieldObj, box);
           } else if (strcmp(vmField.typeString, "int") == 0 ||
                      strcmp(vmField.typeString, "jint") == 0) {
    -        BOXED_LONG(value, *(jint*) vmField.address);
    -        VMField::set_value(vmFieldObj, value);
    +        BOXED_LONG(box, *(jint*) vmField.address);
    +        VMField::set_value(vmFieldObj, box);
           } else if (strcmp(vmField.typeString, "uint64_t") == 0) {
    -        BOXED_LONG(value, *(uint64_t*) vmField.address);
    -        VMField::set_value(vmFieldObj, value);
    +        BOXED_LONG(box, *(uint64_t*) vmField.address);
    +        VMField::set_value(vmFieldObj, box);
           } else if (strcmp(vmField.typeString, "address") == 0 ||
                      strcmp(vmField.typeString, "intptr_t") == 0 ||
                      strcmp(vmField.typeString, "uintptr_t") == 0 ||
                      strcmp(vmField.typeString, "size_t") == 0 ||
                      // All foo* types are addresses.
                      vmField.typeString[strlen(vmField.typeString) - 1] == '*') {
    -        BOXED_LONG(value, *((address*) vmField.address));
    -        VMField::set_value(vmFieldObj, value);
    +        BOXED_LONG(box, *((address*) vmField.address));
    +        VMField::set_value(vmFieldObj, box);
           } else {
             JVMCI_ERROR_NULL("VM field %s has unsupported type %s", name_buf, vmField.typeString);
           }
    @@ -289,16 +432,6 @@ C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
         vmFields->obj_at_put(i, vmFieldObj());
       }
     
    -  len = JVMCIVMStructs::localHotSpotVMTypes_count();
    -  objArrayHandle vmTypes = oopFactory::new_objArray(SystemDictionary::Object_klass(), len * 2, CHECK_NULL);
    -  for (int i = 0; i < len ; i++) {
    -    VMTypeEntry vmType = JVMCIVMStructs::localHotSpotVMTypes[i];
    -    Handle name = java_lang_String::create_from_str(vmType.typeName, CHECK_NULL);
    -    BOXED_LONG(size, vmType.size);
    -    vmTypes->obj_at_put(i * 2, name());
    -    vmTypes->obj_at_put(i * 2 + 1, size);
    -  }
    -
       int ints_len = JVMCIVMStructs::localHotSpotVMIntConstants_count();
       int longs_len = JVMCIVMStructs::localHotSpotVMLongConstants_count();
       len = ints_len + longs_len;
    @@ -306,14 +439,14 @@ C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
       int insert = 0;
       for (int i = 0; i < ints_len ; i++) {
         VMIntConstantEntry c = JVMCIVMStructs::localHotSpotVMIntConstants[i];
    -    Handle name = java_lang_String::create_from_str(c.name, CHECK_NULL);
    +    CSTRING_TO_JSTRING(name, c.name);
         BOXED_LONG(value, c.value);
         vmConstants->obj_at_put(insert++, name());
         vmConstants->obj_at_put(insert++, value);
       }
       for (int i = 0; i < longs_len ; i++) {
         VMLongConstantEntry c = JVMCIVMStructs::localHotSpotVMLongConstants[i];
    -    Handle name = java_lang_String::create_from_str(c.name, CHECK_NULL);
    +    CSTRING_TO_JSTRING(name, c.name);
         BOXED_LONG(value, c.value);
         vmConstants->obj_at_put(insert++, name());
         vmConstants->obj_at_put(insert++, value);
    @@ -324,69 +457,104 @@ C2V_VMENTRY(jobjectArray, readConfiguration, (JNIEnv *env))
       objArrayHandle vmAddresses = oopFactory::new_objArray(SystemDictionary::Object_klass(), len * 2, CHECK_NULL);
       for (int i = 0; i < len ; i++) {
         VMAddressEntry a = JVMCIVMStructs::localHotSpotVMAddresses[i];
    -    Handle name = java_lang_String::create_from_str(a.name, CHECK_NULL);
    +    CSTRING_TO_JSTRING(name, a.name);
         BOXED_LONG(value, a.value);
         vmAddresses->obj_at_put(i * 2, name());
         vmAddresses->obj_at_put(i * 2 + 1, value);
       }
     
    -  // The last entry is the null entry.
    -  len = (int) Flag::numFlags - 1;
    +#define COUNT_FLAG(ignore) +1
    +#ifdef ASSERT
    +#define CHECK_FLAG(type, name) { \
    +  Flag* flag = Flag::find_flag(#name, strlen(#name), /*allow_locked*/ true, /* return_flag */ true); \
    +  assert(flag != NULL, "No such flag named " #name); \
    +  assert(flag->is_##type(), "Flag " #name " is not of type " #type); \
    +}
    +#else
    +#define CHECK_FLAG(type, name)
    +#endif
    +
    +#define ADD_FLAG(type, name, convert) { \
    +  CHECK_FLAG(type, name) \
    +  instanceHandle vmFlagObj = InstanceKlass::cast(VMFlag::klass())->allocate_instance_handle(CHECK_NULL); \
    +  CSTRING_TO_JSTRING(fname, #name); \
    +  CSTRING_TO_JSTRING(ftype, #type); \
    +  VMFlag::set_name(vmFlagObj, fname()); \
    +  VMFlag::set_type(vmFlagObj, ftype()); \
    +  convert(value, name); \
    +  VMFlag::set_value(vmFlagObj, value); \
    +  vmFlags->obj_at_put(i++, vmFlagObj()); \
    +}
    +#define ADD_BOOL_FLAG(name)  ADD_FLAG(bool, name, BOXED_BOOLEAN)
    +#define ADD_INTX_FLAG(name)  ADD_FLAG(intx, name, BOXED_LONG)
    +#define ADD_UINTX_FLAG(name) ADD_FLAG(uintx, name, BOXED_LONG)
    +
    +  len = 0 + PREDEFINED_CONFIG_FLAGS(COUNT_FLAG, COUNT_FLAG, COUNT_FLAG);
       objArrayHandle vmFlags = oopFactory::new_objArray(VMFlag::klass(), len, CHECK_NULL);
    -  for (int i = 0; i < len; i++) {
    -    Flag* flag = &Flag::flags[i];
    -    instanceHandle vmFlagObj = InstanceKlass::cast(VMFlag::klass())->allocate_instance_handle(CHECK_NULL);
    -    Handle name = java_lang_String::create_from_str(flag->_name, CHECK_NULL);
    -    Handle type = java_lang_String::create_from_str(flag->_type, CHECK_NULL);
    -    VMFlag::set_name(vmFlagObj, name());
    -    VMFlag::set_type(vmFlagObj, type());
    -    if (flag->is_bool()) {
    -      BOXED_LONG(value, flag->get_bool());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_ccstr()) {
    -      Handle value = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_NULL);
    -      VMFlag::set_value(vmFlagObj, value());
    -    } else if (flag->is_int()) {
    -      BOXED_LONG(value, flag->get_int());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_intx()) {
    -      BOXED_LONG(value, flag->get_intx());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_uint()) {
    -      BOXED_LONG(value, flag->get_uint());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_uint64_t()) {
    -      BOXED_LONG(value, flag->get_uint64_t());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_uintx()) {
    -      BOXED_LONG(value, flag->get_uintx());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_double()) {
    -      BOXED_DOUBLE(value, flag->get_double());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else if (flag->is_size_t()) {
    -      BOXED_LONG(value, flag->get_size_t());
    -      VMFlag::set_value(vmFlagObj, value);
    -    } else {
    -      JVMCI_ERROR_NULL("VM flag %s has unsupported type %s", flag->_name, flag->_type);
    -    }
    -    vmFlags->obj_at_put(i, vmFlagObj());
    -  }
    +  int i = 0;
    +  PREDEFINED_CONFIG_FLAGS(ADD_BOOL_FLAG, ADD_INTX_FLAG, ADD_UINTX_FLAG)
     
       objArrayHandle vmIntrinsics = CompilerToVM::initialize_intrinsics(CHECK_NULL);
     
    -  objArrayOop data = oopFactory::new_objArray(SystemDictionary::Object_klass(), 6, CHECK_NULL);
    +  objArrayOop data = oopFactory::new_objArray(SystemDictionary::Object_klass(), 5, CHECK_NULL);
       data->obj_at_put(0, vmFields());
    -  data->obj_at_put(1, vmTypes());
    -  data->obj_at_put(2, vmConstants());
    -  data->obj_at_put(3, vmAddresses());
    -  data->obj_at_put(4, vmFlags());
    -  data->obj_at_put(5, vmIntrinsics());
    +  data->obj_at_put(1, vmConstants());
    +  data->obj_at_put(2, vmAddresses());
    +  data->obj_at_put(3, vmFlags());
    +  data->obj_at_put(4, vmIntrinsics());
     
       return (jobjectArray) JNIHandles::make_local(THREAD, data);
    +#undef COUNT_FLAG
    +#undef ADD_FLAG
    +#undef ADD_BOOL_FLAG
    +#undef ADD_INTX_FLAG
    +#undef ADD_UINTX_FLAG
    +#undef CHECK_FLAG
    +C2V_END
    +
    +C2V_VMENTRY(jobject, getFlagValue, (JNIEnv *, jobject c2vm, jobject name_handle))
    +#define RETURN_BOXED_LONG(value) oop box; jvalue p; p.j = (jlong) (value); box = java_lang_boxing_object::create(T_LONG, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
    +#define RETURN_BOXED_DOUBLE(value) oop box; jvalue p; p.d = (jdouble) (value); box = java_lang_boxing_object::create(T_DOUBLE, &p, CHECK_NULL); return JNIHandles::make_local(THREAD, box);
    +  Handle name = JNIHandles::resolve(name_handle);
    +  if (name.is_null()) {
    +    THROW_0(vmSymbols::java_lang_NullPointerException());
    +  }
    +  ResourceMark rm;
    +  const char* cstring = java_lang_String::as_utf8_string(name());
    +  Flag* flag = Flag::find_flag(cstring, strlen(cstring), /* allow_locked */ true, /* return_flag */ true);
    +  if (flag == NULL) {
    +    return c2vm;
    +  }
    +  if (flag->is_bool()) {
    +    jvalue prim;
    +    prim.z = flag->get_bool();
    +    oop box = java_lang_boxing_object::create(T_BOOLEAN, &prim, CHECK_NULL);
    +    return JNIHandles::make_local(THREAD, box);
    +  } else if (flag->is_ccstr()) {
    +    Handle value = java_lang_String::create_from_str(flag->get_ccstr(), CHECK_NULL);
    +    return JNIHandles::make_local(THREAD, value());
    +  } else if (flag->is_intx()) {
    +    RETURN_BOXED_LONG(flag->get_intx());
    +  } else if (flag->is_int()) {
    +    RETURN_BOXED_LONG(flag->get_int());
    +  } else if (flag->is_uint()) {
    +    RETURN_BOXED_LONG(flag->get_uint());
    +  } else if (flag->is_uint64_t()) {
    +    RETURN_BOXED_LONG(flag->get_uint64_t());
    +  } else if (flag->is_size_t()) {
    +    RETURN_BOXED_LONG(flag->get_size_t());
    +  } else if (flag->is_uintx()) {
    +    RETURN_BOXED_LONG(flag->get_uintx());
    +  } else if (flag->is_double()) {
    +    RETURN_BOXED_DOUBLE(flag->get_double());
    +  } else {
    +    JVMCI_ERROR_NULL("VM flag %s has unsupported type %s", flag->_name, flag->_type);
    +  }
    +C2V_END
    +
     #undef BOXED_LONG
     #undef BOXED_DOUBLE
    -C2V_END
    +#undef CSTRING_TO_JSTRING
     
     C2V_VMENTRY(jbyteArray, getBytecode, (JNIEnv *, jobject, jobject jvmci_method))
       methodHandle method = CompilerToVM::asMethod(jvmci_method);
    @@ -593,9 +761,7 @@ C2V_END
     
     C2V_VMENTRY(jboolean, isCompilable,(JNIEnv *, jobject, jobject jvmci_method))
       methodHandle method = CompilerToVM::asMethod(jvmci_method);
    -  // Ignore the not_compilable flags in hosted mode since they are never set by
    -  // the JVMCI compiler.
    -  return UseJVMCICompiler || !method->is_not_compilable(CompLevel_full_optimization);
    +  return !method->is_not_compilable(CompLevel_full_optimization);
     C2V_END
     
     C2V_VMENTRY(jboolean, hasNeverInlineDirective,(JNIEnv *, jobject, jobject jvmci_method))
    @@ -743,7 +909,7 @@ C2V_VMENTRY(jint, constantPoolRemapInstructionOperandFromCache, (JNIEnv*, jobjec
       return cp->remap_instruction_operand_from_cache(index);
     C2V_END
     
    -C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jobject jvmci_method, jbyte opcode, jlongArray info_handle))
    +C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jobject jvmci_method, jbyte opcode, jintArray info_handle))
       ResourceMark rm;
       constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool);
       Bytecodes::Code code = (Bytecodes::Code)(((int) opcode) & 0xFF);
    @@ -751,9 +917,12 @@ C2V_VMENTRY(jobject, resolveFieldInPool, (JNIEnv*, jobject, jobject jvmci_consta
       LinkInfo link_info(cp, index, (jvmci_method != NULL) ? CompilerToVM::asMethod(jvmci_method) : NULL, CHECK_0);
       LinkResolver::resolve_field(fd, link_info, Bytecodes::java_code(code), false, CHECK_0);
       typeArrayOop info = (typeArrayOop) JNIHandles::resolve(info_handle);
    -  assert(info != NULL && info->length() == 2, "must be");
    -  info->long_at_put(0, (jlong) fd.access_flags().as_int());
    -  info->long_at_put(1, (jlong) fd.offset());
    +  if (info == NULL || info->length() != 3) {
    +    JVMCI_ERROR_NULL("info must not be null and have a length of 3");
    +  }
    +  info->int_at_put(0, fd.access_flags().as_int());
    +  info->int_at_put(1, fd.offset());
    +  info->int_at_put(2, fd.index());
       oop field_holder = CompilerToVM::get_jvmci_type(fd.field_holder(), CHECK_NULL);
       return JNIHandles::make_local(THREAD, field_holder);
     C2V_END
    @@ -842,6 +1011,8 @@ C2V_END
     C2V_VMENTRY(jint, installCode, (JNIEnv *jniEnv, jobject, jobject target, jobject compiled_code, jobject installed_code, jobject speculation_log))
       ResourceMark rm;
       HandleMark hm;
    +  JNIHandleMark jni_hm;
    +
       Handle target_handle = JNIHandles::resolve(target);
       Handle compiled_code_handle = JNIHandles::resolve(compiled_code);
       CodeBlob* cb = NULL;
    @@ -1610,7 +1781,7 @@ JNINativeMethod CompilerToVM::methods[] = {
       {CC "resolveConstantInPool",                        CC "(" HS_CONSTANT_POOL "I)" OBJECT,                                                  FN_PTR(resolveConstantInPool)},
       {CC "resolvePossiblyCachedConstantInPool",          CC "(" HS_CONSTANT_POOL "I)" OBJECT,                                                  FN_PTR(resolvePossiblyCachedConstantInPool)},
       {CC "resolveTypeInPool",                            CC "(" HS_CONSTANT_POOL "I)" HS_RESOLVED_KLASS,                                       FN_PTR(resolveTypeInPool)},
    -  {CC "resolveFieldInPool",                           CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[J)" HS_RESOLVED_KLASS,              FN_PTR(resolveFieldInPool)},
    +  {CC "resolveFieldInPool",                           CC "(" HS_CONSTANT_POOL "I" HS_RESOLVED_METHOD "B[I)" HS_RESOLVED_KLASS,              FN_PTR(resolveFieldInPool)},
       {CC "resolveInvokeDynamicInPool",                   CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeDynamicInPool)},
       {CC "resolveInvokeHandleInPool",                    CC "(" HS_CONSTANT_POOL "I)V",                                                        FN_PTR(resolveInvokeHandleInPool)},
       {CC "resolveMethod",                                CC "(" HS_RESOLVED_KLASS HS_RESOLVED_METHOD HS_RESOLVED_KLASS ")" HS_RESOLVED_METHOD, FN_PTR(resolveMethod)},
    @@ -1648,6 +1819,7 @@ JNINativeMethod CompilerToVM::methods[] = {
       {CC "getFingerprint",                               CC "(J)J",                                                                            FN_PTR(getFingerprint)},
       {CC "interpreterFrameSize",                         CC "(" BYTECODE_FRAME ")I",                                                           FN_PTR(interpreterFrameSize)},
       {CC "compileToBytecode",                            CC "(" OBJECT ")V",                                                                   FN_PTR(compileToBytecode)},
    +  {CC "getFlagValue",                                 CC "(" STRING ")" OBJECT,                                                             FN_PTR(getFlagValue)},
     };
     
     int CompilerToVM::methods_count() {
    diff --git a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
    index c0f21e2b8c2..036ffdd3249 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciCompilerToVM.hpp
    @@ -66,6 +66,15 @@ class CompilerToVM {
     
         static int vm_page_size;
     
    +    static int sizeof_vtableEntry;
    +    static int sizeof_ExceptionTableElement;
    +    static int sizeof_LocalVariableTableElement;
    +    static int sizeof_ConstantPool;
    +    static int sizeof_SymbolPointer;
    +    static int sizeof_narrowKlass;
    +    static int sizeof_arrayOopDesc;
    +    static int sizeof_BasicLock;
    +
         static address dsin;
         static address dcos;
         static address dtan;
    @@ -74,8 +83,11 @@ class CompilerToVM {
         static address dlog10;
         static address dpow;
     
    +    static address symbol_init;
    +    static address symbol_clinit;
    +
        public:
    -    static void initialize();
    +    static void initialize(TRAPS);
     
         static int max_oop_map_stack_offset() {
           assert(_max_oop_map_stack_offset > 0, "must be initialized");
    @@ -83,6 +95,20 @@ class CompilerToVM {
         }
       };
     
    +  static bool cstring_equals(const char* const& s0, const char* const& s1) {
    +    return strcmp(s0, s1) == 0;
    +  }
    +
    +  static unsigned cstring_hash(const char* const& s) {
    +    int h = 0;
    +    const char* p = s;
    +    while (*p != '\0') {
    +      h = 31 * h + *p;
    +      p++;
    +    }
    +    return h;
    +  }
    +
       static JNINativeMethod methods[];
     
       static objArrayHandle initialize_intrinsics(TRAPS);
    @@ -180,4 +206,14 @@ class JavaArgumentUnboxer : public SignatureIterator {
       inline void do_void()                     { }
     };
     
    +class JNIHandleMark : public StackObj {
    +  public:
    +    JNIHandleMark() { push_jni_handle_block(); }
    +    ~JNIHandleMark() { pop_jni_handle_block(); }
    +
    +  private:
    +    static void push_jni_handle_block();
    +    static void pop_jni_handle_block();
    +};
    +
     #endif // SHARE_VM_JVMCI_JVMCI_COMPILER_TO_VM_HPP
    diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
    index 9c5d98361e0..8fb1e8cbdbf 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.cpp
    @@ -283,13 +283,14 @@ void JVMCIEnv::get_field_by_index(instanceKlassHandle accessor, fieldDescriptor&
     // Perform an appropriate method lookup based on accessor, holder,
     // name, signature, and bytecode.
     methodHandle JVMCIEnv::lookup_method(instanceKlassHandle h_accessor,
    -                               instanceKlassHandle h_holder,
    +                               KlassHandle   h_holder,
                                    Symbol*       name,
                                    Symbol*       sig,
                                    Bytecodes::Code bc,
                                    constantTag   tag) {
    -  JVMCI_EXCEPTION_CONTEXT;
    -  LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
    +  // Accessibility checks are performed in JVMCIEnv::get_method_by_index_impl().
    +  assert(check_klass_accessibility(h_accessor, h_holder), "holder not accessible");
    +
       methodHandle dest_method;
       LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
       switch (bc) {
    @@ -363,9 +364,8 @@ methodHandle JVMCIEnv::get_method_by_index_impl(const constantPoolHandle& cpool,
       }
     
       if (holder_is_accessible) { // Our declared holder is loaded.
    -    instanceKlassHandle lookup = get_instance_klass_for_declared_method_holder(holder);
         constantTag tag = cpool->tag_ref_at(index);
    -    methodHandle m = lookup_method(accessor, lookup, name_sym, sig_sym, bc, tag);
    +    methodHandle m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
         if (!m.is_null() &&
             (bc == Bytecodes::_invokestatic
              ?  InstanceKlass::cast(m->method_holder())->is_not_initialized()
    diff --git a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
    index 2c884494db8..1154a95d567 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciEnv.hpp
    @@ -127,7 +127,7 @@ private:
       // Helper methods
       static bool       check_klass_accessibility(KlassHandle accessing_klass, KlassHandle resolved_klass);
       static methodHandle  lookup_method(instanceKlassHandle  accessor,
    -                           instanceKlassHandle  holder,
    +                           KlassHandle     holder,
                                Symbol*         name,
                                Symbol*         sig,
                                Bytecodes::Code bc,
    diff --git a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp
    index d6039fca4a3..58764147efa 100644
    --- a/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp
    +++ b/hotspot/src/share/vm/jvmci/jvmciJavaClasses.hpp
    @@ -117,7 +117,7 @@ class JVMCIJavaClasses : AllStatic {
         oop_field(VMField, type, "Ljava/lang/String;")                                                                                                             \
         long_field(VMField, offset)                                                                                                                                \
         long_field(VMField, address)                                                                                                                               \
    -    oop_field(VMField, value, "Ljava/lang/Long;")                                                                                                              \
    +    oop_field(VMField, value, "Ljava/lang/Object;")                                                                                                            \
       end_class                                                                                                                                                    \
       start_class(VMFlag)                                                                                                                                          \
         oop_field(VMFlag, name, "Ljava/lang/String;")                                                                                                              \
    diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
    index a01651f55aa..0ce9816890a 100644
    --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
    +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp
    @@ -78,6 +78,15 @@
                                                                                                                                          \
       static_field(CompilerToVM::Data,             vm_page_size,                           int)                                          \
                                                                                                                                          \
    +  static_field(CompilerToVM::Data,             sizeof_vtableEntry,                     int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_ExceptionTableElement,           int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_LocalVariableTableElement,       int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_ConstantPool,                    int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_SymbolPointer,                   int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_narrowKlass,                     int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_arrayOopDesc,                    int)                                          \
    +  static_field(CompilerToVM::Data,             sizeof_BasicLock,                       int)                                          \
    +                                                                                                                                     \
       static_field(CompilerToVM::Data,             dsin,                                   address)                                      \
       static_field(CompilerToVM::Data,             dcos,                                   address)                                      \
       static_field(CompilerToVM::Data,             dtan,                                   address)                                      \
    @@ -86,6 +95,9 @@
       static_field(CompilerToVM::Data,             dlog10,                                 address)                                      \
       static_field(CompilerToVM::Data,             dpow,                                   address)                                      \
                                                                                                                                          \
    +  static_field(CompilerToVM::Data,             symbol_init,                            address)                                      \
    +  static_field(CompilerToVM::Data,             symbol_clinit,                          address)                                      \
    +                                                                                                                                     \
       static_field(Abstract_VM_Version,            _features,                              uint64_t)                                     \
                                                                                                                                          \
       nonstatic_field(Array,                  _length,                                int)                                          \
    diff --git a/hotspot/src/share/vm/memory/heap.cpp b/hotspot/src/share/vm/memory/heap.cpp
    index 9d2179d5cf7..8db869ca8ce 100644
    --- a/hotspot/src/share/vm/memory/heap.cpp
    +++ b/hotspot/src/share/vm/memory/heap.cpp
    @@ -190,6 +190,10 @@ void* CodeHeap::allocate(size_t instance_size) {
       if (block != NULL) {
         assert(block->length() >= number_of_segments && block->length() < number_of_segments + CodeCacheMinBlockLength, "sanity check");
         assert(!block->free(), "must be marked free");
    +    guarantee((char*) block >= _memory.low_boundary() && (char*) block < _memory.high(),
    +              "The newly allocated block " INTPTR_FORMAT " is not within the heap "
    +              "starting with "  INTPTR_FORMAT " and ending with "  INTPTR_FORMAT,
    +              p2i(block), p2i(_memory.low_boundary()), p2i(_memory.high()));
         DEBUG_ONLY(memset((void*)block->allocated_space(), badCodeHeapNewVal, instance_size));
         _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
         _blob_count++;
    @@ -204,6 +208,10 @@ void* CodeHeap::allocate(size_t instance_size) {
         HeapBlock* b =  block_at(_next_segment);
         b->initialize(number_of_segments);
         _next_segment += number_of_segments;
    +    guarantee((char*) b >= _memory.low_boundary() && (char*) block < _memory.high(),
    +              "The newly allocated block " INTPTR_FORMAT " is not within the heap "
    +              "starting with "  INTPTR_FORMAT " and ending with " INTPTR_FORMAT,
    +              p2i(b), p2i(_memory.low_boundary()), p2i(_memory.high()));
         DEBUG_ONLY(memset((void *)b->allocated_space(), badCodeHeapNewVal, instance_size));
         _max_allocated_capacity = MAX2(_max_allocated_capacity, allocated_capacity());
         _blob_count++;
    @@ -219,6 +227,10 @@ void CodeHeap::deallocate(void* p) {
       // Find start of HeapBlock
       HeapBlock* b = (((HeapBlock *)p) - 1);
       assert(b->allocated_space() == p, "sanity check");
    +  guarantee((char*) b >= _memory.low_boundary() && (char*) b < _memory.high(),
    +            "The block to be deallocated " INTPTR_FORMAT " is not within the heap "
    +            "starting with "  INTPTR_FORMAT " and ending with " INTPTR_FORMAT,
    +            p2i(b), p2i(_memory.low_boundary()), p2i(_memory.high()));
       DEBUG_ONLY(memset((void *)b->allocated_space(), badCodeHeapFreeVal,
                  segments_to_size(b->length()) - sizeof(HeapBlock)));
       add_to_freelist(b);
    diff --git a/hotspot/src/share/vm/memory/heap.hpp b/hotspot/src/share/vm/memory/heap.hpp
    index d75559695e1..6fe3391d6f0 100644
    --- a/hotspot/src/share/vm/memory/heap.hpp
    +++ b/hotspot/src/share/vm/memory/heap.hpp
    @@ -153,7 +153,9 @@ class CodeHeap : public CHeapObj {
       char* high() const                             { return _memory.high(); }
       char* high_boundary() const                    { return _memory.high_boundary(); }
     
    -  virtual bool  contains(const void* p) const    { return low_boundary() <= p && p < high(); }
    +  virtual bool contains(const void* p) const     { return low_boundary() <= p && p < high(); }
    +  virtual bool contains_blob(const CodeBlob* blob) const { return low_boundary() <= (char*) blob && (char*) blob < high(); }
    +
       virtual void* find_start(void* p)     const;   // returns the block containing p or NULL
       virtual CodeBlob* find_blob_unsafe(void* start) const;
       size_t alignment_unit()       const;           // alignment of any block
    diff --git a/hotspot/src/share/vm/oops/constMethod.hpp b/hotspot/src/share/vm/oops/constMethod.hpp
    index 45246ba209b..7453ecbf689 100644
    --- a/hotspot/src/share/vm/oops/constMethod.hpp
    +++ b/hotspot/src/share/vm/oops/constMethod.hpp
    @@ -359,7 +359,9 @@ public:
       }
     
       // Sizing
    -  static int header_size() { return sizeof(ConstMethod)/wordSize; }
    +  static int header_size() {
    +    return align_size_up(sizeof(ConstMethod), wordSize) / wordSize;
    +  }
     
       // Size needed
       static int size(int code_size, InlineTableSizes* sizes);
    diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp
    index 38a71f525d2..86cfa192171 100644
    --- a/hotspot/src/share/vm/oops/constantPool.hpp
    +++ b/hotspot/src/share/vm/oops/constantPool.hpp
    @@ -705,7 +705,9 @@ class ConstantPool : public Metadata {
       }
     
       // Sizing (in words)
    -  static int header_size()             { return sizeof(ConstantPool)/wordSize; }
    +  static int header_size()             {
    +    return align_size_up(sizeof(ConstantPool), wordSize) / wordSize;
    +  }
       static int size(int length)          { return align_metadata_size(header_size() + length); }
       int size() const                     { return size(length()); }
     #if INCLUDE_SERVICES
    diff --git a/hotspot/src/share/vm/oops/cpCache.cpp b/hotspot/src/share/vm/oops/cpCache.cpp
    index a30d19dd685..b7522433bbf 100644
    --- a/hotspot/src/share/vm/oops/cpCache.cpp
    +++ b/hotspot/src/share/vm/oops/cpCache.cpp
    @@ -140,7 +140,8 @@ void ConstantPoolCacheEntry::set_parameter_size(int value) {
     
     void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_code,
                                                            methodHandle method,
    -                                                       int vtable_index) {
    +                                                       int vtable_index,
    +                                                       bool sender_is_interface) {
       bool is_vtable_call = (vtable_index >= 0);  // FIXME: split this method on this boolean
       assert(method->interpreter_entry() != NULL, "should have been set at this point");
       assert(!method->is_obsolete(),  "attempt to write obsolete method to cpCache");
    @@ -204,7 +205,13 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co
       if (byte_no == 1) {
         assert(invoke_code != Bytecodes::_invokevirtual &&
                invoke_code != Bytecodes::_invokeinterface, "");
    +    // Don't mark invokespecial to method as resolved if sender is an interface.  The receiver
    +    // has to be checked that it is a subclass of the current class every time this bytecode
    +    // is executed.
    +    if (invoke_code != Bytecodes::_invokespecial || !sender_is_interface ||
    +        method->name() == vmSymbols::object_initializer_name()) {
         set_bytecode_1(invoke_code);
    +    }
       } else if (byte_no == 2)  {
         if (change_to_virtual) {
           assert(invoke_code == Bytecodes::_invokeinterface, "");
    @@ -234,17 +241,18 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co
       NOT_PRODUCT(verify(tty));
     }
     
    -void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, methodHandle method) {
    +void ConstantPoolCacheEntry::set_direct_call(Bytecodes::Code invoke_code, methodHandle method,
    +                                             bool sender_is_interface) {
       int index = Method::nonvirtual_vtable_index;
       // index < 0; FIXME: inline and customize set_direct_or_vtable_call
    -  set_direct_or_vtable_call(invoke_code, method, index);
    +  set_direct_or_vtable_call(invoke_code, method, index, sender_is_interface);
     }
     
     void ConstantPoolCacheEntry::set_vtable_call(Bytecodes::Code invoke_code, methodHandle method, int index) {
       // either the method is a miranda or its holder should accept the given index
       assert(method->method_holder()->is_interface() || method->method_holder()->verify_vtable_index(index), "");
       // index >= 0; FIXME: inline and customize set_direct_or_vtable_call
    -  set_direct_or_vtable_call(invoke_code, method, index);
    +  set_direct_or_vtable_call(invoke_code, method, index, false);
     }
     
     void ConstantPoolCacheEntry::set_itable_call(Bytecodes::Code invoke_code, const methodHandle& method, int index) {
    diff --git a/hotspot/src/share/vm/oops/cpCache.hpp b/hotspot/src/share/vm/oops/cpCache.hpp
    index e58d7c16ceb..9db57ffa033 100644
    --- a/hotspot/src/share/vm/oops/cpCache.hpp
    +++ b/hotspot/src/share/vm/oops/cpCache.hpp
    @@ -230,13 +230,15 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
       void set_direct_or_vtable_call(
         Bytecodes::Code invoke_code,                 // the bytecode used for invoking the method
         methodHandle    method,                      // the method/prototype if any (NULL, otherwise)
    -    int             vtable_index                 // the vtable index if any, else negative
    +    int             vtable_index,                // the vtable index if any, else negative
    +    bool            sender_is_interface
       );
     
      public:
       void set_direct_call(                          // sets entry to exact concrete method entry
         Bytecodes::Code invoke_code,                 // the bytecode used for invoking the method
    -    methodHandle    method                       // the method to call
    +    methodHandle    method,                      // the method to call
    +    bool            sender_is_interface
       );
     
       void set_vtable_call(                          // sets entry to vtable index
    @@ -359,7 +361,9 @@ class ConstantPoolCacheEntry VALUE_OBJ_CLASS_SPEC {
                                                        return (TosState)((_flags >> tos_state_shift) & tos_state_mask); }
     
       // Code generation support
    -  static WordSize size()                         { return in_WordSize(sizeof(ConstantPoolCacheEntry) / wordSize); }
    +  static WordSize size()                         {
    +    return in_WordSize(align_size_up(sizeof(ConstantPoolCacheEntry), wordSize) / wordSize);
    +  }
       static ByteSize size_in_bytes()                { return in_ByteSize(sizeof(ConstantPoolCacheEntry)); }
       static ByteSize indices_offset()               { return byte_offset_of(ConstantPoolCacheEntry, _indices); }
       static ByteSize f1_offset()                    { return byte_offset_of(ConstantPoolCacheEntry, _f1); }
    diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
    index 41f5fd143a8..70984514348 100644
    --- a/hotspot/src/share/vm/oops/instanceKlass.cpp
    +++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
    @@ -2456,22 +2456,24 @@ Klass* InstanceKlass::compute_enclosing_class_impl(instanceKlassHandle self,
     void InstanceKlass::check_prohibited_package(Symbol* class_name,
                                                  Handle class_loader,
                                                  TRAPS) {
    -  ResourceMark rm(THREAD);
       if (!class_loader.is_null() &&
           !SystemDictionary::is_platform_class_loader(class_loader) &&
    -      class_name != NULL &&
    -      strncmp(class_name->as_C_string(), JAVAPKG, JAVAPKG_LEN) == 0) {
    -    TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name, CHECK);
    -    assert(pkg_name != NULL, "Error in parsing package name starting with 'java/'");
    -    char* name = pkg_name->as_C_string();
    -    const char* class_loader_name = SystemDictionary::loader_name(class_loader());
    -    StringUtils::replace_no_expand(name, "/", ".");
    -    const char* msg_text1 = "Class loader (instance of): ";
    -    const char* msg_text2 = " tried to load prohibited package name: ";
    -    size_t len = strlen(msg_text1) + strlen(class_loader_name) + strlen(msg_text2) + strlen(name) + 1;
    -    char* message = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, len);
    -    jio_snprintf(message, len, "%s%s%s%s", msg_text1, class_loader_name, msg_text2, name);
    -    THROW_MSG(vmSymbols::java_lang_SecurityException(), message);
    +      class_name != NULL) {
    +    ResourceMark rm(THREAD);
    +    char* name = class_name->as_C_string();
    +    if (strncmp(name, JAVAPKG, JAVAPKG_LEN) == 0 && name[JAVAPKG_LEN] == '/') {
    +      TempNewSymbol pkg_name = InstanceKlass::package_from_name(class_name, CHECK);
    +      assert(pkg_name != NULL, "Error in parsing package name starting with 'java/'");
    +      name = pkg_name->as_C_string();
    +      const char* class_loader_name = SystemDictionary::loader_name(class_loader());
    +      StringUtils::replace_no_expand(name, "/", ".");
    +      const char* msg_text1 = "Class loader (instance of): ";
    +      const char* msg_text2 = " tried to load prohibited package name: ";
    +      size_t len = strlen(msg_text1) + strlen(class_loader_name) + strlen(msg_text2) + strlen(name) + 1;
    +      char* message = NEW_RESOURCE_ARRAY_IN_THREAD(THREAD, char, len);
    +      jio_snprintf(message, len, "%s%s%s%s", msg_text1, class_loader_name, msg_text2, name);
    +      THROW_MSG(vmSymbols::java_lang_SecurityException(), message);
    +    }
       }
       return;
     }
    @@ -2806,7 +2808,7 @@ nmethod* InstanceKlass::lookup_osr_nmethod(const Method* m, int bci, int comp_le
       return NULL;
     }
     
    -bool InstanceKlass::add_member_name(Handle mem_name) {
    +oop InstanceKlass::add_member_name(Handle mem_name, bool intern) {
       jweak mem_name_wref = JNIHandles::make_weak_global(mem_name);
       MutexLocker ml(MemberNameTable_lock);
       DEBUG_ONLY(NoSafepointVerifier nsv);
    @@ -2816,7 +2818,7 @@ bool InstanceKlass::add_member_name(Handle mem_name) {
       // is called!
       Method* method = (Method*)java_lang_invoke_MemberName::vmtarget(mem_name());
       if (method->is_obsolete()) {
    -    return false;
    +    return NULL;
       } else if (method->is_old()) {
         // Replace method with redefined version
         java_lang_invoke_MemberName::set_vmtarget(mem_name(), method_with_idnum(method->method_idnum()));
    @@ -2825,8 +2827,11 @@ bool InstanceKlass::add_member_name(Handle mem_name) {
       if (_member_names == NULL) {
         _member_names = new (ResourceObj::C_HEAP, mtClass) MemberNameTable(idnum_allocated_count());
       }
    -  _member_names->add_member_name(mem_name_wref);
    -  return true;
    +  if (intern) {
    +    return _member_names->find_or_add_member_name(mem_name_wref);
    +  } else {
    +    return _member_names->add_member_name(mem_name_wref);
    +  }
     }
     
     // -----------------------------------------------------------------------------------------------------
    diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
    index 015a86c7e9c..1756b9fc86d 100644
    --- a/hotspot/src/share/vm/oops/instanceKlass.hpp
    +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -1359,7 +1359,7 @@ public:
       // JSR-292 support
       MemberNameTable* member_names() { return _member_names; }
       void set_member_names(MemberNameTable* member_names) { _member_names = member_names; }
    -  bool add_member_name(Handle member_name);
    +  oop add_member_name(Handle member_name, bool intern);
     
     public:
       // JVMTI support
    diff --git a/hotspot/src/share/vm/oops/klass.cpp b/hotspot/src/share/vm/oops/klass.cpp
    index ebc59953842..d8ec1ba8875 100644
    --- a/hotspot/src/share/vm/oops/klass.cpp
    +++ b/hotspot/src/share/vm/oops/klass.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -532,7 +532,7 @@ void Klass::restore_unshareable_info(ClassLoaderData* loader_data, Handle protec
         } else {
           module_entry = ModuleEntryTable::javabase_moduleEntry();
         }
    -    // Obtain java.lang.reflect.Module, if available
    +    // Obtain java.lang.Module, if available
         Handle module_handle(THREAD, ((module_entry != NULL) ? JNIHandles::resolve(module_entry->module()) : (oop)NULL));
         java_lang_Class::create_mirror(this, loader, module_handle, protection_domain, CHECK);
       }
    diff --git a/hotspot/src/share/vm/oops/metadata.hpp b/hotspot/src/share/vm/oops/metadata.hpp
    index c42997292e2..b6d60e6a6ef 100644
    --- a/hotspot/src/share/vm/oops/metadata.hpp
    +++ b/hotspot/src/share/vm/oops/metadata.hpp
    @@ -47,6 +47,7 @@ class Metadata : public MetaspaceObj {
       virtual bool is_method()             const volatile { return false; }
       virtual bool is_methodData()         const volatile { return false; }
       virtual bool is_constantPool()       const volatile { return false; }
    +  virtual bool is_methodCounters()     const volatile { return false; }
     
       virtual const char* internal_name()  const = 0;
     
    diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp
    index f37278edd13..beed68bed8e 100644
    --- a/hotspot/src/share/vm/oops/method.cpp
    +++ b/hotspot/src/share/vm/oops/method.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -2199,7 +2199,6 @@ void Method::print_on(outputStream* st) const {
       ResourceMark rm;
       assert(is_method(), "must be method");
       st->print_cr("%s", internal_name());
    -  // get the effect of PrintOopAddress, always, for methods:
       st->print_cr(" - this oop:          " INTPTR_FORMAT, p2i(this));
       st->print   (" - method holder:     "); method_holder()->print_value_on(st); st->cr();
       st->print   (" - constants:         " INTPTR_FORMAT " ", p2i(constants()));
    diff --git a/hotspot/src/share/vm/oops/method.hpp b/hotspot/src/share/vm/oops/method.hpp
    index ebd5f0feef2..6675410db81 100644
    --- a/hotspot/src/share/vm/oops/method.hpp
    +++ b/hotspot/src/share/vm/oops/method.hpp
    @@ -671,7 +671,9 @@ class Method : public Metadata {
     #endif
     
       // sizing
    -  static int header_size()                       { return sizeof(Method)/wordSize; }
    +  static int header_size()                       {
    +    return align_size_up(sizeof(Method), wordSize) / wordSize;
    +  }
       static int size(bool is_native);
       int size() const                               { return method_size(); }
     #if INCLUDE_SERVICES
    diff --git a/hotspot/src/share/vm/oops/methodCounters.cpp b/hotspot/src/share/vm/oops/methodCounters.cpp
    index b78b6e8046b..225573e5220 100644
    --- a/hotspot/src/share/vm/oops/methodCounters.cpp
    +++ b/hotspot/src/share/vm/oops/methodCounters.cpp
    @@ -73,3 +73,11 @@ void MethodCounters::set_highest_osr_comp_level(int level) {
     #endif
     }
     
    +
    +void MethodCounters::print_value_on(outputStream* st) const {
    +  assert(is_methodCounters(), "must be methodCounters");
    +  st->print("method counters");
    +  print_address_on(st);
    +}
    +
    +
    diff --git a/hotspot/src/share/vm/oops/methodCounters.hpp b/hotspot/src/share/vm/oops/methodCounters.hpp
    index df96b638735..97ddc4b5406 100644
    --- a/hotspot/src/share/vm/oops/methodCounters.hpp
    +++ b/hotspot/src/share/vm/oops/methodCounters.hpp
    @@ -30,7 +30,7 @@
     #include "interpreter/invocationCounter.hpp"
     #include "runtime/arguments.hpp"
     
    -class MethodCounters: public MetaspaceObj {
    +class MethodCounters : public Metadata {
      friend class VMStructs;
      friend class JVMCIVMStructs;
      private:
    @@ -109,16 +109,17 @@ class MethodCounters: public MetaspaceObj {
       }
     
      public:
    +  virtual bool is_methodCounters() const volatile { return true; }
    +
       static MethodCounters* allocate(methodHandle mh, TRAPS);
     
       void deallocate_contents(ClassLoaderData* loader_data) {}
    -  DEBUG_ONLY(bool on_stack() { return false; })  // for template
     
       AOT_ONLY(Method* method() const { return _method; })
     
    -  static int size() { return sizeof(MethodCounters) / wordSize; }
    -
    -  bool is_klass() const { return false; }
    +  static int size() {
    +    return align_size_up(sizeof(MethodCounters), wordSize) / wordSize;
    +  }
     
       void clear_counters();
     
    @@ -251,5 +252,9 @@ class MethodCounters: public MetaspaceObj {
       static ByteSize backedge_mask_offset() {
         return byte_offset_of(MethodCounters, _backedge_mask);
       }
    +
    +  virtual const char* internal_name() const { return "{method counters}"; }
    +  virtual void print_value_on(outputStream* st) const;
    +
     };
     #endif //SHARE_VM_OOPS_METHODCOUNTERS_HPP
    diff --git a/hotspot/src/share/vm/opto/arraycopynode.cpp b/hotspot/src/share/vm/opto/arraycopynode.cpp
    index a81d7a96b8a..d581bcbf423 100644
    --- a/hotspot/src/share/vm/opto/arraycopynode.cpp
    +++ b/hotspot/src/share/vm/opto/arraycopynode.cpp
    @@ -225,7 +225,6 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
       Node* dest = in(ArrayCopyNode::Dest);
       const Type* src_type = phase->type(src);
       const TypeAryPtr* ary_src = src_type->isa_aryptr();
    -  assert(ary_src != NULL, "should be an array copy/clone");
     
       if (is_arraycopy() || is_copyofrange() || is_copyof()) {
         const Type* dest_type = phase->type(dest);
    @@ -286,7 +285,8 @@ bool ArrayCopyNode::prepare_array_copy(PhaseGVN *phase, bool can_reshape,
     
         copy_type = dest_elem;
       } else {
    -    assert (is_clonebasic(), "should be");
    +    assert(ary_src != NULL, "should be a clone");
    +    assert(is_clonebasic(), "should be");
     
         disjoint_bases = true;
         assert(src->is_AddP(), "should be base + off");
    diff --git a/hotspot/src/share/vm/opto/callGenerator.cpp b/hotspot/src/share/vm/opto/callGenerator.cpp
    index de9f44c359d..a5aaa552fee 100644
    --- a/hotspot/src/share/vm/opto/callGenerator.cpp
    +++ b/hotspot/src/share/vm/opto/callGenerator.cpp
    @@ -46,7 +46,7 @@ const TypeFunc* CallGenerator::tf() const {
       return TypeFunc::make(method());
     }
     
    -bool CallGenerator::is_inlined_mh_linker(JVMState* jvms, ciMethod* callee) {
    +bool CallGenerator::is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* callee) {
       ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
       return symbolic_info->is_method_handle_intrinsic() && !callee->is_method_handle_intrinsic();
     }
    @@ -142,7 +142,7 @@ JVMState* DirectCallGenerator::generate(JVMState* jvms) {
       }
     
       CallStaticJavaNode *call = new CallStaticJavaNode(kit.C, tf(), target, method(), kit.bci());
    -  if (is_inlined_mh_linker(jvms, method())) {
    +  if (is_inlined_method_handle_intrinsic(jvms, method())) {
         // To be able to issue a direct call and skip a call to MH.linkTo*/invokeBasic adapter,
         // additional information about the method being invoked should be attached
         // to the call site to make resolution logic work
    @@ -241,7 +241,7 @@ JVMState* VirtualCallGenerator::generate(JVMState* jvms) {
       address target = SharedRuntime::get_resolve_virtual_call_stub();
       // Normal inline cache used for call
       CallDynamicJavaNode *call = new CallDynamicJavaNode(tf(), target, method(), _vtable_index, kit.bci());
    -  if (is_inlined_mh_linker(jvms, method())) {
    +  if (is_inlined_method_handle_intrinsic(jvms, method())) {
         // To be able to issue a direct call (optimized virtual or virtual)
         // and skip a call to MH.linkTo*/invokeBasic adapter, additional information
         // about the method being invoked should be attached to the call site to
    @@ -785,8 +785,7 @@ JVMState* PredictedCallGenerator::generate(JVMState* jvms) {
     
     
     CallGenerator* CallGenerator::for_method_handle_call(JVMState* jvms, ciMethod* caller, ciMethod* callee, bool delayed_forbidden) {
    -  assert(callee->is_method_handle_intrinsic() ||
    -         callee->is_compiled_lambda_form(), "for_method_handle_call mismatch");
    +  assert(callee->is_method_handle_intrinsic(), "for_method_handle_call mismatch");
       bool input_not_const;
       CallGenerator* cg = CallGenerator::for_method_handle_inline(jvms, caller, callee, input_not_const);
       Compile* C = Compile::current();
    @@ -826,6 +825,13 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
             const TypeOopPtr* oop_ptr = receiver->bottom_type()->is_oopptr();
             ciMethod* target = oop_ptr->const_oop()->as_method_handle()->get_vmtarget();
             const int vtable_index = Method::invalid_vtable_index;
    +
    +        if (!ciMethod::is_consistent_info(callee, target)) {
    +          print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
    +                                 "signatures mismatch");
    +          return NULL;
    +        }
    +
             CallGenerator* cg = C->call_generator(target, vtable_index,
                                                   false /* call_does_dispatch */,
                                                   jvms,
    @@ -833,9 +839,8 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
                                                   PROB_ALWAYS);
             return cg;
           } else {
    -        const char* msg = "receiver not constant";
    -        if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
    -        C->log_inline_failure(msg);
    +        print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
    +                               "receiver not constant");
           }
         }
         break;
    @@ -852,6 +857,12 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
             const TypeOopPtr* oop_ptr = member_name->bottom_type()->is_oopptr();
             ciMethod* target = oop_ptr->const_oop()->as_member_name()->get_vmtarget();
     
    +        if (!ciMethod::is_consistent_info(callee, target)) {
    +          print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
    +                                 "signatures mismatch");
    +          return NULL;
    +        }
    +
             // In lambda forms we erase signature types to avoid resolving issues
             // involving class loaders.  When we optimize a method handle invoke
             // to a direct call we must cast the receiver and arguments to its
    @@ -912,9 +923,8 @@ CallGenerator* CallGenerator::for_method_handle_inline(JVMState* jvms, ciMethod*
                                                   speculative_receiver_type);
             return cg;
           } else {
    -        const char* msg = "member_name not constant";
    -        if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
    -        C->log_inline_failure(msg);
    +        print_inlining_failure(C, callee, jvms->depth() - 1, jvms->bci(),
    +                               "member_name not constant");
           }
         }
         break;
    diff --git a/hotspot/src/share/vm/opto/callGenerator.hpp b/hotspot/src/share/vm/opto/callGenerator.hpp
    index 58e8fe9c614..8b7ee546571 100644
    --- a/hotspot/src/share/vm/opto/callGenerator.hpp
    +++ b/hotspot/src/share/vm/opto/callGenerator.hpp
    @@ -170,7 +170,12 @@ class CallGenerator : public ResourceObj {
         }
       }
     
    -  static bool is_inlined_mh_linker(JVMState* jvms, ciMethod* m);
    +  static void print_inlining_failure(Compile* C, ciMethod* callee, int inline_level, int bci, const char* msg) {
    +    print_inlining(C, callee, inline_level, bci, msg);
    +    C->log_inline_failure(msg);
    +  }
    +
    +  static bool is_inlined_method_handle_intrinsic(JVMState* jvms, ciMethod* m);
     };
     
     
    diff --git a/hotspot/src/share/vm/opto/callnode.cpp b/hotspot/src/share/vm/opto/callnode.cpp
    index 66b2d086bbd..7def4ee721e 100644
    --- a/hotspot/src/share/vm/opto/callnode.cpp
    +++ b/hotspot/src/share/vm/opto/callnode.cpp
    @@ -784,8 +784,8 @@ bool CallNode::may_modify(const TypeOopPtr *t_oop, PhaseTransform *phase) {
           }
           // May modify (by reflection) if an boxing object is passed
           // as argument or returned.
    -      if (returns_pointer() && (proj_out(TypeFunc::Parms) != NULL)) {
    -        Node* proj = proj_out(TypeFunc::Parms);
    +      Node* proj = returns_pointer() ? proj_out(TypeFunc::Parms) : NULL;
    +      if (proj != NULL) {
             const TypeInstPtr* inst_t = phase->type(proj)->isa_instptr();
             if ((inst_t != NULL) && (!inst_t->klass_is_exact() ||
                                      (inst_t->klass() == boxing_klass))) {
    diff --git a/hotspot/src/share/vm/opto/callnode.hpp b/hotspot/src/share/vm/opto/callnode.hpp
    index 00979ae0d53..f5cc9bcf237 100644
    --- a/hotspot/src/share/vm/opto/callnode.hpp
    +++ b/hotspot/src/share/vm/opto/callnode.hpp
    @@ -452,8 +452,8 @@ public:
       void delete_replaced_nodes() {
         _replaced_nodes.reset();
       }
    -  void apply_replaced_nodes() {
    -    _replaced_nodes.apply(this);
    +  void apply_replaced_nodes(uint idx) {
    +    _replaced_nodes.apply(this, idx);
       }
       void merge_replaced_nodes_with(SafePointNode* sfpt) {
         _replaced_nodes.merge_with(sfpt->_replaced_nodes);
    diff --git a/hotspot/src/share/vm/opto/castnode.cpp b/hotspot/src/share/vm/opto/castnode.cpp
    index 1184728add5..9f829a40008 100644
    --- a/hotspot/src/share/vm/opto/castnode.cpp
    +++ b/hotspot/src/share/vm/opto/castnode.cpp
    @@ -225,7 +225,10 @@ Node *CastIINode::Ideal(PhaseGVN *phase, bool can_reshape) {
       }
     
       // Similar to ConvI2LNode::Ideal() for the same reasons
    -  if (can_reshape && !phase->C->major_progress()) {
    +  // Do not narrow the type of range check dependent CastIINodes to
    +  // avoid corruption of the graph if a CastII is replaced by TOP but
    +  // the corresponding range check is not removed.
    +  if (can_reshape && !_range_check_dependency && !phase->C->major_progress()) {
         const TypeInt* this_type = this->type()->is_int();
         const TypeInt* in_type = phase->type(in(1))->isa_int();
         if (in_type != NULL && this_type != NULL &&
    diff --git a/hotspot/src/share/vm/opto/cfgnode.cpp b/hotspot/src/share/vm/opto/cfgnode.cpp
    index de85b1cb155..69e7659a877 100644
    --- a/hotspot/src/share/vm/opto/cfgnode.cpp
    +++ b/hotspot/src/share/vm/opto/cfgnode.cpp
    @@ -1889,6 +1889,12 @@ Node *PhiNode::Ideal(PhaseGVN *phase, bool can_reshape) {
         bool saw_self = false;
         for( uint i=1; iis_MergeMem()) {
             MergeMemNode* n = ii->as_MergeMem();
             merge_width = MAX2(merge_width, n->req());
    diff --git a/hotspot/src/share/vm/opto/convertnode.cpp b/hotspot/src/share/vm/opto/convertnode.cpp
    index bc111ccae7a..5d97a7330f2 100644
    --- a/hotspot/src/share/vm/opto/convertnode.cpp
    +++ b/hotspot/src/share/vm/opto/convertnode.cpp
    @@ -294,8 +294,7 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
       }
     
     #ifdef _LP64
    -  // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y)) or
    -  // ConvI2L(CastII(AddI(x, y))) to AddL(ConvI2L(CastII(x)), ConvI2L(CastII(y))),
    +  // Convert ConvI2L(AddI(x, y)) to AddL(ConvI2L(x), ConvI2L(y))
       // but only if x and y have subranges that cannot cause 32-bit overflow,
       // under the assumption that x+y is in my own subrange this->type().
     
    @@ -319,13 +318,6 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
     
       Node* z = in(1);
       int op = z->Opcode();
    -  Node* ctrl = NULL;
    -  if (op == Op_CastII && z->as_CastII()->has_range_check()) {
    -    // Skip CastII node but save control dependency
    -    ctrl = z->in(0);
    -    z = z->in(1);
    -    op = z->Opcode();
    -  }
       if (op == Op_AddI || op == Op_SubI) {
         Node* x = z->in(1);
         Node* y = z->in(2);
    @@ -385,8 +377,8 @@ Node *ConvI2LNode::Ideal(PhaseGVN *phase, bool can_reshape) {
         }
         assert(rxlo == (int)rxlo && rxhi == (int)rxhi, "x should not overflow");
         assert(rylo == (int)rylo && ryhi == (int)ryhi, "y should not overflow");
    -    Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), ctrl);
    -    Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), ctrl);
    +    Node* cx = phase->C->constrained_convI2L(phase, x, TypeInt::make(rxlo, rxhi, widen), NULL);
    +    Node* cy = phase->C->constrained_convI2L(phase, y, TypeInt::make(rylo, ryhi, widen), NULL);
         switch (op) {
           case Op_AddI:  return new AddLNode(cx, cy);
           case Op_SubI:  return new SubLNode(cx, cy);
    diff --git a/hotspot/src/share/vm/opto/doCall.cpp b/hotspot/src/share/vm/opto/doCall.cpp
    index 97af80e61b0..3e9bdd53d07 100644
    --- a/hotspot/src/share/vm/opto/doCall.cpp
    +++ b/hotspot/src/share/vm/opto/doCall.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -400,92 +400,10 @@ bool Parse::can_not_compile_call_site(ciMethod *dest_method, ciInstanceKlass* kl
     }
     
     #ifdef ASSERT
    -static bool check_type(ciType* t1, ciType* t2) {
    -  // Either oop-oop or prim-prim pair.
    -  if (t1->is_primitive_type() && t2->is_primitive_type()) {
    -    return t1->size() == t2->size(); // argument sizes should match
    -  } else {
    -    return !t1->is_primitive_type() && !t2->is_primitive_type(); // oop-oop
    -  }
    -}
    -
    -static bool check_inlined_mh_linker_info(ciMethod* symbolic_info, ciMethod* resolved_method) {
    -  assert(symbolic_info->is_method_handle_intrinsic(), "sanity");
    -  assert(!resolved_method->is_method_handle_intrinsic(), "sanity");
    -
    -  if (!symbolic_info->is_loaded() || !resolved_method->is_loaded()) {
    -    return true; // Don't compare unloaded methods.
    -  }
    -  // Linkers have appendix argument which is not passed to callee.
    -  int has_appendix = MethodHandles::has_member_arg(symbolic_info->intrinsic_id()) ? 1 : 0;
    -  if (symbolic_info->arg_size() != (resolved_method->arg_size() + has_appendix)) {
    -    return false; // Total size of arguments on stack mismatch.
    -  }
    -  if (!symbolic_info->return_type()->is_void()) {
    -    // Only check the return type if the symbolic method is not void
    -    // i.e. the return value of the resolved method can be dropped
    -    if (!check_type(symbolic_info->return_type(), resolved_method->return_type())) {
    -      return false; // Return value size or type mismatch encountered.
    -    }
    -  }
    -
    -  switch (symbolic_info->intrinsic_id()) {
    -    case vmIntrinsics::_linkToVirtual:
    -    case vmIntrinsics::_linkToInterface:
    -    case vmIntrinsics::_linkToSpecial: {
    -      if (resolved_method->is_static())  return false;
    -      break;
    -    }
    -    case vmIntrinsics::_linkToStatic: {
    -      if (!resolved_method->is_static())  return false;
    -      break;
    -    }
    -  }
    -
    -  ciSignature* symbolic_sig = symbolic_info->signature();
    -  ciSignature* resolved_sig = resolved_method->signature();
    -
    -  if (symbolic_sig->count() + (symbolic_info->is_static() ? 0 : 1) !=
    -      resolved_sig->count() + (resolved_method->is_static() ? 0 : 1) + has_appendix) {
    -    return false; // Argument count mismatch
    -  }
    -
    -  int sbase = 0, rbase = 0;
    -  int arg_count = MIN2(symbolic_sig->count() - has_appendix, resolved_sig->count());
    -  ciType* recv_type = NULL;
    -  if (symbolic_info->is_static() && !resolved_method->is_static()) {
    -    recv_type = symbolic_sig->type_at(0);
    -    sbase = 1;
    -  } else if (!symbolic_info->is_static() && resolved_method->is_static()) {
    -    recv_type = resolved_sig->type_at(0);
    -    rbase = 1;
    -  }
    -  if (recv_type != NULL && recv_type->is_primitive_type()) {
    -    return false; // Receiver should be an oop.
    -  }
    -  for (int i = 0; i < arg_count; i++) {
    -    if (!check_type(symbolic_sig->type_at(sbase + i), resolved_sig->type_at(rbase + i))) {
    -      return false; // Argument size or type mismatch encountered.
    -    }
    -  }
    -  return true;
    -}
    -
    -static bool is_call_consistent_with_jvms(JVMState* jvms, CallGenerator* cg) {
    +static bool check_call_consistency(JVMState* jvms, CallGenerator* cg) {
       ciMethod* symbolic_info = jvms->method()->get_method_at_bci(jvms->bci());
       ciMethod* resolved_method = cg->method();
    -
    -  if (CallGenerator::is_inlined_mh_linker(jvms, resolved_method)) {
    -    return check_inlined_mh_linker_info(symbolic_info, resolved_method);
    -  } else {
    -    // Method name & descriptor should stay the same.
    -    return (symbolic_info->get_Method()->name() == resolved_method->get_Method()->name()) &&
    -           (symbolic_info->get_Method()->signature() == resolved_method->get_Method()->signature());
    -  }
    -}
    -
    -static bool check_call_consistency(JVMState* jvms, CallGenerator* cg) {
    -  if (!is_call_consistent_with_jvms(jvms, cg)) {
    +  if (!ciMethod::is_consistent_info(symbolic_info, resolved_method)) {
         tty->print_cr("JVMS:");
         jvms->dump();
         tty->print_cr("Bytecode info:");
    @@ -587,6 +505,30 @@ void Parse::do_call() {
         speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL;
       }
     
    +  // invoke-super-special
    +  if (iter().cur_bc_raw() == Bytecodes::_invokespecial && !orig_callee->is_object_initializer()) {
    +    ciInstanceKlass* calling_klass = method()->holder();
    +    ciInstanceKlass* sender_klass =
    +        calling_klass->is_anonymous() ? calling_klass->host_klass() :
    +                                        calling_klass;
    +    if (sender_klass->is_interface()) {
    +      Node* receiver_node = stack(sp() - nargs);
    +      Node* cls_node = makecon(TypeKlassPtr::make(sender_klass));
    +      Node* bad_type_ctrl = NULL;
    +      Node* casted_receiver = gen_checkcast(receiver_node, cls_node, &bad_type_ctrl);
    +      if (bad_type_ctrl != NULL) {
    +        PreserveJVMState pjvms(this);
    +        set_control(bad_type_ctrl);
    +        uncommon_trap(Deoptimization::Reason_class_check,
    +                      Deoptimization::Action_none);
    +      }
    +      if (stopped()) {
    +        return; // MUST uncommon-trap?
    +      }
    +      set_stack(sp() - nargs, casted_receiver);
    +    }
    +  }
    +
       // Note:  It's OK to try to inline a virtual call.
       // The call generator will not attempt to inline a polymorphic call
       // unless it knows how to optimize the receiver dispatch.
    diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp
    index 169146a607e..1f13554db40 100644
    --- a/hotspot/src/share/vm/opto/ifnode.cpp
    +++ b/hotspot/src/share/vm/opto/ifnode.cpp
    @@ -249,6 +249,13 @@ static Node* split_if(IfNode *iff, PhaseIterGVN *igvn) {
           predicate_proj = proj;
         }
       }
    +
    +  // If all the defs of the phi are the same constant, we already have the desired end state.
    +  // Skip the split that would create empty phi and region nodes.
    +  if((r->req() - req_c) == 1) {
    +    return NULL;
    +  }
    +
       if (nb_predicate_proj > 1) {
         // Can happen in case of loop unswitching and when the loop is
         // optimized out: it's not a loop anymore so we don't care about
    @@ -1458,8 +1465,9 @@ Node* IfNode::dominated_by(Node* prev_dom, PhaseIterGVN *igvn) {
       // be skipped. For example, range check predicate has two checks
       // for lower and upper bounds.
       ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj();
    -  if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL)
    -   prev_dom = idom;
    +  if ((unc_proj != NULL) && (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL)) {
    +    prev_dom = idom;
    +  }
     
       // Now walk the current IfNode's projections.
       // Loop ends when 'this' has no more uses.
    diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp
    index 87d6d92d5f6..0cad4dce650 100644
    --- a/hotspot/src/share/vm/opto/lcm.cpp
    +++ b/hotspot/src/share/vm/opto/lcm.cpp
    @@ -254,10 +254,12 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
           const TypePtr *adr_type = NULL;  // Do not need this return value here
           const Node* base = mach->get_base_and_disp(offset, adr_type);
           if (base == NULL || base == NodeSentinel) {
    -        // Narrow oop address doesn't have base, only index
    -        if( val->bottom_type()->isa_narrowoop() &&
    -            MacroAssembler::needs_explicit_null_check(offset) )
    -          continue;             // Give up if offset is beyond page size
    +        // Narrow oop address doesn't have base, only index.
    +        // Give up if offset is beyond page size or if heap base is not protected.
    +        if (val->bottom_type()->isa_narrowoop() &&
    +            (MacroAssembler::needs_explicit_null_check(offset) ||
    +             !Universe::narrow_oop_use_implicit_null_checks()))
    +          continue;
             // cannot reason about it; is probably not implicit null exception
           } else {
             const TypePtr* tptr;
    @@ -269,12 +271,17 @@ void PhaseCFG::implicit_null_check(Block* block, Node *proj, Node *val, int allo
               // only regular oops are expected here
               tptr = base->bottom_type()->is_ptr();
             }
    -        // Give up if offset is not a compile-time constant
    -        if( offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot )
    +        // Give up if offset is not a compile-time constant.
    +        if (offset == Type::OffsetBot || tptr->_offset == Type::OffsetBot)
               continue;
             offset += tptr->_offset; // correct if base is offseted
    -        if( MacroAssembler::needs_explicit_null_check(offset) )
    -          continue;             // Give up is reference is beyond 4K page size
    +        // Give up if reference is beyond page size.
    +        if (MacroAssembler::needs_explicit_null_check(offset))
    +          continue;
    +        // Give up if base is a decode node and the heap base is not protected.
    +        if (base->is_Mach() && base->as_Mach()->ideal_Opcode() == Op_DecodeN &&
    +            !Universe::narrow_oop_use_implicit_null_checks())
    +          continue;
           }
         }
     
    diff --git a/hotspot/src/share/vm/opto/library_call.cpp b/hotspot/src/share/vm/opto/library_call.cpp
    index 5d837d6ecb0..e1e1c9f188f 100644
    --- a/hotspot/src/share/vm/opto/library_call.cpp
    +++ b/hotspot/src/share/vm/opto/library_call.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -277,7 +277,8 @@ class LibraryCallKit : public GraphKit {
       AllocateArrayNode* tightly_coupled_allocation(Node* ptr,
                                                     RegionNode* slow_region);
       JVMState* arraycopy_restore_alloc_state(AllocateArrayNode* alloc, int& saved_reexecute_sp);
    -  void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp);
    +  void arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp,
    +                                      uint new_idx);
     
       typedef enum { LS_get_add, LS_get_set, LS_cmp_swap, LS_cmp_swap_weak, LS_cmp_exchange } LoadStoreKind;
       MemNode::MemOrd access_kind_to_memord_LS(AccessKind access_kind, bool is_store);
    @@ -1667,6 +1668,9 @@ bool LibraryCallKit::inline_string_char_access(bool is_store) {
       }
     
       Node* adr = array_element_address(value, index, T_CHAR);
    +  if (adr->is_top()) {
    +    return false;
    +  }
       if (is_store) {
         (void) store_to_memory(control(), adr, ch, T_CHAR, TypeAryPtr::BYTES, MemNode::unordered,
                                false, false, true /* mismatched */);
    @@ -2371,10 +2375,10 @@ bool LibraryCallKit::inline_unsafe_access(bool is_store, const BasicType type, c
       // the barriers get omitted and the unsafe reference begins to "pollute"
       // the alias analysis of the rest of the graph, either Compile::can_alias
       // or Compile::must_alias will throw a diagnostic assert.)
    -  bool need_mem_bar;
    +  bool need_mem_bar = false;
       switch (kind) {
           case Relaxed:
    -          need_mem_bar = mismatched || can_access_non_heap;
    +          need_mem_bar = mismatched && !adr_type->isa_aryptr();
               break;
           case Opaque:
               // Opaque uses CPUOrder membars for protection against code movement.
    @@ -3017,7 +3021,7 @@ bool LibraryCallKit::inline_unsafe_load_store(const BasicType type, const LoadSt
           load_store = _gvn.transform(new DecodeNNode(load_store, load_store->get_ptr_type()));
         }
     #endif
    -    if (can_move_pre_barrier()) {
    +    if (can_move_pre_barrier() && kind == LS_get_set) {
           // Don't need to load pre_val. The old value is returned by load_store.
           // The pre_barrier can execute after the xchg as long as no safepoint
           // gets inserted between them.
    @@ -4882,7 +4886,8 @@ JVMState* LibraryCallKit::arraycopy_restore_alloc_state(AllocateArrayNode* alloc
     // deoptimize. This is possible because tightly_coupled_allocation()
     // guarantees there's no observer of the allocated array at this point
     // and the control flow is simple enough.
    -void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms, int saved_reexecute_sp) {
    +void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, Node* dest, JVMState* saved_jvms,
    +                                                    int saved_reexecute_sp, uint new_idx) {
       if (saved_jvms != NULL && !stopped()) {
         assert(alloc != NULL, "only with a tightly coupled allocation");
         // restore JVM state to the state at the arraycopy
    @@ -4891,7 +4896,7 @@ void LibraryCallKit::arraycopy_move_allocation_here(AllocateArrayNode* alloc, No
         assert(saved_jvms->map()->i_o() == map()->i_o(), "IO state changed?");
         // If we've improved the types of some nodes (null check) while
         // emitting the guards, propagate them to the current state
    -    map()->replaced_nodes().apply(saved_jvms->map());
    +    map()->replaced_nodes().apply(saved_jvms->map(), new_idx);
         set_jvms(saved_jvms);
         _reexecute_sp = saved_reexecute_sp;
     
    @@ -4949,6 +4954,7 @@ bool LibraryCallKit::inline_arraycopy() {
       Node* dest_offset = argument(3);  // type: int
       Node* length      = argument(4);  // type: int
     
    +  uint new_idx = C->unique();
     
       // Check for allocation before we add nodes that would confuse
       // tightly_coupled_allocation()
    @@ -5164,7 +5170,7 @@ bool LibraryCallKit::inline_arraycopy() {
         }
       }
     
    -  arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp);
    +  arraycopy_move_allocation_here(alloc, dest, saved_jvms, saved_reexecute_sp, new_idx);
     
       if (stopped()) {
         return true;
    diff --git a/hotspot/src/share/vm/opto/loopTransform.cpp b/hotspot/src/share/vm/opto/loopTransform.cpp
    index d35d71aebd4..7590ba66b5a 100644
    --- a/hotspot/src/share/vm/opto/loopTransform.cpp
    +++ b/hotspot/src/share/vm/opto/loopTransform.cpp
    @@ -3174,6 +3174,11 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
         return false;
       }
     
    +  Node* exit = head->loopexit()->proj_out(0);
    +  if (exit == NULL) {
    +    return false;
    +  }
    +
     #ifndef PRODUCT
       if (TraceLoopOpts) {
         tty->print("ArrayFill    ");
    @@ -3281,7 +3286,6 @@ bool PhaseIdealLoop::intrinsify_fill(IdealLoopTree* lpt) {
     */
     
       // Redirect the old control and memory edges that are outside the loop.
    -  Node* exit = head->loopexit()->proj_out(0);
       // Sometimes the memory phi of the head is used as the outgoing
       // state of the loop.  It's safe in this case to replace it with the
       // result_mem.
    diff --git a/hotspot/src/share/vm/opto/memnode.cpp b/hotspot/src/share/vm/opto/memnode.cpp
    index 445192c1da4..ca1405f0e51 100644
    --- a/hotspot/src/share/vm/opto/memnode.cpp
    +++ b/hotspot/src/share/vm/opto/memnode.cpp
    @@ -61,6 +61,15 @@ const TypePtr *MemNode::adr_type() const {
       return calculate_adr_type(adr->bottom_type(), cross_check);
     }
     
    +bool MemNode::check_if_adr_maybe_raw(Node* adr) {
    +  if (adr != NULL) {
    +    if (adr->bottom_type()->base() == Type::RawPtr || adr->bottom_type()->base() == Type::AnyPtr) {
    +      return true;
    +    }
    +  }
    +  return false;
    +}
    +
     #ifndef PRODUCT
     void MemNode::dump_spec(outputStream *st) const {
       if (in(Address) == NULL)  return; // node is dead
    @@ -560,6 +569,7 @@ Node* MemNode::find_previous_store(PhaseTransform* phase) {
       if (offset == Type::OffsetBot)
         return NULL;            // cannot unalias unless there are precise offsets
     
    +  const bool adr_maybe_raw = check_if_adr_maybe_raw(adr);
       const TypeOopPtr *addr_t = adr->bottom_type()->isa_oopptr();
     
       intptr_t size_in_bytes = memory_size();
    @@ -577,6 +587,13 @@ Node* MemNode::find_previous_store(PhaseTransform* phase) {
           Node* st_base = AddPNode::Ideal_base_and_offset(st_adr, phase, st_offset);
           if (st_base == NULL)
             break;              // inscrutable pointer
    +
    +      // For raw accesses it's not enough to prove that constant offsets don't intersect.
    +      // We need the bases to be the equal in order for the offset check to make sense.
    +      if ((adr_maybe_raw || check_if_adr_maybe_raw(st_adr)) && st_base != base) {
    +        break;
    +      }
    +
           if (st_offset != offset && st_offset != Type::OffsetBot) {
             const int MAX_STORE = BytesPerLong;
             if (st_offset >= offset + size_in_bytes ||
    diff --git a/hotspot/src/share/vm/opto/memnode.hpp b/hotspot/src/share/vm/opto/memnode.hpp
    index f0608bc752d..3409446861a 100644
    --- a/hotspot/src/share/vm/opto/memnode.hpp
    +++ b/hotspot/src/share/vm/opto/memnode.hpp
    @@ -78,6 +78,7 @@ protected:
       }
     
       virtual Node* find_previous_arraycopy(PhaseTransform* phase, Node* ld_alloc, Node*& mem, bool can_see_stored_value) const { return NULL; }
    +  static bool check_if_adr_maybe_raw(Node* adr);
     
     public:
       // Helpers for the optimizer.  Documented in memnode.cpp.
    diff --git a/hotspot/src/share/vm/opto/parse1.cpp b/hotspot/src/share/vm/opto/parse1.cpp
    index be1d82d7554..35d099bdeda 100644
    --- a/hotspot/src/share/vm/opto/parse1.cpp
    +++ b/hotspot/src/share/vm/opto/parse1.cpp
    @@ -1086,7 +1086,7 @@ void Parse::do_exits() {
             kit.make_dtrace_method_exit(method());
           }
           if (_replaced_nodes_for_exceptions) {
    -        kit.map()->apply_replaced_nodes();
    +        kit.map()->apply_replaced_nodes(_new_idx);
           }
           // Done with exception-path processing.
           ex_map = kit.make_exception_state(ex_oop);
    @@ -1107,7 +1107,7 @@ void Parse::do_exits() {
           _exits.add_exception_state(ex_map);
         }
       }
    -  _exits.map()->apply_replaced_nodes();
    +  _exits.map()->apply_replaced_nodes(_new_idx);
     }
     
     //-----------------------------create_entry_map-------------------------------
    diff --git a/hotspot/src/share/vm/opto/parse2.cpp b/hotspot/src/share/vm/opto/parse2.cpp
    index c8553ce798b..51538767fde 100644
    --- a/hotspot/src/share/vm/opto/parse2.cpp
    +++ b/hotspot/src/share/vm/opto/parse2.cpp
    @@ -826,6 +826,9 @@ float Parse::dynamic_branch_prediction(float &cnt, BoolTest::mask btest, Node* t
         ciMethodData* methodData = method()->method_data();
         if (!methodData->is_mature())  return PROB_UNKNOWN;
         ciProfileData* data = methodData->bci_to_data(bci());
    +    if (data == NULL) {
    +      return PROB_UNKNOWN;
    +    }
         if (!data->is_JumpData())  return PROB_UNKNOWN;
     
         // get taken and not taken values
    @@ -917,8 +920,8 @@ float Parse::branch_prediction(float& cnt,
             // of the OSR-ed method, and we want to deopt to gather more stats.
             // If you have ANY counts, then this loop is simply 'cold' relative
             // to the OSR loop.
    -        if (data->as_BranchData()->taken() +
    -            data->as_BranchData()->not_taken() == 0 ) {
    +        if (data == NULL ||
    +            (data->as_BranchData()->taken() +  data->as_BranchData()->not_taken() == 0)) {
               // This is the only way to return PROB_UNKNOWN:
               return PROB_UNKNOWN;
             }
    diff --git a/hotspot/src/share/vm/opto/replacednodes.cpp b/hotspot/src/share/vm/opto/replacednodes.cpp
    index e3f3c113572..68928fc1601 100644
    --- a/hotspot/src/share/vm/opto/replacednodes.cpp
    +++ b/hotspot/src/share/vm/opto/replacednodes.cpp
    @@ -92,13 +92,17 @@ void ReplacedNodes::reset() {
     }
     
     // Perfom node replacement (used when returning to caller)
    -void ReplacedNodes::apply(Node* n) {
    +void ReplacedNodes::apply(Node* n, uint idx) {
       if (is_empty()) {
         return;
       }
       for (int i = 0; i < _replaced_nodes->length(); i++) {
         ReplacedNode replaced = _replaced_nodes->at(i);
    -    n->replace_edge(replaced.initial(), replaced.improved());
    +    // Only apply if improved node was created in a callee to avoid
    +    // issues with irreducible loops in the caller
    +    if (replaced.improved()->_idx >= idx) {
    +      n->replace_edge(replaced.initial(), replaced.improved());
    +    }
       }
     }
     
    diff --git a/hotspot/src/share/vm/opto/replacednodes.hpp b/hotspot/src/share/vm/opto/replacednodes.hpp
    index 0f68fe986d5..3c31d0de903 100644
    --- a/hotspot/src/share/vm/opto/replacednodes.hpp
    +++ b/hotspot/src/share/vm/opto/replacednodes.hpp
    @@ -71,7 +71,7 @@ class ReplacedNodes VALUE_OBJ_CLASS_SPEC {
       void record(Node* initial, Node* improved);
       void transfer_from(const ReplacedNodes& other, uint idx);
       void reset();
    -  void apply(Node* n);
    +  void apply(Node* n, uint idx);
       void merge_with(const ReplacedNodes& other);
       bool is_empty() const;
       void dump(outputStream *st) const;
    diff --git a/hotspot/src/share/vm/opto/stringopts.cpp b/hotspot/src/share/vm/opto/stringopts.cpp
    index 85151b0b99e..889353dabfe 100644
    --- a/hotspot/src/share/vm/opto/stringopts.cpp
    +++ b/hotspot/src/share/vm/opto/stringopts.cpp
    @@ -891,8 +891,9 @@ bool StringConcat::validate_control_flow() {
           ctrl_path.push(cn);
           ctrl_path.push(cn->proj_out(0));
           ctrl_path.push(cn->proj_out(0)->unique_out());
    -      if (cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0) != NULL) {
    -        ctrl_path.push(cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0));
    +      Node* catchproj = cn->proj_out(0)->unique_out()->as_Catch()->proj_out(0);
    +      if (catchproj != NULL) {
    +        ctrl_path.push(catchproj);
           }
         } else {
           ShouldNotReachHere();
    diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp
    index a8c68006020..6411307c517 100644
    --- a/hotspot/src/share/vm/opto/type.cpp
    +++ b/hotspot/src/share/vm/opto/type.cpp
    @@ -373,7 +373,7 @@ const Type* Type::make_constant_from_field(ciField* field, ciInstance* holder,
       if (con_type != NULL && field->is_call_site_target()) {
         ciCallSite* call_site = holder->as_call_site();
         if (!call_site->is_constant_call_site()) {
    -      ciMethodHandle* target = call_site->get_target();
    +      ciMethodHandle* target = con.as_object()->as_method_handle();
           Compile::current()->dependencies()->assert_call_site_target_value(call_site, target);
         }
       }
    diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp
    index f519e5e2788..acda443267a 100644
    --- a/hotspot/src/share/vm/prims/jni.cpp
    +++ b/hotspot/src/share/vm/prims/jni.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * Copyright (c) 2012 Red Hat, Inc.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
    @@ -935,8 +935,7 @@ class JNI_ArgumentPusherVaArg : public JNI_ArgumentPusher {
       inline void get_long()   { _arguments->push_long(va_arg(_ap, jlong)); }
       inline void get_float()  { _arguments->push_float((jfloat)va_arg(_ap, jdouble)); } // float is coerced to double w/ va_arg
       inline void get_double() { _arguments->push_double(va_arg(_ap, jdouble)); }
    -  inline void get_object() { jobject l = va_arg(_ap, jobject);
    -                             _arguments->push_oop(Handle((oop *)l, false)); }
    +  inline void get_object() { _arguments->push_jobject(va_arg(_ap, jobject)); }
     
       inline void set_ap(va_list rap) {
         va_copy(_ap, rap);
    @@ -1025,7 +1024,7 @@ class JNI_ArgumentPusherArray : public JNI_ArgumentPusher {
       inline void get_long()   { _arguments->push_long((_ap++)->j);  }
       inline void get_float()  { _arguments->push_float((_ap++)->f); }
       inline void get_double() { _arguments->push_double((_ap++)->d);}
    -  inline void get_object() { _arguments->push_oop(Handle((oop *)(_ap++)->l, false)); }
    +  inline void get_object() { _arguments->push_jobject((_ap++)->l); }
     
       inline void set_ap(const jvalue *rap) { _ap = rap; }
     
    diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp
    index 2955463852e..59704b2ced7 100644
    --- a/hotspot/src/share/vm/prims/jvm.cpp
    +++ b/hotspot/src/share/vm/prims/jvm.cpp
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      *
      * This code is free software; you can redistribute it and/or modify it
    @@ -684,7 +684,7 @@ JVM_ENTRY(jobject, JVM_Clone(JNIEnv* env, jobject handle))
           // This can safepoint and redefine method, so need both new_obj and method
           // in a handle, for two different reasons.  new_obj can move, method can be
           // deleted if nothing is using it on the stack.
    -      m->method_holder()->add_member_name(new_obj());
    +      m->method_holder()->add_member_name(new_obj(), false);
         }
       }
     
    @@ -2967,14 +2967,7 @@ JVM_ENTRY(void, JVM_Yield(JNIEnv *env, jclass threadClass))
       JVMWrapper("JVM_Yield");
       if (os::dont_yield()) return;
       HOTSPOT_THREAD_YIELD();
    -
    -  // When ConvertYieldToSleep is off (default), this matches the classic VM use of yield.
    -  // Critical for similar threading behaviour
    -  if (ConvertYieldToSleep) {
    -    os::sleep(thread, MinSleepInterval, false);
    -  } else {
    -    os::naked_yield();
    -  }
    +  os::naked_yield();
     JVM_END
     
     
    @@ -2998,18 +2991,7 @@ JVM_ENTRY(void, JVM_Sleep(JNIEnv* env, jclass threadClass, jlong millis))
       EventThreadSleep event;
     
       if (millis == 0) {
    -    // When ConvertSleepToYield is on, this matches the classic VM implementation of
    -    // JVM_Sleep. Critical for similar threading behaviour (Win32)
    -    // It appears that in certain GUI contexts, it may be beneficial to do a short sleep
    -    // for SOLARIS
    -    if (ConvertSleepToYield) {
    -      os::naked_yield();
    -    } else {
    -      ThreadState old_state = thread->osthread()->get_state();
    -      thread->osthread()->set_state(SLEEPING);
    -      os::sleep(thread, MinSleepInterval, false);
    -      thread->osthread()->set_state(old_state);
    -    }
    +    os::naked_yield();
       } else {
         ThreadState old_state = thread->osthread()->get_state();
         thread->osthread()->set_state(SLEEPING);
    diff --git a/hotspot/src/share/vm/prims/jvmti.xml b/hotspot/src/share/vm/prims/jvmti.xml
    index 7a0515c2bc4..e7d02cc6dd0 100644
    --- a/hotspot/src/share/vm/prims/jvmti.xml
    +++ b/hotspot/src/share/vm/prims/jvmti.xml
    @@ -1486,6 +1486,10 @@ jvmtiEnv *jvmti;
           
             Get the current thread.  
             The current thread is the Java programming language thread which has called the function.
    +        The function may return NULL in the start phase if the
    +        
    +        can_generate_early_vmstart capability is enabled
    +        and the java.lang.Thread class has not been initialized yet.
             

    Note that most functions that take a thread as an argument will accept NULL to mean @@ -1498,7 +1502,7 @@ jvmtiEnv *jvmti; - On return, points to the current thread. + On return, points to the current thread, or NULL. @@ -6512,7 +6516,7 @@ class C2 extends C1 implements I2 { Get Named Module - Return the java.lang.reflect.Module object for a named + Return the java.lang.Module object for a named module defined to a class loader that contains a given package. The module is returned via module_ptr.

    @@ -6550,7 +6554,7 @@ class C2 extends C1 implements I2 { - On return, points to a java.lang.reflect.Module object + On return, points to a java.lang.Module object or points to NULL. @@ -6595,6 +6599,10 @@ class C2 extends C1 implements I2 { If is not a module object. + + if the module cannot be modified. + See . + @@ -6629,7 +6637,7 @@ class C2 extends C1 implements I2 { The module the package is exported to. If the to_module is not a subclass of - java.lang.reflect.Module this function returns + java.lang.Module this function returns . @@ -6645,6 +6653,10 @@ class C2 extends C1 implements I2 { If the package does not belong to the module. + + if the module cannot be modified. + See . + @@ -6680,7 +6692,7 @@ class C2 extends C1 implements I2 { The module with the package to open. If the to_module is not a subclass of - java.lang.reflect.Module this function returns + java.lang.Module this function returns . @@ -6696,6 +6708,10 @@ class C2 extends C1 implements I2 { If the package does not belong to the module. + + if the module cannot be modified. + See . + @@ -6733,6 +6749,10 @@ class C2 extends C1 implements I2 { If is not a class object. + + if the module cannot be modified. + See . + @@ -6779,6 +6799,44 @@ class C2 extends C1 implements I2 { If is not a class object. + + if the module cannot be modified. + See . + + + + + + Is Modifiable Module + + Determines whether a module is modifiable. + If a module is modifiable then this module can be updated with + , , + , , + and . If a module is not modifiable + then the module can not be updated with these functions. + + new + + + + + + + The module to query. + + + + + + On return, points to the boolean result of this function. + + + + + + If is not a module object. + @@ -7799,6 +7857,10 @@ class C2 extends C1 implements I2 { A method in the new class version has different modifiers than its counterpart in the old class version. + + A module cannot be modified. + See . + @@ -11563,6 +11625,9 @@ myInit() { The class cannot be modified. + + The module cannot be modified. + The functionality is not available in this virtual machine. @@ -14732,9 +14797,15 @@ typedef void (JNICALL *jvmtiEventVMInit) - Add new functions: - GetAllModules - AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides + - IsModifiableModule Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to disallow some implementation defined classes. + + Minor update for GetCurrentThread function: + - The function may return NULL in the start phase if the + can_generate_early_vmstart capability is enabled. + diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index f9dc315a552..491eeddd1d5 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,12 +235,12 @@ JvmtiEnv::AddModuleReads(jobject module, jobject to_module) { // check module Handle h_module(THREAD, JNIHandles::resolve(module)); - if (!java_lang_reflect_Module::is_instance(h_module())) { + if (!java_lang_Module::is_instance(h_module())) { return JVMTI_ERROR_INVALID_MODULE; } // check to_module Handle h_to_module(THREAD, JNIHandles::resolve(to_module)); - if (!java_lang_reflect_Module::is_instance(h_to_module())) { + if (!java_lang_Module::is_instance(h_to_module())) { return JVMTI_ERROR_INVALID_MODULE; } return JvmtiExport::add_module_reads(h_module, h_to_module, THREAD); @@ -257,12 +257,12 @@ JvmtiEnv::AddModuleExports(jobject module, const char* pkg_name, jobject to_modu // check module Handle h_module(THREAD, JNIHandles::resolve(module)); - if (!java_lang_reflect_Module::is_instance(h_module())) { + if (!java_lang_Module::is_instance(h_module())) { return JVMTI_ERROR_INVALID_MODULE; } // check to_module Handle h_to_module(THREAD, JNIHandles::resolve(to_module)); - if (!java_lang_reflect_Module::is_instance(h_to_module())) { + if (!java_lang_Module::is_instance(h_to_module())) { return JVMTI_ERROR_INVALID_MODULE; } return JvmtiExport::add_module_exports(h_module, h_pkg, h_to_module, THREAD); @@ -279,12 +279,12 @@ JvmtiEnv::AddModuleOpens(jobject module, const char* pkg_name, jobject to_module // check module Handle h_module(THREAD, JNIHandles::resolve(module)); - if (!java_lang_reflect_Module::is_instance(h_module())) { + if (!java_lang_Module::is_instance(h_module())) { return JVMTI_ERROR_INVALID_MODULE; } // check to_module Handle h_to_module(THREAD, JNIHandles::resolve(to_module)); - if (!java_lang_reflect_Module::is_instance(h_to_module())) { + if (!java_lang_Module::is_instance(h_to_module())) { return JVMTI_ERROR_INVALID_MODULE; } return JvmtiExport::add_module_opens(h_module, h_pkg, h_to_module, THREAD); @@ -299,7 +299,7 @@ JvmtiEnv::AddModuleUses(jobject module, jclass service) { // check module Handle h_module(THREAD, JNIHandles::resolve(module)); - if (!java_lang_reflect_Module::is_instance(h_module())) { + if (!java_lang_Module::is_instance(h_module())) { return JVMTI_ERROR_INVALID_MODULE; } // check service @@ -321,7 +321,7 @@ JvmtiEnv::AddModuleProvides(jobject module, jclass service, jclass impl_class) { // check module Handle h_module(THREAD, JNIHandles::resolve(module)); - if (!java_lang_reflect_Module::is_instance(h_module())) { + if (!java_lang_Module::is_instance(h_module())) { return JVMTI_ERROR_INVALID_MODULE; } // check service @@ -339,6 +339,22 @@ JvmtiEnv::AddModuleProvides(jobject module, jclass service, jclass impl_class) { return JvmtiExport::add_module_provides(h_module, h_service, h_impl_class, THREAD); } /* end AddModuleProvides */ +// module - pre-checked for NULL +// is_modifiable_class_ptr - pre-checked for NULL +jvmtiError +JvmtiEnv::IsModifiableModule(jobject module, jboolean* is_modifiable_module_ptr) { + JavaThread* THREAD = JavaThread::current(); + + // check module + Handle h_module(THREAD, JNIHandles::resolve(module)); + if (!java_lang_Module::is_instance(h_module())) { + return JVMTI_ERROR_INVALID_MODULE; + } + + *is_modifiable_module_ptr = JNI_TRUE; + return JVMTI_ERROR_NONE; +} /* end IsModifiableModule */ + // // Class functions @@ -1796,6 +1812,13 @@ JvmtiEnv::FollowReferences(jint heap_filter, jclass klass, jobject initial_objec } } + if (initial_object != NULL) { + oop init_obj = JNIHandles::resolve_external_guard(initial_object); + if (init_obj == NULL) { + return JVMTI_ERROR_INVALID_OBJECT; + } + } + Thread *thread = Thread::current(); HandleMark hm(thread); KlassHandle kh (thread, k_oop); diff --git a/hotspot/src/share/vm/prims/jvmtiExport.cpp b/hotspot/src/share/vm/prims/jvmtiExport.cpp index 52350da0cde..ad7984c4a8f 100644 --- a/hotspot/src/share/vm/prims/jvmtiExport.cpp +++ b/hotspot/src/share/vm/prims/jvmtiExport.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1230,8 +1230,12 @@ void JvmtiExport::post_class_unload(Klass* klass) { assert(thread->is_VM_thread(), "wrong thread"); // get JavaThread for whom we are proxy - JavaThread *real_thread = - (JavaThread *)((VMThread *)thread)->vm_operation()->calling_thread(); + Thread *calling_thread = ((VMThread *)thread)->vm_operation()->calling_thread(); + if (!calling_thread->is_Java_thread()) { + // cannot post an event to a non-JavaThread + return; + } + JavaThread *real_thread = (JavaThread *)calling_thread; JvmtiEnvIterator it; for (JvmtiEnv* env = it.first(); env != NULL; env = it.next(env)) { diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index b2cf5660865..e90420d03b8 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ #include "services/serviceUtil.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" #endif // INCLUDE_ALL_GCS @@ -1534,6 +1535,14 @@ class TagObjectCollector : public JvmtiTagHashmapEntryClosure { if (_tags[i] == entry->tag()) { oop o = entry->object(); assert(o != NULL && Universe::heap()->is_in_reserved(o), "sanity check"); +#if INCLUDE_ALL_GCS + if (UseG1GC) { + // The reference in this tag map could be the only (implicitly weak) + // reference to that object. If we hand it out, we need to keep it live wrt + // SATB marking similar to other j.l.ref.Reference referents. + G1SATBCardTableModRefBS::enqueue(o); + } +#endif jobject ref = JNIHandles::make_local(JavaThread::current(), o); _object_results->append(ref); _tag_results->append((uint64_t)entry->tag()); diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp index 717c1fe00ad..1ddc306d4a0 100644 --- a/hotspot/src/share/vm/prims/methodHandles.cpp +++ b/hotspot/src/share/vm/prims/methodHandles.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -176,7 +176,7 @@ oop MethodHandles::init_MemberName(Handle mname, Handle target) { return NULL; } -oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { +oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info, bool intern) { assert(info.resolved_appendix().is_null(), "only normal methods here"); methodHandle m = info.resolved_method(); assert(m.not_null(), "null method handle"); @@ -277,13 +277,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) { // If relevant, the vtable or itable value is stored as vmindex. // This is done eagerly, since it is readily available without // constructing any new objects. - // TO DO: maybe intern mname_oop - if (m->method_holder()->add_member_name(mname)) { - return mname(); - } else { - // Redefinition caused this to fail. Return NULL (and an exception?) - return NULL; - } + return m->method_holder()->add_member_name(mname, intern); } oop MethodHandles::init_field_MemberName(Handle mname, fieldDescriptor& fd, bool is_setter) { @@ -733,7 +727,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS assert(!is_signature_polymorphic_static(mh_invoke_id), ""); LinkResolver::resolve_handle_call(result, link_info, THREAD); } else if (ref_kind == JVM_REF_invokeSpecial) { - LinkResolver::resolve_special_call(result, + LinkResolver::resolve_special_call(result, Handle(), link_info, THREAD); } else if (ref_kind == JVM_REF_invokeVirtual) { LinkResolver::resolve_virtual_call(result, Handle(), defc, @@ -761,7 +755,7 @@ Handle MethodHandles::resolve_MemberName(Handle mname, KlassHandle caller, TRAPS { assert(!HAS_PENDING_EXCEPTION, ""); if (name == vmSymbols::object_initializer_name()) { - LinkResolver::resolve_special_call(result, link_info, THREAD); + LinkResolver::resolve_special_call(result, Handle(), link_info, THREAD); } else { break; // will throw after end of switch } @@ -973,7 +967,9 @@ int MethodHandles::find_MemberNames(KlassHandle k, if (!java_lang_invoke_MemberName::is_instance(result())) return -99; // caller bug! CallInfo info(m); - oop saved = MethodHandles::init_method_MemberName(result, info); + // Since this is going through the methods to create MemberNames, don't search + // for matching methods already in the table + oop saved = MethodHandles::init_method_MemberName(result, info, /*intern*/false); if (saved != result()) results->obj_at_put(rfill-1, saved); // show saved instance to user } else if (++overflow >= overflow_limit) { @@ -1054,9 +1050,34 @@ MemberNameTable::~MemberNameTable() { } } -void MemberNameTable::add_member_name(jweak mem_name_wref) { +oop MemberNameTable::add_member_name(jweak mem_name_wref) { assert_locked_or_safepoint(MemberNameTable_lock); this->push(mem_name_wref); + return JNIHandles::resolve(mem_name_wref); +} + +oop MemberNameTable::find_or_add_member_name(jweak mem_name_wref) { + assert_locked_or_safepoint(MemberNameTable_lock); + oop new_mem_name = JNIHandles::resolve(mem_name_wref); + + // Find matching member name in the list. + // This is linear because these are short lists. + int len = this->length(); + int new_index = len; + for (int idx = 0; idx < len; idx++) { + oop mname = JNIHandles::resolve(this->at(idx)); + if (mname == NULL) { + new_index = idx; + continue; + } + if (java_lang_invoke_MemberName::equals(new_mem_name, mname)) { + JNIHandles::destroy_weak_global(mem_name_wref); + return mname; + } + } + // Not found, push the new one, or reuse empty slot + this->at_put_grow(new_index, mem_name_wref); + return new_mem_name; } #if INCLUDE_JVMTI @@ -1208,9 +1229,10 @@ JVM_ENTRY(jobject, MHN_resolve_Mem(JNIEnv *env, jobject igcls, jobject mname_jh, if (reference_klass != NULL && reference_klass->is_instance_klass()) { // Emulate LinkResolver::check_klass_accessability. Klass* caller = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(caller_jh)); - if (Reflection::verify_class_access(caller, - reference_klass, - true) != Reflection::ACCESS_OK) { + if (caller != SystemDictionary::Object_klass() + && Reflection::verify_class_access(caller, + reference_klass, + true) != Reflection::ACCESS_OK) { THROW_MSG_NULL(vmSymbols::java_lang_InternalError(), reference_klass->external_name()); } } diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp index 4a825464fb8..3a5e90305fe 100644 --- a/hotspot/src/share/vm/prims/methodHandles.hpp +++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,7 @@ class MethodHandles: AllStatic { static Handle new_MemberName(TRAPS); // must be followed by init_MemberName static oop init_MemberName(Handle mname_h, Handle target_h); // compute vmtarget/vmindex from target static oop init_field_MemberName(Handle mname_h, fieldDescriptor& fd, bool is_setter = false); - static oop init_method_MemberName(Handle mname_h, CallInfo& info); + static oop init_method_MemberName(Handle mname_h, CallInfo& info, bool intern = true); static int method_ref_kind(Method* m, bool do_dispatch_if_possible = true); static int find_MemberNames(KlassHandle k, Symbol* name, Symbol* sig, int mflags, KlassHandle caller, @@ -235,7 +235,8 @@ class MemberNameTable : public GrowableArray { public: MemberNameTable(int methods_cnt); ~MemberNameTable(); - void add_member_name(jweak mem_name_ref); + oop add_member_name(jweak mem_name_ref); + oop find_or_add_member_name(jweak mem_name_ref); #if INCLUDE_JVMTI // RedefineClasses() API support: diff --git a/hotspot/src/share/vm/prims/stackwalk.cpp b/hotspot/src/share/vm/prims/stackwalk.cpp index e130127318a..9e3fc9a8464 100644 --- a/hotspot/src/share/vm/prims/stackwalk.cpp +++ b/hotspot/src/share/vm/prims/stackwalk.cpp @@ -173,7 +173,11 @@ void JavaFrameStream::fill_frame(int index, objArrayHandle frames_array, } } -oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* values, int i, TRAPS) { +// Create and return a LiveStackFrame.PrimitiveSlot (if needed) for the +// StackValue at the given index. 'type' is expected to be T_INT, T_LONG, +// T_OBJECT, or T_CONFLICT. +oop LiveFrameStream::create_primitive_slot_instance(StackValueCollection* values, + int i, BasicType type, TRAPS) { Klass* k = SystemDictionary::resolve_or_null(vmSymbols::java_lang_LiveStackFrameInfo(), CHECK_NULL); instanceKlassHandle ik (THREAD, k); @@ -182,8 +186,8 @@ oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* value Symbol* signature = NULL; // ## TODO: type is only available in LocalVariable table, if present. - // ## StackValue type is T_INT or T_OBJECT. - switch (values->at(i)->type()) { + // ## StackValue type is T_INT or T_OBJECT (or converted to T_LONG on 64-bit) + switch (type) { case T_INT: args.push_int(values->int_at(i)); signature = vmSymbols::asPrimitive_int_signature(); @@ -195,42 +199,26 @@ oop LiveFrameStream::create_primitive_value_instance(StackValueCollection* value break; case T_FLOAT: - args.push_float(values->float_at(i)); - signature = vmSymbols::asPrimitive_float_signature(); - break; - case T_DOUBLE: - args.push_double(values->double_at(i)); - signature = vmSymbols::asPrimitive_double_signature(); - break; - case T_BYTE: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_byte_signature(); - break; - case T_SHORT: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_short_signature(); - break; - case T_CHAR: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_char_signature(); - break; - case T_BOOLEAN: - args.push_int(values->int_at(i)); - signature = vmSymbols::asPrimitive_boolean_signature(); - break; + THROW_MSG_(vmSymbols::java_lang_InternalError(), "Unexpected StackValue type", NULL); case T_OBJECT: return values->obj_at(i)(); case T_CONFLICT: // put a non-null slot - args.push_int(0); - signature = vmSymbols::asPrimitive_int_signature(); + #ifdef _LP64 + args.push_long(0); + signature = vmSymbols::asPrimitive_long_signature(); + #else + args.push_int(0); + signature = vmSymbols::asPrimitive_int_signature(); + #endif + break; default: ShouldNotReachHere(); @@ -252,9 +240,19 @@ objArrayHandle LiveFrameStream::values_to_object_array(StackValueCollection* val objArrayHandle array_h(THREAD, array_oop); for (int i = 0; i < values->size(); i++) { StackValue* st = values->at(i); - oop obj = create_primitive_value_instance(values, i, CHECK_(empty)); - if (obj != NULL) + BasicType type = st->type(); + int index = i; +#ifdef _LP64 + if (type != T_OBJECT && type != T_CONFLICT) { + intptr_t ret = st->get_int(); // read full 64-bit slot + type = T_LONG; // treat as long + index--; // undo +1 in StackValueCollection::long_at + } +#endif + oop obj = create_primitive_slot_instance(values, index, type, CHECK_(empty)); + if (obj != NULL) { array_h->obj_at_put(i, obj); + } } return array_h; } @@ -286,6 +284,13 @@ void LiveFrameStream::fill_live_stackframe(Handle stackFrame, StackValueCollection* expressions = _jvf->expressions(); GrowableArray* monitors = _jvf->monitors(); + int mode = 0; + if (_jvf->is_interpreted_frame()) { + mode = MODE_INTERPRETED; + } else if (_jvf->is_compiled_frame()) { + mode = MODE_COMPILED; + } + if (!locals->is_empty()) { objArrayHandle locals_h = values_to_object_array(locals, CHECK); java_lang_LiveStackFrameInfo::set_locals(stackFrame(), locals_h()); @@ -298,6 +303,7 @@ void LiveFrameStream::fill_live_stackframe(Handle stackFrame, objArrayHandle monitors_h = monitors_to_object_array(monitors, CHECK); java_lang_LiveStackFrameInfo::set_monitors(stackFrame(), monitors_h()); } + java_lang_LiveStackFrameInfo::set_mode(stackFrame(), mode); } } diff --git a/hotspot/src/share/vm/prims/stackwalk.hpp b/hotspot/src/share/vm/prims/stackwalk.hpp index 161a74599c3..a0c4bede64a 100644 --- a/hotspot/src/share/vm/prims/stackwalk.hpp +++ b/hotspot/src/share/vm/prims/stackwalk.hpp @@ -92,11 +92,16 @@ public: class LiveFrameStream : public BaseFrameStream { private: + enum { + MODE_INTERPRETED = 0x01, + MODE_COMPILED = 0x02 + }; + javaVFrame* _jvf; void fill_live_stackframe(Handle stackFrame, const methodHandle& method, TRAPS); - static oop create_primitive_value_instance(StackValueCollection* values, - int i, TRAPS); + static oop create_primitive_slot_instance(StackValueCollection* values, + int i, BasicType type, TRAPS); static objArrayHandle monitors_to_object_array(GrowableArray* monitors, TRAPS); static objArrayHandle values_to_object_array(StackValueCollection* values, TRAPS); diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index b57cb96839f..c825685a837 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -375,53 +375,18 @@ static SpecialFlag const special_jvm_flags[] = { // -------------- Deprecated Flags -------------- // --- Non-alias flags - sorted by obsolete_in then expired_in: { "MaxGCMinorPauseMillis", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, - { "AutoGCSelectPauseMillis", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "UseAutoGCSelectPolicy", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "UseParNewGC", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ExplicitGCInvokesConcurrentAndUnloadsClasses", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, - { "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "UseConcMarkSweepGC", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, { "CreateMinidumpOnCrash", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::undefined() }, - { "CMSMarkStackSizeMax", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "CMSMarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "G1MarkStackSize", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ParallelMarkingThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, - { "ParallelCMSThreads", JDK_Version::jdk(9), JDK_Version::undefined(), JDK_Version::jdk(10) }, // -------------- Obsolete Flags - sorted by expired_in -------------- - { "UseOldInlining", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "SafepointPollOffset", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseBoundThreads", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "DefaultThreadPriority", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "NoYieldsInMicrolock", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "BackEdgeThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseNewReflection", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "ReflectionWrapResolutionErrors",JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "VerifyReflectionBytecodes", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "AutoShutdownNMT", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "NmethodSweepFraction", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "NmethodSweepCheckInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "CodeCacheMinimumFreeSpace", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, -#ifndef ZERO - { "UseFastAccessorMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseFastEmptyMethods", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, -#endif // ZERO - { "UseCompilerSafepoints", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "AdaptiveSizePausePolicy", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "ParallelGCRetainPLAB", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "ThreadSafetyMargin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "LazyBootClassLoader", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "StarvationMonitorInterval", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "PreInflateSpin", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "JNIDetachReleasesMonitors", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "UseAltSigs", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "SegmentedHeapDumpThreshold", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "PrintOopAddress", JDK_Version::undefined(), JDK_Version::jdk(9), JDK_Version::jdk(10) }, - { "PermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::jdk(10) }, - { "MaxPermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::jdk(10) }, + { "ConvertSleepToYield", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "ConvertYieldToSleep", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "MinSleepInterval", JDK_Version::jdk(9), JDK_Version::jdk(10), JDK_Version::jdk(11) }, + { "PermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::undefined() }, + { "MaxPermSize", JDK_Version::undefined(), JDK_Version::jdk(8), JDK_Version::undefined() }, #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, @@ -444,11 +409,6 @@ typedef struct { static AliasedFlag const aliased_jvm_flags[] = { { "DefaultMaxRAMFraction", "MaxRAMFraction" }, - { "CMSMarkStackSizeMax", "MarkStackSizeMax" }, - { "CMSMarkStackSize", "MarkStackSize" }, - { "G1MarkStackSize", "MarkStackSize" }, - { "ParallelMarkingThreads", "ConcGCThreads" }, - { "ParallelCMSThreads", "ConcGCThreads" }, { "CreateMinidumpOnCrash", "CreateCoredumpOnCrash" }, { NULL, NULL} }; @@ -1547,7 +1507,6 @@ void Arguments::set_parnew_gc_flags() { assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC && !UseG1GC, "control point invariant"); assert(UseConcMarkSweepGC, "CMS is expected to be on here"); - assert(UseParNewGC, "ParNew should always be used with CMS"); if (FLAG_IS_DEFAULT(ParallelGCThreads)) { FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads()); @@ -1588,7 +1547,6 @@ void Arguments::set_parnew_gc_flags() { void Arguments::set_cms_and_parnew_gc_flags() { assert(!UseSerialGC && !UseParallelOldGC && !UseParallelGC, "Error"); assert(UseConcMarkSweepGC, "CMS is expected to be on here"); - assert(UseParNewGC, "ParNew should always be used with CMS"); // Turn off AdaptiveSizePolicy by default for cms until it is complete. disable_adaptive_size_policy("UseConcMarkSweepGC"); @@ -1728,16 +1686,6 @@ size_t Arguments::max_heap_for_compressed_oops() { NOT_LP64(ShouldNotReachHere(); return 0); } -bool Arguments::should_auto_select_low_pause_collector() { - if (UseAutoGCSelectPolicy && - !FLAG_IS_DEFAULT(MaxGCPauseMillis) && - (MaxGCPauseMillis <= AutoGCSelectPauseMillis)) { - log_trace(gc)("Automatic selection of the low pause collector based on pause goal of %d (ms)", (int) MaxGCPauseMillis); - return true; - } - return false; -} - void Arguments::set_use_compressed_oops() { #ifndef ZERO #ifdef _LP64 @@ -1841,16 +1789,7 @@ void Arguments::select_compilation_mode_ergonomically() { void Arguments::select_gc_ergonomically() { #if INCLUDE_ALL_GCS if (os::is_server_class_machine()) { - if (!UseAutoGCSelectPolicy) { - FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true); - } else { - if (should_auto_select_low_pause_collector()) { - FLAG_SET_ERGO_IF_DEFAULT(bool, UseConcMarkSweepGC, true); - FLAG_SET_ERGO_IF_DEFAULT(bool, UseParNewGC, true); - } else { - FLAG_SET_ERGO_IF_DEFAULT(bool, UseParallelGC, true); - } - } + FLAG_SET_ERGO_IF_DEFAULT(bool, UseG1GC, true); } else { FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); } @@ -1859,7 +1798,6 @@ void Arguments::select_gc_ergonomically() { UNSUPPORTED_OPTION(UseParallelGC); UNSUPPORTED_OPTION(UseParallelOldGC); UNSUPPORTED_OPTION(UseConcMarkSweepGC); - UNSUPPORTED_OPTION(UseParNewGC); FLAG_SET_ERGO_IF_DEFAULT(bool, UseSerialGC, true); #endif // INCLUDE_ALL_GCS } @@ -1894,6 +1832,11 @@ void Arguments::set_jvmci_specific_flags() { if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) { FLAG_SET_DEFAULT(NewSizeThreadIncrease, 4*K); } + if (TieredStopAtLevel != CompLevel_full_optimization) { + // Currently JVMCI compiler can only work at the full optimization level + warning("forcing TieredStopAtLevel to full optimization because JVMCI is enabled"); + TieredStopAtLevel = CompLevel_full_optimization; + } if (FLAG_IS_DEFAULT(TypeProfileLevel)) { FLAG_SET_DEFAULT(TypeProfileLevel, 0); } @@ -2073,7 +2016,6 @@ void Arguments::set_gc_specific_flags() { if (!ClassUnloading) { FLAG_SET_CMDLINE(bool, CMSClassUnloadingEnabled, false); FLAG_SET_CMDLINE(bool, ClassUnloadingWithConcurrentMark, false); - FLAG_SET_CMDLINE(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false); } #endif // INCLUDE_ALL_GCS } @@ -2299,8 +2241,6 @@ jint Arguments::set_aggressive_heap_flags() { if (FLAG_SET_CMDLINE(bool, UseParallelGC, true) != Flag::SUCCESS) { return JNI_EINVAL; } - FLAG_SET_DEFAULT(ParallelGCThreads, - Abstract_VM_Version::parallel_worker_threads()); // Encourage steady state memory management if (FLAG_SET_CMDLINE(uintx, ThresholdTolerance, 100) != Flag::SUCCESS) { @@ -2428,18 +2368,6 @@ bool Arguments::check_gc_consistency() { return false; } - if (UseConcMarkSweepGC && !UseParNewGC) { - jio_fprintf(defaultStream::error_stream(), - "It is not possible to combine the DefNew young collector with the CMS collector.\n"); - return false; - } - - if (UseParNewGC && !UseConcMarkSweepGC) { - jio_fprintf(defaultStream::error_stream(), - "It is not possible to combine the ParNew young collector with any collector other than CMS.\n"); - return false; - } - return true; } @@ -2506,11 +2434,14 @@ bool Arguments::check_vm_args_consistency() { } #endif } -#if INCLUDE_JVMCI +#if INCLUDE_JVMCI status = status && check_jvmci_args_consistency(); if (EnableJVMCI) { + PropertyList_unique_add(&_system_properties, "jdk.internal.vm.ci.enabled", "true", + AddProperty, UnwriteableProperty, InternalProperty); + if (!ScavengeRootsInCode) { warning("forcing ScavengeRootsInCode non-zero because JVMCI is enabled"); ScavengeRootsInCode = 1; @@ -2927,6 +2858,10 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m if (res != JNI_OK) { return res; } + } else if (match_option(option, "--permit-illegal-access")) { + if (!create_property("jdk.module.permitIllegalAccess", "true", ExternalProperty)) { + return JNI_ENOMEM; + } // -agentlib and -agentpath } else if (match_option(option, "-agentlib:", &tail) || (is_absolute_path = match_option(option, "-agentpath:", &tail))) { @@ -3169,6 +3104,7 @@ jint Arguments::parse_each_vm_init_arg(const JavaVMInitArgs* args, bool* patch_m // -Xprof } else if (match_option(option, "-Xprof")) { #if INCLUDE_FPROF + log_warning(arguments)("Option -Xprof was deprecated in version 9 and will likely be removed in a future release."); _has_profile = true; #else // INCLUDE_FPROF jio_fprintf(defaultStream::error_stream(), @@ -3700,7 +3636,7 @@ jint Arguments::finalize_vm_init_args() { #if INCLUDE_JVMCI if (EnableJVMCI && - !create_numbered_property("jdk.module.addmods", "jdk.vm.ci", addmods_count++)) { + !create_numbered_property("jdk.module.addmods", "jdk.internal.vm.ci", addmods_count++)) { return JNI_ENOMEM; } #endif @@ -3726,11 +3662,6 @@ jint Arguments::finalize_vm_init_args() { } } - if (UseConcMarkSweepGC && FLAG_IS_DEFAULT(UseParNewGC) && !UseParNewGC) { - // CMS can only be used with ParNew - FLAG_SET_ERGO(bool, UseParNewGC, true); - } - if (!check_vm_args_consistency()) { return JNI_ERR; } diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index daa91c22bd7..ad2178d7d20 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -480,9 +480,6 @@ class Arguments : AllStatic { static julong limit_by_allocatable_memory(julong size); // Setup heap size static void set_heap_size(); - // Based on automatic selection criteria, should the - // low pause collector be used. - static bool should_auto_select_low_pause_collector(); // Bytecode rewriting static void set_bytecode_flags(); diff --git a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp index abcf73ca3a7..9911ffb4e9e 100644 --- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp +++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp index 3bfb2825b74..776685ee95b 100644 --- a/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp +++ b/hotspot/src/share/vm/runtime/commandLineFlagConstraintsRuntime.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp index e3b88640768..cebdcfc9124 100644 --- a/hotspot/src/share/vm/runtime/deoptimization.cpp +++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -189,19 +189,6 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread assert(vf->is_compiled_frame(), "Wrong frame type"); chunk->push(compiledVFrame::cast(vf)); - ScopeDesc* trap_scope = chunk->at(0)->scope(); - Handle exceptionObject; - if (trap_scope->rethrow_exception()) { - if (PrintDeoptimizationDetails) { - tty->print_cr("Exception to be rethrown in the interpreter for method %s::%s at bci %d", trap_scope->method()->method_holder()->name()->as_C_string(), trap_scope->method()->name()->as_C_string(), trap_scope->bci()); - } - GrowableArray* expressions = trap_scope->expressions(); - guarantee(expressions != NULL && expressions->length() > 0, "must have exception to throw"); - ScopeValue* topOfStack = expressions->top(); - exceptionObject = StackValue::create_stack_value(&deoptee, &map, topOfStack)->get_obj(); - assert(exceptionObject() != NULL, "exception oop can not be null"); - } - bool realloc_failures = false; #if defined(COMPILER2) || INCLUDE_JVMCI @@ -221,8 +208,9 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread // It is not guaranteed that we can get such information here only // by analyzing bytecode in deoptimized frames. This is why this flag // is set during method compilation (see Compile::Process_OopMap_Node()). - // If the previous frame was popped, we don't have a result. - bool save_oop_result = chunk->at(0)->scope()->return_oop() && !thread->popframe_forcing_deopt_reexecution(); + // If the previous frame was popped or if we are dispatching an exception, + // we don't have an oop result. + bool save_oop_result = chunk->at(0)->scope()->return_oop() && !thread->popframe_forcing_deopt_reexecution() && (exec_mode == Unpack_deopt); Handle return_value; if (save_oop_result) { // Reallocation may trigger GC. If deoptimization happened on return from @@ -295,6 +283,19 @@ Deoptimization::UnrollBlock* Deoptimization::fetch_unroll_info_helper(JavaThread #endif // INCLUDE_JVMCI #endif // COMPILER2 || INCLUDE_JVMCI + ScopeDesc* trap_scope = chunk->at(0)->scope(); + Handle exceptionObject; + if (trap_scope->rethrow_exception()) { + if (PrintDeoptimizationDetails) { + tty->print_cr("Exception to be rethrown in the interpreter for method %s::%s at bci %d", trap_scope->method()->method_holder()->name()->as_C_string(), trap_scope->method()->name()->as_C_string(), trap_scope->bci()); + } + GrowableArray* expressions = trap_scope->expressions(); + guarantee(expressions != NULL && expressions->length() > 0, "must have exception to throw"); + ScopeValue* topOfStack = expressions->top(); + exceptionObject = StackValue::create_stack_value(&deoptee, &map, topOfStack)->get_obj(); + guarantee(exceptionObject() != NULL, "exception oop can not be null"); + } + // Ensure that no safepoint is taken after pointers have been stored // in fields of rematerialized objects. If a safepoint occurs from here on // out the java state residing in the vframeArray will be missed. @@ -1596,9 +1597,9 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra get_method_data(thread, profiled_method, create_if_missing); // Log a message - Events::log_deopt_message(thread, "Uncommon trap: reason=%s action=%s pc=" INTPTR_FORMAT " method=%s @ %d", + Events::log_deopt_message(thread, "Uncommon trap: reason=%s action=%s pc=" INTPTR_FORMAT " method=%s @ %d %s", trap_reason_name(reason), trap_action_name(action), p2i(fr.pc()), - trap_method->name_and_sig_as_C_string(), trap_bci); + trap_method->name_and_sig_as_C_string(), trap_bci, nm->compiler_name()); // Print a bunch of diagnostics, if requested. if (TraceDeoptimization || LogCompilation) { @@ -1812,7 +1813,7 @@ JRT_ENTRY(void, Deoptimization::uncommon_trap_inner(JavaThread* thread, jint tra // aggressive optimization. bool inc_recompile_count = false; ProfileData* pdata = NULL; - if (ProfileTraps && update_trap_state && trap_mdo != NULL) { + if (ProfileTraps && !is_client_compilation_mode_vm() && update_trap_state && trap_mdo != NULL) { assert(trap_mdo == get_method_data(thread, profiled_method, false), "sanity"); uint this_trap_count = 0; bool maybe_prior_trap = false; diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index 90b274e58a2..13c2f242c6c 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -657,14 +657,13 @@ public: range(0, 99) \ \ product(bool, UseAES, false, \ - "Control whether AES instructions can be used on x86/x64") \ + "Control whether AES instructions are used when available") \ \ product(bool, UseFMA, false, \ - "Control whether FMA instructions can be used") \ + "Control whether FMA instructions are used when available") \ \ product(bool, UseSHA, false, \ - "Control whether SHA instructions can be used " \ - "on SPARC, on ARM and on x86") \ + "Control whether SHA instructions are used when available") \ \ diagnostic(bool, UseGHASHIntrinsics, false, \ "Use intrinsics for GHASH versions of crypto") \ @@ -1159,13 +1158,6 @@ public: product_pd(bool, DontYieldALot, \ "Throw away obvious excess yield calls") \ \ - product(bool, ConvertSleepToYield, true, \ - "Convert sleep(0) to thread yield ") \ - \ - product(bool, ConvertYieldToSleep, false, \ - "Convert yield to a sleep of MinSleepInterval to simulate Win32 " \ - "behavior") \ - \ develop(bool, UseDetachedThreads, true, \ "Use detached threads that are recycled upon termination " \ "(for Solaris only)") \ @@ -1458,9 +1450,9 @@ public: "Number of threads concurrent gc will use") \ constraint(ConcGCThreadsConstraintFunc,AfterErgo) \ \ - product(uintx, GCTaskTimeStampEntries, 200, \ + product(uint, GCTaskTimeStampEntries, 200, \ "Number of time stamp entries per gc worker thread") \ - range(1, max_uintx) \ + range(1, max_jint) \ \ product(bool, AlwaysTenure, false, \ "Always tenure objects in eden (ParallelGC only)") \ @@ -1479,11 +1471,6 @@ public: "A System.gc() request invokes a concurrent collection; " \ "(effective only when using concurrent collectors)") \ \ - product(bool, ExplicitGCInvokesConcurrentAndUnloadsClasses, false, \ - "A System.gc() request invokes a concurrent collection and " \ - "also unloads classes during such a concurrent gc cycle " \ - "(effective only when UseConcMarkSweepGC)") \ - \ product(bool, GCLockerInvokesConcurrent, false, \ "The exit of a JNI critical section necessitating a scavenge, " \ "also kicks off a background concurrent collection") \ @@ -1501,9 +1488,6 @@ public: product(bool, UseCMSBestFit, true, \ "Use CMS best fit allocation strategy") \ \ - product(bool, UseParNewGC, false, \ - "Use parallel threads in the new generation") \ - \ product(uintx, ParallelGCBufferWastePct, 10, \ "Wasted fraction of parallel allocation buffer") \ range(0, 100) \ @@ -2059,13 +2043,6 @@ public: "Maximum fraction (1/n) of virtual memory used for ergonomically "\ "determining maximum heap size") \ \ - product(bool, UseAutoGCSelectPolicy, false, \ - "Use automatic collection selection policy") \ - \ - product(uintx, AutoGCSelectPauseMillis, 5000, \ - "Automatic GC selection pause threshold in milliseconds") \ - range(0, max_uintx) \ - \ product(bool, UseAdaptiveSizePolicy, true, \ "Use adaptive generation sizing policies") \ \ @@ -3003,10 +2980,6 @@ public: develop(intx, DontYieldALotInterval, 10, \ "Interval between which yields will be dropped (milliseconds)") \ \ - develop(intx, MinSleepInterval, 1, \ - "Minimum sleep() interval (milliseconds) when " \ - "ConvertSleepToYield is off (used for Solaris)") \ - \ develop(intx, ProfilerPCTickThreshold, 15, \ "Number of ticks in a PC buckets to be a hotspot") \ \ @@ -3375,7 +3348,7 @@ public: "Code cache expansion size (in bytes)") \ range(0, max_uintx) \ \ - develop_pd(uintx, CodeCacheMinBlockLength, \ + diagnostic_pd(uintx, CodeCacheMinBlockLength, \ "Minimum number of segments in a code cache block") \ range(1, 100) \ \ diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 0c7187cf745..9223f12b764 100644 --- a/hotspot/src/share/vm/runtime/java.cpp +++ b/hotspot/src/share/vm/runtime/java.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -621,6 +621,13 @@ void vm_notify_during_shutdown(const char* error, const char* message) { } } +void vm_exit_during_initialization() { + vm_notify_during_shutdown(NULL, NULL); + + // Failure during initialization, we don't want to dump core + vm_abort(false); +} + void vm_exit_during_initialization(Handle exception) { tty->print_cr("Error occurred during initialization of VM"); // If there are exceptions on this thread it must be cleared diff --git a/hotspot/src/share/vm/runtime/java.hpp b/hotspot/src/share/vm/runtime/java.hpp index e1e982e3824..3b3a714ee8a 100644 --- a/hotspot/src/share/vm/runtime/java.hpp +++ b/hotspot/src/share/vm/runtime/java.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ extern void vm_abort(bool dump_core=true); extern void notify_vm_shutdown(); // VM exit if error occurs during initialization of VM +extern void vm_exit_during_initialization(); extern void vm_exit_during_initialization(Handle exception); extern void vm_exit_during_initialization(Symbol* exception_name, const char* message); extern void vm_exit_during_initialization(const char* error, const char* message = NULL); diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index 5874699a1fc..d83f45cba41 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +221,7 @@ void JavaCalls::call_virtual(JavaValue* result, Handle receiver, KlassHandle spe void JavaCalls::call_special(JavaValue* result, KlassHandle klass, Symbol* name, Symbol* signature, JavaCallArguments* args, TRAPS) { CallInfo callinfo; LinkInfo link_info(klass, name, signature); - LinkResolver::resolve_special_call(callinfo, link_info, CHECK); + LinkResolver::resolve_special_call(callinfo, args->receiver(), link_info, CHECK); methodHandle method = callinfo.selected_method(); assert(method.not_null(), "should have thrown exception"); @@ -328,9 +328,9 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC // Verify the arguments if (CheckJNICalls) { - args->verify(method, result->get_type(), thread); + args->verify(method, result->get_type()); } - else debug_only(args->verify(method, result->get_type(), thread)); + else debug_only(args->verify(method, result->get_type())); #if INCLUDE_JVMCI } #else @@ -442,12 +442,43 @@ void JavaCalls::call_helper(JavaValue* result, const methodHandle& method, JavaC //-------------------------------------------------------------------------------------- // Implementation of JavaCallArguments +inline bool is_value_state_indirect_oop(uint state) { + assert(state != JavaCallArguments::value_state_oop, + "Checking for handles after removal"); + assert(state < JavaCallArguments::value_state_limit, + "Invalid value state %u", state); + return state != JavaCallArguments::value_state_primitive; +} + +inline oop resolve_indirect_oop(intptr_t value, uint state) { + switch (state) { + case JavaCallArguments::value_state_handle: + { + oop* ptr = reinterpret_cast(value); + return Handle::raw_resolve(ptr); + } + + case JavaCallArguments::value_state_jobject: + { + jobject obj = reinterpret_cast(value); + return JNIHandles::resolve(obj); + } + + default: + ShouldNotReachHere(); + return NULL; + } +} + intptr_t* JavaCallArguments::parameters() { // First convert all handles to oops for(int i = 0; i < _size; i++) { - if (_is_oop[i]) { - // Handle conversion - _value[i] = cast_from_oop(Handle::raw_resolve((oop *)_value[i])); + uint state = _value_state[i]; + assert(state != value_state_oop, "Multiple handle conversions"); + if (is_value_state_indirect_oop(state)) { + oop obj = resolve_indirect_oop(_value[i], state); + _value[i] = cast_from_oop(obj); + _value_state[i] = value_state_oop; } } // Return argument vector @@ -457,30 +488,42 @@ intptr_t* JavaCallArguments::parameters() { class SignatureChekker : public SignatureIterator { private: - bool *_is_oop; - int _pos; + int _pos; BasicType _return_type; - intptr_t* _value; - Thread* _thread; + u_char* _value_state; + intptr_t* _value; public: bool _is_return; - SignatureChekker(Symbol* signature, BasicType return_type, bool is_static, bool* is_oop, intptr_t* value, Thread* thread) : SignatureIterator(signature) { - _is_oop = is_oop; - _is_return = false; - _return_type = return_type; - _pos = 0; - _value = value; - _thread = thread; - + SignatureChekker(Symbol* signature, + BasicType return_type, + bool is_static, + u_char* value_state, + intptr_t* value) : + SignatureIterator(signature), + _pos(0), + _return_type(return_type), + _value_state(value_state), + _value(value), + _is_return(false) + { if (!is_static) { check_value(true); // Receiver must be an oop } } void check_value(bool type) { - guarantee(_is_oop[_pos++] == type, "signature does not match pushed arguments"); + uint state = _value_state[_pos++]; + if (type) { + guarantee(is_value_state_indirect_oop(state), + "signature does not match pushed arguments: %u at %d", + state, _pos - 1); + } else { + guarantee(state == JavaCallArguments::value_state_primitive, + "signature does not match pushed arguments: %u at %d", + state, _pos - 1); + } } void check_doing_return(bool state) { _is_return = state; } @@ -515,24 +558,20 @@ class SignatureChekker : public SignatureIterator { return; } - // verify handle and the oop pointed to by handle - int p = _pos; - bool bad = false; - // If argument is oop - if (_is_oop[p]) { - intptr_t v = _value[p]; - if (v != 0 ) { - size_t t = (size_t)v; - bad = (t < (size_t)os::vm_page_size() ) || !Handle::raw_resolve((oop *)v)->is_oop_or_null(true); - if (CheckJNICalls && bad) { - ReportJNIFatalError((JavaThread*)_thread, "Bad JNI oop argument"); - } - } - // for the regular debug case. - assert(!bad, "Bad JNI oop argument"); + intptr_t v = _value[_pos]; + if (v != 0) { + // v is a "handle" referring to an oop, cast to integral type. + // There shouldn't be any handles in very low memory. + guarantee((size_t)v >= (size_t)os::vm_page_size(), + "Bad JNI oop argument %d: " PTR_FORMAT, _pos, v); + // Verify the pointee. + oop vv = resolve_indirect_oop(v, _value_state[_pos]); + guarantee(vv->is_oop_or_null(true), + "Bad JNI oop argument %d: " PTR_FORMAT " -> " PTR_FORMAT, + _pos, v, p2i(vv)); } - check_value(true); + check_value(true); // Verify value state. } void do_bool() { check_int(T_BOOLEAN); } @@ -549,8 +588,7 @@ class SignatureChekker : public SignatureIterator { }; -void JavaCallArguments::verify(const methodHandle& method, BasicType return_type, - Thread *thread) { +void JavaCallArguments::verify(const methodHandle& method, BasicType return_type) { guarantee(method->size_of_parameters() == size_of_parameters(), "wrong no. of arguments pushed"); // Treat T_OBJECT and T_ARRAY as the same @@ -559,7 +597,11 @@ void JavaCallArguments::verify(const methodHandle& method, BasicType return_type // Check that oop information is correct Symbol* signature = method->signature(); - SignatureChekker sc(signature, return_type, method->is_static(),_is_oop, _value, thread); + SignatureChekker sc(signature, + return_type, + method->is_static(), + _value_state, + _value); sc.iterate_parameters(); sc.check_doing_return(true); sc.iterate_returntype(); diff --git a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp index efe1f8b9813..e77abf7d36b 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.hpp +++ b/hotspot/src/share/vm/runtime/javaCalls.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +80,11 @@ class JavaCallArguments : public StackObj { _default_size = 8 // Must be at least # of arguments in JavaCalls methods }; - intptr_t _value_buffer [_default_size + 1]; - bool _is_oop_buffer[_default_size + 1]; + intptr_t _value_buffer [_default_size + 1]; + u_char _value_state_buffer[_default_size + 1]; intptr_t* _value; - bool* _is_oop; + u_char* _value_state; int _size; int _max_size; bool _start_at_zero; // Support late setting of receiver @@ -92,8 +92,8 @@ class JavaCallArguments : public StackObj { void initialize() { // Starts at first element to support set_receiver. - _value = &_value_buffer[1]; - _is_oop = &_is_oop_buffer[1]; + _value = &_value_buffer[1]; + _value_state = &_value_state_buffer[1]; _max_size = _default_size; _size = 0; @@ -101,6 +101,23 @@ class JavaCallArguments : public StackObj { JVMCI_ONLY(_alternative_target = NULL;) } + // Helper for push_oop and the like. The value argument is a + // "handle" that refers to an oop. We record the address of the + // handle rather than the designated oop. The handle is later + // resolved to the oop by parameters(). This delays the exposure of + // naked oops until it is GC-safe. + template + inline int push_oop_impl(T handle, int size) { + // JNITypes::put_obj expects an oop value, so we play fast and + // loose with the type system. The cast from handle type to oop + // *must* use a C-style cast. In a product build it performs a + // reinterpret_cast. In a debug build (more accurately, in a + // CHECK_UNHANDLED_OOPS build) it performs a static_cast, invoking + // the debug-only oop class's conversion from void* constructor. + JNITypes::put_obj((oop)handle, _value, size); // Updates size. + return size; // Return the updated size. + } + public: JavaCallArguments() { initialize(); } @@ -111,11 +128,12 @@ class JavaCallArguments : public StackObj { JavaCallArguments(int max_size) { if (max_size > _default_size) { - _value = NEW_RESOURCE_ARRAY(intptr_t, max_size + 1); - _is_oop = NEW_RESOURCE_ARRAY(bool, max_size + 1); + _value = NEW_RESOURCE_ARRAY(intptr_t, max_size + 1); + _value_state = NEW_RESOURCE_ARRAY(u_char, max_size + 1); - // Reserve room for potential receiver in value and is_oop - _value++; _is_oop++; + // Reserve room for potential receiver in value and state + _value++; + _value_state++; _max_size = max_size; _size = 0; @@ -136,25 +154,52 @@ class JavaCallArguments : public StackObj { } #endif - inline void push_oop(Handle h) { _is_oop[_size] = true; - JNITypes::put_obj((oop)h.raw_value(), _value, _size); } + // The possible values for _value_state elements. + enum { + value_state_primitive, + value_state_oop, + value_state_handle, + value_state_jobject, + value_state_limit + }; - inline void push_int(int i) { _is_oop[_size] = false; - JNITypes::put_int(i, _value, _size); } + inline void push_oop(Handle h) { + _value_state[_size] = value_state_handle; + _size = push_oop_impl(h.raw_value(), _size); + } - inline void push_double(double d) { _is_oop[_size] = false; _is_oop[_size + 1] = false; - JNITypes::put_double(d, _value, _size); } + inline void push_jobject(jobject h) { + _value_state[_size] = value_state_jobject; + _size = push_oop_impl(h, _size); + } - inline void push_long(jlong l) { _is_oop[_size] = false; _is_oop[_size + 1] = false; - JNITypes::put_long(l, _value, _size); } + inline void push_int(int i) { + _value_state[_size] = value_state_primitive; + JNITypes::put_int(i, _value, _size); + } - inline void push_float(float f) { _is_oop[_size] = false; - JNITypes::put_float(f, _value, _size); } + inline void push_double(double d) { + _value_state[_size] = value_state_primitive; + _value_state[_size + 1] = value_state_primitive; + JNITypes::put_double(d, _value, _size); + } + + inline void push_long(jlong l) { + _value_state[_size] = value_state_primitive; + _value_state[_size + 1] = value_state_primitive; + JNITypes::put_long(l, _value, _size); + } + + inline void push_float(float f) { + _value_state[_size] = value_state_primitive; + JNITypes::put_float(f, _value, _size); + } // receiver Handle receiver() { assert(_size > 0, "must at least be one argument"); - assert(_is_oop[0], "first argument must be an oop"); + assert(_value_state[0] == value_state_handle, + "first argument must be an oop"); assert(_value[0] != 0, "receiver must be not-null"); return Handle((oop*)_value[0], false); } @@ -162,11 +207,11 @@ class JavaCallArguments : public StackObj { void set_receiver(Handle h) { assert(_start_at_zero == false, "can only be called once"); _start_at_zero = true; - _is_oop--; + _value_state--; _value--; _size++; - _is_oop[0] = true; - _value[0] = (intptr_t)h.raw_value(); + _value_state[0] = value_state_handle; + push_oop_impl(h.raw_value(), 0); } // Converts all Handles to oops, and returns a reference to parameter vector @@ -174,7 +219,7 @@ class JavaCallArguments : public StackObj { int size_of_parameters() const { return _size; } // Verify that pushed arguments fits a given method - void verify(const methodHandle& method, BasicType return_type, Thread *thread); + void verify(const methodHandle& method, BasicType return_type); }; // All calls to Java have to go via JavaCalls. Sets up the stack frame diff --git a/hotspot/src/share/vm/runtime/jniHandles.cpp b/hotspot/src/share/vm/runtime/jniHandles.cpp index 679ade0eaca..f4aae3c20bf 100644 --- a/hotspot/src/share/vm/runtime/jniHandles.cpp +++ b/hotspot/src/share/vm/runtime/jniHandles.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,9 @@ #include "runtime/jniHandles.hpp" #include "runtime/mutexLocker.hpp" #include "runtime/thread.inline.hpp" +#if INCLUDE_ALL_GCS +#include "gc/g1/g1SATBCardTableModRefBS.hpp" +#endif JNIHandleBlock* JNIHandles::_global_handles = NULL; JNIHandleBlock* JNIHandles::_weak_global_handles = NULL; @@ -92,28 +95,48 @@ jobject JNIHandles::make_weak_global(Handle obj) { jobject res = NULL; if (!obj.is_null()) { // ignore null handles - MutexLocker ml(JNIGlobalHandle_lock); - assert(Universe::heap()->is_in_reserved(obj()), "sanity check"); - res = _weak_global_handles->allocate_handle(obj()); + { + MutexLocker ml(JNIGlobalHandle_lock); + assert(Universe::heap()->is_in_reserved(obj()), "sanity check"); + res = _weak_global_handles->allocate_handle(obj()); + } + // Add weak tag. + assert(is_ptr_aligned(res, weak_tag_alignment), "invariant"); + char* tptr = reinterpret_cast(res) + weak_tag_value; + res = reinterpret_cast(tptr); } else { CHECK_UNHANDLED_OOPS_ONLY(Thread::current()->clear_unhandled_oops()); } return res; } +template +oop JNIHandles::resolve_jweak(jweak handle) { + assert(is_jweak(handle), "precondition"); + oop result = jweak_ref(handle); + result = guard_value(result); +#if INCLUDE_ALL_GCS + if (result != NULL && UseG1GC) { + G1SATBCardTableModRefBS::enqueue(result); + } +#endif // INCLUDE_ALL_GCS + return result; +} + +template oop JNIHandles::resolve_jweak(jweak); +template oop JNIHandles::resolve_jweak(jweak); void JNIHandles::destroy_global(jobject handle) { if (handle != NULL) { assert(is_global_handle(handle), "Invalid delete of global JNI handle"); - *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it + jobject_ref(handle) = deleted_handle(); } } void JNIHandles::destroy_weak_global(jobject handle) { if (handle != NULL) { - assert(!CheckJNICalls || is_weak_global_handle(handle), "Invalid delete of weak global JNI handle"); - *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it + jweak_ref(handle) = deleted_handle(); } } diff --git a/hotspot/src/share/vm/runtime/jniHandles.hpp b/hotspot/src/share/vm/runtime/jniHandles.hpp index ce37d940d7c..13e0e155740 100644 --- a/hotspot/src/share/vm/runtime/jniHandles.hpp +++ b/hotspot/src/share/vm/runtime/jniHandles.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * 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,28 @@ class JNIHandles : AllStatic { static JNIHandleBlock* _weak_global_handles; // First weak global handle block static oop _deleted_handle; // Sentinel marking deleted handles + inline static bool is_jweak(jobject handle); + inline static oop& jobject_ref(jobject handle); // NOT jweak! + inline static oop& jweak_ref(jobject handle); + + template inline static oop guard_value(oop value); + template inline static oop resolve_impl(jobject handle); + template static oop resolve_jweak(jweak handle); + public: + // Low tag bit in jobject used to distinguish a jweak. jweak is + // type equivalent to jobject, but there are places where we need to + // be able to distinguish jweak values from other jobjects, and + // is_weak_global_handle is unsuitable for performance reasons. To + // provide such a test we add weak_tag_value to the (aligned) byte + // address designated by the jobject to produce the corresponding + // jweak. Accessing the value of a jobject must account for it + // being a possibly offset jweak. + static const uintptr_t weak_tag_size = 1; + static const uintptr_t weak_tag_alignment = (1u << weak_tag_size); + static const uintptr_t weak_tag_mask = weak_tag_alignment - 1; + static const int weak_tag_value = 1; + // Resolve handle into oop inline static oop resolve(jobject handle); // Resolve externally provided handle into oop with some guards @@ -176,36 +197,85 @@ class JNIHandleBlock : public CHeapObj { #endif }; +inline bool JNIHandles::is_jweak(jobject handle) { + STATIC_ASSERT(weak_tag_size == 1); + STATIC_ASSERT(weak_tag_value == 1); + return (reinterpret_cast(handle) & weak_tag_mask) != 0; +} + +inline oop& JNIHandles::jobject_ref(jobject handle) { + assert(!is_jweak(handle), "precondition"); + return *reinterpret_cast(handle); +} + +inline oop& JNIHandles::jweak_ref(jobject handle) { + assert(is_jweak(handle), "precondition"); + char* ptr = reinterpret_cast(handle) - weak_tag_value; + return *reinterpret_cast(ptr); +} + +// external_guard is true if called from resolve_external_guard. +// Treat deleted (and possibly zapped) as NULL for external_guard, +// else as (asserted) error. +template +inline oop JNIHandles::guard_value(oop value) { + if (!external_guard) { + assert(value != badJNIHandle, "Pointing to zapped jni handle area"); + assert(value != deleted_handle(), "Used a deleted global handle"); + } else if ((value == badJNIHandle) || (value == deleted_handle())) { + value = NULL; + } + return value; +} + +// external_guard is true if called from resolve_external_guard. +template +inline oop JNIHandles::resolve_impl(jobject handle) { + assert(handle != NULL, "precondition"); + oop result; + if (is_jweak(handle)) { // Unlikely + result = resolve_jweak(handle); + } else { + result = jobject_ref(handle); + // Construction of jobjects canonicalize a null value into a null + // jobject, so for non-jweak the pointee should never be null. + assert(external_guard || result != NULL, + "Invalid value read from jni handle"); + result = guard_value(result); + } + return result; +} inline oop JNIHandles::resolve(jobject handle) { - oop result = (handle == NULL ? (oop)NULL : *(oop*)handle); - assert(result != NULL || (handle == NULL || !CheckJNICalls || is_weak_global_handle(handle)), "Invalid value read from jni handle"); - assert(result != badJNIHandle, "Pointing to zapped jni handle area"); + oop result = NULL; + if (handle != NULL) { + result = resolve_impl(handle); + } return result; -}; - +} +// Resolve some erroneous cases to NULL, rather than treating them as +// possibly unchecked errors. In particular, deleted handles are +// treated as NULL (though a deleted and later reallocated handle +// isn't detected). inline oop JNIHandles::resolve_external_guard(jobject handle) { - if (handle == NULL) return NULL; - oop result = *(oop*)handle; - if (result == NULL || result == badJNIHandle) return NULL; + oop result = NULL; + if (handle != NULL) { + result = resolve_impl(handle); + } return result; -}; - +} inline oop JNIHandles::resolve_non_null(jobject handle) { assert(handle != NULL, "JNI handle should not be null"); - oop result = *(oop*)handle; - assert(result != NULL, "Invalid value read from jni handle"); - assert(result != badJNIHandle, "Pointing to zapped jni handle area"); - // Don't let that private _deleted_handle object escape into the wild. - assert(result != deleted_handle(), "Used a deleted global handle."); + oop result = resolve_impl(handle); + assert(result != NULL, "NULL read from jni handle"); return result; -}; +} inline void JNIHandles::destroy_local(jobject handle) { if (handle != NULL) { - *((oop*)handle) = deleted_handle(); // Mark the handle as deleted, allocate will reuse it + jobject_ref(handle) = deleted_handle(); } } diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp index 29ad520e1f0..8c47a1c308a 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp @@ -181,13 +181,13 @@ void mutex_init() { } if (UseG1GC) { - def(SATB_Q_FL_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); - def(SATB_Q_CBL_mon , PaddedMonitor, nonleaf, true, Monitor::_safepoint_check_never); - def(Shared_SATB_Q_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_never); + def(SATB_Q_FL_lock , PaddedMutex , special , true, Monitor::_safepoint_check_never); + def(SATB_Q_CBL_mon , PaddedMonitor, leaf - 1 , true, Monitor::_safepoint_check_never); + def(Shared_SATB_Q_lock , PaddedMutex , leaf - 1 , true, Monitor::_safepoint_check_never); - def(DirtyCardQ_FL_lock , PaddedMutex , special, true, Monitor::_safepoint_check_never); - def(DirtyCardQ_CBL_mon , PaddedMonitor, nonleaf, true, Monitor::_safepoint_check_never); - def(Shared_DirtyCardQ_lock , PaddedMutex , nonleaf, true, Monitor::_safepoint_check_never); + def(DirtyCardQ_FL_lock , PaddedMutex , special , true, Monitor::_safepoint_check_never); + def(DirtyCardQ_CBL_mon , PaddedMonitor, leaf - 1 , true, Monitor::_safepoint_check_never); + def(Shared_DirtyCardQ_lock , PaddedMutex , leaf - 1 , true, Monitor::_safepoint_check_never); def(FreeList_lock , PaddedMutex , leaf , true, Monitor::_safepoint_check_never); def(SecondaryFreeList_lock , PaddedMonitor, leaf , true, Monitor::_safepoint_check_never); diff --git a/hotspot/src/share/vm/runtime/os_ext.hpp b/hotspot/src/share/vm/runtime/os_ext.hpp index 3aa733a322a..5fcaae13728 100644 --- a/hotspot/src/share/vm/runtime/os_ext.hpp +++ b/hotspot/src/share/vm/runtime/os_ext.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp index fb4b2ee63cc..68b895c5f05 100644 --- a/hotspot/src/share/vm/runtime/reflection.cpp +++ b/hotspot/src/share/vm/runtime/reflection.cpp @@ -594,9 +594,9 @@ char* Reflection::verify_class_access_msg(const Klass* current_class, current_class_name, module_from_name, new_class_name, module_to_name, module_from_name, module_to_name); } else { - jobject jlrm = module_to->module(); - assert(jlrm != NULL, "Null jlrm in module_to ModuleEntry"); - intptr_t identity_hash = JNIHandles::resolve(jlrm)->identity_hash(); + jobject jlm = module_to->module(); + assert(jlm != NULL, "Null jlm in module_to ModuleEntry"); + intptr_t identity_hash = JNIHandles::resolve(jlm)->identity_hash(); size_t len = 160 + strlen(current_class_name) + 2*strlen(module_from_name) + strlen(new_class_name) + 2*sizeof(uintx); msg = NEW_RESOURCE_ARRAY(char, len); @@ -621,9 +621,9 @@ char* Reflection::verify_class_access_msg(const Klass* current_class, current_class_name, module_from_name, new_class_name, module_to_name, module_to_name, package_name, module_from_name); } else { - jobject jlrm = module_from->module(); - assert(jlrm != NULL, "Null jlrm in module_from ModuleEntry"); - intptr_t identity_hash = JNIHandles::resolve(jlrm)->identity_hash(); + jobject jlm = module_from->module(); + assert(jlm != NULL, "Null jlm in module_from ModuleEntry"); + intptr_t identity_hash = JNIHandles::resolve(jlm)->identity_hash(); size_t len = 170 + strlen(current_class_name) + strlen(new_class_name) + 2*strlen(module_to_name) + strlen(package_name) + 2*sizeof(uintx); msg = NEW_RESOURCE_ARRAY(char, len); diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp index abdcab5684c..c5bf44f76ec 100644 --- a/hotspot/src/share/vm/runtime/thread.cpp +++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3409,9 +3409,16 @@ static void call_initPhase2(TRAPS) { Klass* k = SystemDictionary::resolve_or_fail(vmSymbols::java_lang_System(), true, CHECK); instanceKlassHandle klass (THREAD, k); - JavaValue result(T_VOID); + JavaValue result(T_INT); + JavaCallArguments args; + args.push_int(DisplayVMOutputToStderr); + args.push_int(log_is_enabled(Debug, init)); // print stack trace if exception thrown JavaCalls::call_static(&result, klass, vmSymbols::initPhase2_name(), - vmSymbols::void_method_signature(), CHECK); + vmSymbols::boolean_boolean_int_signature(), &args, CHECK); + if (result.get_jint() != JNI_OK) { + vm_exit_during_initialization(); // no message or exception + } + universe_post_module_init(); } @@ -3458,7 +3465,7 @@ void Threads::initialize_java_lang_classes(JavaThread* main_thread, TRAPS) { java_lang_Thread::RUNNABLE); // The VM creates objects of this class. - initialize_class(vmSymbols::java_lang_reflect_Module(), CHECK); + initialize_class(vmSymbols::java_lang_Module(), CHECK); // The VM preresolves methods to these classes. Make sure that they get initialized initialize_class(vmSymbols::java_lang_reflect_Method(), CHECK); diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp index 7d9a7b39e6e..1759e31dd64 100644 --- a/hotspot/src/share/vm/runtime/vframe.cpp +++ b/hotspot/src/share/vm/runtime/vframe.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -463,14 +463,15 @@ void interpretedVFrame::set_locals(StackValueCollection* values) const { entryVFrame::entryVFrame(const frame* fr, const RegisterMap* reg_map, JavaThread* thread) : externalVFrame(fr, reg_map, thread) {} - -void vframeStreamCommon::found_bad_method_frame() { +#ifdef ASSERT +void vframeStreamCommon::found_bad_method_frame() const { // 6379830 Cut point for an assertion that occasionally fires when // we are using the performance analyzer. // Disable this assert when testing the analyzer with fastdebug. // -XX:SuppressErrorAt=vframe.cpp:XXX (XXX=following line number) - assert(false, "invalid bci or invalid scope desc"); + fatal("invalid bci or invalid scope desc"); } +#endif // top-frame will be skipped vframeStream::vframeStream(JavaThread* thread, frame top_frame, diff --git a/hotspot/src/share/vm/runtime/vframe.hpp b/hotspot/src/share/vm/runtime/vframe.hpp index de7d510fc2d..40c43ad1824 100644 --- a/hotspot/src/share/vm/runtime/vframe.hpp +++ b/hotspot/src/share/vm/runtime/vframe.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -297,14 +297,14 @@ class vframeStreamCommon : StackObj { void fill_from_compiled_frame(int decode_offset); void fill_from_compiled_native_frame(); - void found_bad_method_frame(); - void fill_from_interpreter_frame(); bool fill_from_frame(); // Helper routine for security_get_caller_frame void skip_prefixed_method_and_wrappers(); + DEBUG_ONLY(void found_bad_method_frame() const;) + public: // Constructor vframeStreamCommon(JavaThread* thread) : _reg_map(thread, false) { @@ -407,9 +407,9 @@ inline void vframeStreamCommon::fill_from_compiled_frame(int decode_offset) { nm()->print_code(); nm()->print_pcs(); } + found_bad_method_frame(); #endif // Provide a cheap fallback in product mode. (See comment above.) - found_bad_method_frame(); fill_from_compiled_native_frame(); return; } @@ -523,7 +523,7 @@ inline void vframeStreamCommon::fill_from_interpreter_frame() { // In this scenario, pretend that the interpreter is at the point // of entering the method. if (bci < 0) { - found_bad_method_frame(); + DEBUG_ONLY(found_bad_method_frame();) bci = 0; } _mode = interpreted_mode; diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp index d5b9e3db03c..e054f01c6d9 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -199,6 +199,7 @@ typedef Hashtable KlassHashtable; typedef HashtableEntry KlassHashtableEntry; typedef TwoOopHashtable SymbolTwoOopHashtable; typedef CompactHashtable SymbolCompactHashTable; +typedef RehashableHashtable RehashableSymbolHashtable; //-------------------------------------------------------------------------------- // VM_STRUCTS @@ -584,6 +585,7 @@ typedef CompactHashtable SymbolCompactHashTable; \ static_field(SymbolTable, _the_table, SymbolTable*) \ static_field(SymbolTable, _shared_table, SymbolCompactHashTable) \ + static_field(RehashableSymbolHashtable, _seed, juint) \ \ /***************/ \ /* StringTable */ \ @@ -1602,6 +1604,8 @@ typedef CompactHashtable SymbolCompactHashTable; \ declare_toplevel_type(BasicHashtable) \ declare_type(IntptrHashtable, BasicHashtable) \ + declare_toplevel_type(BasicHashtable) \ + declare_type(RehashableSymbolHashtable, BasicHashtable) \ declare_type(SymbolTable, SymbolHashtable) \ declare_type(StringTable, StringHashtable) \ declare_type(LoaderConstraintTable, KlassHashtable) \ diff --git a/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp b/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp index 53fea3154b8..b9ac6a3ebf5 100644 --- a/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp +++ b/hotspot/src/share/vm/shark/sharkNativeWrapper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, 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. * @@ -300,6 +300,7 @@ void SharkNativeWrapper::initialize(const char *name) { not_null, merge); builder()->SetInsertPoint(not_null); +#error Needs to be updated for tagged jweak; see JNIHandles. Value *unboxed_result = builder()->CreateLoad(result); builder()->CreateBr(merge); diff --git a/hotspot/src/share/vm/utilities/debug.hpp b/hotspot/src/share/vm/utilities/debug.hpp index 3a4483e681e..dbb5dc63bfc 100644 --- a/hotspot/src/share/vm/utilities/debug.hpp +++ b/hotspot/src/share/vm/utilities/debug.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,6 +140,9 @@ do { \ // For backward compatibility. #define assert(p, ...) vmassert(p, __VA_ARGS__) +#ifndef ASSERT +#define vmassert_status(p, status, msg) +#else // This version of vmassert is for use with checking return status from // library calls that return actual error values eg. EINVAL, // ENOMEM etc, rather than returning -1 and setting errno. @@ -155,6 +158,7 @@ do { \ BREAKPOINT; \ } \ } while (0) +#endif // For backward compatibility. #define assert_status(p, status, msg) vmassert_status(p, status, msg) diff --git a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp index 623a8cbe6cf..1b216359d4c 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions_xlc.hpp @@ -1,6 +1,6 @@ /* * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2016 SAP SE. All rights reserved. + * Copyright (c) 2012, 2017 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -153,6 +153,9 @@ inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); } // offset_of as it is defined for gcc. #define offset_of(klass,field) (size_t)((intx)&(((klass*)16)->field) - 16) +// AIX 5.3 has buggy __thread support. (see JDK-8176442). +#define USE_LIBRARY_BASED_TLS_ONLY 1 + #ifndef USE_LIBRARY_BASED_TLS_ONLY #define THREAD_LOCAL_DECL __thread #endif diff --git a/hotspot/src/share/vm/utilities/hashtable.hpp b/hotspot/src/share/vm/utilities/hashtable.hpp index 51324a18c62..b29818b922e 100644 --- a/hotspot/src/share/vm/utilities/hashtable.hpp +++ b/hotspot/src/share/vm/utilities/hashtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -294,6 +294,7 @@ protected: }; template class RehashableHashtable : public Hashtable { + friend class VMStructs; protected: enum { diff --git a/hotspot/test/ProblemList.txt b/hotspot/test/ProblemList.txt index bf6811efb15..2c657d33705 100644 --- a/hotspot/test/ProblemList.txt +++ b/hotspot/test/ProblemList.txt @@ -73,12 +73,11 @@ runtime/SharedArchiveFile/DefaultUseWithClient.java 8154204 generic-all serviceability/jdwp/AllModulesCommandTest.java 8168478 generic-all serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all +serviceability/jvmti/ModuleAwareAgents/ClassFileLoadHook/MAAClassFileLoadHook.java 8173936 generic-all ############################################################################# # :hotspot_misc -testlibrary_tests/ctw/JarDirTest.java 8172457 windows-all - ############################################################################# diff --git a/hotspot/test/TEST.ROOT b/hotspot/test/TEST.ROOT index 54b61ac1406..fabc5e42672 100644 --- a/hotspot/test/TEST.ROOT +++ b/hotspot/test/TEST.ROOT @@ -50,8 +50,8 @@ requires.properties= \ vm.cpu.features \ vm.debug -# Tests using jtreg 4.2 b04 features -requiredVersion=4.2 b04 +# Tests using jtreg 4.2 b07 features +requiredVersion=4.2 b07 # Path to libraries in the topmost test directory. This is needed so @library # does not need ../../ notation to reach them @@ -59,3 +59,6 @@ external.lib.roots = ../../ # Use new module options useNewOptions=true + +# Use --patch-module instead of -Xmodule: +useNewPatchModule=true diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups index c50c741f44d..8953467a9b2 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups @@ -1,5 +1,5 @@ # -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -209,11 +209,8 @@ needs_full_vm_compact1 = \ gc/g1/TestShrinkToOneRegion.java \ gc/metaspace/G1AddMetaspaceDependency.java \ gc/startup_warnings/TestCMS.java \ - gc/startup_warnings/TestDefNewCMS.java \ gc/startup_warnings/TestParallelGC.java \ gc/startup_warnings/TestParallelScavengeSerialOld.java \ - gc/startup_warnings/TestParNewCMS.java \ - gc/startup_warnings/TestParNewSerialOld.java \ runtime/SharedArchiveFile/SharedArchiveFile.java # Minimal VM on Compact 2 adds in some compact2 tests diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java index b212fc3139c..18983b351c6 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSearchTest.java @@ -20,10 +20,19 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @modules jdk.aot/jdk.tools.jaotc + * jdk.aot/jdk.tools.jaotc.collect + * @run junit/othervm jdk.tools.jaotc.test.collect.ClassSearchTest + */ + package jdk.tools.jaotc.test.collect; import jdk.tools.jaotc.LoadedClass; +import jdk.tools.jaotc.collect.*; import org.junit.Assert; import org.junit.Test; @@ -32,45 +41,90 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.function.BiConsumer; +import java.util.function.BiFunction; public class ClassSearchTest { @Test(expected = InternalError.class) public void itShouldThrowExceptionIfNoProvidersAvailable() { ClassSearch target = new ClassSearch(); SearchPath searchPath = new SearchPath(); - target.search(list("foo"), searchPath); + target.search(list(new SearchFor("foo")), searchPath); } @Test public void itShouldFindAProviderForEachEntry() { Set searched = new HashSet<>(); ClassSearch target = new ClassSearch(); - target.addProvider(new SourceProvider() { - @Override - public ClassSource findSource(String name, SearchPath searchPath) { + target.addProvider(provider("", (name, searchPath) -> { searched.add(name); return new NoopSource(); - } - }); - target.search(list("foo", "bar", "foobar"), null); + })); + target.search(searchForList("foo", "bar", "foobar"), null); Assert.assertEquals(hashset("foo", "bar", "foobar"), searched); } + private SourceProvider provider(String supports, BiFunction fn) { + return new SourceProvider() { + @Override + public ClassSource findSource(String name, SearchPath searchPath) { + return fn.apply(name, searchPath); + } + + @Override + public boolean supports(String type) { + return supports.equals(type); + } + }; + } + @Test - public void itShouldSearchAllProviders() { + public void itShouldOnlySearchSupportedProvidersForKnownType() { Set visited = new HashSet<>(); ClassSearch target = new ClassSearch(); - target.addProvider((name, searchPath) -> { - visited.add("1"); + + target.addProvider(provider("jar", (name, searchPath) -> { + visited.add("jar"); return null; - }); - target.addProvider((name, searchPath) -> { - visited.add("2"); + })); + + target.addProvider(provider("dir", (name, searchPath) -> { + visited.add("dir"); return null; - }); + })); try { - target.search(list("foo"), null); + target.search(list(new SearchFor("some", "dir")), null); + } catch (InternalError e) { + // throws because no provider gives a source + } + + Assert.assertEquals(hashset("dir"), visited); + } + + @Test(expected = InternalError.class) + public void itShouldThrowErrorIfMultipleSourcesAreAvailable() { + ClassSearch target = new ClassSearch(); + target.addProvider(provider("", (name, searchPath) -> consumer -> Assert.fail())); + target.addProvider(provider("", (name, searchPath) -> consumer -> Assert.fail())); + + target.search(searchForList("somethign"), null); + } + + @Test + public void itShouldSearchAllProvidersForUnknownType() { + Set visited = new HashSet<>(); + ClassSearch target = new ClassSearch(); + target.addProvider(provider("", (name, searchPath) -> { + visited.add("1"); + return null; + })); + target.addProvider(provider("", (name, searchPath) -> { + visited.add("2"); + return null; + })); + + try { + target.search(searchForList("foo"), null); } catch (InternalError e) { // throws because no provider gives a source } @@ -84,6 +138,11 @@ public class ClassSearchTest { ClassSearch target = new ClassSearch(); target.addProvider(new SourceProvider() { + @Override + public boolean supports(String type) { + return true; + } + @Override public ClassSource findSource(String name, SearchPath searchPath) { return new ClassSource() { @@ -101,7 +160,7 @@ public class ClassSearchTest { } }); - java.util.List search = target.search(list("/tmp/something"), null); + java.util.List search = target.search(searchForList("/tmp/something"), null); Assert.assertEquals(list(new LoadedClass("foo.Bar", null)), search); } @@ -115,8 +174,16 @@ public class ClassSearchTest { }; ClassSearch target = new ClassSearch(); - target.addProvider((name, searchPath) -> consumer -> consumer.accept("foo.Bar", classLoader)); - target.search(list("foobar"), null); + target.addProvider(provider("", (name, searchPath) -> consumer -> consumer.accept("foo.Bar", classLoader))); + target.search(searchForList("foobar"), null); + } + + private List searchForList(String... entries) { + List list = new ArrayList<>(); + for (String entry : entries) { + list.add(new SearchFor(entry)); + } + return list; } private List list(T... entries) { diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java index 5fad5f57d76..ac9b8c9d12a 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/ClassSourceTest.java @@ -20,6 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @modules jdk.aot/jdk.tools.jaotc + * jdk.aot/jdk.tools.jaotc.collect + * @run junit/othervm jdk.tools.jaotc.test.collect.ClassSourceTest + */ + package jdk.tools.jaotc.test.collect; import org.junit.Assert; diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java index 178c3d47353..0e9011ac4f3 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeFileSupport.java @@ -27,6 +27,8 @@ import java.nio.file.Path; import java.util.HashSet; import java.util.Set; +import jdk.tools.jaotc.collect.FileSupport; + public class FakeFileSupport extends FileSupport { private final Set exists = new HashSet<>(); private final Set directories = new HashSet<>(); diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java index 9a7873ccf96..899d89f6228 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/FakeSearchPath.java @@ -22,6 +22,8 @@ */ package jdk.tools.jaotc.test.collect; +import jdk.tools.jaotc.collect.SearchPath; + import java.nio.file.FileSystem; import java.nio.file.Path; import java.nio.file.Paths; diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java index 8ceca8dc5cf..f3d3f56051d 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/SearchPathTest.java @@ -20,6 +20,17 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @modules jdk.aot/jdk.tools.jaotc + * jdk.aot/jdk.tools.jaotc.collect + * + * @build jdk.tools.jaotc.test.collect.Utils + * @build jdk.tools.jaotc.test.collect.FakeFileSupport + * @run junit/othervm jdk.tools.jaotc.test.collect.SearchPathTest + */ + package jdk.tools.jaotc.test.collect; import org.junit.Before; @@ -30,6 +41,8 @@ import java.nio.file.FileSystems; import java.nio.file.Path; import java.nio.file.Paths; +import jdk.tools.jaotc.collect.*; + import static jdk.tools.jaotc.test.collect.Utils.set; import static org.junit.Assert.*; diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java index 6608c01ab50..66ed4e234e2 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/directory/DirectorySourceProviderTest.java @@ -21,11 +21,22 @@ * questions. */ +/** + * @test + * @modules jdk.aot/jdk.tools.jaotc + * jdk.aot/jdk.tools.jaotc.collect + * jdk.aot/jdk.tools.jaotc.collect.directory + * @compile ../Utils.java + * @compile ../FakeFileSupport.java + * @run junit/othervm jdk.tools.jaotc.test.collect.directory.DirectorySourceProviderTest + */ + package jdk.tools.jaotc.test.collect.directory; import jdk.tools.jaotc.collect.ClassSource; +import jdk.tools.jaotc.collect.directory.DirectorySourceProvider; import jdk.tools.jaotc.test.collect.FakeFileSupport; -import jdk.tools.jaotc.test.collect.FileSupport; +import jdk.tools.jaotc.collect.FileSupport; import org.junit.Assert; import org.junit.Test; diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java index 14059883538..a6b687fdad4 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/jar/JarSourceProviderTest.java @@ -20,9 +20,23 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @modules jdk.aot/jdk.tools.jaotc + * jdk.aot/jdk.tools.jaotc.collect + * jdk.aot/jdk.tools.jaotc.collect.jar + * @compile ../Utils.java + * @compile ../FakeFileSupport.java + * @compile ../FakeSearchPath.java + * + * @run junit/othervm jdk.tools.jaotc.test.collect.jar.JarSourceProviderTest + */ + package jdk.tools.jaotc.test.collect.jar; import jdk.tools.jaotc.collect.ClassSource; +import jdk.tools.jaotc.collect.jar.JarSourceProvider; import jdk.tools.jaotc.test.collect.FakeFileSupport; import jdk.tools.jaotc.test.collect.FakeSearchPath; import org.junit.Assert; diff --git a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java index 80f06913269..b8a44041b19 100644 --- a/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java +++ b/hotspot/test/compiler/aot/jdk.tools.jaotc.test/src/jdk/tools/jaotc/test/collect/module/ModuleSourceProviderTest.java @@ -20,15 +20,31 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + +/** + * @test + * @modules jdk.aot/jdk.tools.jaotc + * jdk.aot/jdk.tools.jaotc.collect + * jdk.aot/jdk.tools.jaotc.collect.module + * @compile ../Utils.java + * @run junit/othervm jdk.tools.jaotc.test.collect.module.ModuleSourceProviderTest + */ + package jdk.tools.jaotc.test.collect.module; -import jdk.tools.jaotc.*; -import jdk.tools.jaotc.test.collect.FakeSearchPath; +import jdk.tools.jaotc.collect.FileSupport; +import jdk.tools.jaotc.collect.module.ModuleSource; +import jdk.tools.jaotc.collect.module.ModuleSourceProvider; import jdk.tools.jaotc.test.collect.Utils; import org.junit.Before; import org.junit.Test; +import java.io.IOException; +import java.nio.file.FileSystem; import java.nio.file.FileSystems; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.function.BiFunction; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; @@ -36,28 +52,42 @@ import static org.junit.Assert.assertNull; public class ModuleSourceProviderTest { private ClassLoader classLoader; private ModuleSourceProvider target; + private FileSupport fileSupport; + private BiFunction getSubDirectory = null; @Before public void setUp() { classLoader = new FakeClassLoader(); - target = new ModuleSourceProvider(FileSystems.getDefault(), classLoader); + fileSupport = new FileSupport() { + + @Override + public boolean isDirectory(Path path) { + return true; + } + + @Override + public Path getSubDirectory(FileSystem fileSystem, Path root, Path path) throws IOException { + if (getSubDirectory == null) { + throw new IOException("Nope"); + } + return getSubDirectory.apply(root, path); + } + }; + target = new ModuleSourceProvider(FileSystems.getDefault(), classLoader, fileSupport); } @Test - public void itShouldUseSearchPath() { - FakeSearchPath searchPath = new FakeSearchPath("blah/java.base"); - ModuleSource source = (ModuleSource) target.findSource("java.base", searchPath); - assertEquals(Utils.set("java.base"), searchPath.entries); - assertEquals("blah/java.base", source.getModulePath().toString()); - assertEquals("module:blah/java.base", source.toString()); - } + public void itShouldUseFileSupport() { + getSubDirectory = (root, path) -> { + if (root.toString().equals("modules") && path.toString().equals("test.module")) { + return Paths.get("modules/test.module"); + } + return null; + }; - @Test - public void itShouldReturnNullIfSearchPathReturnsNull() { - FakeSearchPath searchPath = new FakeSearchPath(null); - ModuleSource source = (ModuleSource) target.findSource("jdk.base", searchPath); - assertEquals(Utils.set("jdk.base"), searchPath.entries); - assertNull(source); + ModuleSource source = (ModuleSource) target.findSource("test.module", null); + assertEquals("modules/test.module", source.getModulePath().toString()); + assertEquals("module:modules/test.module", source.toString()); } private static class FakeClassLoader extends ClassLoader { diff --git a/hotspot/test/compiler/arraycopy/TestDefaultMethodArrayCloneDeoptC2.java b/hotspot/test/compiler/arraycopy/TestDefaultMethodArrayCloneDeoptC2.java new file mode 100644 index 00000000000..c4100ad2f80 --- /dev/null +++ b/hotspot/test/compiler/arraycopy/TestDefaultMethodArrayCloneDeoptC2.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8170455 + * @summary C2: Access to [].clone from interfaces fails. + * @library /test/lib / + * + * @requires vm.flavor == "server" & !vm.emulatedClient + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xcomp -Xbatch -Xbootclasspath/a:. -XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:CompileCommand=compileonly,*TestDefaultMethodArrayCloneDeoptC2Interface::test + * compiler.arraycopy.TestDefaultMethodArrayCloneDeoptC2 + */ + +package compiler.arraycopy; + +import sun.hotspot.WhiteBox; +import java.lang.reflect.Method; +import compiler.whitebox.CompilerWhiteBoxTest; + + + +interface TestDefaultMethodArrayCloneDeoptC2Interface { + default int[] test(int[] arr) { + return arr.clone(); + } + + default TDMACDC2InterfaceTypeTest[] test(TDMACDC2InterfaceTypeTest[] arr) { + return arr.clone(); + } + + default TDMACDC2ClassTypeTest[] test(TDMACDC2ClassTypeTest[] arr) { + return arr.clone(); + } +} + +public class TestDefaultMethodArrayCloneDeoptC2 implements TestDefaultMethodArrayCloneDeoptC2Interface { + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + public static TestDefaultMethodArrayCloneDeoptC2 a = new TestDefaultMethodArrayCloneDeoptC2(); + + public static void main(String[] args) throws Exception { + testPrimitiveArr(); + testIntfArr(); + testClassArr(); + } + + public static void testPrimitiveArr() throws Exception { + Method m = TestDefaultMethodArrayCloneDeoptC2Interface.class.getMethod("test", int[].class); + a.test(new int[1]); // Compiled + a.test(new int[1]); + if (!WB.isMethodCompiled(m)) { + WB.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + } + a.test(new int[1]); + if (!WB.isMethodCompiled(m)) { + throw new Exception("Method should be compiled"); + } + } + + public static void testIntfArr() throws Exception { + Method m = TestDefaultMethodArrayCloneDeoptC2Interface.class.getMethod("test", TDMACDC2InterfaceTypeTest[].class); + a.test(new TDMACDC2InterfaceTypeTest[1]); // Compiled, Decompile unloaded + a.test(new TDMACDC2InterfaceTypeTest[1]); // Compiled + a.test(new TDMACDC2InterfaceTypeTest[1]); + if (!WB.isMethodCompiled(m)) { + WB.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + } + a.test(new TDMACDC2InterfaceTypeTest[1]); + if (!WB.isMethodCompiled(m)) { + throw new Exception("Method should be compiled"); + } + } + + public static void testClassArr() throws Exception { + Method m = TestDefaultMethodArrayCloneDeoptC2Interface.class.getMethod("test", TDMACDC2ClassTypeTest[].class); + a.test(new TDMACDC2ClassTypeTest[1]); // Compiled, Decompile unloaded + a.test(new TDMACDC2ClassTypeTest[1]); // Compiled + a.test(new TDMACDC2ClassTypeTest[1]); + if (!WB.isMethodCompiled(m)) { + WB.enqueueMethodForCompilation(m, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); + } + a.test(new TDMACDC2ClassTypeTest[1]); + if (!WB.isMethodCompiled(m)) { + throw new Exception("Method should be compiled"); + } + } +} + +interface TDMACDC2InterfaceTypeTest { +} + +class TDMACDC2ClassTypeTest { +} + diff --git a/jdk/test/demo/jvmti/gctest/BigHello.java b/hotspot/test/compiler/arraycopy/TestObjectArrayCopy.java similarity index 59% rename from jdk/test/demo/jvmti/gctest/BigHello.java rename to hotspot/test/compiler/arraycopy/TestObjectArrayCopy.java index b08643a5849..0cc8475692b 100644 --- a/jdk/test/demo/jvmti/gctest/BigHello.java +++ b/hotspot/test/compiler/arraycopy/TestObjectArrayCopy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, SAP SE and/or its affiliates. All rights reserved. * 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,27 +21,30 @@ * questions. */ - /* + * @test + * @bug 8176505 + * @summary Wrong assertion 'should be an array copy/clone' in arraycopynode.cpp * - * Sample target application for gctest demo + * @run main/othervm -Xbatch -XX:-UseOnStackReplacement compiler.arraycopy.TestObjectArrayCopy * + * @author Volker Simonis */ -public class BigHello { - private final static int NLOOPS = 20000; - private static Object garbage[]; - public static void main(String args[]) { - long count = 0; - System.out.println("Big Hello start"); - for(int i=1; i<=NLOOPS; i++) { - count += i; - garbage = new Object[i]; - garbage[0] = new Object(); +package compiler.arraycopy; + +public class TestObjectArrayCopy { + + public static boolean crash(Object src) { + String[] dst = new String[1]; + System.arraycopy(src, 0, dst, 0, 1); + return dst[0] == null; + } + + public static void main(String[] args) { + String[] sa = new String[1]; + for (int i = 0; i < 20_000; i++) { + crash(sa); } - System.out.println("Allocated " + count + - " array elements, and " + NLOOPS + - " arrays and Objects."); - System.out.println("Big Hello end"); } } diff --git a/hotspot/test/compiler/c1/TestUnresolvedField.jasm b/hotspot/test/compiler/c1/TestUnresolvedField.jasm new file mode 100644 index 00000000000..e6c2ae4de2b --- /dev/null +++ b/hotspot/test/compiler/c1/TestUnresolvedField.jasm @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 compiler/c1/TestUnresolvedField version 52:0 { + public static Method testGetField:"()V" stack 1 locals 1 { + aconst_null; + getfield Field T.f:I; // T does not exist + return; + } + + public static Method testPutField:"()V" stack 2 locals 1 { + aconst_null; + iconst_0; + putfield Field T.f:I; // T does not exist + return; + } +} diff --git a/jdk/test/sun/security/krb5/auto/BadKdc3.java b/hotspot/test/compiler/c1/TestUnresolvedFieldMain.java similarity index 61% rename from jdk/test/sun/security/krb5/auto/BadKdc3.java rename to hotspot/test/compiler/c1/TestUnresolvedFieldMain.java index 4bafd9a2ffe..040f1b17be6 100644 --- a/jdk/test/sun/security/krb5/auto/BadKdc3.java +++ b/hotspot/test/compiler/c1/TestUnresolvedFieldMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * 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,26 @@ /* * @test - * @bug 6843127 - * @run main/othervm/timeout=300 BadKdc3 - * @summary krb5 should not try to access unavailable kdc too often + * @bug 8173373 + * @compile TestUnresolvedField.jasm + * @run main/othervm -XX:TieredStopAtLevel=1 -Xcomp + * -XX:CompileCommand=compileonly,compiler.c1.TestUnresolvedField::test* + * compiler.c1.TestUnresolvedFieldMain */ -import java.io.*; -import java.security.Security; +package compiler.c1; -public class BadKdc3 { - - public static void main(String[] args) - throws Exception { - Security.setProperty("krb5.kdc.bad.policy", "tryLast"); - BadKdc.go( - "121212222222(32){2,4}", // 1 2 - "(32){2,4}", // 1 2 - // refresh - "121212222222(32){2,4}", // 1 2 - // k3 off k2 on - "323232121212(22){2,4}", // 1 3 - // k1 on - "(22){2,4}" // 1 3 - ); +public class TestUnresolvedFieldMain { + public static void main(String[] args) { + try { + TestUnresolvedField.testGetField(); + } catch (java.lang.NoClassDefFoundError error) { + // Expected + } + try { + TestUnresolvedField.testPutField(); + } catch (java.lang.NoClassDefFoundError error) { + // Expected + } } } diff --git a/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java b/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java new file mode 100644 index 00000000000..b10c4a6285c --- /dev/null +++ b/hotspot/test/compiler/c1/UnsafeVolatileGuardTest.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017, Red Hat Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.lang.reflect.Field; + +/** + * @test + * @bug 8175887 + * @summary C1 value numbering handling of Unsafe.get*Volatile is incorrect + * @modules java.base/jdk.internal.misc + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 UnsafeVolatileGuardTest + */ +public class UnsafeVolatileGuardTest { + volatile static private int a; + static private int b; + + static final jdk.internal.misc.Unsafe UNSAFE = jdk.internal.misc.Unsafe.getUnsafe(); + + static final Object BASE; + static final long OFFSET; + + static { + try { + Field f = UnsafeVolatileGuardTest.class.getDeclaredField("a"); + BASE = UNSAFE.staticFieldBase(f); + OFFSET = UNSAFE.staticFieldOffset(f); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + static void test() { + int tt = b; // makes the JVM CSE the value of b + + while (UNSAFE.getIntVolatile(BASE, OFFSET) == 0) {} // burn + if (b == 0) { + System.err.println("wrong value of b"); + System.exit(1); // fail hard to report the error + } + } + + public static void main(String [] args) throws Exception { + for (int i = 0; i < 10; i++) { + new Thread(UnsafeVolatileGuardTest::test).start(); + } + b = 1; + a = 1; + } +} diff --git a/jdk/test/demo/jvmti/gctest/Gctest.java b/hotspot/test/compiler/c1/VolatileGuardTest.java similarity index 55% rename from jdk/test/demo/jvmti/gctest/Gctest.java rename to hotspot/test/compiler/c1/VolatileGuardTest.java index 2683cf2bc89..44b603160ad 100644 --- a/jdk/test/demo/jvmti/gctest/Gctest.java +++ b/hotspot/test/compiler/c1/VolatileGuardTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Red Hat Inc. All rights reserved. * 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,32 @@ * questions. */ - -/* @test - * @bug 5027764 - * @summary Test jvmti demo gctest +/** + * @test + * @bug 8175887 + * @summary C1 doesn't respect the JMM with volatile field loads * - * @compile ../DemoRun.java - * @build BigHello Gctest - * @run main Gctest BigHello + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:TieredStopAtLevel=1 VolatileGuardTest */ +public class VolatileGuardTest { + volatile static private int a; + static private int b; -public class Gctest { + static void test() { + int tt = b; // makes the JVM CSE the value of b - public static void main(String args[]) throws Exception { - DemoRun demo; - - /* Run demo that uses JVMTI gctest agent (no options) */ - demo = new DemoRun("gctest", "" /* options to gctest */ ); - demo.runit(args[0]); - - /* Make sure patterns in output look ok */ - if (demo.output_contains("ERROR")) { - throw new RuntimeException("Test failed - ERROR seen in output"); + while (a == 0) {} // burn + if (b == 0) { + System.err.println("wrong value of b"); + System.exit(1); // fail hard to report the error } + } - /* Must be a pass. */ - System.out.println("Test passed - cleanly terminated"); + public static void main(String [] args) throws Exception { + for (int i = 0; i < 10; i++) { + new Thread(VolatileGuardTest::test).start(); + } + b = 1; + a = 1; } } diff --git a/hotspot/test/compiler/c2/TestNPEHeapBased.java b/hotspot/test/compiler/c2/TestNPEHeapBased.java new file mode 100644 index 00000000000..0fdb5d3da37 --- /dev/null +++ b/hotspot/test/compiler/c2/TestNPEHeapBased.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8176518 + * @summary Invalid ImplicitNullChecks when heap base not protected + * + * @run main/othervm -XX:ObjectAlignmentInBytes=16 -XX:HeapBaseMinAddress=64g + * -XX:-TieredCompilation -Xbatch + * compiler.c2.TestNPEHeapBased + * @requires vm.bits == "64" + */ + +package compiler.c2; +public class TestNPEHeapBased { + + TestNPEHeapBased instance = null; + int i = 0; + + public void set_i(int value) { + instance.i = value; + } + + + static final int loop_cnt = 200000; + + public static void main(String args[]){ + TestNPEHeapBased xyz = new TestNPEHeapBased(); + xyz.instance = xyz; + for (int x = 0; x < loop_cnt; x++) xyz.set_i(x); + xyz.instance = null; + try { + xyz.set_i(0); + } catch (NullPointerException npe) { + System.out.println("Got expected NullPointerException:"); + npe.printStackTrace(); + return; + } + throw new InternalError("NullPointerException is missing!"); + } + +} diff --git a/hotspot/test/compiler/c2/TestReplacedNodesOSR.java b/hotspot/test/compiler/c2/TestReplacedNodesOSR.java new file mode 100644 index 00000000000..926295e496e --- /dev/null +++ b/hotspot/test/compiler/c2/TestReplacedNodesOSR.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2017, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8174164 + * @summary SafePointNode::_replaced_nodes breaks with irreducible loops + * @run main/othervm -XX:-BackgroundCompilation TestReplacedNodesOSR + * + */ + +public class TestReplacedNodesOSR { + + static Object dummy; + + static interface I { + } + + static class A implements I { + } + + static final class MyException extends Exception { + } + + static final A obj = new A(); + static I static_field() { return obj; } + + // When OSR compiled, this method has an irreducible loop + static void test(int v, MyException e) { + int i = 0; + for (;;) { + if (i == 1000) { + break; + } + try { + if ((i%2) == 0) { + int j = 0; + for (;;) { + j++; + if (i+j != v) { + if (j == 1000) { + break; + } + } else { + A a = (A)static_field(); + // replaced node recorded here + throw e; + } + } + } + } catch(MyException ex) { + } + i++; + // replaced node applied on return of the method + // replaced node used here + dummy = static_field(); + } + } + + + static public void main(String[] args) { + for (int i = 0; i < 1000; i++) { + test(1100, new MyException()); + } + } +} diff --git a/hotspot/test/compiler/c2/cr7200264/TestDriver.java b/hotspot/test/compiler/c2/cr7200264/TestDriver.java index 558592ba693..bc8a987ffb2 100644 --- a/hotspot/test/compiler/c2/cr7200264/TestDriver.java +++ b/hotspot/test/compiler/c2/cr7200264/TestDriver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 compiler.c2.cr7200264; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.regex.Pattern; import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; @@ -45,7 +44,7 @@ public class TestDriver { } private List executeApplication() throws Throwable { - OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvmAllArgs( + OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm( "-Xbatch", "-XX:-TieredCompilation", "-XX:+PrintCompilation", diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java index 4c81223b565..5009ba634bf 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeDynamic2NativeTest.java @@ -32,10 +32,10 @@ * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeDynamic * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeDynamic * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java index 2544b4cc3d8..3387d3e800d 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeInterface2NativeTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeInterface * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeInterface * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java index 301811399c2..4948890a985 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeSpecial2NativeTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java index a40d9d41090..563c4c4091f 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeStatic2NativeTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java index c82f056bd24..4a1f046583e 100644 --- a/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java +++ b/hotspot/test/compiler/calls/fromCompiled/CompiledInvokeVirtual2NativeTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -compileCaller 1 -checkCallerCompileLevel 1 -nativeCallee - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -compileCaller 4 -checkCallerCompileLevel 4 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java index 1d5ac09b6c1..b59a4f96ff9 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeDynamic2NativeTest.java @@ -32,7 +32,7 @@ * @run main compiler.calls.common.InvokeDynamicPatcher * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeDynamic::caller compiler.calls.common.InvokeDynamic * -checkCallerCompileLevel 0 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java index b03e5bd5ec2..63ab11a5a47 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeInterface2NativeTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeInterface::caller compiler.calls.common.InvokeInterface * -checkCallerCompileLevel 0 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java index 8593ebc2551..c7dda1f3faa 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeSpecial2NativeTest.java @@ -30,7 +30,7 @@ * @build compiler.calls.common.InvokeSpecial * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::caller compiler.calls.common.InvokeSpecial * -checkCallerCompileLevel 0 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java index a17e9c5c2a7..ca2613b14a2 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeStatic2NativeTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::caller compiler.calls.common.InvokeStatic * -checkCallerCompileLevel 0 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java index 9ebf7a359c8..c983efd890f 100644 --- a/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java +++ b/hotspot/test/compiler/calls/fromInterpreted/InterpretedInvokeVirtual2NativeTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::caller compiler.calls.common.InvokeVirtual * -checkCallerCompileLevel 0 -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java index 74007716168..1ddea48c639 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2CompiledTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeSpecial * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java index 4efd098904d..961daf545bd 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2InterpretedTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeSpecial::callee compiler.calls.common.InvokeSpecial * -nativeCaller -checkCalleeCompileLevel 0 */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java index 1005783754c..bde00f6da43 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeSpecial2NativeTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * compiler.calls.common.InvokeSpecial * -nativeCaller -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java index f1f0634e9f0..f86ca89896c 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2CompiledTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeStatic * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java index fc0a0592072..fff52824542 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2InterpretedTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeStatic::callee compiler.calls.common.InvokeStatic * -nativeCaller -checkCalleeCompileLevel 0 */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java index f9da3d65c98..3d106fdf12b 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeStatic2NativeTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * compiler.calls.common.InvokeStatic * -nativeCaller -nativeCallee */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java index b6cce29b413..7b744249c3c 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2CompiledTest.java @@ -30,10 +30,10 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -nativeCaller -compileCallee 1 -checkCalleeCompileLevel 1 - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -Xbatch compiler.calls.common.InvokeVirtual * -nativeCaller -compileCallee 4 -checkCalleeCompileLevel 4 */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java index 270ecfa6f35..43be4d49c4e 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2InterpretedTest.java @@ -30,7 +30,7 @@ * * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * -XX:CompileCommand=exclude,compiler.calls.common.InvokeVirtual::callee compiler.calls.common.InvokeVirtual * -nativeCaller -checkCalleeCompileLevel 0 */ diff --git a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java index 83564c143b2..9b9fe1a44df 100644 --- a/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java +++ b/hotspot/test/compiler/calls/fromNative/NativeInvokeVirtual2NativeTest.java @@ -30,7 +30,7 @@ * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. * compiler.calls.common.InvokeVirtual * -nativeCaller -nativeCallee */ diff --git a/hotspot/test/compiler/ciReplay/SABase.java b/hotspot/test/compiler/ciReplay/SABase.java index 0354835b8f9..57690848489 100644 --- a/hotspot/test/compiler/ciReplay/SABase.java +++ b/hotspot/test/compiler/ciReplay/SABase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +141,7 @@ public class SABase extends CiReplayBase { if (Platform.isSolaris()) { try { OutputAnalyzer oa = ProcessTools.executeProcess("coreadm", "-p", "core", - "" + ProcessHandle.current().getPid()); + "" + ProcessHandle.current().pid()); oa.shouldHaveExitValue(0); } catch (Throwable t) { throw new Error("Can't launch coreadm: " + t, t); diff --git a/hotspot/test/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java b/hotspot/test/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java new file mode 100644 index 00000000000..52ccab6aff8 --- /dev/null +++ b/hotspot/test/compiler/codecache/stress/ReturnBlobToWrongHeapTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 ReturnBlobToWrongHeapTest + * @key stress + * @summary Test if VM attempts to return code blobs to an incorrect code heap or to outside of the code cache. + * @library /test/lib / + * @modules java.base/jdk.internal.misc + * java.management + * + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI + * -XX:CompileCommand=dontinline,compiler.codecache.stress.Helper$TestCase::method + * -XX:+SegmentedCodeCache + * -XX:ReservedCodeCacheSize=16M + * -XX:CodeCacheMinBlockLength=1 + * compiler.codecache.stress.ReturnBlobToWrongHeapTest + */ + +package compiler.codecache.stress; + +import sun.hotspot.code.BlobType; + +import java.util.ArrayList; + +public class ReturnBlobToWrongHeapTest { + private static final long largeBlobSize = Helper.WHITE_BOX.getUintxVMFlag("ReservedCodeCacheSize") >> 6; + private static final long codeCacheMinBlockLength = Helper.WHITE_BOX.getUintxVMFlag("CodeCacheMinBlockLength"); + private static final BlobType[] BLOB_TYPES = BlobType.getAvailable().toArray(new BlobType[0]); + + // Allocate blob in first code heap (the code heap with index 0). + private static long allocate(int size) { + return Helper.WHITE_BOX.allocateCodeBlob(size, BLOB_TYPES[0].id); + } + + // Free blob. + private static void free(long address) { + Helper.WHITE_BOX.freeCodeBlob(address); + } + + public static void main(String[] args) { + if (codeCacheMinBlockLength == 1) { + // Fill first code heap with large blobs until allocation fails. + long address; + while ((address = allocate((int)largeBlobSize)) != 0) { + } + + // Allocate segment-sized blocks in first code heap. + long lastSegmentSizedAddress = 0; // Address of the last segment-sized blob allocated + while ((address = allocate(0)) != 0) { + lastSegmentSizedAddress = address; + } + + if (lastSegmentSizedAddress == 0) { + throw new RuntimeException("Test failed: Not possible to allocate segment-sized blob"); + } + + // Remove last segment-sized block from the first code heap. + free(lastSegmentSizedAddress); + } else { + throw new RuntimeException("Test requires CodeCacheMinBlockLength==1; CodeCacheMinBlockLength is " + + codeCacheMinBlockLength); + } + } +} diff --git a/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java b/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java index fbd3f13259b..19ebd612e7c 100644 --- a/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java +++ b/hotspot/test/compiler/compilercontrol/share/scenario/Executor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 compiler.compilercontrol.share.scenario; import compiler.compilercontrol.share.actions.BaseAction; import jdk.test.lib.Asserts; +import jdk.test.lib.management.InputArguments; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.dcmd.CommandExecutor; @@ -38,6 +39,7 @@ import java.lang.reflect.Executable; import java.net.ServerSocket; import java.net.Socket; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; @@ -97,9 +99,13 @@ public class Executor { // Start separate thread to connect with test VM new Thread(() -> connectTestVM(serverSocket)).start(); } - // Start test VM - output = ProcessTools.executeTestJvmAllArgs( - vmOptions.toArray(new String[vmOptions.size()])); + // Start a test VM using vm flags from @run and from vm options + String[] vmInputArgs = InputArguments.getVmInputArgs(); + String[] cmds = Arrays.copyOf(vmInputArgs, + vmInputArgs.length + vmOptions.size()); + System.arraycopy(vmOptions.toArray(), 0, cmds, vmInputArgs.length, + vmOptions.size()); + output = ProcessTools.executeTestJvm(cmds); } catch (Throwable thr) { throw new Error("Execution failed: " + thr.getMessage(), thr); } diff --git a/hotspot/test/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java b/hotspot/test/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java new file mode 100644 index 00000000000..86de75132ea --- /dev/null +++ b/hotspot/test/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java @@ -0,0 +1,320 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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 8158168 + * @summary Verifies that callers of StringUTF16 intrinsics throw array out of bounds exceptions. + * @library /compiler/patches /test/lib + * @build java.base/java.lang.Helper + * @run main/othervm -Xbatch -XX:CompileThreshold=100 -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_getCharStringU,_putCharStringU compiler.intrinsics.string.TestStringUTF16IntrinsicRangeChecks + * @run main/othervm -Xbatch -XX:CompileThreshold=100 -esa -ea -XX:+UnlockDiagnosticVMOptions -XX:DisableIntrinsic=_getCharStringU,_putCharStringU compiler.intrinsics.string.TestStringUTF16IntrinsicRangeChecks + */ +package compiler.intrinsics.string; + +import java.lang.reflect.Field; +import java.util.Arrays; + +public class TestStringUTF16IntrinsicRangeChecks { + + public static void main(String[] args) throws Exception { + byte[] val = new byte[2]; + byte[] b4 = new byte[4]; + char[] c4 = new char[4]; + String s4 = new String(c4); + byte[] valHigh = new byte[2]; + byte[] valLow = new byte[2]; + Helper.putCharSB(valHigh, 0, Character.MIN_HIGH_SURROGATE); + Helper.putCharSB(valLow, 0, Character.MIN_LOW_SURROGATE); + + for (int i = 0; i < 1000; ++i) { + getChars((int)1234, -5, -5 + 4, val); + getChars((int)1234, -1, -1 + 4, val); + getChars((int)1234, 0, 0 + 4, val); + getChars((int)1234, 1, 1 + 4, val); + + getChars((long)1234, -5, -5 + 4, val); + getChars((long)1234, -1, -1 + 4, val); + getChars((long)1234, 0, 0 + 4, val); + getChars((long)1234, 1, 1 + 4, val); + + byte[] val2 = Arrays.copyOf(val, val.length); + putCharSB(val2, -1, '!'); + putCharSB(val2, 1, '!'); + + byte[] val4 = Arrays.copyOf(b4, b4.length); + char[] c2 = new char[2]; + String s2 = new String(c2); + + putCharsSB(val4, -3, c2, 0, 2); + putCharsSB(val4, -1, c2, 0, 2); + putCharsSB(val4, 0, c4, 0, 4); + putCharsSB(val4, 1, c2, 0, 2); + putCharsSB(val4, -3, s2, 0, 2); + putCharsSB(val4, -1, s2, 0, 2); + putCharsSB(val4, 0, s4, 0, 4); + putCharsSB(val4, 1, s2, 0, 2); + + codePointAtSB(valHigh, -1, 1); + codePointAtSB(valHigh, -1, 2); + codePointAtSB(valHigh, 0, 2); + codePointAtSB(valHigh, 1, 2); + + codePointBeforeSB(valLow, 0); + codePointBeforeSB(valLow, -1); + codePointBeforeSB(valLow, 2); + + if (Helper.codePointCountSB(valHigh, 0, 1) != 1) { + throw new AssertionError("codePointCountSB"); + } + if (Helper.codePointCountSB(valLow, 0, 1) != 1) { + throw new AssertionError("codePointCountSB"); + } + codePointCountSB(valHigh, -1, 0); + codePointCountSB(valHigh, -1, 2); + codePointCountSB(valHigh, 0, 2); + + charAt(val, -1); + charAt(val, 1); + + contentEquals(b4, val, -1); + contentEquals(b4, val, 2); + contentEquals(val, s4, 2); + contentEquals(val, s4, -1); + + StringBuilder sb = new StringBuilder(); + sb.append((String)null).append(true).append(false); + if (!sb.toString().equals("nulltruefalse")) { + throw new AssertionError("append"); + } + + putCharsAt(val2, -1, '1', '2', '3', '4'); + putCharsAt(val2, 0, '1', '2', '3', '4'); + putCharsAt(val2, 2, '1', '2', '3', '4'); + putCharsAt(val2, -1, '1', '2', '3', '4', '5'); + putCharsAt(val2, 0, '1', '2', '3', '4', '5'); + putCharsAt(val2, 2, '1', '2', '3', '4', '5'); + + reverse(valHigh, -1); + reverse(valHigh, 2); + reverse(valLow, -1); + reverse(valLow, 2); + + byte[] d4 = new byte[4]; + inflate(b4, 0, d4, -1, 2); + inflate(b4, 0, d4, 3, 2); + inflate(b4, 0, d4, 4, 1); + + byte[] b0 = new byte[0]; + byte[] b1 = new byte[1]; + byte[] b2 = new byte[2]; + byte[] t1 = new byte[] {1}; + byte[] t2 = new byte[] {1, 2}; + byte[] t4 = new byte[] {1, 2, 3, 4}; + indexOf(b1, 1, t2, 1, 0); + indexOf(b2, 1, t1, 1, 0); + indexOf(b2, 2, t2, 1, 0); + indexOf(b2, 1, t2, 2, 0); + indexOf(b2, -1, t2, 1, 0); + indexOf(b2, 1, t2, -1, 0); + indexOf(b2, 1, t2, 1, 1); + + indexOfLatin1(b1, 1, t1, 1, 0); + indexOfLatin1(b2, 2, t1, 1, 0); + indexOfLatin1(b2, 1, b0, 1, 0); + indexOfLatin1(b2, 1, t1, 2, 0); + indexOfLatin1(b2, -1, t1, 1, 0); + indexOfLatin1(b2, 2, t1, 1, 0); + indexOfLatin1(b2, 1, t1, -1, 0); + indexOfLatin1(b2, 1, t1, 2, 0); + + lastIndexOf(b1, t2, 1, 0); + lastIndexOf(b2, t4, 2, 0); + lastIndexOf(b2, t2, 1, 0); + lastIndexOf(b2, t2, 1, 1); + + lastIndexOfLatin1(b1, t1, 1, 0); + lastIndexOfLatin1(b2, t2, 2, 0); + lastIndexOfLatin1(b2, t1, 1, 0); + lastIndexOfLatin1(b2, t1, 1, 1); + } + } + + static void getChars(int i, int begin, int end, byte[] value) { + try { + Helper.getChars(i, begin, end, value); + throw new AssertionError("getChars"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void getChars(long l, int begin, int end, byte[] value) { + try { + Helper.getChars(l, begin, end, value); + throw new AssertionError("getChars"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void putCharSB(byte[] val, int index, int c) { + try { + Helper.putCharSB(val, index, c); + throw new AssertionError("putCharSB"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void putCharsSB(byte[] val, int index, char[] ca, int off, int end) { + try { + Helper.putCharsSB(val, index, ca, off, end); + throw new AssertionError("putCharsSB"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void putCharsSB(byte[] val, int index, CharSequence s, int off, int end) { + try { + Helper.putCharsSB(val, index, s, off, end); + throw new AssertionError("putCharsSB"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void codePointAtSB(byte[] val, int index, int end) { + try { + Helper.codePointAtSB(val, index, end); + throw new AssertionError("codePointAtSB"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void codePointBeforeSB(byte[] val, int index) { + try { + Helper.codePointBeforeSB(val, index); + throw new AssertionError("codePointBeforeSB"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void codePointCountSB(byte[] val, int beginIndex, int endIndex) { + try { + Helper.codePointCountSB(val, beginIndex, endIndex); + throw new AssertionError("codePointCountSB"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void charAt(byte[] v, int index) { + try { + Helper.charAt(v, index); + throw new AssertionError("charAt"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void contentEquals(byte[] v1, byte[] v2, int len) { + try { + Helper.contentEquals(v1, v2, len); + throw new AssertionError("contentEquals"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void contentEquals(byte[] v, CharSequence cs, int len) { + try { + Helper.contentEquals(v, cs, len); + throw new AssertionError("contentEquals"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void putCharsAt(byte[] v, int i, char c1, char c2, char c3, char c4) { + try { + Helper.putCharsAt(v, i, c1, c2, c3, c4); + throw new AssertionError("putCharsAt"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void putCharsAt(byte[] v, int i, char c1, char c2, char c3, char c4, char c5) { + try { + Helper.putCharsAt(v, i, c1, c2, c3, c4, c5); + throw new AssertionError("putCharsAt"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void reverse(byte[] v, int len) { + try { + Helper.reverse(v, len); + throw new AssertionError("reverse"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void inflate(byte[] v1, int o1, byte[] v2, int o2, int len) { + try { + Helper.inflate(v1, o1, v2, o2, len); + throw new AssertionError("inflate"); + } catch (IndexOutOfBoundsException io) { + } + } + + static void indexOf(byte[] v1, int l1, byte[] v2, int l2, int from) { + try { + if (Helper.indexOf(v1, l1, v2, l2, from) != -1) { + throw new AssertionError("indexOf"); + } + } catch (IndexOutOfBoundsException io) { + } + } + + static void lastIndexOf(byte[] v1, byte[] v2, int l2, int from) { + try { + if (Helper.lastIndexOf(v1, v2, l2, from) != -1) { + throw new AssertionError("lastIndexOf"); + } + } catch (IndexOutOfBoundsException io) { + } + } + + static void indexOfLatin1(byte[] v1, int l1, byte[] v2, int l2, int from) { + try { + if (Helper.indexOfLatin1(v1, l1, v2, l2, from) != -1) { + throw new AssertionError("indexOfLatin1"); + } + } catch (IndexOutOfBoundsException io) { + } + } + + static void lastIndexOfLatin1(byte[] v1, byte[] v2, int l2, int from) { + try { + if (Helper.lastIndexOfLatin1(v1, v2, l2, from) != -1) { + throw new AssertionError("lastIndexOfLatin1"); + } + } catch (IndexOutOfBoundsException io) { + } + } +} diff --git a/hotspot/test/compiler/intrinsics/zip/TestCRC32.java b/hotspot/test/compiler/intrinsics/zip/TestCRC32.java index 626f506e48c..cacffd98ce2 100644 --- a/hotspot/test/compiler/intrinsics/zip/TestCRC32.java +++ b/hotspot/test/compiler/intrinsics/zip/TestCRC32.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,22 @@ import java.util.zip.CRC32; import java.util.zip.Checksum; public class TestCRC32 { - public static void main(String[] args) { + // standard CRC32 polynomial + // coefficients in different forms + // normal: polyBits = 0x04c11db7 = 0b0000 0100 1100 0001 0001 1101 1011 0111 + // reversed: polybits = 0xedb88320 = 0b1110 1101 1011 1000 1000 0011 0010 0000 + // reversed reciprocal polybits = 0x82608edb = 0b1000 0010 0110 0000 1000 1110 1101 1011 + // + // 0 5 9 13 17 21 25 29 + // | | | | | | | | + // reversed shiftL 1 polyBits = 0x1db710641L = 0b1 1101 1011 0111 0001 0000 0110 0100 0001 + final static long polyBits = (1L<<(32-32)) + (1L<<(32-26)) + (1L<<(32-23)) + (1L<<(32-22)) + + (1L<<(32-16)) + (1L<<(32-12)) + (1L<<(32-11)) + (1L<<(32-10)) + + (1L<<(32-8)) + (1L<<(32-7)) + (1L<<(32-5)) + (1L<<(32-4)) + + (1L<<(32-2)) + (1L<<(32-1)) + (1L<<(32-0)); + final static long polyBitsShifted = polyBits>>1; + + public static void main(String[] args) throws Exception { int offset = Integer.getInteger("offset", 0); int msgSize = Integer.getInteger("msgSize", 512); boolean multi = false; @@ -65,11 +80,14 @@ public class TestCRC32 { byte[] b = initializedBytes(msgSize, offset); + final long crcReference = update_byteLoop(0, b, offset); + CRC32 crc0 = new CRC32(); CRC32 crc1 = new CRC32(); CRC32 crc2 = new CRC32(); crc0.update(b, offset, msgSize); + check(crc0, crcReference); System.out.println("-------------------------------------------------------"); @@ -77,27 +95,35 @@ public class TestCRC32 { for (int i = 0; i < warmupIters; i++) { crc1.reset(); crc1.update(b, offset, msgSize); + check(crc1, crcReference); } - /* measure performance */ + /* check correctness + * Do that before measuring performance + * to even better heat up involved methods. + */ + for (int i = 0; i < iters; i++) { + crc1.reset(); + crc1.update(b, offset, msgSize); + check(crc1, crcReference); + } + report("CRCs", crc1, crcReference); + + /* measure performance + * Don't spoil times with error checking. + */ long start = System.nanoTime(); for (int i = 0; i < iters; i++) { crc1.reset(); crc1.update(b, offset, msgSize); } long end = System.nanoTime(); + double total = (double)(end - start)/1e9; // in seconds double thruput = (double)msgSize*iters/1e6/total; // in MB/s System.out.println("CRC32.update(byte[]) runtime = " + total + " seconds"); System.out.println("CRC32.update(byte[]) throughput = " + thruput + " MB/s"); - - /* check correctness */ - for (int i = 0; i < iters; i++) { - crc1.reset(); - crc1.update(b, offset, msgSize); - if (!check(crc0, crc1)) break; - } - report("CRCs", crc0, crc1); + report("CRCs", crc1, crcReference); System.out.println("-------------------------------------------------------"); @@ -110,9 +136,24 @@ public class TestCRC32 { crc2.reset(); crc2.update(buf); buf.rewind(); + check(crc2, crcReference); } - /* measure performance */ + /* check correctness + * Do that before measuring performance + * to even better heat up involved methods. + */ + for (int i = 0; i < iters; i++) { + crc2.reset(); + crc2.update(buf); + buf.rewind(); + check(crc2, crcReference); + } + report("CRCs", crc2, crcReference); + + /* measure performance + * Don't spoil times with error checking. + */ start = System.nanoTime(); for (int i = 0; i < iters; i++) { crc2.reset(); @@ -124,31 +165,57 @@ public class TestCRC32 { thruput = (double)msgSize*iters/1e6/total; // in MB/s System.out.println("CRC32.update(ByteBuffer) runtime = " + total + " seconds"); System.out.println("CRC32.update(ByteBuffer) throughput = " + thruput + " MB/s"); - - /* check correctness */ - for (int i = 0; i < iters; i++) { - crc2.reset(); - crc2.update(buf); - buf.rewind(); - if (!check(crc0, crc2)) break; - } - report("CRCs", crc0, crc2); + report("CRCs", crc2, crcReference); System.out.println("-------------------------------------------------------"); } - private static void report(String s, Checksum crc0, Checksum crc1) { - System.out.printf("%s: crc0 = %08x, crc1 = %08x\n", - s, crc0.getValue(), crc1.getValue()); + // Just a loop over a byte array, updating the CRC byte by byte. + public static long update_byteLoop(long crc, byte[] buf, int offset) { + return update_byteLoop(crc, buf, offset, buf.length-offset); } - private static boolean check(Checksum crc0, Checksum crc1) { - if (crc0.getValue() != crc1.getValue()) { - System.err.printf("ERROR: crc0 = %08x, crc1 = %08x\n", - crc0.getValue(), crc1.getValue()); - return false; + // Just a loop over a byte array, with given length, updating the CRC byte by byte. + public static long update_byteLoop(long crc, byte[] buf, int offset, int length) { + int end = length+offset; + for (int i = offset; i < end; i++) { + crc = update_singlebyte(crc, polyBitsShifted, buf[i]); + } + return crc; + } + + // Straight-forward implementation of CRC update by one byte. + // We use this very basic implementation to calculate reference + // results. It is necessary to have full control over how the + // reference results are calculated. It is not sufficient to rely + // on the interpreter (or c1, or c2) to do the right thing. + public static long update_singlebyte(long crc, long polynomial, int val) { + crc = (crc ^ -1L) & 0x00000000ffffffffL; // use 1's complement of crc + crc = crc ^ (val&0xff); // XOR in next byte from stream + for (int i = 0; i < 8; i++) { + boolean bitset = (crc & 0x01L) != 0; + + crc = crc>>1; + if (bitset) { + crc = crc ^ polynomial; + crc = crc & 0x00000000ffffffffL; + } + } + crc = (crc ^ -1L) & 0x00000000ffffffffL; // revert taking 1's complement + return crc; + } + + private static void report(String s, Checksum crc, long crcReference) { + System.out.printf("%s: crc = %08x, crcReference = %08x\n", + s, crc.getValue(), crcReference); + } + + private static void check(Checksum crc, long crcReference) throws Exception { + if (crc.getValue() != crcReference) { + System.err.printf("ERROR: crc = %08x, crcReference = %08x\n", + crc.getValue(), crcReference); + throw new Exception("TestCRC32 Error"); } - return true; } private static byte[] initializedBytes(int M, int offset) { @@ -162,7 +229,7 @@ public class TestCRC32 { return bytes; } - private static void test_multi(int iters) { + private static void test_multi(int iters) throws Exception { int len1 = 8; // the 8B/iteration loop int len2 = 32; // the 32B/iteration loop int len3 = 4096; // the 4KB/iteration loop @@ -185,37 +252,31 @@ public class TestCRC32 { (len1+len2+len3)*2+5, (len1+len2+len3)*2+7, (len1+len2+len3)*3, (len1+len2+len3)*3-1, (len1+len2+len3)*3-3, (len1+len2+len3)*3-5, (len1+len2+len3)*3-7 }; - CRC32[] crc0 = new CRC32[offsets.length*sizes.length]; CRC32[] crc1 = new CRC32[offsets.length*sizes.length]; + long[] crcReference = new long[offsets.length*sizes.length]; int i, j, k; System.out.printf("testing %d cases ...\n", offsets.length*sizes.length); - /* set the result from interpreter as reference */ + // Initialize CRC32 result arrays, CRC32 reference array. + // Reference is calculated using a very basic Java implementation. for (i = 0; i < offsets.length; i++) { for (j = 0; j < sizes.length; j++) { - crc0[i*sizes.length + j] = new CRC32(); crc1[i*sizes.length + j] = new CRC32(); - crc0[i*sizes.length + j].update(b, offsets[i], sizes[j]); + crcReference[i*sizes.length + j] = update_byteLoop(0, b, offsets[i], sizes[j]); } } - /* warm up the JIT compiler and get result */ + // Warm up the JIT compiler. Over time, all methods involved will + // be executed by the interpreter, then get compiled by c1 and + // finally by c2. Each calculated CRC value must, in each iteration, + // be equal to the precalculated reference value for the test to pass. for (k = 0; k < iters; k++) { for (i = 0; i < offsets.length; i++) { for (j = 0; j < sizes.length; j++) { crc1[i*sizes.length + j].reset(); crc1[i*sizes.length + j].update(b, offsets[i], sizes[j]); - } - } - } - - /* check correctness */ - for (i = 0; i < offsets.length; i++) { - for (j = 0; j < sizes.length; j++) { - if (!check(crc0[i*sizes.length + j], crc1[i*sizes.length + j])) { - System.out.printf("offsets[%d] = %d", i, offsets[i]); - System.out.printf("\tsizes[%d] = %d\n", j, sizes[j]); + check(crc1[i*sizes.length + j], crcReference[i*sizes.length + j]); } } } diff --git a/hotspot/test/compiler/intrinsics/zip/TestCRC32C.java b/hotspot/test/compiler/intrinsics/zip/TestCRC32C.java index 2f280aa1254..2955af3478c 100644 --- a/hotspot/test/compiler/intrinsics/zip/TestCRC32C.java +++ b/hotspot/test/compiler/intrinsics/zip/TestCRC32C.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,23 @@ import java.util.zip.CRC32C; import java.util.zip.Checksum; public class TestCRC32C { - public static void main(String[] args) { + // CRC32C (Castagnoli) polynomial + // coefficients in different forms + // normal: polyBits = 0x1edc6f41 = 0b0001 1110 1101 1100 0110 1111 0100 0001 + // reversed: polybits = 0x82f63b78 = 0b1000 0010 1111 0110 0011 1011 0111 1000 + // reversed reciprocal polybits = 0x8f6e37a0 = 0b1000 1111 0110 1110 0011 0111 1010 0000 + // + // 0 5 9 13 17 21 25 29 + // | | | | | | | | + // reversed shiftL 1 polyBits = 0x105ec76f1L = 0b1 0000 0101 1110 1100 0111 0110 1111 0001 + final static long polyBits = (1L<<(32-32)) + (1L<<(32-28)) + (1L<<(32-27)) + + (1L<<(32-26)) + (1L<<(32-25)) + (1L<<(32-23)) + (1L<<(32-22)) + + (1L<<(32-20)) + (1L<<(32-19)) + (1L<<(32-18)) + (1L<<(32-14)) + + (1L<<(32-13)) + (1L<<(32-11)) + (1L<<(32-10)) + (1L<<(32-9)) + + (1L<<(32-8)) + (1L<<(32-6)) + (1L<<(32-0)); + final static long polyBitsShifted = polyBits>>1; + + public static void main(String[] args) throws Exception { int offset = Integer.getInteger("offset", 0); int msgSize = Integer.getInteger("msgSize", 512); boolean multi = false; @@ -65,11 +81,14 @@ public class TestCRC32C { byte[] b = initializedBytes(msgSize, offset); + final long crcReference = update_byteLoop(0, b, offset); + CRC32C crc0 = new CRC32C(); CRC32C crc1 = new CRC32C(); CRC32C crc2 = new CRC32C(); crc0.update(b, offset, msgSize); + check(crc0, crcReference); System.out.println("-------------------------------------------------------"); @@ -77,27 +96,35 @@ public class TestCRC32C { for (int i = 0; i < warmupIters; i++) { crc1.reset(); crc1.update(b, offset, msgSize); + check(crc1, crcReference); } - /* measure performance */ + /* check correctness + * Do that before measuring performance + * to even better heat up involved methods. + */ + for (int i = 0; i < iters; i++) { + crc1.reset(); + crc1.update(b, offset, msgSize); + check(crc1, crcReference); + } + report("CRCs", crc1, crcReference); + + /* measure performance + * Don't spoil times with error checking. + */ long start = System.nanoTime(); for (int i = 0; i < iters; i++) { crc1.reset(); crc1.update(b, offset, msgSize); } long end = System.nanoTime(); + double total = (double)(end - start)/1e9; // in seconds double thruput = (double)msgSize*iters/1e6/total; // in MB/s System.out.println("CRC32C.update(byte[]) runtime = " + total + " seconds"); System.out.println("CRC32C.update(byte[]) throughput = " + thruput + " MB/s"); - - /* check correctness */ - for (int i = 0; i < iters; i++) { - crc1.reset(); - crc1.update(b, offset, msgSize); - if (!check(crc0, crc1)) break; - } - report("CRCs", crc0, crc1); + report("CRCs", crc1, crcReference); System.out.println("-------------------------------------------------------"); @@ -110,9 +137,24 @@ public class TestCRC32C { crc2.reset(); crc2.update(buf); buf.rewind(); + check(crc2, crcReference); } - /* measure performance */ + /* check correctness + * Do that before measuring performance + * to even better heat up involved methods. + */ + for (int i = 0; i < iters; i++) { + crc2.reset(); + crc2.update(buf); + buf.rewind(); + check(crc2, crcReference); + } + report("CRCs", crc2, crcReference); + + /* measure performance + * Don't spoil times with error checking. + */ start = System.nanoTime(); for (int i = 0; i < iters; i++) { crc2.reset(); @@ -124,31 +166,57 @@ public class TestCRC32C { thruput = (double)msgSize*iters/1e6/total; // in MB/s System.out.println("CRC32C.update(ByteBuffer) runtime = " + total + " seconds"); System.out.println("CRC32C.update(ByteBuffer) throughput = " + thruput + " MB/s"); - - /* check correctness */ - for (int i = 0; i < iters; i++) { - crc2.reset(); - crc2.update(buf); - buf.rewind(); - if (!check(crc0, crc2)) break; - } - report("CRCs", crc0, crc2); + report("CRCs", crc2, crcReference); System.out.println("-------------------------------------------------------"); } - private static void report(String s, Checksum crc0, Checksum crc1) { - System.out.printf("%s: crc0 = %08x, crc1 = %08x\n", - s, crc0.getValue(), crc1.getValue()); + // Just a loop over a byte array, updating the CRC byte by byte. + public static long update_byteLoop(long crc, byte[] buf, int offset) { + return update_byteLoop(crc, buf, offset, buf.length-offset); } - private static boolean check(Checksum crc0, Checksum crc1) { - if (crc0.getValue() != crc1.getValue()) { - System.err.printf("ERROR: crc0 = %08x, crc1 = %08x\n", - crc0.getValue(), crc1.getValue()); - return false; + // Just a loop over a byte array, with given length, updating the CRC byte by byte. + public static long update_byteLoop(long crc, byte[] buf, int offset, int length) { + int end = length+offset; + for (int i = offset; i < end; i++) { + crc = update_singlebyte(crc, polyBitsShifted, buf[i]); + } + return crc; + } + + // Straight-forward implementation of CRC update by one byte. + // We use this very basic implementation to calculate reference + // results. It is necessary to have full control over how the + // reference results are calculated. It is not sufficient to rely + // on the interpreter (or c1, or c2) to do the right thing. + public static long update_singlebyte(long crc, long polynomial, int val) { + crc = (crc ^ -1L) & 0x00000000ffffffffL; // use 1's complement of crc + crc = crc ^ (val&0xff); // XOR in next byte from stream + for (int i = 0; i < 8; i++) { + boolean bitset = (crc & 0x01L) != 0; + + crc = crc>>1; + if (bitset) { + crc = crc ^ polynomial; + crc = crc & 0x00000000ffffffffL; + } + } + crc = (crc ^ -1L) & 0x00000000ffffffffL; // revert taking 1's complement + return crc; + } + + private static void report(String s, Checksum crc, long crcReference) { + System.out.printf("%s: crc = %08x, crcReference = %08x\n", + s, crc.getValue(), crcReference); + } + + private static void check(Checksum crc, long crcReference) throws Exception { + if (crc.getValue() != crcReference) { + System.err.printf("ERROR: crc = %08x, crcReference = %08x\n", + crc.getValue(), crcReference); + throw new Exception("TestCRC32C Error"); } - return true; } private static byte[] initializedBytes(int M, int offset) { @@ -162,7 +230,7 @@ public class TestCRC32C { return bytes; } - private static void test_multi(int iters) { + private static void test_multi(int iters) throws Exception { int len1 = 8; // the 8B/iteration loop int len2 = 32; // the 32B/iteration loop int len3 = 4096; // the 4KB/iteration loop @@ -185,37 +253,31 @@ public class TestCRC32C { (len1+len2+len3)*2+5, (len1+len2+len3)*2+7, (len1+len2+len3)*3, (len1+len2+len3)*3-1, (len1+len2+len3)*3-3, (len1+len2+len3)*3-5, (len1+len2+len3)*3-7 }; - CRC32C[] crc0 = new CRC32C[offsets.length*sizes.length]; CRC32C[] crc1 = new CRC32C[offsets.length*sizes.length]; + long[] crcReference = new long[offsets.length*sizes.length]; int i, j, k; System.out.printf("testing %d cases ...\n", offsets.length*sizes.length); - /* set the result from interpreter as reference */ + // Initialize CRC32C result arrays, CRC32C reference array. + // Reference is calculated using a very basic Java implementation. for (i = 0; i < offsets.length; i++) { for (j = 0; j < sizes.length; j++) { - crc0[i*sizes.length + j] = new CRC32C(); crc1[i*sizes.length + j] = new CRC32C(); - crc0[i*sizes.length + j].update(b, offsets[i], sizes[j]); + crcReference[i*sizes.length + j] = update_byteLoop(0, b, offsets[i], sizes[j]); } } - /* warm up the JIT compiler and get result */ + // Warm up the JIT compiler. Over time, all methods involved will + // be executed by the interpreter, then get compiled by c1 and + // finally by c2. Each calculated CRC value must, in each iteration, + // be equal to the precalculated reference value for the test to pass. for (k = 0; k < iters; k++) { for (i = 0; i < offsets.length; i++) { for (j = 0; j < sizes.length; j++) { crc1[i*sizes.length + j].reset(); crc1[i*sizes.length + j].update(b, offsets[i], sizes[j]); - } - } - } - - /* check correctness */ - for (i = 0; i < offsets.length; i++) { - for (j = 0; j < sizes.length; j++) { - if (!check(crc0[i*sizes.length + j], crc1[i*sizes.length + j])) { - System.out.printf("offsets[%d] = %d", i, offsets[i]); - System.out.printf("\tsizes[%d] = %d\n", j, sizes[j]); + check(crc1[i*sizes.length + j], crcReference[i*sizes.length + j]); } } } diff --git a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java index d9f2ddb1721..7fdd282033d 100644 --- a/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java +++ b/hotspot/test/compiler/jsr292/ContinuousCallSiteTargetChange.java @@ -23,7 +23,6 @@ /** * @test - * @modules java.base/jdk.internal.misc * @library /test/lib / * * @run driver compiler.jsr292.ContinuousCallSiteTargetChange @@ -31,6 +30,7 @@ package compiler.jsr292; +import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; @@ -39,15 +39,26 @@ import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; import java.lang.invoke.MutableCallSite; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; public class ContinuousCallSiteTargetChange { - static void testServer() throws Exception { + static final int ITERATIONS = Integer.parseInt(System.getProperty("iterations", "50")); + + static void runTest(Class test, String... extraArgs) throws Exception { + List argsList = new ArrayList<>( + List.of("-XX:+IgnoreUnrecognizedVMOptions", + "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", + "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining")); + + argsList.addAll(Arrays.asList(extraArgs)); + + argsList.add(test.getName()); + argsList.add(Integer.toString(ITERATIONS)); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+IgnoreUnrecognizedVMOptions", - "-server", "-XX:-TieredCompilation", "-Xbatch", - "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", - "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - Test.class.getName(), "100"); + argsList.toArray(new String[argsList.size()])); OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); @@ -55,30 +66,42 @@ public class ContinuousCallSiteTargetChange { analyzer.shouldNotContain("made not compilable"); analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff"); + } - static void testClient() throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:+IgnoreUnrecognizedVMOptions", - "-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch", - "-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10", - "-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining", - Test.class.getName(), "100"); + static void testServer(Class test, String... args) throws Exception { + List extraArgsList = new ArrayList<>( + List.of("-server", "-XX:-TieredCompilation")); + extraArgsList.addAll(Arrays.asList(args)); - OutputAnalyzer analyzer = new OutputAnalyzer(pb.start()); + runTest(test, extraArgsList.toArray(new String[extraArgsList.size()])); + } - analyzer.shouldHaveExitValue(0); + static void testClient(Class test, String... args) throws Exception { + List extraArgsList = new ArrayList<>( + List.of("-client", "-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1")); + extraArgsList.addAll(Arrays.asList(args)); - analyzer.shouldNotContain("made not compilable"); - analyzer.shouldNotContain("decompile_count > PerMethodRecompilationCutoff"); + runTest(test, extraArgsList.toArray(new String[extraArgsList.size()])); } public static void main(String[] args) throws Exception { - testServer(); - testClient(); + testServer(RecompilationTest.class, "-Xbatch"); + testClient(RecompilationTest.class, "-Xbatch"); + + testServer(PingPongTest.class); + testClient(PingPongTest.class); } - static class Test { + static MethodHandle findStatic(Class cls, String name, MethodType mt) { + try { + return MethodHandles.lookup().findStatic(cls, name, mt); + } catch (Exception e) { + throw new Error(e); + } + } + + static class RecompilationTest { static final MethodType mt = MethodType.methodType(void.class); static final CallSite cs = new MutableCallSite(mt); @@ -96,7 +119,7 @@ public class ContinuousCallSiteTargetChange { } static void iteration() throws Throwable { - MethodHandle mh1 = MethodHandles.lookup().findStatic(ContinuousCallSiteTargetChange.Test.class, "f", mt); + MethodHandle mh1 = findStatic(RecompilationTest.class, "f", mt); cs.setTarget(mh1); for (int i = 0; i < 20_000; i++) { test1(); @@ -111,4 +134,38 @@ public class ContinuousCallSiteTargetChange { } } } + + static class PingPongTest { + static final MethodType mt = MethodType.methodType(void.class); + static final CallSite cs = new MutableCallSite(mt); + + static final MethodHandle mh = cs.dynamicInvoker(); + + static final MethodHandle ping = findStatic(PingPongTest.class, "ping", mt); + static final MethodHandle pong = findStatic(PingPongTest.class, "pong", mt); + + static void ping() { + Asserts.assertEQ(cs.getTarget(), ping, "wrong call site target"); + cs.setTarget(pong); + } + + static void pong() { + Asserts.assertEQ(cs.getTarget(), pong, "wrong call site target"); + cs.setTarget(ping); + } + + static void iteration() throws Throwable { + cs.setTarget(ping); + for (int i = 0; i < 20_000; i++) { + mh.invokeExact(); + } + } + + public static void main(String[] args) throws Throwable { + int iterations = Integer.parseInt(args[0]); + for (int i = 0; i < iterations; i++) { + iteration(); + } + } + } } diff --git a/hotspot/test/compiler/jsr292/InvokerSignatureMismatch.java b/hotspot/test/compiler/jsr292/InvokerSignatureMismatch.java new file mode 100644 index 00000000000..dbd9e0101fc --- /dev/null +++ b/hotspot/test/compiler/jsr292/InvokerSignatureMismatch.java @@ -0,0 +1,56 @@ +package compiler.jsr292; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.invoke.MethodHandleHelper; +import jdk.internal.vm.annotation.ForceInline; + +/* + * @test + * @bug 8166110 + * @library /test/lib / patches + * @modules java.base/jdk.internal.misc + * java.base/jdk.internal.vm.annotation + * + * @build java.base/java.lang.invoke.MethodHandleHelper + * @run main/bootclasspath/othervm -XX:+IgnoreUnrecognizedVMOptions -Xbatch -XX:-TieredCompilation + * compiler.jsr292.InvokerSignatureMismatch + */ +public class InvokerSignatureMismatch { + + static final MethodHandle INT_MH; + + static { + MethodHandle mhI = null; + try { + mhI = MethodHandles.lookup().findStatic(InvokerSignatureMismatch.class, "bodyI", MethodType.methodType(void.class, int.class)); + } catch (Throwable e) { + } + INT_MH = mhI; + } + + public static void main(String[] args) throws Throwable { + for (int i = 0; i < 50_000; i++) { // OSR + mainLink(i); + mainInvoke(i); + } + } + + static void mainLink(int i) throws Throwable { + Object name = MethodHandleHelper.internalMemberName(INT_MH); + MethodHandleHelper.linkToStatic(INT_MH, (float) i, name); + } + + static void mainInvoke(int i) throws Throwable { + MethodHandleHelper.invokeBasicV(INT_MH, (float) i); + } + + static int cnt = 0; + static void bodyI(int x) { + if ((x & 1023) == 0) { // already optimized x % 1024 == 0 + ++cnt; + } + } + +} diff --git a/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java b/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java index a4732624a3a..c7406282274 100644 --- a/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java +++ b/hotspot/test/compiler/jsr292/patches/java.base/java/lang/invoke/MethodHandleHelper.java @@ -43,6 +43,21 @@ public class MethodHandleHelper { mh.customize(); } + @ForceInline + public static Object internalMemberName(MethodHandle mh) throws Throwable { + return mh.internalMemberName(); + } + + @ForceInline + public static void linkToStatic(MethodHandle mh, float arg, Object name) throws Throwable { + MethodHandle.linkToStatic(mh, arg, name); + } + + @ForceInline + public static void invokeBasicV(MethodHandle mh, float arg) throws Throwable { + mh.invokeBasic(arg); + } + @ForceInline public static Object invokeBasicL(MethodHandle mh) throws Throwable { return mh.invokeBasic(); @@ -84,7 +99,7 @@ public class MethodHandleHelper { public static MethodHandle make(MethodHandle target) { LambdaForm lform = DelegatingMethodHandle.makeReinvokerForm( - target, -1, DelegatingMethodHandle.class, "reinvoker.dontInline", + target, -1, DelegatingMethodHandle.class, /*forceInline=*/false, DelegatingMethodHandle.NF_getTarget, null); return new NonInlinedReinvoker(target, lform); } diff --git a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java index 481334f4ca4..3d01b4adbd9 100644 --- a/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java +++ b/hotspot/test/compiler/jvmci/JVM_GetJVMCIRuntimeTest.java @@ -27,10 +27,10 @@ * @requires vm.jvmci * @library /test/lib / * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.runtime * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true - * -XX:+EnableJVMCI + * -XX:+EnableJVMCI -Djvmci.Compiler=null * compiler.jvmci.JVM_GetJVMCIRuntimeTest * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=false @@ -39,7 +39,7 @@ * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=true * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.threaded=true - * -XX:+EnableJVMCI + * -XX:+EnableJVMCI -Djvmci.Compiler=null * compiler.jvmci.JVM_GetJVMCIRuntimeTest * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.JVM_GetJVMCIRuntimeTest.positive=false diff --git a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java index b86cfbf6dd9..a52e19b3817 100644 --- a/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java +++ b/hotspot/test/compiler/jvmci/SecurityRestrictionsTest.java @@ -28,8 +28,8 @@ * @library /test/lib / * @library common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions * -XX:+EnableJVMCI * compiler.jvmci.SecurityRestrictionsTest diff --git a/hotspot/test/compiler/jvmci/TestJVMCIPrintProperties.java b/hotspot/test/compiler/jvmci/TestJVMCIPrintProperties.java index 4f40c5b8a2d..2779db7b213 100644 --- a/hotspot/test/compiler/jvmci/TestJVMCIPrintProperties.java +++ b/hotspot/test/compiler/jvmci/TestJVMCIPrintProperties.java @@ -36,11 +36,11 @@ public class TestJVMCIPrintProperties { public static void main(String[] args) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-XX:+UnlockExperimentalVMOptions", - "-XX:+EnableJVMCI", + "-XX:+EnableJVMCI", "-Djvmci.Compiler=null", "-XX:+JVMCIPrintProperties"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("[JVMCI properties]"); // expected message - output.shouldContain("jvmci.Compiler = null"); // expected message + output.shouldContain("jvmci.Compiler := \"null\""); // expected message output.shouldContain("jvmci.InitTimer = false"); // expected message output.shouldContain("jvmci.PrintConfig = false"); // expected message output.shouldContain("jvmci.TraceMethodDataFilter = null"); // expected message diff --git a/hotspot/test/compiler/jvmci/common/CTVMUtilities.java b/hotspot/test/compiler/jvmci/common/CTVMUtilities.java index 7ba6d00debf..7f32d95855d 100644 --- a/hotspot/test/compiler/jvmci/common/CTVMUtilities.java +++ b/hotspot/test/compiler/jvmci/common/CTVMUtilities.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import java.lang.reflect.Executable; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.lang.reflect.Module; import java.lang.reflect.Parameter; import java.util.HashMap; import java.util.Map; diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java similarity index 98% rename from hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java rename to hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java index fc03353f76a..1cdee2d2974 100644 --- a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java +++ b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java @@ -48,6 +48,10 @@ public class CompilerToVMHelper { return CTVM.getExceptionTableStart((HotSpotResolvedJavaMethodImpl)method); } + public static Object getFlagValue(String name) { + return CTVM.getFlagValue(name); + } + public static boolean isCompilable(HotSpotResolvedJavaMethod method) { return CTVM.isCompilable((HotSpotResolvedJavaMethodImpl)method); } @@ -128,7 +132,7 @@ public class CompilerToVMHelper { } public static HotSpotResolvedObjectType resolveFieldInPool( - ConstantPool constantPool, int cpi, ResolvedJavaMethod method, byte opcode, long[] info) { + ConstantPool constantPool, int cpi, ResolvedJavaMethod method, byte opcode, int[] info) { return CTVM.resolveFieldInPool((HotSpotConstantPool) constantPool, cpi, (HotSpotResolvedJavaMethodImpl) method, opcode, info); } diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java similarity index 100% rename from hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java rename to hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/MetaAccessWrapper.java diff --git a/hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java b/hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java similarity index 100% rename from hotspot/test/compiler/jvmci/common/patches/jdk.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java rename to hotspot/test/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/PublicMetaspaceWrapperObject.java diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java index adfece82f94..7aaf6bd4cb9 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/AllocateCompileIdTest.java @@ -30,10 +30,10 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. diff --git a/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java index 09e8f0e2b5b..92b00bd48a6 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/AsResolvedJavaMethodTest.java @@ -30,11 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.AsResolvedJavaMethodTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java index 507c56987d7..f729894dd55 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/CollectCountersTest.java @@ -28,8 +28,8 @@ * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run main/othervm -XX:+UnlockExperimentalVMOptions * -XX:+EnableJVMCI * -XX:JVMCICounterSize=0 diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java index 6f2ccb0f3c0..f799f0c2734 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java @@ -202,13 +202,13 @@ public class ConstantPoolTestCase { public final String type; public final ResolvedJavaMethod[] methods; public final byte[] opcodes; - public final long accFlags; + public final int accFlags; - public TestedCPEntry(String klass, String name, String type, byte[] opcodes, long accFlags) { + public TestedCPEntry(String klass, String name, String type, byte[] opcodes, int accFlags) { this(klass, name, type, null, opcodes, accFlags); } - public TestedCPEntry(String klass, String name, String type, ResolvedJavaMethod[] methods, byte[] opcodes, long accFlags) { + public TestedCPEntry(String klass, String name, String type, ResolvedJavaMethod[] methods, byte[] opcodes, int accFlags) { this.klass = klass; this.name = name; this.type = type; diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java index e0bb9d41c8e..0ac7f3d6a6f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ConstantPoolTestsHelper.java @@ -206,7 +206,7 @@ public class ConstantPoolTestsHelper { "stringFieldEmpty", "Ljava/lang/String;", new byte[] {(byte) Opcodes.PUTFIELD | (byte) Opcodes.GETFIELD}, - 0L), + 0), } ); CP_MAP_FOR_CLASS.put(CONSTANT_METHODREF, @@ -362,7 +362,7 @@ public class ConstantPoolTestsHelper { "stringFieldEmpty", "Ljava/lang/String;", new byte[] {(byte) Opcodes.PUTFIELD | (byte) Opcodes.GETFIELD}, - 0L), + 0), } ); CP_MAP_FOR_ABS_CLASS.put(CONSTANT_METHODREF, diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java index 806c2e7e349..f07c570fa16 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DebugOutputTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +28,11 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * @run main/othervm compiler.jvmci.compilerToVM.DebugOutputTest + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @run driver compiler.jvmci.compilerToVM.DebugOutputTest */ - // as soon as CODETOOLS-7901589 fixed, '@run main/othervm' should be replaced w/ '@run driver' - package compiler.jvmci.compilerToVM; import jdk.test.lib.process.OutputAnalyzer; @@ -42,8 +40,11 @@ import jdk.test.lib.process.ProcessTools; import jdk.vm.ci.hotspot.CompilerToVMHelper; import java.util.Arrays; +import java.nio.file.Path; +import java.nio.file.Paths; public class DebugOutputTest { + private static final String VM_CI_MODULE = "jdk.internal.vm.ci"; public static void main(String[] args) { new DebugOutputTest().test(); } @@ -53,10 +54,18 @@ public class DebugOutputTest { System.out.println(testCase); OutputAnalyzer oa; try { - oa = ProcessTools.executeTestJvmAllArgs( + Path patch = Paths.get(System.getProperty("test.patch.path")); + Path jvmciPath = patch.resolve(VM_CI_MODULE).toAbsolutePath(); + if (!jvmciPath.toFile().exists()) { + throw new Error("TESTBUG: patch for " + VM_CI_MODULE + " : " + + jvmciPath.toString() + " does not exist"); + } + oa = ProcessTools.executeTestJvm( "-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", - "-Xbootclasspath/a:.", + "--add-exports", "java.base/jdk.internal.misc=ALL-UNNAMED", + "--add-exports", "jdk.internal.vm.ci/jdk.vm.ci.hotspot=ALL-UNNAMED", + "--patch-module", VM_CI_MODULE + "=" + jvmciPath.toString(), DebugOutputTest.Worker.class.getName(), testCase.name()); } catch (Throwable e) { diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java index 9101d2a66e5..09f9b94d426 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java @@ -30,10 +30,10 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build sun.hotspot.WhiteBox * compiler.jvmci.compilerToVM.DisassembleCodeBlobTest * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff --git a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java index 57e2e1fea1c..e8c9a086253 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/DoNotInlineOrCompileTest.java @@ -30,15 +30,16 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.DoNotInlineOrCompileTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java index 5d7c4d376ba..02e4b68c938 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java @@ -21,6 +21,26 @@ * questions. */ +/* + * @test + * @bug 8136421 + * @requires vm.jvmci + * @library /test/lib / + * @library ../common/patches + * @modules java.base/jdk.internal.misc + * @modules java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm.tree + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest + */ + package compiler.jvmci.compilerToVM; import jdk.test.lib.Asserts; @@ -36,26 +56,6 @@ import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.List; -/* - * @test - * @bug 8136421 - * @requires vm.jvmci - * @library /test/lib / - * @library ../common/patches - * @modules java.base/jdk.internal.misc - * @modules java.base/jdk.internal.org.objectweb.asm - * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. - * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest - */ - public class ExecuteInstalledCodeTest { public static void main(String[] args) { diff --git a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java index 4f39cf05c6c..82d5d10d46c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/FindUniqueConcreteMethodTest.java @@ -30,12 +30,13 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.FindUniqueConcreteMethodTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java index e959482d0f1..0cdcbc9f88b 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetBytecodeTest.java @@ -30,10 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetBytecodeTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java index 5dcc9f4e7e7..51cc6392cec 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetClassInitializerTest.java @@ -28,9 +28,10 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetClassInitializerTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java index 2aa39371567..7b51c257da0 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetConstantPoolTest.java @@ -29,15 +29,16 @@ * @library ../common/patches * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm - java.base/jdk.internal.org.objectweb.asm.tree - jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.code + * java.base/jdk.internal.org.objectweb.asm.tree + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetConstantPoolTest */ package compiler.jvmci.compilerToVM; diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java index af7c9bb8985..66386522965 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetExceptionTableTest.java @@ -30,10 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetExceptionTableTest */ @@ -137,4 +138,3 @@ public class GetExceptionTableTest { } } } - diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetFlagValueTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetFlagValueTest.java new file mode 100644 index 00000000000..b074ca8140d --- /dev/null +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetFlagValueTest.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8173912 + * @requires vm.jvmci + * @library / /test/lib + * @library ../common/patches + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. + * compiler.jvmci.compilerToVM.GetFlagValueTest + */ + +package compiler.jvmci.compilerToVM; + +import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; +import java.math.BigInteger; +import java.util.Arrays; +import java.util.regex.Pattern; +import java.util.regex.Matcher; +import sun.hotspot.WhiteBox; + +public class GetFlagValueTest { + public static void main(String[] args) throws Exception { + try { + CompilerToVMHelper.getFlagValue(null); + Asserts.fail("Expected NullPointerException when calling getFlagValue(null)"); + } catch (NullPointerException e) { + // expected + } + + Object missing = CompilerToVMHelper.getFlagValue("this is surely not a flag"); + Asserts.assertEquals(CompilerToVMHelper.CTVM, missing); + + ProcessBuilder pb; + OutputAnalyzer out; + + String[] arguments = {"-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:+PrintFlagsFinal", "-version"}; + pb = ProcessTools.createJavaProcessBuilder(arguments); + out = new OutputAnalyzer(pb.start()); + + out.shouldHaveExitValue(0); + String[] lines = out.getStdout().split("\\r?\\n"); + Asserts.assertTrue(lines.length > 1, "Expected output from -XX:+PrintFlagsFinal"); + + final WhiteBox wb = WhiteBox.getWhiteBox(); + + // Line example: ccstr PrintIdealGraphAddress = 127.0.0.1 {C2 notproduct} {default} + Pattern flagLine = Pattern.compile("(\\w+)\\s+(\\w+)\\s+:?= (?:(.+))\\{[^}]+\\}\\s+\\{[^}]+\\}"); + for (String line : lines) { + if (line.indexOf('=') != -1) { + line = line.trim(); + Matcher m = flagLine.matcher(line); + Asserts.assertTrue(m.matches(), "Unexpected line in -XX:+PrintFlagsFinal output: " + line); + String type = m.group(1); + String name = m.group(2); + String expect = m.group(3).trim(); + Object value = CompilerToVMHelper.getFlagValue(name); + Object wbValue = wb.getVMFlag(name); + Asserts.assertEquals(value, wbValue, "Value of flag " + name); + } + } + } +} diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java index 3811c74abf6..9b33cc6fb48 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetImplementorTest.java @@ -28,9 +28,10 @@ * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetImplementorTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java index 33b20f2f4bb..b6518820926 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLineNumberTableTest.java @@ -31,10 +31,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetLineNumberTableTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java index 8202d1260c1..53d0ce5c2da 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetLocalVariableTableTest.java @@ -30,14 +30,15 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * @clean compiler.jvmci.compilerToVM.* * @compile -g DummyInterface.java * @compile -g DummyAbstractClass.java * @compile -g DummyClass.java - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetLocalVariableTableTest * @clean compiler.jvmci.compilerToVM.* */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java index 0923e10c9b7..bf43ca431b6 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetMaxCallTargetOffsetTest.java @@ -28,8 +28,8 @@ * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * compiler.jvmci.compilerToVM.GetMaxCallTargetOffsetTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java index 0b079f3741f..10a75a81402 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetNextStackFrameTest.java @@ -30,11 +30,12 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetNextStackFrameTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java index b50dd8e1e2e..b7d4b5d0ae7 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaMethodTest.java @@ -28,16 +28,17 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc:+open - * @modules jdk.vm.ci/jdk.vm.ci.hotspot:+open + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject * sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetResolvedJavaMethodTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java index 483f1416e93..39a40d39a9d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java @@ -28,11 +28,11 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper - * jdk.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot.PublicMetaspaceWrapperObject * sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission @@ -44,7 +44,7 @@ * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * -XX:-UseCompressedOops + * -XX:-UseCompressedOops -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetResolvedJavaTypeTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java index 0c3e4ba92cc..d24806720ea 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetStackTraceElementTest.java @@ -30,10 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetStackTraceElementTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java index 87c40534e7b..bde201af7ab 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetSymbolTest.java @@ -30,11 +30,12 @@ * @modules java.base/jdk.internal.misc:+open * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * @modules jdk.vm.ci/jdk.vm.ci.hotspot:+open - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetSymbolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java index 8cfc1d89cf9..fbe44716b71 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/GetVtableIndexForInterfaceTest.java @@ -30,10 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.GetVtableIndexForInterfaceTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java index 969a7f6d5ff..f9e50cb69f8 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasCompiledCodeForOSRTest.java @@ -30,16 +30,16 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * -XX:-BackgroundCompilation + * -XX:-BackgroundCompilation -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.HasCompiledCodeForOSRTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java index 57ec63acd3e..ad4319de20e 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasFinalizableSubclassTest.java @@ -28,10 +28,11 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * compiler.jvmci.compilerToVM.HasFinalizableSubclassTest + * -Djvmci.Compiler=null + * compiler.jvmci.compilerToVM.HasFinalizableSubclassTest */ package compiler.jvmci.compilerToVM; diff --git a/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java b/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java index 7efd8d2d994..12b808f072f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/HasNeverInlineDirectiveTest.java @@ -30,15 +30,16 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.HasNeverInlineDirectiveTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java index 828dc7788d5..de6f2f6f1a3 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java @@ -30,11 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.runtime * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox @@ -42,6 +42,7 @@ * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.InvalidateInstalledCodeTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java index 02436906636..ce0f5335270 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/IsCompilableTest.java @@ -30,19 +30,21 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+UseJVMCICompiler + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.IsCompilableTest * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI - * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.IsCompilableTest */ @@ -69,20 +71,17 @@ public class IsCompilableTest { } private static void runSanityTest(Executable aMethod) { - boolean UseJVMCICompiler = (Boolean) WB.getVMFlag("UseJVMCICompiler"); HotSpotResolvedJavaMethod method = CTVMUtilities .getResolvedMethod(aMethod); boolean isCompilable = CompilerToVMHelper.isCompilable(method); - boolean expected = UseJVMCICompiler || WB.isMethodCompilable(aMethod); + boolean expected = WB.isMethodCompilable(aMethod); Asserts.assertEQ(isCompilable, expected, "Unexpected initial " + "value of property 'compilable'"); - if (!UseJVMCICompiler) { - WB.makeMethodNotCompilable(aMethod); - isCompilable = CompilerToVMHelper.isCompilable(method); - Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " + - "property 'isCompilable' after setting 'compilable' to false"); - } + WB.makeMethodNotCompilable(aMethod); + isCompilable = CompilerToVMHelper.isCompilable(method); + Asserts.assertFalse(isCompilable, aMethod + "Unexpected value of " + + "property 'isCompilable' after setting 'compilable' to false"); } private static List createTestCases() { diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java index e1427d0becb..329990e2a7d 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureTest.java @@ -28,9 +28,9 @@ * @library / /test/lib * ../common/patches * @modules java.base/jdk.internal.misc - * jdk.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.hotspot * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission diff --git a/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java new file mode 100644 index 00000000000..b748403c2b0 --- /dev/null +++ b/hotspot/test/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8136421 + * @requires vm.jvmci + * @library / /test/lib + * ../common/patches + * @modules java.base/jdk.internal.misc + * java.base/jdk.internal.org.objectweb.asm + * java.base/jdk.internal.org.objectweb.asm.tree + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions + * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbatch + * -Djvmci.Compiler=null + * compiler.jvmci.compilerToVM.IsMatureVsReprofileTest + */ + +package compiler.jvmci.compilerToVM; + +import compiler.jvmci.common.CTVMUtilities; +import compiler.jvmci.common.testcases.SimpleClass; +import jdk.vm.ci.hotspot.CompilerToVMHelper; +import jdk.test.lib.Asserts; +import sun.hotspot.WhiteBox; +import compiler.whitebox.CompilerWhiteBoxTest; +import java.lang.reflect.Executable; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; +import jdk.test.lib.Platform; + +public class IsMatureVsReprofileTest { + private static final WhiteBox WB = WhiteBox.getWhiteBox(); + private static final boolean TIERED = WB.getBooleanVMFlag("TieredCompilation"); + private static final boolean IS_XCOMP = Platform.isComp(); + + public static void main(String[] args) throws Exception { + new IsMatureVsReprofileTest().test(); + } + + public void test() throws Exception { + SimpleClass sclass = new SimpleClass(); + Executable method = SimpleClass.class.getDeclaredMethod("testMethod"); + long metaspaceMethodData = WB.getMethodData(method); + Asserts.assertEQ(metaspaceMethodData, 0L, "MDO should be null for a " + + "never invoked method"); + boolean isMature = CompilerToVMHelper.isMature(metaspaceMethodData); + Asserts.assertFalse(isMature, "null MDO can't be mature"); + for (int i = 0; i < CompilerWhiteBoxTest.THRESHOLD; i++) { + sclass.testMethod(); + } + Asserts.assertTrue(WB.isMethodCompiled(method), + "Method should be compiled"); + metaspaceMethodData = WB.getMethodData(method); + Asserts.assertNE(metaspaceMethodData, 0L, + "Multiple times invoked method should have MDO"); + isMature = CompilerToVMHelper.isMature(metaspaceMethodData); + /* a method is not mature for -Xcomp and -Tiered, + see NonTieredCompPolicy::is_mature */ + Asserts.assertEQ(!IS_XCOMP || TIERED, isMature, + "Unexpected isMature state for compiled method"); + HotSpotResolvedJavaMethod resolvedMethod + = CTVMUtilities.getResolvedMethod(method); + CompilerToVMHelper.reprofile(resolvedMethod); + Asserts.assertFalse(WB.isMethodCompiled(method), + "Unexpected method compilation state after reprofile"); + metaspaceMethodData = WB.getMethodData(method); + isMature = CompilerToVMHelper.isMature(metaspaceMethodData); + Asserts.assertNE(metaspaceMethodData, 0L, + "Got null MDO after reprofile"); + Asserts.assertEQ(TIERED && IS_XCOMP, isMature, + "Got unexpected isMature state after reprofiling"); + } +} diff --git a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java index 826868ae54d..0c0e60bfd39 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/JVM_RegisterJVMCINatives.java @@ -27,8 +27,8 @@ * @requires vm.jvmci * @library /test/lib / * @modules java.base/jdk.internal.misc:open - * @modules jdk.vm.ci/jdk.vm.ci.hotspot:open - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:open + * jdk.internal.vm.ci/jdk.vm.ci.runtime * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Dcompiler.jvmci.compilerToVM.JVM_RegisterJVMCINatives.positive=true * -XX:+EnableJVMCI diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java index 690ef34b195..4b7e81e4b80 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassInPoolTest.java @@ -32,16 +32,17 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupKlassInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java index e53d695161d..d952505718a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupKlassRefIndexInPoolTest.java @@ -31,15 +31,16 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupKlassRefIndexInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java index f6d139c3b05..42bd66cd30f 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupMethodInPoolTest.java @@ -31,15 +31,16 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupMethodInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java index ed376e04e41..e75a531b4e4 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameAndTypeRefIndexInPoolTest.java @@ -31,15 +31,16 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupNameAndTypeRefIndexInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java index e01f023f716..91b7867d6a2 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupNameInPoolTest.java @@ -31,16 +31,17 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupNameInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java index 3dc8a64bdd2..0953363e67e 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupSignatureInPoolTest.java @@ -31,16 +31,17 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupSignatureInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java index 225da6983e4..2b838bc0bd8 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/LookupTypeTest.java @@ -28,9 +28,10 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.LookupTypeTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java index dee13cfef8d..8e919fb5ba9 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MaterializeVirtualObjectTest.java @@ -32,28 +32,60 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xmixed -Xbootclasspath/a:. + * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * -XX:CompileCommand=exclude,*::check + * -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2 + * -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse * -XX:+DoEscapeAnalysis -XX:-UseCounterDecay - * -Xbatch + * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest - * @run main/othervm -Xmixed -Xbootclasspath/a:. + * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * -XX:CompileCommand=exclude,*::check + * -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2 + * -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse * -XX:+DoEscapeAnalysis -XX:-UseCounterDecay - * -Xbatch + * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false + * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=false + * -Djvmci.Compiler=null + * compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest + * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2 + * -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse + * -XX:+DoEscapeAnalysis -XX:-UseCounterDecay + * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=true * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true + * -Djvmci.Compiler=null + * compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest + * @run main/othervm -Xmixed -Xbatch -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:CompileCommand=exclude,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::check + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame + * -XX:CompileCommand=dontinline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::testFrame2 + * -XX:CompileCommand=inline,compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest::recurse + * -XX:+DoEscapeAnalysis -XX:-UseCounterDecay + * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst=false + * -Dcompiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate=true + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest */ @@ -72,25 +104,41 @@ import java.lang.reflect.Method; public class MaterializeVirtualObjectTest { private static final WhiteBox WB; - private static final Method METHOD; - private static final ResolvedJavaMethod RESOLVED_METHOD; private static final boolean INVALIDATE; private static final int COMPILE_THRESHOLD; + private static final Method MATERIALIZED_METHOD; + private static final Method NOT_MATERIALIZED_METHOD; + private static final ResolvedJavaMethod MATERIALIZED_RESOLVED; + private static final ResolvedJavaMethod NOT_MATERIALIZED_RESOLVED; + private static final boolean MATERIALIZE_FIRST; static { + Method method1; + Method method2; WB = WhiteBox.getWhiteBox(); try { - METHOD = MaterializeVirtualObjectTest.class.getDeclaredMethod( - "testFrame", String.class, int.class); + method1 = MaterializeVirtualObjectTest.class.getDeclaredMethod("testFrame", + String.class, int.class); + method2 = MaterializeVirtualObjectTest.class.getDeclaredMethod("testFrame2", + String.class, int.class); } catch (NoSuchMethodException e) { throw new Error("Can't get executable for test method", e); } - RESOLVED_METHOD = CTVMUtilities.getResolvedMethod(METHOD); + ResolvedJavaMethod resolved1; + ResolvedJavaMethod resolved2; + resolved1 = CTVMUtilities.getResolvedMethod(method1); + resolved2 = CTVMUtilities.getResolvedMethod(method2); INVALIDATE = Boolean.getBoolean( "compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.invalidate"); COMPILE_THRESHOLD = WB.getBooleanVMFlag("TieredCompilation") ? CompilerWhiteBoxTest.THRESHOLD : CompilerWhiteBoxTest.THRESHOLD * 2; + MATERIALIZE_FIRST = Boolean.getBoolean( + "compiler.jvmci.compilerToVM.MaterializeVirtualObjectTest.materializeFirst"); + MATERIALIZED_RESOLVED = MATERIALIZE_FIRST ? resolved1 : resolved2; + NOT_MATERIALIZED_RESOLVED = MATERIALIZE_FIRST ? resolved2 : resolved1; + MATERIALIZED_METHOD = MATERIALIZE_FIRST ? method1 : method2; + NOT_MATERIALIZED_METHOD = MATERIALIZE_FIRST ? method2 : method1; } public static void main(String[] args) { @@ -105,47 +153,87 @@ public class MaterializeVirtualObjectTest { } private static String getName() { - return "CASE: invalidate=" + INVALIDATE; + return "CASE: invalidate=" + INVALIDATE + ", materializedMethod=" + + (MATERIALIZE_FIRST ? "testFrame" : "testFrame2") + + ", notMaterializedMethod=" + + (MATERIALIZE_FIRST ? "testFrame2" : "testFrame"); } private void test() { System.out.println(getName()); - Asserts.assertFalse(WB.isMethodCompiled(METHOD), getName() - + " : method unexpectedly compiled"); - /* need to trigger compilation by multiple method invocations - in order to have method profile data to be gathered */ - for (int i = 0; i < COMPILE_THRESHOLD; i++) { + Asserts.assertFalse(WB.isMethodCompiled(MATERIALIZED_METHOD), + getName() + " : materialized method is compiled"); + Asserts.assertFalse(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD), + getName() + " : not materialized method is compiled"); + for (int i = 0; i < CompilerWhiteBoxTest.THRESHOLD; i++) { testFrame("someString", i); } - Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName() - + "Method unexpectedly not compiled"); - testFrame("someString", COMPILE_THRESHOLD); + Asserts.assertTrue(WB.isMethodCompiled(MATERIALIZED_METHOD), getName() + + " : materialized method not compiled"); + Asserts.assertTrue(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD), + getName() + " : not materialized method not compiled"); + testFrame("someString", /* materialize */ CompilerWhiteBoxTest.THRESHOLD); } private void testFrame(String str, int iteration) { Helper helper = new Helper(str); - check(iteration); + testFrame2(str, iteration); Asserts.assertTrue((helper.string != null) && (this != null) - && (helper != null), getName() + " : some locals are null"); + && (helper != null), String.format("%s : some locals are null", getName())); + } + + private void testFrame2(String str, int iteration) { + Helper helper = new Helper(str); + recurse(2, iteration); + Asserts.assertTrue((helper.string != null) && (this != null) + && (helper != null), String.format("%s : some locals are null", getName())); + } + + private void recurse(int depth, int iteration) { + if (depth == 0) { + check(iteration); + } else { + Integer s = new Integer(depth); + recurse(depth - 1, iteration); + Asserts.assertEQ(s.intValue(), depth, + String.format("different values: %s != %s", s.intValue(), depth)); + } } private void check(int iteration) { // Materialize virtual objects on last invocation if (iteration == COMPILE_THRESHOLD) { - HotSpotStackFrameReference hsFrame = CompilerToVMHelper - .getNextStackFrame(/* topmost frame */ null, - new ResolvedJavaMethod[]{ - RESOLVED_METHOD}, /* don't skip any */ 0); - Asserts.assertNotNull(hsFrame, getName() + " : got null frame"); - Asserts.assertTrue(WB.isMethodCompiled(METHOD), getName() - + "Test method should be compiled"); - Asserts.assertTrue(hsFrame.hasVirtualObjects(), getName() - + ": has no virtual object before materialization"); - CompilerToVMHelper.materializeVirtualObjects(hsFrame, INVALIDATE); - Asserts.assertFalse(hsFrame.hasVirtualObjects(), getName() - + " : has virtual object after materialization"); - Asserts.assertEQ(WB.isMethodCompiled(METHOD), !INVALIDATE, getName() - + " : unexpected compiled status"); + // get frames and check not-null + HotSpotStackFrameReference materialized = CompilerToVMHelper.getNextStackFrame( + /* topmost frame */ null, new ResolvedJavaMethod[]{MATERIALIZED_RESOLVED}, + /* don't skip any */ 0); + Asserts.assertNotNull(materialized, getName() + + " : got null frame for materialized method"); + HotSpotStackFrameReference notMaterialized = CompilerToVMHelper.getNextStackFrame( + /* topmost frame */ null, new ResolvedJavaMethod[]{NOT_MATERIALIZED_RESOLVED}, + /* don't skip any */ 0); + Asserts.assertNE(materialized, notMaterialized, + "Got same frame pointer for both tested frames"); + Asserts.assertNotNull(notMaterialized, getName() + + " : got null frame for not materialized method"); + // check that frames has virtual objects before materialization stage + Asserts.assertTrue(materialized.hasVirtualObjects(), getName() + + ": materialized frame has no virtual object before materialization"); + Asserts.assertTrue(notMaterialized.hasVirtualObjects(), getName() + + ": notMaterialized frame has no virtual object before materialization"); + // materialize + CompilerToVMHelper.materializeVirtualObjects(materialized, INVALIDATE); + // check that only not materialized frame has virtual objects + Asserts.assertFalse(materialized.hasVirtualObjects(), getName() + + " : materialized has virtual object after materialization"); + Asserts.assertTrue(notMaterialized.hasVirtualObjects(), getName() + + " : notMaterialized has no virtual object after materialization"); + // check that materialized frame was deoptimized in case invalidate=true + Asserts.assertEQ(WB.isMethodCompiled(MATERIALIZED_METHOD), !INVALIDATE, getName() + + " : materialized method has unexpected compiled status"); + // check that not materialized frame wasn't deoptimized + Asserts.assertTrue(WB.isMethodCompiled(NOT_MATERIALIZED_METHOD), getName() + + " : not materialized method has unexpected compiled status"); } } diff --git a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java index 6f87bcfcd2d..a854c6e798a 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/MethodIsIgnoredBySecurityStackWalkTest.java @@ -31,10 +31,11 @@ * @modules java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.MethodIsIgnoredBySecurityStackWalkTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java index 866756c5b42..080e0e81c9c 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReadConfigurationTest.java @@ -28,16 +28,18 @@ * @library / /test/lib * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build compiler.jvmci.compilerToVM.ReadConfigurationTest * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ReadConfigurationTest */ package compiler.jvmci.compilerToVM; import jdk.test.lib.Asserts; +import jdk.vm.ci.hotspot.VMField; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; @@ -49,10 +51,19 @@ public class ReadConfigurationTest { } private void runTest() { - TestHotSpotVMConfig config = new TestHotSpotVMConfig(HotSpotJVMCIRuntime.runtime().getConfigStore()); + HotSpotVMConfigStore store = HotSpotJVMCIRuntime.runtime().getConfigStore(); + TestHotSpotVMConfig config = new TestHotSpotVMConfig(store); Asserts.assertNE(config.codeCacheHighBound, 0L, "Got null address"); Asserts.assertNE(config.stubRoutineJintArrayCopy, 0L, "Got null address"); + for (VMField field : store.getFields().values()) { + Object value = field.value; + if (value != null) { + Asserts.assertTrue(value instanceof Long || value instanceof Boolean, + "Got unexpected value type for VM field " + field.name + ": " + value.getClass()); + } + } + for (VMIntrinsicMethod m : config.getStore().getIntrinsics()) { Asserts.assertNotNull(m); Asserts.assertNotNull(m.declaringClass); diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java index 9953d4c596a..c9e24fe4f2b 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ReprofileTest.java @@ -30,17 +30,17 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * -Xmixed -Xbatch + * -Xmixed -Xbatch -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ReprofileTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java index 63aef07deee..68709ee2d67 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveConstantInPoolTest.java @@ -30,16 +30,17 @@ * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ResolveConstantInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java index 2ee506ba4f9..38e9ede8f7b 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveFieldInPoolTest.java @@ -31,15 +31,16 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ResolveFieldInPoolTest */ @@ -103,7 +104,7 @@ public class ResolveFieldInPoolTest { cached = "cached "; } for (int j = 0; j < entry.opcodes.length; j++) { - long[] info = new long[2]; + int[] info = new int[3]; HotSpotResolvedObjectType fieldToVerify = CompilerToVMHelper.resolveFieldInPool(constantPoolCTVM, index, @@ -147,11 +148,11 @@ public class ResolveFieldInPoolTest { } catch (Exception ex) { throw new Error("Unexpected exception", ex); } - long offsetToRefer; + int offsetToRefer; if ((entry.accFlags & Opcodes.ACC_STATIC) != 0) { - offsetToRefer = UNSAFE.staticFieldOffset(fieldToRefer); + offsetToRefer = (int) UNSAFE.staticFieldOffset(fieldToRefer); } else { - offsetToRefer = UNSAFE.objectFieldOffset(fieldToRefer); + offsetToRefer = (int) UNSAFE.objectFieldOffset(fieldToRefer); } msg = String.format("Field offset returned by resolveFieldInPool" + " method is wrong for the field %s.%s" diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java index 248077d615e..99ac158f3c5 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveMethodTest.java @@ -30,10 +30,11 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ResolveMethodTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java index ca91e75011f..1aa57ca8cc5 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolvePossiblyCachedConstantInPoolTest.java @@ -31,15 +31,16 @@ * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ResolvePossiblyCachedConstantInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java index 3f48fd2f7b0..593ea7aa6e0 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ResolveTypeInPoolTest.java @@ -31,16 +31,17 @@ * @modules java.base/jdk.internal.misc * java.base/jdk.internal.reflect * java.base/jdk.internal.org.objectweb.asm - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ResolveTypeInPoolTest */ diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java index 18a571ba660..0cefb66e711 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldDebugNonSafepointsTest.java @@ -28,8 +28,8 @@ * @library / /test/lib/ * @library ../common/patches * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI * -XX:+UnlockDiagnosticVMOptions * -XX:+DebugNonSafepoints diff --git a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java index 675a1364041..89801842a09 100644 --- a/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java +++ b/hotspot/test/compiler/jvmci/compilerToVM/ShouldInlineMethodTest.java @@ -30,15 +30,16 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null * compiler.jvmci.compilerToVM.ShouldInlineMethodTest */ diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java index 7ef5f8e4800..e9670786c9e 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidCompilationResult.java @@ -24,14 +24,15 @@ /** * @test * @requires vm.jvmci - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.common + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.common * @compile CodeInstallerTest.java - * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidCompilationResult + * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidCompilationResult */ package compiler.jvmci.errors; diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java index 8d3e92b1912..0d3a583141c 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidDebugInfo.java @@ -24,14 +24,15 @@ /** * @test * @requires vm.jvmci - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.common + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.common * @compile CodeInstallerTest.java - * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidDebugInfo + * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidDebugInfo */ package compiler.jvmci.errors; diff --git a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java index 2e3f5f65e97..ddab47481d8 100644 --- a/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java +++ b/hotspot/test/compiler/jvmci/errors/TestInvalidOopMap.java @@ -24,14 +24,15 @@ /** * @test * @requires vm.jvmci - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.common + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.common * @compile CodeInstallerTest.java - * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI compiler.jvmci.errors.TestInvalidOopMap + * @run junit/othervm -da:jdk.vm.ci... -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null compiler.jvmci.errors.TestInvalidOopMap */ package compiler.jvmci.errors; diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java index 84a4c90938b..f9e3392384a 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyBootstrapFinishedEventTest.java @@ -30,12 +30,13 @@ * @modules java.base/jdk.internal.misc * java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.services * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build compiler.jvmci.common.JVMCIHelpers * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyBootstrapFinishedEventTest.config * ./META-INF/services/jdk.vm.ci.services.JVMCIServiceLocator diff --git a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java index bb888c36a00..4e661d25b6d 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciNotifyInstallEventTest.java @@ -30,13 +30,14 @@ * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.org.objectweb.asm.tree - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.services * - * @build jdk.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @build compiler.jvmci.common.JVMCIHelpers * @run driver jdk.test.lib.FileInstaller ./JvmciNotifyInstallEventTest.config * ./META-INF/services/jdk.vm.ci.services.JVMCIServiceLocator @@ -48,21 +49,14 @@ * @run main/othervm -XX:+UnlockExperimentalVMOptions * -Xbootclasspath/a:. -Xmixed * -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI - * -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false * compiler.jvmci.events.JvmciNotifyInstallEventTest * @run main/othervm -XX:+UnlockExperimentalVMOptions - * -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed + * -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed * -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI - * -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false * compiler.jvmci.events.JvmciNotifyInstallEventTest * @run main/othervm -XX:+UnlockExperimentalVMOptions - * -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed + * -Djvmci.Compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed * -XX:+UseJVMCICompiler -XX:-BootstrapJVMCI -XX:JVMCINMethodSizeLimit=0 - * -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=false - * compiler.jvmci.events.JvmciNotifyInstallEventTest - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-EnableJVMCI - * -Djvmci.compiler=EmptyCompiler -Xbootclasspath/a:. -Xmixed - * -Dcompiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit=true * compiler.jvmci.events.JvmciNotifyInstallEventTest */ @@ -90,8 +84,6 @@ import java.lang.reflect.Method; public class JvmciNotifyInstallEventTest extends JVMCIServiceLocator implements HotSpotVMEventListener { private static final String METHOD_NAME = "testMethod"; - private static final boolean FAIL_ON_INIT = !Boolean.getBoolean( - "compiler.jvmci.events.JvmciNotifyInstallEventTest.failoninit"); private static volatile int gotInstallNotification = 0; public static void main(String args[]) { @@ -115,16 +107,9 @@ public class JvmciNotifyInstallEventTest extends JVMCIServiceLocator implements codeCache = (HotSpotCodeCacheProvider) HotSpotJVMCIRuntime.runtime() .getHostJVMCIBackend().getCodeCache(); } catch (InternalError ie) { - if (FAIL_ON_INIT) { - throw new AssertionError( - "Got unexpected InternalError trying to get code cache", - ie); - } // passed return; } - Asserts.assertTrue(FAIL_ON_INIT, - "Haven't caught InternalError in negative case"); Method testMethod; try { testMethod = SimpleClass.class.getDeclaredMethod(METHOD_NAME); diff --git a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java index 76f6538bac6..40069651d59 100644 --- a/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java +++ b/hotspot/test/compiler/jvmci/events/JvmciShutdownEventTest.java @@ -27,10 +27,11 @@ * @requires vm.jvmci * @library /test/lib / * @modules java.base/jdk.internal.misc - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.services * * @build compiler.jvmci.common.JVMCIHelpers * compiler.jvmci.events.JvmciShutdownEventListener diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java index 10a968f696c..135bb9284d1 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/DataPatchTest.java @@ -25,15 +25,15 @@ * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") * @library / - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.DataPatchTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.DataPatchTest */ package jdk.vm.ci.code.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java index 05d8bdb9c44..75d0748da52 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/InterpreterFrameSizeTest.java @@ -24,16 +24,16 @@ /** * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.common - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.common + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.InterpreterFrameSizeTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.InterpreterFrameSizeTest */ package jdk.vm.ci.code.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java index 78965574ff2..a67fa2c1dfe 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/MaxOopMapStackOffsetTest.java @@ -25,16 +25,16 @@ * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") * @library / - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.common - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.common + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.MaxOopMapStackOffsetTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.MaxOopMapStackOffsetTest */ package jdk.vm.ci.code.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java index 49a52f8c01e..61f0e729fa4 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/NativeCallTest.java @@ -25,14 +25,14 @@ * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") * @library /test/lib / - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.common - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.common + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java TestHotSpotVMConfig.java NativeCallTest.java TestAssembler.java sparc/SPARCTestAssembler.java amd64/AMD64TestAssembler.java * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbootclasspath/a:. jdk.vm.ci.code.test.NativeCallTest */ diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java index 908eaf6e79a..9b921140553 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java @@ -25,15 +25,15 @@ * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") * @library / - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleCodeInstallationTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.SimpleCodeInstallationTest */ package jdk.vm.ci.code.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java index 6f3833ed9fd..5b2204868c4 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java @@ -25,15 +25,15 @@ * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") * @library / - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.SimpleDebugInfoTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.SimpleDebugInfoTest */ package jdk.vm.ci.code.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java index c0dadbbc99e..a10e90acdaf 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/VirtualObjectDebugInfoTest.java @@ -25,15 +25,15 @@ * @test * @requires vm.jvmci & (vm.simpleArch == "x64" | vm.simpleArch == "sparcv9") * @library / - * @modules jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.code - * jdk.vm.ci/jdk.vm.ci.code.site - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.amd64 - * jdk.vm.ci/jdk.vm.ci.sparc + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.code + * jdk.internal.vm.ci/jdk.vm.ci.code.site + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.amd64 + * jdk.internal.vm.ci/jdk.vm.ci.sparc * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java sparc/SPARCTestAssembler.java - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.code.test.VirtualObjectDebugInfoTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.code.test.VirtualObjectDebugInfoTest */ package jdk.vm.ci.code.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java index b3ee6312348..a9bba4a4bb6 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java @@ -24,9 +24,9 @@ /* * @test jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest * @requires vm.jvmci - * @modules jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.hotspot + * @modules jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.hotspot * java.base/jdk.internal.vm.annotation * java.base/jdk.internal.misc * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src @@ -34,7 +34,7 @@ * @run driver ClassFileInstaller jdk.vm.ci.hotspot.test.DummyClass * @run testng/othervm/timeout=300 -Xbootclasspath/a:. * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest + * -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.HotSpotConstantReflectionProviderTest */ package jdk.vm.ci.hotspot.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java index fcbc721caa8..1122bd7eb5d 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java @@ -27,6 +27,7 @@ import java.lang.reflect.Field; import org.testng.annotations.DataProvider; +import sun.hotspot.WhiteBox; import jdk.internal.misc.Unsafe; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; @@ -36,6 +37,10 @@ import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.runtime.JVMCI; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; public class MemoryAccessProviderData { private static final Unsafe UNSAFE = Unsafe.getUnsafe(); @@ -43,6 +48,18 @@ public class MemoryAccessProviderData { private static final TestClass TEST_OBJECT = new TestClass(); private static final JavaConstant TEST_CONSTANT = CONSTANT_REFLECTION.forObject(TEST_OBJECT); private static final JavaConstant TEST_CLASS_CONSTANT = CONSTANT_REFLECTION.forObject(TestClass.class); + private static KindData[] PRIMITIVE_KIND_DATA = { + new KindData(JavaKind.Boolean, TEST_OBJECT), + new KindData(JavaKind.Byte, TEST_OBJECT), + new KindData(JavaKind.Char, TEST_OBJECT), + new KindData(JavaKind.Short, TEST_OBJECT), + new KindData(JavaKind.Int, TEST_OBJECT), + new KindData(JavaKind.Float, TEST_OBJECT), + new KindData(JavaKind.Long, TEST_OBJECT), + new KindData(JavaKind.Double, TEST_OBJECT) + }; + private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); + @DataProvider(name = "positiveObject") public static Object[][] getPositiveObjectJavaKind() { @@ -54,51 +71,40 @@ public class MemoryAccessProviderData { @DataProvider(name = "positivePrimitive") public static Object[][] getPositivePrimitiveJavaKinds() { - Field booleanField; - Field byteField; - Field shortField; - Field intField; - Field longField; - Field floatField; - Field doubleField; - Field charField; - try { - booleanField = MemoryAccessProviderData.TestClass.class.getDeclaredField("booleanField"); - byteField = MemoryAccessProviderData.TestClass.class.getDeclaredField("byteField"); - shortField = MemoryAccessProviderData.TestClass.class.getDeclaredField("shortField"); - intField = MemoryAccessProviderData.TestClass.class.getDeclaredField("intField"); - longField = MemoryAccessProviderData.TestClass.class.getDeclaredField("longField"); - floatField = MemoryAccessProviderData.TestClass.class.getDeclaredField("floatField"); - doubleField = MemoryAccessProviderData.TestClass.class.getDeclaredField("doubleField"); - charField = MemoryAccessProviderData.TestClass.class.getDeclaredField("charField"); - } catch (NoSuchFieldException e) { - throw new Error("TESTBUG: can't find test field " + e, e); + List result = new ArrayList<>(); + for (KindData k : PRIMITIVE_KIND_DATA) { + result.add(new Object[] {k.kind, TEST_CONSTANT, k.instanceFieldOffset, k.instanceFieldValue, Math.max(8, k.kind.getBitCount())}); + result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, k.staticFieldOffset, k.staticFieldValue, Math.max(8, k.kind.getBitCount())}); } - long booleanFieldOffset = UNSAFE.objectFieldOffset(booleanField); - long byteFieldOffset = UNSAFE.objectFieldOffset(byteField); - long shortFieldOffset = UNSAFE.objectFieldOffset(shortField); - long intFieldOffset = UNSAFE.objectFieldOffset(intField); - long longFieldOffset = UNSAFE.objectFieldOffset(longField); - long floatFieldOffset = UNSAFE.objectFieldOffset(floatField); - long doubleFieldOffset = UNSAFE.objectFieldOffset(doubleField); - long charFieldOffset = UNSAFE.objectFieldOffset(charField); - return new Object[][]{ - new Object[]{JavaKind.Boolean, TEST_CONSTANT, booleanFieldOffset, - JavaConstant.forBoolean(TEST_OBJECT.booleanField), 8}, - new Object[]{JavaKind.Byte, TEST_CONSTANT, byteFieldOffset, - JavaConstant.forByte(TEST_OBJECT.byteField), 8}, - new Object[]{JavaKind.Short, TEST_CONSTANT, shortFieldOffset, - JavaConstant.forShort(TEST_OBJECT.shortField), 16}, - new Object[]{JavaKind.Int, TEST_CONSTANT, intFieldOffset, - JavaConstant.forInt(TEST_OBJECT.intField), 32}, - new Object[]{JavaKind.Long, TEST_CONSTANT, longFieldOffset, - JavaConstant.forLong(TEST_OBJECT.longField), 64}, - new Object[]{JavaKind.Float, TEST_CONSTANT, floatFieldOffset, - JavaConstant.forFloat(TEST_OBJECT.floatField), 32}, - new Object[]{JavaKind.Double, TEST_CONSTANT, doubleFieldOffset, - JavaConstant.forDouble(TEST_OBJECT.doubleField), 64}, - new Object[]{JavaKind.Char, TEST_CONSTANT, charFieldOffset, - JavaConstant.forChar(TEST_OBJECT.charField), 16}}; + return result.toArray(new Object[result.size()][]); + } + + @DataProvider(name = "outOfBoundsInstanceFields") + public static Object[][] getOutOfBoundsStaticFieldReads() { + long instanceSize = WHITE_BOX.getObjectSize(TEST_OBJECT); + List result = new ArrayList<>(); + for (KindData k : PRIMITIVE_KIND_DATA) { + long lastValidOffset = instanceSize - (k.kind.getByteCount()); + result.add(new Object[] {k.kind, TEST_CONSTANT, lastValidOffset, false}); + result.add(new Object[] {k.kind, TEST_CONSTANT, (long) -1, true}); + result.add(new Object[] {k.kind, TEST_CONSTANT, lastValidOffset + 1, true}); + result.add(new Object[] {k.kind, TEST_CONSTANT, lastValidOffset + 100, true}); + } + return result.toArray(new Object[result.size()][]); + } + + @DataProvider(name = "outOfBoundsStaticFields") + public static Object[][] getOutOfBoundsInstanceFieldReads() { + long staticsSize = WHITE_BOX.getObjectSize(TEST_OBJECT.getClass()); + List result = new ArrayList<>(); + for (KindData k : PRIMITIVE_KIND_DATA) { + long lastValidOffset = staticsSize - (k.kind.getByteCount()); + result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, lastValidOffset, false}); + result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, (long) -1, true}); + result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, lastValidOffset + 1, true}); + result.add(new Object[] {k.kind, TEST_CLASS_CONSTANT, lastValidOffset + 100, true}); + } + return result.toArray(new Object[result.size()][]); } @DataProvider(name = "negative") @@ -108,6 +114,7 @@ public class MemoryAccessProviderData { new Object[]{JavaKind.Illegal, JavaConstant.INT_1}}; } + private static class TestClass { public final boolean booleanField = true; public final byte byteField = 2; @@ -117,6 +124,43 @@ public class MemoryAccessProviderData { public final double doubleField = 6.0d; public final float floatField = 7.0f; public final char charField = 'a'; - public final String stringField = "abc"; + public final String objectField = "abc"; + + public static final boolean booleanStaticField = true; + public static final byte byteStaticField = 2; + public static final short shortStaticField = 3; + public static final int intStaticField = 4; + public static final long longStaticField = 5L; + public static final double doubleStaticField = 6.0d; + public static final float floatStaticField = 7.0f; + public static final char charStaticField = 'a'; + public static final String objectStaticField = "abc"; + } + + + static class KindData { + final JavaKind kind; + final Field instanceField; + final Field staticField; + final long instanceFieldOffset; + final long staticFieldOffset; + final JavaConstant instanceFieldValue; + final JavaConstant staticFieldValue; + KindData(JavaKind kind, Object testObject) { + this.kind = kind; + try { + Class c = testObject.getClass(); + instanceField = c.getDeclaredField(kind.getJavaName() + "Field"); + staticField = c.getDeclaredField(kind.getJavaName() + "StaticField"); + instanceField.setAccessible(true); + staticField.setAccessible(true); + instanceFieldOffset = UNSAFE.objectFieldOffset(instanceField); + staticFieldOffset = UNSAFE.staticFieldOffset(staticField); + instanceFieldValue = JavaConstant.forBoxedPrimitive(instanceField.get(testObject)); + staticFieldValue = JavaConstant.forBoxedPrimitive(staticField.get(null)); + } catch (Exception e) { + throw new Error("TESTBUG for kind " + kind, e); + } + } } } diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java index bbf4c3a1ab9..d119a2bca06 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java @@ -26,17 +26,24 @@ * @bug 8152341 * @requires vm.jvmci * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.common - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.hotspot + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.common + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot * java.base/jdk.internal.misc - * @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * jdk.vm.ci.hotspot.test.MemoryAccessProviderTest + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run testng/othervm -Xbootclasspath/a:. + * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.MemoryAccessProviderTest */ package jdk.vm.ci.hotspot.test; +import sun.hotspot.WhiteBox; + import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MemoryAccessProvider; @@ -59,7 +66,27 @@ public class MemoryAccessProviderTest { @Test(dataProvider = "negative", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class}) public void testNegativeReadPrimitiveConstant(JavaKind kind, Constant base) { - PROVIDER.readPrimitiveConstant(kind, base, 0L, kind == null ? 0 : kind.getBitCount()); + PROVIDER.readPrimitiveConstant(kind, base, 0L, kind == null ? 0 : kind.getByteCount() / 8); + } + + @Test(dataProvider = "outOfBoundsInstanceFields", dataProviderClass = MemoryAccessProviderData.class) + public void testReadPrimitiveInstanceFieldOutOfBounds(JavaKind kind, Constant base, Long offset, boolean isOutOfBounds) { + try { + PROVIDER.readPrimitiveConstant(kind, base, offset, kind.getByteCount() * 8); + Assert.assertFalse(isOutOfBounds); + } catch (IllegalArgumentException iae) { + Assert.assertTrue(isOutOfBounds); + } + } + + @Test(dataProvider = "outOfBoundsStaticFields", dataProviderClass = MemoryAccessProviderData.class) + public void testReadPrimitiveStaticFieldOutOFBounds(JavaKind kind, Constant base, Long offset, boolean isOutOfBounds) { + try { + PROVIDER.readPrimitiveConstant(kind, base, offset, kind.getByteCount() * 8); + Assert.assertFalse(isOutOfBounds); + } catch (IllegalArgumentException iae) { + Assert.assertTrue(isOutOfBounds); + } } @Test(dataProvider = "positiveObject", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class}) @@ -87,7 +114,7 @@ public class MemoryAccessProviderTest { Assert.assertNull(PROVIDER.readObjectConstant(base, offset + 1), "Expected null"); } - @Test(dataProvider = "positivePrimitive", dataProviderClass = MemoryAccessProviderData.class) + @Test(dataProvider = "positivePrimitive", dataProviderClass = MemoryAccessProviderData.class, expectedExceptions = {IllegalArgumentException.class}) public void testNegativeReadObjectConstantPrimitiveBase(JavaKind kind, Constant base, Long offset, Object expected, int bitsCount) { Assert.assertNull(PROVIDER.readObjectConstant(base, offset), "Expected null"); } diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java index 153cfc9698e..a1fea7d8f0f 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MethodHandleAccessProviderTest.java @@ -28,11 +28,11 @@ * @requires vm.jvmci * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src * @modules java.base/java.lang.invoke:+open - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * @modules jdk.vm.ci/jdk.vm.ci.hotspot:+open + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot:+open * @run testng/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI - * jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest + * -Djvmci.Compiler=null jdk.vm.ci.hotspot.test.MethodHandleAccessProviderTest */ package jdk.vm.ci.hotspot.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java index fb0f1a2bd80..a0a9218b220 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ConstantTest.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ConstantTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ConstantTest */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java index 8f0ce0c2cc9..5826f452f8f 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/RedefineClassTest.java @@ -25,11 +25,11 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * jdk.attach * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.RedefineClassTest + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.RedefineClassTest */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java index 78c5a79f81c..20bb4d872c6 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java @@ -24,9 +24,9 @@ /** * @test * @requires vm.jvmci - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveConcreteMethodTest */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java index f4b15b2dc82..1d754b1f381 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java @@ -24,9 +24,9 @@ /** * @test * @requires vm.jvmci - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.ResolvedJavaTypeResolveMethodTest */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java index 43cd69f0352..6f11bd5d5de 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestConstantReflectionProvider.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestConstantReflectionProvider + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestConstantReflectionProvider */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java index 792901898a3..4d4313981c5 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaField.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaField + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestJavaField */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java index a8edfec11e5..357d1097597 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaMethod.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaMethod + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestJavaMethod */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java index 669b579d51b..45aa1b73dbd 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestJavaType.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestJavaType + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestJavaType */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java index 37d7d5233da..fc7cecdaba2 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestMetaAccessProvider.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestMetaAccessProvider + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestMetaAccessProvider */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java index 48a6dc8613e..20800d4478b 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaField + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestResolvedJavaField */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java index 5087814bdaf..3a27644ab6a 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java @@ -25,10 +25,10 @@ * @test * @requires vm.jvmci * @library ../../../../../ - * @modules jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * @modules jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaMethod + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestResolvedJavaMethod */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java index e8f9f9ba082..b732aca979a 100644 --- a/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java +++ b/hotspot/test/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java @@ -26,11 +26,11 @@ * @requires vm.jvmci * @library ../../../../../ * @modules java.base/jdk.internal.reflect - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime - * jdk.vm.ci/jdk.vm.ci.common + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.common * java.base/jdk.internal.misc - * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI jdk.vm.ci.runtime.test.TestResolvedJavaType + * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null jdk.vm.ci.runtime.test.TestResolvedJavaType */ package jdk.vm.ci.runtime.test; diff --git a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java index 147811f6b6f..05849847603 100644 --- a/hotspot/test/compiler/jvmci/meta/StableFieldTest.java +++ b/hotspot/test/compiler/jvmci/meta/StableFieldTest.java @@ -28,13 +28,13 @@ * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation - * jdk.vm.ci/jdk.vm.ci.hotspot - * jdk.vm.ci/jdk.vm.ci.meta - * jdk.vm.ci/jdk.vm.ci.runtime + * jdk.internal.vm.ci/jdk.vm.ci.hotspot + * jdk.internal.vm.ci/jdk.vm.ci.meta + * jdk.internal.vm.ci/jdk.vm.ci.runtime * * @compile StableFieldTest.java * @run driver ClassFileInstaller compiler.jvmci.meta.StableFieldTest - * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Xbootclasspath/a:. compiler.jvmci.meta.StableFieldTest + * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -Djvmci.Compiler=null -Xbootclasspath/a:. compiler.jvmci.meta.StableFieldTest */ package compiler.jvmci.meta; diff --git a/hotspot/test/compiler/loopopts/TestLoopPeeling.java b/hotspot/test/compiler/loopopts/TestLoopPeeling.java index 3627ff5726c..a32f3cb851a 100644 --- a/hotspot/test/compiler/loopopts/TestLoopPeeling.java +++ b/hotspot/test/compiler/loopopts/TestLoopPeeling.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * 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 8078262 + * @bug 8078262 8177095 * @summary Tests correct dominator information after loop peeling. * * @run main/othervm -Xcomp @@ -40,14 +40,16 @@ public class TestLoopPeeling { public static void main(String args[]) { TestLoopPeeling test = new TestLoopPeeling(); try { - test.testArrayAccess(0, 1); + test.testArrayAccess1(0, 1); + test.testArrayAccess2(0); + test.testArrayAccess3(0, false); test.testArrayAllocation(0, 1); } catch (Exception e) { // Ignore exceptions } } - public void testArrayAccess(int index, int inc) { + public void testArrayAccess1(int index, int inc) { int storeIndex = -1; for (; index < 10; index += inc) { @@ -63,7 +65,7 @@ public class TestLoopPeeling { if (index == 42) { // This store and the corresponding range check are moved out of the - // loop and both used after old loop and the peeled iteration exit. + // loop and both used after main loop and the peeled iteration exit. // For the peeled iteration, storeIndex is always -1 and the ConvI2L // is replaced by TOP. However, the range check is not folded because // we don't do the split if optimization in PhaseIdealLoop2. @@ -77,6 +79,44 @@ public class TestLoopPeeling { } } + public int testArrayAccess2(int index) { + // Load1 and the corresponding range check are moved out of the loop + // and both are used after the main loop and the peeled iteration exit. + // For the peeled iteration, storeIndex is always Integer.MIN_VALUE and + // for the main loop it is 0. Hence, the merging phi has type int:<=0. + // Load1 reads the array at index ConvI2L(CastII(AddI(storeIndex, -1))) + // where the CastII is range check dependent and has type int:>=0. + // The CastII gets pushed through the AddI and its type is changed to int:>=1 + // which does not overlap with the input type of storeIndex (int:<=0). + // The CastII is replaced by TOP causing a cascade of other eliminations. + // Since the control path through the range check CmpU(AddI(storeIndex, -1)) + // is not eliminated, the graph is in a corrupted state. We fail once we merge + // with the result of Load2 because we get data from a non-dominating region. + int storeIndex = Integer.MIN_VALUE; + for (; index < 10; ++index) { + if (index == 42) { + return array[storeIndex-1]; // Load1 + } + storeIndex = 0; + } + return array[42]; // Load2 + } + + public int testArrayAccess3(int index, boolean b) { + // Same as testArrayAccess2 but manifests as crash in register allocator. + int storeIndex = Integer.MIN_VALUE; + for (; index < 10; ++index) { + if (b) { + return 0; + } + if (index == 42) { + return array[storeIndex-1]; // Load1 + } + storeIndex = 0; + } + return array[42]; // Load2 + } + public byte[] testArrayAllocation(int index, int inc) { int allocationCount = -1; byte[] result; @@ -88,7 +128,7 @@ public class TestLoopPeeling { if (index == 42) { // This allocation and the corresponding size check are moved out of the - // loop and both used after old loop and the peeled iteration exit. + // loop and both used after main loop and the peeled iteration exit. // For the peeled iteration, allocationCount is always -1 and the ConvI2L // is replaced by TOP. However, the size check is not folded because // we don't do the split if optimization in PhaseIdealLoop2. diff --git a/hotspot/test/compiler/patches/java.base/java/lang/Helper.java b/hotspot/test/compiler/patches/java.base/java/lang/Helper.java index 65347c87b1b..b38bebba309 100644 --- a/hotspot/test/compiler/patches/java.base/java/lang/Helper.java +++ b/hotspot/test/compiler/patches/java.base/java/lang/Helper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,4 +73,84 @@ public class Helper { StringUTF16.getChars(value, srcBegin, srcEnd, dst, dstBegin); return dst; } + + public static void putCharSB(byte[] val, int index, int c) { + StringUTF16.putCharSB(val, index, c); + } + + public static void putCharsSB(byte[] val, int index, char[] ca, int off, int end) { + StringUTF16.putCharsSB(val, index, ca, off, end); + } + + public static void putCharsSB(byte[] val, int index, CharSequence s, int off, int end) { + StringUTF16.putCharsSB(val, index, s, off, end); + } + + public static int codePointAtSB(byte[] val, int index, int end) { + return StringUTF16.codePointAtSB(val, index, end); + } + + public static int codePointBeforeSB(byte[] val, int index) { + return StringUTF16.codePointBeforeSB(val, index); + } + + public static int codePointCountSB(byte[] val, int beginIndex, int endIndex) { + return StringUTF16.codePointCountSB(val, beginIndex, endIndex); + } + + public static int getChars(int i, int begin, int end, byte[] value) { + return StringUTF16.getChars(i, begin, end, value); + } + + public static int getChars(long l, int begin, int end, byte[] value) { + return StringUTF16.getChars(l, begin, end, value); + } + + public static boolean contentEquals(byte[] v1, byte[] v2, int len) { + return StringUTF16.contentEquals(v1, v2, len); + } + + public static boolean contentEquals(byte[] value, CharSequence cs, int len) { + return StringUTF16.contentEquals(value, cs, len); + } + + public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4) { + return StringUTF16.putCharsAt(value, i, c1, c2, c3, c4); + } + + public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4, char c5) { + return StringUTF16.putCharsAt(value, i, c1, c2, c3, c4, c5); + } + + public static char charAt(byte[] value, int index) { + return StringUTF16.charAt(value, index); + } + + public static void reverse(byte[] value, int count) { + StringUTF16.reverse(value, count); + } + + public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { + StringUTF16.inflate(src, srcOff, dst, dstOff, len); + } + + public static int indexOf(byte[] src, int srcCount, + byte[] tgt, int tgtCount, int fromIndex) { + return StringUTF16.indexOf(src, srcCount, tgt, tgtCount, fromIndex); + } + + public static int indexOfLatin1(byte[] src, int srcCount, + byte[] tgt, int tgtCount, int fromIndex) { + return StringUTF16.indexOfLatin1(src, srcCount, tgt, tgtCount, fromIndex); + } + public static int lastIndexOf(byte[] src, byte[] tgt, int tgtCount, int fromIndex) { + int srcCount = StringUTF16.length(src); // ignored + return StringUTF16.lastIndexOf(src, srcCount, tgt, tgtCount, fromIndex); + } + + public static int lastIndexOfLatin1(byte[] src, byte[] tgt, int tgtCount, int fromIndex) { + int srcCount = StringUTF16.length(src); // ignored + return StringUTF16.lastIndexOfLatin1(src, srcCount, tgt, tgtCount, fromIndex); + } + } diff --git a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java index f4958a607c2..fee36b9e5c1 100644 --- a/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java +++ b/hotspot/test/compiler/testlibrary/rtm/predicate/SupportedVM.java @@ -30,6 +30,6 @@ import java.util.function.BooleanSupplier; public class SupportedVM implements BooleanSupplier { @Override public boolean getAsBoolean() { - return Platform.isServer(); + return Platform.isServer() && !Platform.isEmulatedClient(); } } diff --git a/hotspot/test/compiler/types/correctness/OffTest.java b/hotspot/test/compiler/types/correctness/OffTest.java index 7593fc68a0d..5a8fe5953ac 100644 --- a/hotspot/test/compiler/types/correctness/OffTest.java +++ b/hotspot/test/compiler/types/correctness/OffTest.java @@ -24,6 +24,7 @@ /* * @test CorrectnessTest * @bug 8038418 + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff --git a/hotspot/test/compiler/unsafe/TestRawAliasing.java b/hotspot/test/compiler/unsafe/TestRawAliasing.java new file mode 100644 index 00000000000..c4042b81e2c --- /dev/null +++ b/hotspot/test/compiler/unsafe/TestRawAliasing.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8178047 + * @run main/othervm -XX:CompileCommand=exclude,*.main -XX:-TieredCompilation -XX:-BackgroundCompilation compiler.unsafe.TestRawAliasing + * @modules java.base/jdk.internal.misc:+open + */ + +package compiler.unsafe; + +import java.lang.reflect.Field; + +public class TestRawAliasing { + static private final jdk.internal.misc.Unsafe UNSAFE; + static { + try { + Field f = jdk.internal.misc.Unsafe.class.getDeclaredField("theUnsafe"); + f.setAccessible(true); + UNSAFE = (jdk.internal.misc.Unsafe) f.get(null); + } catch (Exception e) { + throw new RuntimeException("Unable to get Unsafe instance.", e); + } + } + + static private final int OFFSET_X = 50; + static private final int OFFSET_Y = 100; + + private static int test(long base_plus_offset_x, long base_plus_offset_y, int magic_value) { + // write 0 to a location + UNSAFE.putByte(base_plus_offset_x - OFFSET_X, (byte)0); + // write unfoldable value to really the same location with another base + UNSAFE.putByte(base_plus_offset_y - OFFSET_Y, (byte)magic_value); + // read the value back, should be equal to "unfoldable_value" + return UNSAFE.getByte(base_plus_offset_x - OFFSET_X); + } + + private static final int OFF_HEAP_AREA_SIZE = 128; + private static final byte MAGIC = 123; + + // main is excluded from compilation since we don't want the test method to inline and make base values fold + public static void main(String... args) { + long base = UNSAFE.allocateMemory(OFF_HEAP_AREA_SIZE); + for (int i = 0; i < 100_000; i++) { + if (test(base + OFFSET_X, base + OFFSET_Y, MAGIC) != MAGIC) { + throw new RuntimeException("Unexpected magic value"); + } + } + } +} diff --git a/hotspot/test/gc/arguments/TestAggressiveHeap.java b/hotspot/test/gc/arguments/TestAggressiveHeap.java new file mode 100644 index 00000000000..417e98090ea --- /dev/null +++ b/hotspot/test/gc/arguments/TestAggressiveHeap.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 TestAggressiveHeap + * @key gc + * @bug 8179084 + * @requires vm.gc.Parallel + * @summary Test argument processing for -XX:+AggressiveHeap. + * @library /test/lib + * @modules java.base java.management + * @run driver TestAggressiveHeap + */ + +import java.lang.management.ManagementFactory; +import javax.management.MBeanServer; +import javax.management.ObjectName; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +public class TestAggressiveHeap { + + public static void main(String args[]) throws Exception { + if (canUseAggressiveHeapOption()) { + testFlag(); + } + } + + // Note: Not a normal boolean flag; -XX:-AggressiveHeap is invalid. + private static final String option = "-XX:+AggressiveHeap"; + + // Option requires at least 256M, else error during option processing. + private static final long minMemory = 256 * 1024 * 1024; + + // bool UseParallelGC = true {product} {command line} + private static final String parallelGCPattern = + " *bool +UseParallelGC *= *true +\\{product\\} *\\{command line\\}"; + + private static void testFlag() throws Exception { + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( + option, "-XX:+PrintFlagsFinal", "-version"); + + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.shouldHaveExitValue(0); + + String value = output.firstMatch(parallelGCPattern); + if (value == null) { + throw new RuntimeException( + option + " didn't set UseParallelGC as if from command line"); + } + } + + private static boolean haveRequiredMemory() throws Exception { + MBeanServer server = ManagementFactory.getPlatformMBeanServer(); + ObjectName os = new ObjectName("java.lang", "type", "OperatingSystem"); + Object attr = server.getAttribute(os, "TotalPhysicalMemorySize"); + String value = attr.toString(); + long memory = Long.parseLong(value); + return memory >= minMemory; + } + + private static boolean canUseAggressiveHeapOption() throws Exception { + if (!haveRequiredMemory()) { + System.out.println( + "Skipping test of " + option + " : insufficient memory"); + return false; + } + return true; + } +} + diff --git a/hotspot/test/gc/arguments/TestExplicitGCInvokesConcurrentAndUnloadsClasses.java b/hotspot/test/gc/arguments/TestExplicitGCInvokesConcurrentAndUnloadsClasses.java deleted file mode 100644 index 83f075760d6..00000000000 --- a/hotspot/test/gc/arguments/TestExplicitGCInvokesConcurrentAndUnloadsClasses.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 TestExplicitGCInvokesConcurrentAndUnloadsClasses - * @summary Test that the flag ExplicitGCInvokesConcurrentAndUnloadsClasses is deprecated - * @bug 8170388 - * @key gc - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - * @run driver TestExplicitGCInvokesConcurrentAndUnloadsClasses - */ - -import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.process.ProcessTools; - -public class TestExplicitGCInvokesConcurrentAndUnloadsClasses { - public static void main(String[] args) throws Exception { - ProcessBuilder pb = - ProcessTools.createJavaProcessBuilder("-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses", - "-Xlog:gc", - "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("ExplicitGCInvokesConcurrentAndUnloadsClasses was deprecated"); - output.shouldHaveExitValue(0); - } -} diff --git a/hotspot/test/gc/arguments/TestSelectDefaultGC.java b/hotspot/test/gc/arguments/TestSelectDefaultGC.java index de770b283b8..084ee04a86b 100644 --- a/hotspot/test/gc/arguments/TestSelectDefaultGC.java +++ b/hotspot/test/gc/arguments/TestSelectDefaultGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,7 +66,6 @@ public class TestSelectDefaultGC { assertVMOption(output, "UseSerialGC", !isServer); // CMS is never default assertVMOption(output, "UseConcMarkSweepGC", false); - assertVMOption(output, "UseParNewGC", false); } public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java b/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java index 1069b417d47..ccba8fcb8d5 100644 --- a/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java +++ b/hotspot/test/gc/parallel/TestPrintGCDetailsVerbose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,12 +23,13 @@ /* * @test TestPrintGCDetailsVerbose - * @bug 8016740 + * @bug 8016740 8177963 * @summary Tests that jvm with maximally verbose GC logging does not crash when ParOldGC has no memory * @key gc * @requires vm.gc.Parallel * @modules java.base/jdk.internal.misc * @run main/othervm -Xmx50m -XX:+UseParallelGC -Xlog:gc*=trace TestPrintGCDetailsVerbose + * @run main/othervm -Xmx50m -XX:+UseParallelGC -XX:GCTaskTimeStampEntries=1 -Xlog:gc*=trace TestPrintGCDetailsVerbose */ public class TestPrintGCDetailsVerbose { diff --git a/hotspot/test/gc/startup_warnings/TestCMS.java b/hotspot/test/gc/startup_warnings/TestCMS.java index d51a3ded1c0..a5b7cc9fc89 100644 --- a/hotspot/test/gc/startup_warnings/TestCMS.java +++ b/hotspot/test/gc/startup_warnings/TestCMS.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test TestCMS * @key gc -* @bug 8006398 8155948 -* @summary Test that CMS prints a warning message only for a commercial build +* @bug 8006398 8155948 8179013 +* @summary Test that CMS prints a warning message * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -33,19 +33,13 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; -import jdk.test.lib.BuildHelper; public class TestCMS { public static void runTest(String[] args) throws Exception { - boolean isCommercial = BuildHelper.isCommercialBuild(); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(args); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - if (isCommercial) { - output.shouldContain("deprecated"); - } else { - output.shouldNotContain("deprecated"); - } + output.shouldContain("deprecated"); output.shouldNotContain("error"); output.shouldHaveExitValue(0); } diff --git a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java b/hotspot/test/gc/startup_warnings/TestDefNewCMS.java deleted file mode 100644 index f8780679733..00000000000 --- a/hotspot/test/gc/startup_warnings/TestDefNewCMS.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 TestDefNewCMS -* @key gc -* @bug 8065972 -* @summary Test that the unsupported DefNew+CMS combination does not start -* @library /test/lib -* @modules java.base/jdk.internal.misc -* java.management -*/ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - -public class TestDefNewCMS { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:-UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("It is not possible to combine the DefNew young collector with the CMS collector."); - output.shouldContain("Error"); - output.shouldHaveExitValue(1); - } - -} diff --git a/hotspot/test/gc/startup_warnings/TestParNewCMS.java b/hotspot/test/gc/startup_warnings/TestParNewCMS.java deleted file mode 100644 index 75dbe4bf7b3..00000000000 --- a/hotspot/test/gc/startup_warnings/TestParNewCMS.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 TestParNewCMS -* @key gc -* @bug 8065972 -* @summary Test that specifying -XX:+UseParNewGC on the command line logs a warning message -* @library /test/lib -* @modules java.base/jdk.internal.misc -* java.management -*/ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - - -public class TestParNewCMS { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-XX:+UseConcMarkSweepGC", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("warning: Option UseParNewGC was deprecated in version"); - output.shouldNotContain("error"); - output.shouldHaveExitValue(0); - } - -} diff --git a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java b/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java deleted file mode 100644 index a4c8d5c31e1..00000000000 --- a/hotspot/test/gc/startup_warnings/TestParNewSerialOld.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 TestParNewSerialOld -* @key gc -* @bug 8065972 -* @summary Test that the unsupported ParNew+SerialOld combination does not start -* @library /test/lib -* @modules java.base/jdk.internal.misc -* java.management -*/ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - - -public class TestParNewSerialOld { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseParNewGC", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("It is not possible to combine the ParNew young collector with any collector other than CMS."); - output.shouldContain("Error"); - output.shouldHaveExitValue(1); - } - -} diff --git a/hotspot/test/gc/startup_warnings/TestUseAutoGCSelectPolicy.java b/hotspot/test/gc/startup_warnings/TestUseAutoGCSelectPolicy.java deleted file mode 100644 index 360e5e05970..00000000000 --- a/hotspot/test/gc/startup_warnings/TestUseAutoGCSelectPolicy.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 TestUseAutoGCSelectPolicy - * @key gc - * @bug 8166461 8167494 - * @summary Test that UseAutoGCSelectPolicy and AutoGCSelectPauseMillis do print a warning message - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - */ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - -public class TestUseAutoGCSelectPolicy { - - public static void main(String args[]) throws Exception { - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseAutoGCSelectPolicy", "-XX:AutoGCSelectPauseMillis=3000", "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("UseAutoGCSelectPolicy was deprecated in version 9.0"); - output.shouldContain("AutoGCSelectPauseMillis was deprecated in version 9.0"); - output.shouldNotContain("error"); - output.shouldHaveExitValue(0); - } -} diff --git a/hotspot/test/native/runtime/test_globals.cpp b/hotspot/test/native/runtime/test_globals.cpp index 2b6a99771d2..3a84f2ce714 100644 --- a/hotspot/test/native/runtime/test_globals.cpp +++ b/hotspot/test/native/runtime/test_globals.cpp @@ -53,7 +53,7 @@ TEST_VM(FlagGuard, uint_flag) { } TEST_VM(FlagGuard, uintx_flag) { - TEST_FLAG(GCTaskTimeStampEntries, uintx, 1337); + TEST_FLAG(GCTaskTimeStampEntries, uint, 1337); } TEST_VM(FlagGuard, size_t_flag) { diff --git a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java index 31d8b47a2ba..59d245548a5 100644 --- a/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java +++ b/hotspot/test/runtime/CommandLine/ObsoleteFlagErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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,18 +37,18 @@ public class ObsoleteFlagErrorMessage { // Case 1: Newly obsolete flags with extra junk appended should not be treated as newly obsolete (8060449) ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:UseOldInliningPlusJunk", "-version"); + "-XX:ConvertSleepToYieldPlusJunk", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Unrecognized VM option 'UseOldInliningPlusJunk'"); // Must identify bad option. + output.shouldContain("Unrecognized VM option 'ConvertSleepToYieldPlusJunk'"); // Must identify bad option. output.shouldHaveExitValue(1); - // Case 2: Newly obsolete integer-valued flags should be recognized as newly obsolete (8073989) + // Case 2: Newly obsolete flags should be recognized as newly obsolete (8073989) ProcessBuilder pb2 = ProcessTools.createJavaProcessBuilder( - "-XX:NmethodSweepFraction=10", "-version"); + "-XX:+ConvertSleepToYield", "-version"); OutputAnalyzer output2 = new OutputAnalyzer(pb2.start()); output2.shouldContain("Ignoring option").shouldContain("support was removed"); - output2.shouldContain("NmethodSweepFraction"); + output2.shouldContain("ConvertSleepToYield"); } } diff --git a/hotspot/test/runtime/CommandLine/VMAliasOptions.java b/hotspot/test/runtime/CommandLine/VMAliasOptions.java index eae37477c08..d82b4ae2274 100644 --- a/hotspot/test/runtime/CommandLine/VMAliasOptions.java +++ b/hotspot/test/runtime/CommandLine/VMAliasOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ public class VMAliasOptions { */ public static final String[][] ALIAS_OPTIONS = { {"DefaultMaxRAMFraction", "MaxRAMFraction", "1032"}, - {"CMSMarkStackSizeMax", "MarkStackSizeMax", "1032"}, - {"CMSMarkStackSize", "MarkStackSize", "1032"}, - {"G1MarkStackSize", "MarkStackSize", "1032"}, - {"ParallelMarkingThreads", "ConcGCThreads", "2"}, - {"ParallelCMSThreads", "ConcGCThreads", "2"}, {"CreateMinidumpOnCrash", "CreateCoredumpOnCrash", "false" }, }; diff --git a/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java index 06f73568460..bbd2ea5c49f 100644 --- a/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java +++ b/hotspot/test/runtime/CommandLine/VMDeprecatedOptions.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,17 +41,9 @@ public class VMDeprecatedOptions { public static final String[][] DEPRECATED_OPTIONS = { // deprecated non-alias flags: {"MaxGCMinorPauseMillis", "1032"}, - {"UseParNewGC", "false"}, - {"ConvertSleepToYield", "false" }, - {"ConvertYieldToSleep", "false" }, // deprecated alias flags (see also aliased_jvm_flags): {"DefaultMaxRAMFraction", "4"}, - {"CMSMarkStackSizeMax", "1032"}, - {"CMSMarkStackSize", "1032"}, - {"G1MarkStackSize", "1032"}, - {"ParallelMarkingThreads", "2"}, - {"ParallelCMSThreads", "2"}, {"CreateMinidumpOnCrash", "false"} }; diff --git a/hotspot/test/runtime/LocalLong/LocalLongHelper.java b/hotspot/test/runtime/LocalLong/LocalLongHelper.java index 2134aee069e..065d7d8cbcb 100644 --- a/hotspot/test/runtime/LocalLong/LocalLongHelper.java +++ b/hotspot/test/runtime/LocalLong/LocalLongHelper.java @@ -30,10 +30,10 @@ import java.lang.StackWalker.StackFrame; public class LocalLongHelper { static StackWalker sw; - static Method intValue; + static Method longValue; static Method getLocals; static Class primitiveValueClass; - static Method primitiveType; + static Method primitiveSize; static Method getMethodType; static Field memberName; static Field offset; @@ -43,27 +43,29 @@ public class LocalLongHelper { new LocalLongHelper().longArg(0xC0FFEE, 0x1234567890ABCDEFL); } - // locals[2] contains the high byte of the long argument. + // locals[2] contains the unused slot of the long argument. public long longArg(int i, long l) throws Throwable { List frames = sw.walk(s -> s.collect(Collectors.toList())); Object[] locals = (Object[]) getLocals.invoke(frames.get(0)); - int locals_2 = (int) intValue.invoke(locals[2]); - if (locals_2 != 0){ - throw new RuntimeException("Expected locals_2 == 0"); + if (8 == (int) primitiveSize.invoke(locals[2])) { // Only test 64-bit + long locals_2 = (long) longValue.invoke(locals[2]); + if (locals_2 != 0){ + throw new RuntimeException("Expected locals_2 == 0"); + } } return l; // Don't want l to become a dead var } private static void setupReflectionStatics() throws Throwable { Class liveStackFrameClass = Class.forName("java.lang.LiveStackFrame"); - primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveValue"); + primitiveValueClass = Class.forName("java.lang.LiveStackFrame$PrimitiveSlot"); getLocals = liveStackFrameClass.getDeclaredMethod("getLocals"); getLocals.setAccessible(true); - intValue = primitiveValueClass.getDeclaredMethod("intValue"); - intValue.setAccessible(true); + longValue = primitiveValueClass.getDeclaredMethod("longValue"); + longValue.setAccessible(true); Class stackFrameInfoClass = Class.forName("java.lang.StackFrameInfo"); memberName = stackFrameInfoClass.getDeclaredField("memberName"); @@ -80,20 +82,8 @@ public class LocalLongHelper { f.setAccessible(true); Object localsAndOperandsOption = f.get(null); - primitiveType = primitiveValueClass.getDeclaredMethod("type"); - primitiveType.setAccessible(true); - + primitiveSize = primitiveValueClass.getDeclaredMethod("size"); + primitiveSize.setAccessible(true); sw = (StackWalker) ewsNI.invoke(null, java.util.Collections.emptySet(), localsAndOperandsOption); } - - private static String type(Object o) throws Throwable { - if (primitiveValueClass.isInstance(o)) { - final char c = (char) primitiveType.invoke(o); - return String.valueOf(c); - } else if (o != null) { - return o.getClass().getName(); - } else { - return "null"; - } - } } diff --git a/hotspot/test/runtime/Metaspace/DefineClass.java b/hotspot/test/runtime/Metaspace/DefineClass.java new file mode 100644 index 00000000000..4563e56366f --- /dev/null +++ b/hotspot/test/runtime/Metaspace/DefineClass.java @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2017 SAP SE. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8173743 + * @requires vm.compMode != "Xcomp" + * @summary Failures during class definition can lead to memory leaks in metaspace + * @library /test/lib + * @run main/othervm test.DefineClass defineClass + * @run main/othervm test.DefineClass defineSystemClass + * @run main/othervm -XX:+UnlockDiagnosticVMOptions + -XX:+UnsyncloadClass -XX:+AllowParallelDefineClass + test.DefineClass defineClassParallel + * @run main/othervm -XX:+UnlockDiagnosticVMOptions + -XX:+UnsyncloadClass -XX:-AllowParallelDefineClass + test.DefineClass defineClassParallel + * @run main/othervm -XX:+UnlockDiagnosticVMOptions + -XX:-UnsyncloadClass -XX:+AllowParallelDefineClass + test.DefineClass defineClassParallel + * @run main/othervm -XX:+UnlockDiagnosticVMOptions + -XX:-UnsyncloadClass -XX:-AllowParallelDefineClass + test.DefineClass defineClassParallel + * @run main/othervm test.DefineClass redefineClass + * @run main/othervm test.DefineClass redefineClassWithError + * @author volker.simonis@gmail.com + */ + +package test; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.lang.instrument.ClassDefinition; +import java.lang.instrument.Instrumentation; +import java.lang.management.ManagementFactory; +import java.util.Scanner; +import java.util.concurrent.CountDownLatch; +import java.util.jar.Attributes; +import java.util.jar.JarEntry; +import java.util.jar.JarOutputStream; +import java.util.jar.Manifest; + +import javax.management.MBeanServer; +import javax.management.ObjectName; + +import com.sun.tools.attach.VirtualMachine; + +import jdk.test.lib.process.ProcessTools; + +public class DefineClass { + + private static Instrumentation instrumentation; + + public void getID(CountDownLatch start, CountDownLatch stop) { + String id = "AAAAAAAA"; + System.out.println(id); + try { + // Signal that we've entered the activation.. + start.countDown(); + //..and wait until we can leave it. + stop.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + System.out.println(id); + return; + } + + private static class MyThread extends Thread { + private DefineClass dc; + private CountDownLatch start, stop; + + public MyThread(DefineClass dc, CountDownLatch start, CountDownLatch stop) { + this.dc = dc; + this.start = start; + this.stop = stop; + } + + public void run() { + dc.getID(start, stop); + } + } + + private static class ParallelLoadingThread extends Thread { + private MyParallelClassLoader pcl; + private CountDownLatch stop; + private byte[] buf; + + public ParallelLoadingThread(MyParallelClassLoader pcl, byte[] buf, CountDownLatch stop) { + this.pcl = pcl; + this.stop = stop; + this.buf = buf; + } + + public void run() { + try { + stop.await(); + } catch (InterruptedException e) { + e.printStackTrace(); + } + try { + @SuppressWarnings("unchecked") + Class dc = (Class) pcl.myDefineClass(DefineClass.class.getName(), buf, 0, buf.length); + } + catch (LinkageError jle) { + // Expected with a parallel capable class loader and + // -XX:+UnsyncloadClass or -XX:+AllowParallelDefineClass + pcl.incrementLinkageErrors(); + } + + } + } + + static private class MyClassLoader extends ClassLoader { + public Class myDefineClass(String name, byte[] b, int off, int len) throws ClassFormatError { + return defineClass(name, b, off, len, null); + } + } + + static private class MyParallelClassLoader extends ClassLoader { + static { + System.out.println("parallelCapable : " + registerAsParallelCapable()); + } + public Class myDefineClass(String name, byte[] b, int off, int len) throws ClassFormatError { + return defineClass(name, b, off, len, null); + } + public synchronized void incrementLinkageErrors() { + linkageErrors++; + } + public int getLinkageErrors() { + return linkageErrors; + } + private volatile int linkageErrors; + } + + public static void agentmain(String args, Instrumentation inst) { + System.out.println("Loading Java Agent."); + instrumentation = inst; + } + + + private static void loadInstrumentationAgent(String myName, byte[] buf) throws Exception { + // Create agent jar file on the fly + Manifest m = new Manifest(); + m.getMainAttributes().put(Attributes.Name.MANIFEST_VERSION, "1.0"); + m.getMainAttributes().put(new Attributes.Name("Agent-Class"), myName); + m.getMainAttributes().put(new Attributes.Name("Can-Redefine-Classes"), "true"); + File jarFile = File.createTempFile("agent", ".jar"); + jarFile.deleteOnExit(); + JarOutputStream jar = new JarOutputStream(new FileOutputStream(jarFile), m); + jar.putNextEntry(new JarEntry(myName.replace('.', '/') + ".class")); + jar.write(buf); + jar.close(); + String pid = Long.toString(ProcessTools.getProcessId()); + System.out.println("Our pid is = " + pid); + VirtualMachine vm = VirtualMachine.attach(pid); + vm.loadAgent(jarFile.getAbsolutePath()); + } + + private static byte[] getBytecodes(String myName) throws Exception { + InputStream is = DefineClass.class.getResourceAsStream(myName + ".class"); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buf = new byte[4096]; + int len; + while ((len = is.read(buf)) != -1) baos.write(buf, 0, len); + buf = baos.toByteArray(); + System.out.println("sizeof(" + myName + ".class) == " + buf.length); + return buf; + } + + private static int getStringIndex(String needle, byte[] buf) { + return getStringIndex(needle, buf, 0); + } + + private static int getStringIndex(String needle, byte[] buf, int offset) { + outer: + for (int i = offset; i < buf.length - offset - needle.length(); i++) { + for (int j = 0; j < needle.length(); j++) { + if (buf[i + j] != (byte)needle.charAt(j)) continue outer; + } + return i; + } + return 0; + } + + private static void replaceString(byte[] buf, String name, int index) { + for (int i = index; i < index + name.length(); i++) { + buf[i] = (byte)name.charAt(i - index); + } + } + + private static MBeanServer mbserver = ManagementFactory.getPlatformMBeanServer(); + + private static int getClassStats(String pattern) { + try { + ObjectName diagCmd = new ObjectName("com.sun.management:type=DiagnosticCommand"); + + String result = (String)mbserver.invoke(diagCmd , "gcClassStats" , new Object[] { null }, new String[] {String[].class.getName()}); + int count = 0; + try (Scanner s = new Scanner(result)) { + if (s.hasNextLine()) { + System.out.println(s.nextLine()); + } + while (s.hasNextLine()) { + String l = s.nextLine(); + if (l.endsWith(pattern)) { + count++; + System.out.println(l); + } + } + } + return count; + } + catch (Exception e) { + throw new RuntimeException("Test failed because we can't read the class statistics!", e); + } + } + + private static void printClassStats(int expectedCount, boolean reportError) { + int count = getClassStats("DefineClass"); + String res = "Should have " + expectedCount + + " DefineClass instances and we have: " + count; + System.out.println(res); + if (reportError && count != expectedCount) { + throw new RuntimeException(res); + } + } + + public static final int ITERATIONS = 10; + + public static void main(String[] args) throws Exception { + String myName = DefineClass.class.getName(); + byte[] buf = getBytecodes(myName.substring(myName.lastIndexOf(".") + 1)); + int iterations = (args.length > 1 ? Integer.parseInt(args[1]) : ITERATIONS); + + if (args.length == 0 || "defineClass".equals(args[0])) { + MyClassLoader cl = new MyClassLoader(); + for (int i = 0; i < iterations; i++) { + try { + @SuppressWarnings("unchecked") + Class dc = (Class) cl.myDefineClass(myName, buf, 0, buf.length); + System.out.println(dc); + } + catch (LinkageError jle) { + // Can only define once! + if (i == 0) throw new Exception("Should succeed the first time."); + } + } + // We expect to have two instances of DefineClass here: the initial version in which we are + // executing and another version which was loaded into our own classloader 'MyClassLoader'. + // All the subsequent attempts to reload DefineClass into our 'MyClassLoader' should have failed. + printClassStats(2, false); + System.gc(); + System.out.println("System.gc()"); + // At least after System.gc() the failed loading attempts should leave no instances around! + printClassStats(2, true); + } + else if ("defineSystemClass".equals(args[0])) { + MyClassLoader cl = new MyClassLoader(); + int index = getStringIndex("test/DefineClass", buf); + replaceString(buf, "java/DefineClass", index); + while ((index = getStringIndex("Ltest/DefineClass;", buf, index + 1)) != 0) { + replaceString(buf, "Ljava/DefineClass;", index); + } + index = getStringIndex("test.DefineClass", buf); + replaceString(buf, "java.DefineClass", index); + + for (int i = 0; i < iterations; i++) { + try { + @SuppressWarnings("unchecked") + Class dc = (Class) cl.myDefineClass(null, buf, 0, buf.length); + throw new RuntimeException("Defining a class in the 'java' package should fail!"); + } + catch (java.lang.SecurityException jlse) { + // Expected, because we're not allowed to define a class in the 'java' package + } + } + // We expect to stay with one (the initial) instances of DefineClass. + // All the subsequent attempts to reload DefineClass into the 'java' package should have failed. + printClassStats(1, false); + System.gc(); + System.out.println("System.gc()"); + // At least after System.gc() the failed loading attempts should leave no instances around! + printClassStats(1, true); + } + else if ("defineClassParallel".equals(args[0])) { + MyParallelClassLoader pcl = new MyParallelClassLoader(); + CountDownLatch stop = new CountDownLatch(1); + + Thread[] threads = new Thread[iterations]; + for (int i = 0; i < iterations; i++) { + (threads[i] = new ParallelLoadingThread(pcl, buf, stop)).start(); + } + stop.countDown(); // start parallel class loading.. + // ..and wait until all threads loaded the class + for (int i = 0; i < iterations; i++) { + threads[i].join(); + } + System.out.print("Counted " + pcl.getLinkageErrors() + " LinkageErrors "); + System.out.println(pcl.getLinkageErrors() == 0 ? + "" : "(use -XX:+UnsyncloadClass and/or -XX:+AllowParallelDefineClass to avoid this)"); + System.gc(); + System.out.println("System.gc()"); + // After System.gc() we expect to remain with two instances: one is the initial version which is + // kept alive by this main method and another one in the parallel class loader. + printClassStats(2, true); + } + else if ("redefineClass".equals(args[0])) { + loadInstrumentationAgent(myName, buf); + int index = getStringIndex("AAAAAAAA", buf); + CountDownLatch stop = new CountDownLatch(1); + + Thread[] threads = new Thread[iterations]; + for (int i = 0; i < iterations; i++) { + buf[index] = (byte) ('A' + i + 1); // Change string constant in getID() which is legal in redefinition + instrumentation.redefineClasses(new ClassDefinition(DefineClass.class, buf)); + DefineClass dc = DefineClass.class.newInstance(); + CountDownLatch start = new CountDownLatch(1); + (threads[i] = new MyThread(dc, start, stop)).start(); + start.await(); // Wait until the new thread entered the getID() method + } + // We expect to have one instance for each redefinition because they are all kept alive by an activation + // plus the initial version which is kept active by this main method. + printClassStats(iterations + 1, false); + stop.countDown(); // Let all threads leave the DefineClass.getID() activation.. + // ..and wait until really all of them returned from DefineClass.getID() + for (int i = 0; i < iterations; i++) { + threads[i].join(); + } + System.gc(); + System.out.println("System.gc()"); + // After System.gc() we expect to remain with two instances: one is the initial version which is + // kept alive by this main method and another one which is the latest redefined version. + printClassStats(2, true); + } + else if ("redefineClassWithError".equals(args[0])) { + loadInstrumentationAgent(myName, buf); + int index = getStringIndex("getID", buf); + + for (int i = 0; i < iterations; i++) { + buf[index] = (byte) 'X'; // Change getID() to XetID() which is illegal in redefinition + try { + instrumentation.redefineClasses(new ClassDefinition(DefineClass.class, buf)); + throw new RuntimeException("Class redefinition isn't allowed to change method names!"); + } + catch (UnsupportedOperationException uoe) { + // Expected because redefinition can't change the name of methods + } + } + // We expect just a single DefineClass instance because failed redefinitions should + // leave no garbage around. + printClassStats(1, false); + System.gc(); + System.out.println("System.gc()"); + // At least after a System.gc() we should definitely stay with a single instance! + printClassStats(1, true); + } + } +} diff --git a/hotspot/test/runtime/MinimalVM/JMX.java b/hotspot/test/runtime/MinimalVM/JMX.java index e57325ebaa7..5a9dc20abf0 100644 --- a/hotspot/test/runtime/MinimalVM/JMX.java +++ b/hotspot/test/runtime/MinimalVM/JMX.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ public class JMX { .shouldContain("-Dcom.sun.management is not supported in this VM.") .shouldHaveExitValue(1); - pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), Long.toString(ProcessTools.getProcessId()), "VM.print_threads"}); + pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), "-l"}); new OutputAnalyzer(pb.start()) - .shouldContain("Could not find any processes matching ") - .shouldHaveExitValue(1); + .shouldNotMatch("^" + Long.toString(ProcessTools.getProcessId()) + "\\s+.*$"); } } diff --git a/hotspot/test/runtime/NMT/AutoshutdownNMT.java b/hotspot/test/runtime/NMT/AutoshutdownNMT.java deleted file mode 100644 index d07103e810c..00000000000 --- a/hotspot/test/runtime/NMT/AutoshutdownNMT.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 - * @key nmt - * @summary Test for deprecated message if -XX:-AutoShutdownNMT is specified - * @library /test/lib - * @modules java.base/jdk.internal.misc - * java.management - */ - -import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.process.OutputAnalyzer; - -public class AutoshutdownNMT { - - public static void main(String args[]) throws Exception { - - ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "-XX:NativeMemoryTracking=detail", - "-XX:-AutoShutdownNMT", - "-version"); - OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Ignoring option AutoShutdownNMT"); - } -} diff --git a/hotspot/test/runtime/classFileParserBug/AccModuleTest.java b/hotspot/test/runtime/classFileParserBug/AccModuleTest.java new file mode 100644 index 00000000000..2adc1e3db43 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/AccModuleTest.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8174725 + * @summary Throw NoClassDefFoundError if class access_flags have ACC_MODULE set + * @compile BadAccModule.jcod BadAccModInrClss.jcod + * @run main AccModuleTest + */ + +// Test that classes with access_flags containing ACC_MODULE cause ClassDefNotFoundErrors. +public class AccModuleTest { + public static void main(String args[]) throws Throwable { + + System.out.println("Regression test for bug 8174725"); + try { + Class newClass = Class.forName("BadAccModule"); + throw new RuntimeException("Expected NoClassDefFoundError exception not thrown"); + } catch (java.lang.NoClassDefFoundError e) { + if (!e.getMessage().contains("BadAccModule is not a class because access_flag ACC_MODULE is set")) { + throw new RuntimeException("Wrong NoClassDefFoundError exception for AccModuleTest: " + e.getMessage()); + } + } + try { + Class newClass = Class.forName("BadAccModInrClss"); + throw new RuntimeException("Expected NoClassDefFoundError exception not thrown"); + } catch (java.lang.NoClassDefFoundError e) { + if (!e.getMessage().contains("BadAccModInrClss is not a class because access_flag ACC_MODULE is set")) { + throw new RuntimeException("Wrong NoClassDefFoundError exception for BadAccModInrClss: " + e.getMessage()); + } + } + } +} diff --git a/hotspot/test/runtime/classFileParserBug/BadAccModInrClss.jcod b/hotspot/test/runtime/classFileParserBug/BadAccModInrClss.jcod new file mode 100644 index 00000000000..bba5d08794b --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/BadAccModInrClss.jcod @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 tests that a class in an InnerClasses attribute with ACC_MODULE set + * causes a NoClassDefFoundError exception to get thrown. + */ + +class BadAccModInrClss { + 0xCAFEBABE; + 0; // minor version + 53; // version + [22] { // Constant Pool + ; // first element is empty + Field #3 #14; // #1 at 0x0A + Method #4 #15; // #2 at 0x0F + class #16; // #3 at 0x14 + class #19; // #4 at 0x17 + Utf8 "this$0"; // #5 at 0x1A + Utf8 "La;"; // #6 at 0x23 + Utf8 "Synthetic"; // #7 at 0x29 + Utf8 ""; // #8 at 0x35 + Utf8 "(Ljava/lang/Object;)V"; // #9 at 0x3E + Utf8 "Code"; // #10 at 0x56 + Utf8 "LineNumberTable"; // #11 at 0x5D + Utf8 "SourceFile"; // #12 at 0x6F + Utf8 "a.java"; // #13 at 0x7C + NameAndType #5 #6; // #14 at 0x85 + NameAndType #8 #20; // #15 at 0x8A + Utf8 "BadAccModInrClss"; // #16 at 0x8F + Utf8 "Loc"; // #17 at 0x9E + Utf8 "InnerClasses"; // #18 at 0xA4 + Utf8 "java/lang/Object"; // #19 at 0xB3 + Utf8 "()V"; // #20 at 0xC6 + Utf8 "EnclosingMethod"; // #21 at 0xCC + } // Constant Pool + + 0x0000; // access + #3;// this_cpx + #4;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [1] { // fields + { // Member at 0xE8 + 0x0000; // access + #5; // name_cpx + #6; // sig_cpx + [1] { // Attributes + Attr(#7, 0) { // Synthetic at 0xF0 + } // end Synthetic + } // Attributes + } // Member + } // fields + + [1] { // methods + { // Member at 0xF8 + 0x0001; // access + #8; // name_cpx + #20; // sig_cpx + [1] { // Attributes + Attr(#10, 17) { // Code at 0x0100 + 2; // max_stack + 2; // max_locals + Bytes[5]{ + 0x2AB70002B1; + }; + [0] { // Traps + } // end Traps + [0] { // Attributes + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [3] { // Attributes + Attr(#12, 2) { // SourceFile at 0x0119 + #13; + } // end SourceFile + ; + Attr(#18, 10) { // InnerClasses at 0x0121 + [1] { // InnerClasses + #3 #0 #17 0x8000; // at 0x0131 + } + } // end InnerClasses + ; + Attr(#21, 4) { // EnclosingMethod at 0x0131 + 0x0004000F; + } // end EnclosingMethod + } // Attributes +} // end class BadAccModInrClss diff --git a/hotspot/test/runtime/classFileParserBug/BadAccModule.jcod b/hotspot/test/runtime/classFileParserBug/BadAccModule.jcod new file mode 100644 index 00000000000..6d7d1ec1211 --- /dev/null +++ b/hotspot/test/runtime/classFileParserBug/BadAccModule.jcod @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 is a .jcod file for a simple "Hello World" program with ACC_MODULE added +// to its access_flags. (See line 67.) This should cause a NoClassDefFoundError +// when loading the class. +class BadAccModule { + 0xCAFEBABE; + 0; // minor version + 53; // version + [32] { // Constant Pool + ; // first element is empty + Method #6 #17; // #1 at 0x0A + Field #18 #19; // #2 at 0x0F + String #20; // #3 at 0x14 + Method #21 #22; // #4 at 0x17 + class #23; // #5 at 0x1C + class #24; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x31 + Utf8 "LineNumberTable"; // #10 at 0x38 + Utf8 "main"; // #11 at 0x4A + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x51 + Utf8 "Exceptions"; // #13 at 0x6A + class #25; // #14 at 0x77 + Utf8 "SourceFile"; // #15 at 0x7A + Utf8 "BadAccModule.java"; // #16 at 0x87 + NameAndType #7 #8; // #17 at 0x9B + class #26; // #18 at 0xA0 + NameAndType #27 #28; // #19 at 0xA3 + Utf8 "Hello World"; // #20 at 0xA8 + class #29; // #21 at 0xB6 + NameAndType #30 #31; // #22 at 0xB9 + Utf8 "BadAccModule"; // #23 at 0xBE + Utf8 "java/lang/Object"; // #24 at 0xCD + Utf8 "java/lang/Throwable"; // #25 at 0xE0 + Utf8 "java/lang/System"; // #26 at 0xF6 + Utf8 "out"; // #27 at 0x0109 + Utf8 "Ljava/io/PrintStream;"; // #28 at 0x010F + Utf8 "java/io/PrintStream"; // #29 at 0x0127 + Utf8 "println"; // #30 at 0x013D + Utf8 "(Ljava/lang/String;)V"; // #31 at 0x0147 + } // Constant Pool + + 0x8021; // access Added ACC_MODULE (0x8000) !!! + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x016B + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x0173 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x018A + [1] { // LineNumberTable + 0 1; // at 0x0196 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x0196 + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [2] { // Attributes + Attr(#9, 37) { // Code at 0x019E + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x01B9 + [2] { // LineNumberTable + 0 4; // at 0x01C5 + 8 5; // at 0x01C9 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#13, 4) { // Exceptions at 0x01C9 + [1] { // Exceptions + #14; // at 0x01D3 + } + } // end Exceptions + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#15, 2) { // SourceFile at 0x01D5 + #16; + } // end SourceFile + } // Attributes +} // end class BadAccModule diff --git a/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm b/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm index 36cebcb5049..207438a59a7 100644 --- a/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm +++ b/hotspot/test/runtime/classFileParserBug/fakeMethodAccessor.jasm @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ // to create a sub-type of jdk.internal.reflect.MethodAccessorImpl in order // to bypass Reflection.getCallerClass. That should fail with an IAE. // - import java.lang.reflect.Module; class fakeMethodAccessor extends jdk.internal.reflect.MethodAccessorImpl { public static void main(String[] a) throws Exception { fakeMethodAccessor f = new fakeMethodAccessor(); @@ -60,11 +59,11 @@ public static Method main:"([Ljava/lang/String;)V" astore_1; getstatic Field java/lang/System.out:"Ljava/io/PrintStream;"; ldc class java/lang/String; - invokevirtual Method java/lang/Class.getModule:"()Ljava/lang/reflect/Module;"; + invokevirtual Method java/lang/Class.getModule:"()Ljava/lang/Module;"; ldc String "jdk.internal.misc"; ldc class FakeMethodAccessor; - invokevirtual Method java/lang/Class.getModule:"()Ljava/lang/reflect/Module;"; - invokevirtual Method java/lang/reflect/Module.isExported:"(Ljava/lang/String;Ljava/lang/reflect/Module;)Z"; + invokevirtual Method java/lang/Class.getModule:"()Ljava/lang/Module;"; + invokevirtual Method java/lang/Module.isExported:"(Ljava/lang/String;Ljava/lang/Module;)Z"; invokevirtual Method java/io/PrintStream.println:"(Z)V"; return; } diff --git a/hotspot/test/runtime/constantPool/ACCModule52.java b/hotspot/test/runtime/constantPool/ACCModule52.java new file mode 100644 index 00000000000..241425076ca --- /dev/null +++ b/hotspot/test/runtime/constantPool/ACCModule52.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 jdk.internal.org.objectweb.asm.*; + +/* + * @test + * @summary Test that the JVM ignores ACC_MODULE if it is set for a version + * 52 class file. + * @bug 8175383 + * @library /test/lib + * @modules java.base/jdk.internal.org.objectweb.asm + * @compile -XDignore.symbol.file ACCModule52.java + * @run main ACCModule52 + */ + +public class ACCModule52 { + + static final String CLASS_NAME = "ACCModule52Pkg"; + + public static void main(String[] args) throws Exception { + int ACC_MODULE = 0x8000; + ClassWriter cw = new ClassWriter(0); + cw.visit(Opcodes.V1_8, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE, + CLASS_NAME, + null, + "java/lang/Object", + null); + + cw.visitEnd(); + byte[] bytes = cw.toByteArray(); + + + ClassLoader loader = new ClassLoader(ACCModule52.class.getClassLoader()) { + @Override + protected Class findClass(String cn)throws ClassNotFoundException { + if (cn.equals(CLASS_NAME)) { + Class superClass = super.defineClass(cn, bytes, 0, bytes.length); + } else { + throw new ClassNotFoundException(cn); + } + return null; + } + }; + + Class clazz = loader.loadClass(CLASS_NAME); + } +} diff --git a/hotspot/test/runtime/constantPool/ConstModule.java b/hotspot/test/runtime/constantPool/ConstModule.java new file mode 100644 index 00000000000..94e577a29ef --- /dev/null +++ b/hotspot/test/runtime/constantPool/ConstModule.java @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 jdk.internal.org.objectweb.asm.*; + +/* + * @test + * @summary Test scenarios for constant pool CONSTANT_Module and CONSTANT_Package + * types, for class file versions 53 and 52, when ACC_MODULE is set and + * not set in the access_flags. + * @bug 8175383 + * @library /test/lib + * @modules java.base/jdk.internal.org.objectweb.asm + * @compile -XDignore.symbol.file ConstModule.java + * @run main ConstModule + */ + +public class ConstModule { + + static final int ACC_MODULE = 0x8000; + static final boolean MODULE_TEST = true; + static final boolean PACKAGE_TEST = false; + static final boolean CFE_EXCEPTION = true; + static final boolean NCDFE_EXCEPTION = false; + + public static void main(String[] args) throws Exception { + + // Test that the JVM throws CFE for constant pool CONSTANT_Module type, for + // class file version 53, when ACC_MODULE is not set in the access_flags. + ConstModule.write_and_load(Opcodes.V1_9, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC, + "jdk.fooMod", "FooMod", MODULE_TEST, CFE_EXCEPTION); + + // Test that the JVM throws NCDFE for constant pool CONSTANT_Module type, + // for class file version 53, when ACC_MODULE is set in the access_flags. + ConstModule.write_and_load(Opcodes.V1_9, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE, + "jdk.fooModACC", "FooModACC", MODULE_TEST, NCDFE_EXCEPTION); + + // Test that the JVM throws CFE for constant pool CONSTANT_Module type, for + // class file version 52, even when ACC_MODULE is set in the access_flags. + ConstModule.write_and_load(Opcodes.V1_8, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE, + "jdk.fooModACC52", "FooModACC52", MODULE_TEST, CFE_EXCEPTION); + + // Test that the JVM throws CFE for constant pool CONSTANT_Package type, for + // class file version 53, when ACC_MODULE is not set in the access_flags. + ConstModule.write_and_load(Opcodes.V1_9, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC, + "jdk.fooPkg", "FooPkg", PACKAGE_TEST, CFE_EXCEPTION); + + // Test that the JVM throws NCDFE for constant pool CONSTANT_Package type, + // for class file version 53, when ACC_MODULE is set in the access_flags. + ConstModule.write_and_load(Opcodes.V1_9, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE, + "jdk.fooModACC", "FooModACC", PACKAGE_TEST, NCDFE_EXCEPTION); + + // Test that the JVM throws CFE for constant pool CONSTANT_Package type, for + // class file version 52, even when ACC_MODULE is set in the access_flags. + ConstModule.write_and_load(Opcodes.V1_8, + Opcodes.ACC_INTERFACE + Opcodes.ACC_ABSTRACT + Opcodes.ACC_SYNTHETIC + ACC_MODULE, + "jdk.fooModACC52", "FooModACC52", PACKAGE_TEST, CFE_EXCEPTION); + + } + + public static void write_and_load(int version, + int access_flags, + String attr, + String class_name, + boolean module_test, + boolean throwCFE) throws Exception { + ClassWriter cw = new ClassWriter(0); + cw.visit(version, + access_flags, + class_name, + null, + "java/lang/Object", + null); + + if (module_test) + cw.visitAttribute(new TestModuleAttribute(attr)); + else + cw.visitAttribute(new TestPackageAttribute(attr)); + + cw.visitEnd(); + byte[] bytes = cw.toByteArray(); + + + ClassLoader loader = new ClassLoader(ConstModule.class.getClassLoader()) { + @Override + protected Class findClass(String cn)throws ClassNotFoundException { + if (cn.equals(class_name)) { + try { + Class superClass = super.defineClass(cn, bytes, 0, bytes.length); + throw new RuntimeException("Expected ClassFormatError not thrown"); + } catch (java.lang.ClassFormatError e) { + if (!throwCFE) { + throw new RuntimeException("Unexpected ClassFormatError exception: " + e.getMessage()); + } + if (module_test && !e.getMessage().contains( + "Unknown constant tag 19 in class file")) { + throw new RuntimeException("Wrong ClassFormatError exception: " + e.getMessage()); + } else if (!module_test && !e.getMessage().contains( + "Unknown constant tag 20 in class file")) { + throw new RuntimeException("Wrong ClassFormatError exception: " + e.getMessage()); + } + } catch (java.lang.NoClassDefFoundError f) { + if (throwCFE) { + throw new RuntimeException("Unexpected NoClassDefFoundError exception: " + f.getMessage()); + } + if (!f.getMessage().contains( + "is not a class because access_flag ACC_MODULE is set")) { + throw new RuntimeException("Wrong NoClassDefFoundError exception: " + f.getMessage()); + } + } + } else { + throw new ClassNotFoundException(cn); + } + return null; + } + }; + + Class clazz = loader.loadClass(class_name); + } + + /** + * ConstModuleAttr attribute. + * + *

     {@code
    +     *
    +     * MainClass_attribute {
    +     *   // index to CONSTANT_utf8_info structure in constant pool representing
    +     *   // the string "ConstModuleAttr"
    +     *   u2 attribute_name_index;
    +     *   u4 attribute_length;
    +     *
    +     *   // index to CONSTANT_Module_info structure
    +     *   u2 module_name_index
    +     * }
    +     *
    +     * } 
    + */ + public static class TestModuleAttribute extends Attribute { + private final String moduleName; + + public TestModuleAttribute(String moduleName) { + super("ConstModuleAttr"); + this.moduleName = moduleName; + } + + public TestModuleAttribute() { + this(null); + } + + @Override + protected Attribute read(ClassReader cr, + int off, + int len, + char[] buf, + int codeOff, + Label[] labels) + { + String mn = cr.readModule(off, buf); + off += 2; + return new TestModuleAttribute(mn); + } + + @Override + protected ByteVector write(ClassWriter cw, + byte[] code, + int len, + int maxStack, + int maxLocals) + { + ByteVector attr = new ByteVector(); + attr.putShort(cw.newModule(moduleName)); + return attr; + } + } + + /** + * ConstPackageAttr attribute. + * + *
     {@code
    +     *
    +     * MainClass_attribute {
    +     *   // index to CONSTANT_utf8_info structure in constant pool representing
    +     *   // the string "ConstPackageAttr"
    +     *   u2 attribute_name_index;
    +     *   u4 attribute_length;
    +     *
    +     *   // index to CONSTANT_Package_info structure
    +     *   u2 module_name_index
    +     * }
    +     *
    +     * } 
    + */ + public static class TestPackageAttribute extends Attribute { + private final String packageName; + + public TestPackageAttribute(String packageName) { + super("ConstPackageAttr"); + this.packageName = packageName; + } + + public TestPackageAttribute() { + this(null); + } + + @Override + protected Attribute read(ClassReader cr, + int off, + int len, + char[] buf, + int codeOff, + Label[] labels) + { + String mn = cr.readPackage(off, buf); + off += 2; + return new TestPackageAttribute(mn); + } + + @Override + protected ByteVector write(ClassWriter cw, + byte[] code, + int len, + int maxStack, + int maxLocals) + { + ByteVector attr = new ByteVector(); + attr.putShort(cw.newPackage(packageName)); + return attr; + } + } +} diff --git a/hotspot/test/runtime/duplAttributes/DupSignatureAttrs.jcod b/hotspot/test/runtime/duplAttributes/DupSignatureAttrs.jcod new file mode 100644 index 00000000000..b43db02f5b5 --- /dev/null +++ b/hotspot/test/runtime/duplAttributes/DupSignatureAttrs.jcod @@ -0,0 +1,615 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 containing duplicate Signature attributes. Loading it should cause a +// ClassFormatError exception. +class DupClassSigAttrs { + 0xCAFEBABE; + 0; // minor version + 53; // version + [33] { // Constant Pool + ; // first element is empty + Method #6 #17; // #1 at 0x0A + Field #18 #19; // #2 at 0x0F + String #20; // #3 at 0x14 + Method #21 #22; // #4 at 0x17 + class #23; // #5 at 0x1C + class #24; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x31 + Utf8 "LineNumberTable"; // #10 at 0x38 + Utf8 "main"; // #11 at 0x4A + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x51 + Utf8 "Exceptions"; // #13 at 0x6A + class #25; // #14 at 0x77 + Utf8 "SourceFile"; // #15 at 0x7A + Utf8 "DupClassSigAttrs.java"; // #16 at 0x87 + NameAndType #7 #8; // #17 at 0x9F + class #26; // #18 at 0xA4 + NameAndType #27 #28; // #19 at 0xA7 + Utf8 "hi"; // #20 at 0xAC + class #29; // #21 at 0xB1 + NameAndType #30 #31; // #22 at 0xB4 + Utf8 "DupClassSigAttrs"; // #23 at 0xB9 + Utf8 "java/lang/Object"; // #24 at 0xCC + Utf8 "java/lang/Throwable"; // #25 at 0xDF + Utf8 "java/lang/System"; // #26 at 0xF5 + Utf8 "out"; // #27 at 0x0108 + Utf8 "Ljava/io/PrintStream;"; // #28 at 0x010E + Utf8 "java/io/PrintStream"; // #29 at 0x0126 + Utf8 "println"; // #30 at 0x013C + Utf8 "(Ljava/lang/String;)V"; // #31 at 0x0146 + Utf8 "Signature"; // #32 at 0x015E + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0176 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x017E + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0195 + [1] { // LineNumberTable + 0 1; // at 0x01A1 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x01A1 + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [2] { // Attributes + Attr(#9, 37) { // Code at 0x01A9 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x01C4 + [2] { // LineNumberTable + 0 4; // at 0x01D0 + 8 5; // at 0x01D4 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#13, 4) { // Exceptions at 0x01D4 + [1] { // Exceptions + #14; // at 0x01DE + } + } // end Exceptions + } // Attributes + } // Member + } // methods + + [3] { // Attributes + Attr(#15, 2) { // SourceFile at 0x01E0 + #16; + } // end SourceFile + ; + Attr(#32, 2) { // Signature at 0x01E8 + #16; + } // end Signature + ; + Attr(#32, 2) { // *** Duplicate *** Signature at 0x01F0 + #16; + } // end Signature + } // Attributes +} // end class DupClassSigAttrs + + +// Class containing a method with duplicate Signature attributes. Loading it +// should cause a ClassFormatError exception. +class DupMthSigAttrs { + 0xCAFEBABE; + 0; // minor version + 53; // version + [33] { // Constant Pool + ; // first element is empty + Method #6 #17; // #1 at 0x0A + Field #18 #19; // #2 at 0x0F + String #20; // #3 at 0x14 + Method #21 #22; // #4 at 0x17 + class #23; // #5 at 0x1C + class #24; // #6 at 0x1F + Utf8 ""; // #7 at 0x22 + Utf8 "()V"; // #8 at 0x2B + Utf8 "Code"; // #9 at 0x31 + Utf8 "LineNumberTable"; // #10 at 0x38 + Utf8 "main"; // #11 at 0x4A + Utf8 "([Ljava/lang/String;)V"; // #12 at 0x51 + Utf8 "Exceptions"; // #13 at 0x6A + class #25; // #14 at 0x77 + Utf8 "SourceFile"; // #15 at 0x7A + Utf8 "DupMthSigAttrs.java"; // #16 at 0x87 + NameAndType #7 #8; // #17 at 0x9D + class #26; // #18 at 0xA2 + NameAndType #27 #28; // #19 at 0xA5 + Utf8 "hi"; // #20 at 0xAA + class #29; // #21 at 0xAF + NameAndType #30 #31; // #22 at 0xB2 + Utf8 "DupMthSigAttrs"; // #23 at 0xB7 + Utf8 "java/lang/Object"; // #24 at 0xC8 + Utf8 "java/lang/Throwable"; // #25 at 0xDB + Utf8 "java/lang/System"; // #26 at 0xF1 + Utf8 "out"; // #27 at 0x0104 + Utf8 "Ljava/io/PrintStream;"; // #28 at 0x010A + Utf8 "java/io/PrintStream"; // #29 at 0x0122 + Utf8 "println"; // #30 at 0x0138 + Utf8 "(Ljava/lang/String;)V"; // #31 at 0x0142 + Utf8 "Signature"; // #32 at 0x015A + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [2] { // methods + { // Member at 0x0172 + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [1] { // Attributes + Attr(#9, 29) { // Code at 0x017A + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 6) { // LineNumberTable at 0x0191 + [1] { // LineNumberTable + 0 1; // at 0x019D + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x019D + 0x0009; // access + #11; // name_cpx + #12; // sig_cpx + [4] { // Attributes + Attr(#9, 37) { // Code at 0x01A5 + 2; // max_stack + 1; // max_locals + Bytes[9]{ + 0xB200021203B60004; + 0xB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#10, 10) { // LineNumberTable at 0x01C0 + [2] { // LineNumberTable + 0 4; // at 0x01CC + 8 5; // at 0x01D0 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#32, 2) { // Signature at 0x01D0 + #16; + } // end Signature + ; + Attr(#13, 4) { // Exceptions at 0x01D8 + [1] { // Exceptions + #14; // at 0x01E2 + } + } // end Exceptions + ; + Attr(#32, 2) { // *** Duplicate *** Signature at 0x01E2 + #16; + } // end Signature + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#15, 2) { // SourceFile at 0x01EC + #16; + } // end SourceFile + } // Attributes +} // end class DupMthSigAttrs + + +// Class containing a field with duplicate Signature attributes. Loading it +// should cause a ClassFormatError exception. +class DupFldSigAttrs { + 0xCAFEBABE; + 0; // minor version + 53; // version + [42] { // Constant Pool + ; // first element is empty + Method #9 #23; // #1 at 0x0A + Field #24 #25; // #2 at 0x0F + Field #8 #26; // #3 at 0x14 + Method #27 #28; // #4 at 0x19 + class #29; // #5 at 0x1E + String #30; // #6 at 0x21 + Method #5 #31; // #7 at 0x24 + class #32; // #8 at 0x29 + class #33; // #9 at 0x2C + Utf8 "str"; // #10 at 0x2F + Utf8 "Ljava/lang/String;"; // #11 at 0x35 + Utf8 ""; // #12 at 0x4A + Utf8 "()V"; // #13 at 0x53 + Utf8 "Code"; // #14 at 0x59 + Utf8 "LineNumberTable"; // #15 at 0x60 + Utf8 "main"; // #16 at 0x72 + Utf8 "([Ljava/lang/String;)V"; // #17 at 0x79 + Utf8 "Exceptions"; // #18 at 0x92 + class #34; // #19 at 0x9F + Utf8 ""; // #20 at 0xA2 + Utf8 "SourceFile"; // #21 at 0xAD + Utf8 "DupFldSigAttrs.java"; // #22 at 0xBA + NameAndType #12 #13; // #23 at 0xD0 + class #35; // #24 at 0xD5 + NameAndType #36 #37; // #25 at 0xD8 + NameAndType #10 #11; // #26 at 0xDD + class #38; // #27 at 0xE2 + NameAndType #39 #40; // #28 at 0xE5 + Utf8 "java/lang/String"; // #29 at 0xEA + Utf8 "Hi"; // #30 at 0xFD + NameAndType #12 #40; // #31 at 0x0102 + Utf8 "DupFldSigAttrs"; // #32 at 0x0107 + Utf8 "java/lang/Object"; // #33 at 0x0118 + Utf8 "java/lang/Throwable"; // #34 at 0x012B + Utf8 "java/lang/System"; // #35 at 0x0141 + Utf8 "out"; // #36 at 0x0154 + Utf8 "Ljava/io/PrintStream;"; // #37 at 0x015A + Utf8 "java/io/PrintStream"; // #38 at 0x0172 + Utf8 "println"; // #39 at 0x0188 + Utf8 "(Ljava/lang/String;)V"; // #40 at 0x0192 + Utf8 "Signature"; // #41 at 0x01AA + } // Constant Pool + + 0x0021; // access + #8;// this_cpx + #9;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [1] { // fields + { // Member at 0x01C0 + 0x0008; // access + #10; // name_cpx + #11; // sig_cpx + [2] { // Attributes + Attr(#41, 2) { // Signature at 0x01C8 + #16; + } // end Signature + ; + Attr(#41, 2) { // *** Duplicate *** Signature at 0x01D0 + #16; + } // end Signature + } // Attributes + } // Member + } // fields + + [3] { // methods + { // Member at 0x01DA + 0x0001; // access + #12; // name_cpx + #13; // sig_cpx + [1] { // Attributes + Attr(#14, 29) { // Code at 0x01E2 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#15, 6) { // LineNumberTable at 0x01F9 + [1] { // LineNumberTable + 0 1; // at 0x0205 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x0205 + 0x0009; // access + #16; // name_cpx + #17; // sig_cpx + [2] { // Attributes + Attr(#14, 38) { // Code at 0x020D + 2; // max_stack + 1; // max_locals + Bytes[10]{ + 0xB20002B20003B600; + 0x04B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#15, 10) { // LineNumberTable at 0x0229 + [2] { // LineNumberTable + 0 6; // at 0x0235 + 9 7; // at 0x0239 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#18, 4) { // Exceptions at 0x0239 + [1] { // Exceptions + #19; // at 0x0243 + } + } // end Exceptions + } // Attributes + } // Member + ; + { // Member at 0x0243 + 0x0008; // access + #20; // name_cpx + #13; // sig_cpx + [1] { // Attributes + Attr(#14, 37) { // Code at 0x024B + 3; // max_stack + 0; // max_locals + Bytes[13]{ + 0xBB0005591206B700; + 0x07B30003B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#15, 6) { // LineNumberTable at 0x026A + [1] { // LineNumberTable + 0 3; // at 0x0276 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#21, 2) { // SourceFile at 0x0278 + #22; + } // end SourceFile + } // Attributes +} // end class DupFldSigAttrs + + +// Class containing a Signature attribute and a field and methods with Signature +// attributes. Since neither the class nor any of its fields or methods have +// duplicate Signature attributes, loading this class should not cause a +// ClassFormatError exception. +class OkaySigAttrs { + 0xCAFEBABE; + 0; // minor version + 53; // version + [42] { // Constant Pool + ; // first element is empty + Method #9 #23; // #1 at 0x0A + Field #24 #25; // #2 at 0x0F + Field #8 #26; // #3 at 0x14 + Method #27 #28; // #4 at 0x19 + class #29; // #5 at 0x1E + String #30; // #6 at 0x21 + Method #5 #31; // #7 at 0x24 + class #32; // #8 at 0x29 + class #33; // #9 at 0x2C + Utf8 "str"; // #10 at 0x2F + Utf8 "Ljava/lang/String;"; // #11 at 0x35 + Utf8 ""; // #12 at 0x4A + Utf8 "()V"; // #13 at 0x53 + Utf8 "Code"; // #14 at 0x59 + Utf8 "LineNumberTable"; // #15 at 0x60 + Utf8 "main"; // #16 at 0x72 + Utf8 "([Ljava/lang/String;)V"; // #17 at 0x79 + Utf8 "Exceptions"; // #18 at 0x92 + class #34; // #19 at 0x9F + Utf8 ""; // #20 at 0xA2 + Utf8 "SourceFile"; // #21 at 0xAD + Utf8 "OkaySigAttrs.java"; // #22 at 0xBA + NameAndType #12 #13; // #23 at 0xCE + class #35; // #24 at 0xD3 + NameAndType #36 #37; // #25 at 0xD6 + NameAndType #10 #11; // #26 at 0xDB + class #38; // #27 at 0xE0 + NameAndType #39 #40; // #28 at 0xE3 + Utf8 "java/lang/String"; // #29 at 0xE8 + Utf8 "Hi"; // #30 at 0xFB + NameAndType #12 #40; // #31 at 0x0100 + Utf8 "OkaySigAttrs"; // #32 at 0x0105 + Utf8 "java/lang/Object"; // #33 at 0x0114 + Utf8 "java/lang/Throwable"; // #34 at 0x0127 + Utf8 "java/lang/System"; // #35 at 0x013D + Utf8 "out"; // #36 at 0x0150 + Utf8 "Ljava/io/PrintStream;"; // #37 at 0x0156 + Utf8 "java/io/PrintStream"; // #38 at 0x016E + Utf8 "println"; // #39 at 0x0184 + Utf8 "(Ljava/lang/String;)V"; // #40 at 0x018E + Utf8 "Signature"; // #41 at 0x01A6 + } // Constant Pool + + 0x0021; // access + #8;// this_cpx + #9;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [1] { // fields + { // Member at 0x01BC + 0x0008; // access + #10; // name_cpx + #11; // sig_cpx + [1] { // Attributes + Attr(#41, 2) { // Signature at 0x01C4 + #16; + } // end Signature + } // Attributes + } // Member + } // fields + + [3] { // methods + { // Member at 0x01CE + 0x0001; // access + #12; // name_cpx + #13; // sig_cpx + [2] { // Attributes + Attr(#14, 29) { // Code at 0x01D6 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#15, 6) { // LineNumberTable at 0x01ED + [1] { // LineNumberTable + 0 1; // at 0x01F9 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#41, 2) { // Signature at 0x01F9 + #16; + } // end Signature + } // Attributes + } // Member + ; + { // Member at 0x0201 + 0x0009; // access + #16; // name_cpx + #17; // sig_cpx + [3] { // Attributes + Attr(#14, 38) { // Code at 0x0209 + 2; // max_stack + 1; // max_locals + Bytes[10]{ + 0xB20002B20003B600; + 0x04B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#15, 10) { // LineNumberTable at 0x0225 + [2] { // LineNumberTable + 0 6; // at 0x0231 + 9 7; // at 0x0235 + } + } // end LineNumberTable + } // Attributes + } // end Code + ; + Attr(#41, 2) { // Signature at 0x0235 + #16; + } // end Signature + ; + Attr(#18, 4) { // Exceptions at 0x023D + [1] { // Exceptions + #19; // at 0x0247 + } + } // end Exceptions + } // Attributes + } // Member + ; + { // Member at 0x0247 + 0x0008; // access + #20; // name_cpx + #13; // sig_cpx + [1] { // Attributes + Attr(#14, 37) { // Code at 0x024F + 3; // max_stack + 0; // max_locals + Bytes[13]{ + 0xBB0005591206B700; + 0x07B30003B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#15, 6) { // LineNumberTable at 0x026E + [1] { // LineNumberTable + 0 3; // at 0x027A + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [2] { // Attributes + Attr(#21, 2) { // SourceFile at 0x027C + #22; + } // end SourceFile + ; + Attr(#41, 2) { // Signature at 0x0284 + #16; + } // end Signature + } // Attributes +} // end class OkaySigAttrs diff --git a/hotspot/test/runtime/duplAttributes/TestDupSignatureAttr.java b/hotspot/test/runtime/duplAttributes/TestDupSignatureAttr.java new file mode 100644 index 00000000000..856d0617d59 --- /dev/null +++ b/hotspot/test/runtime/duplAttributes/TestDupSignatureAttr.java @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8176147 + * @summary Throw ClassFormatError exception for multiple Signature attributes + * @compile DupSignatureAttrs.jcod + * @run main TestDupSignatureAttr + */ + +public class TestDupSignatureAttr { + public static void main(String args[]) throws Throwable { + + System.out.println("Regression test for bug 8176147"); + + String[] badClasses = new String[] { + "DupClassSigAttrs", + "DupMthSigAttrs", + "DupFldSigAttrs", + }; + String[] messages = new String[] { + "Multiple Signature attributes in class file", + "Multiple Signature attributes for method", + "Multiple Signature attributes for field", + }; + + for (int x = 0; x < badClasses.length; x++) { + try { + Class newClass = Class.forName(badClasses[x]); + throw new RuntimeException("Expected ClassFormatError exception not thrown"); + } catch (java.lang.ClassFormatError e) { + if (!e.getMessage().contains(messages[x])) { + throw new RuntimeException("Wrong ClassFormatError exception thrown: " + + e.getMessage()); + } + } + } + + // Multiple Signature attributes but no duplicates. + Class newClass = Class.forName("OkaySigAttrs"); + } +} diff --git a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java index d3f3ca700d6..6847f26c8f1 100644 --- a/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java +++ b/hotspot/test/runtime/getSysPackage/GetSysPkgTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 GetSysPkgTest { return m; } } - throw new RuntimeException("Failed to find method " + name + " in java.lang.reflect.Module"); + throw new RuntimeException("Failed to find method " + name + " in java.lang.Module"); } // Throw RuntimeException if getSystemPackageLocation() does not return diff --git a/hotspot/test/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java b/hotspot/test/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java new file mode 100644 index 00000000000..3aaec5e4fd5 --- /dev/null +++ b/hotspot/test/runtime/jni/CallWithJNIWeak/CallWithJNIWeak.java @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8166188 + * @summary Test call of native function with JNI weak global ref. + * @modules java.base + * @run main/othervm/native CallWithJNIWeak + */ + +public class CallWithJNIWeak { + static { + System.loadLibrary("CallWithJNIWeak"); + } + + private static native void testJNIFieldAccessors(CallWithJNIWeak o); + + // The field initializations must be kept in sync with the JNI code + // which reads verifies the values of these fields. + private int i = 1; + private long j = 2; + private boolean z = true; + private char c = 'a'; + private short s = 3; + private float f = 1.0f; + private double d = 2.0; + private Object l; + + private CallWithJNIWeak() { + this.l = this; + } + + private native void weakReceiverTest0(); + private void weakReceiverTest() { + weakReceiverTest0(); + } + + private synchronized void synchonizedWeakReceiverTest() { + this.notifyAll(); + } + + + private static native void runTests(CallWithJNIWeak o); + + public static void main(String[] args) { + CallWithJNIWeak w = new CallWithJNIWeak(); + for (int i = 0; i < 20000; i++) { + runTests(w); + } + } +} diff --git a/hotspot/test/runtime/jni/CallWithJNIWeak/libCallWithJNIWeak.c b/hotspot/test/runtime/jni/CallWithJNIWeak/libCallWithJNIWeak.c new file mode 100644 index 00000000000..83a5784c1e8 --- /dev/null +++ b/hotspot/test/runtime/jni/CallWithJNIWeak/libCallWithJNIWeak.c @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 + +/* + * Class: CallWithJNIWeak + * Method: testJNIFieldAccessors + * Signature: (LCallWithJNIWeak;)V + */ +JNIEXPORT void JNICALL +Java_CallWithJNIWeak_testJNIFieldAccessors(JNIEnv *env, jclass clazz, jobject this) { + // Make sure that we have a weak reference to the receiver + + jweak self = (*env)->NewWeakGlobalRef(env, this); + + jclass this_class = (*env)->GetObjectClass(env, self); + + jclass exception = (*env)->FindClass(env, "java/lang/RuntimeException"); + + jfieldID id_i = (*env)->GetFieldID(env, this_class, "i", "I"); + jfieldID id_j = (*env)->GetFieldID(env, this_class, "j", "J"); + jfieldID id_z = (*env)->GetFieldID(env, this_class, "z", "Z"); + jfieldID id_c = (*env)->GetFieldID(env, this_class, "c", "C"); + jfieldID id_s = (*env)->GetFieldID(env, this_class, "s", "S"); + jfieldID id_f = (*env)->GetFieldID(env, this_class, "f", "F"); + jfieldID id_d = (*env)->GetFieldID(env, this_class, "d", "D"); + jfieldID id_l = (*env)->GetFieldID(env, this_class, "l", "Ljava/lang/Object;"); + jvalue v; + +#define CHECK(variable, expected) \ + do { \ + if ((variable) != (expected)) { \ + (*env)->ThrowNew(env, exception, #variable" != " #expected); \ + return; \ + } \ + } while(0) + + // The values checked below must be kept in sync with the Java source file. + + v.i = (*env)->GetIntField(env, self, id_i); + CHECK(v.i, 1); + + v.j = (*env)->GetLongField(env, self, id_j); + CHECK(v.j, 2); + + v.z = (*env)->GetBooleanField(env, self, id_z); + CHECK(v.z, JNI_TRUE); + + v.c = (*env)->GetCharField(env, self, id_c); + CHECK(v.c, 'a'); + + v.s = (*env)->GetShortField(env, self, id_s); + CHECK(v.s, 3); + + v.f = (*env)->GetFloatField(env, self, id_f); + CHECK(v.f, 1.0f); + + v.d = (*env)->GetDoubleField(env, self, id_d); + CHECK(v.d, 2.0); + +#undef CHECK + + v.l = (*env)->GetObjectField(env, self, id_l); + if (v.l == NULL) { + (*env)->ThrowNew(env, exception, "Object field was null"); + return; + } + { + jclass clz = (*env)->GetObjectClass(env, v.l); + if (!(*env)->IsSameObject(env, clazz, clz)) { + (*env)->ThrowNew(env, exception, "Bad object class"); + } + } + + (*env)->DeleteWeakGlobalRef(env, self); +} + +/* + * Class: CallWithJNIWeak + * Method: runTests + * Signature: (LCallWithJNIWeak;)V + */ +JNIEXPORT void JNICALL +Java_CallWithJNIWeak_runTests(JNIEnv *env, jclass clazz, jobject this) { + jweak that = (*env)->NewWeakGlobalRef(env, this); + { + jmethodID method = (*env)->GetStaticMethodID(env, + clazz, "testJNIFieldAccessors", "(LCallWithJNIWeak;)V"); + (*env)->CallStaticVoidMethod(env, clazz, method, that); + if ((*env)->ExceptionCheck(env)) { + return; + } + } + + { + jmethodID method = (*env)->GetMethodID(env, clazz, "weakReceiverTest", "()V"); + (*env)->CallVoidMethod(env, that, method); + if ((*env)->ExceptionCheck(env)) { + return; + } + } + + { + jmethodID method = (*env)->GetMethodID(env, clazz, "synchonizedWeakReceiverTest", "()V"); + (*env)->CallVoidMethod(env, that, method); + if ((*env)->ExceptionCheck(env)) { + return; + } + } + (*env)->DeleteWeakGlobalRef(env, that); +} + +/* + * Class: CallWithJNIWeak + * Method: weakReceiverTest0 + * Signature: ()V + */ +JNIEXPORT void JNICALL +Java_CallWithJNIWeak_weakReceiverTest0(JNIEnv *env, jobject obj) { + (*env)->GetObjectClass(env, obj); +} diff --git a/hotspot/test/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java b/hotspot/test/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java new file mode 100644 index 00000000000..6d581000fb8 --- /dev/null +++ b/hotspot/test/runtime/jni/ReturnJNIWeak/ReturnJNIWeak.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 8166188 + * @requires vm.opt.ExplicitGCInvokesConcurrent != true + * @summary Test return of JNI weak global refs from native calls. + * @modules java.base + * @run main/othervm/native -Xint ReturnJNIWeak + * @run main/othervm/native -Xcomp ReturnJNIWeak + */ + +public final class ReturnJNIWeak { + + static { + System.loadLibrary("ReturnJNIWeak"); + } + + private static final class TestObject { + public final int value; + + public TestObject(int value) { + this.value = value; + } + } + + private static volatile TestObject testObject = null; + + private static native void registerObject(Object o); + private static native void unregisterObject(); + private static native Object getObject(); + + // Create the test object and record it both strongly and weakly. + private static void remember(int value) { + TestObject o = new TestObject(value); + registerObject(o); + testObject = o; + } + + // Remove both strong and weak references to the current test object. + private static void forget() { + unregisterObject(); + testObject = null; + } + + // Verify the weakly recorded object + private static void checkValue(int value) throws Exception { + Object o = getObject(); + if (o == null) { + throw new RuntimeException("Weak reference unexpectedly null"); + } + TestObject t = (TestObject)o; + if (t.value != value) { + throw new RuntimeException("Incorrect value"); + } + } + + // Verify we can create a weak reference and get it back. + private static void testSanity() throws Exception { + System.out.println("running testSanity"); + int value = 5; + try { + remember(value); + checkValue(value); + } finally { + forget(); + } + } + + // Verify weak ref value survives across collection if strong ref exists. + private static void testSurvival() throws Exception { + System.out.println("running testSurvival"); + int value = 10; + try { + remember(value); + checkValue(value); + System.gc(); + // Verify weak ref still has expected value. + checkValue(value); + } finally { + forget(); + } + } + + // Verify weak ref cleared if no strong ref exists. + private static void testClear() throws Exception { + System.out.println("running testClear"); + int value = 15; + try { + remember(value); + checkValue(value); + // Verify still good. + checkValue(value); + // Drop reference. + testObject = null; + System.gc(); + // Verify weak ref cleared as expected. + Object recorded = getObject(); + if (recorded != null) { + throw new RuntimeException("expected clear"); + } + } finally { + forget(); + } + } + + public static void main(String[] args) throws Exception { + testSanity(); + testSurvival(); + testClear(); + } +} diff --git a/hotspot/test/runtime/jni/ReturnJNIWeak/libReturnJNIWeak.c b/hotspot/test/runtime/jni/ReturnJNIWeak/libReturnJNIWeak.c new file mode 100644 index 00000000000..12d7ae92e6e --- /dev/null +++ b/hotspot/test/runtime/jni/ReturnJNIWeak/libReturnJNIWeak.c @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Native support for ReturnJNIWeak test. + */ + +#include "jni.h" + +static jweak registered = NULL; + +JNIEXPORT void JNICALL +Java_ReturnJNIWeak_registerObject(JNIEnv* env, + jclass jclazz, + jobject value) { + // assert registered == NULL + registered = (*env)->NewWeakGlobalRef(env, value); +} + +JNIEXPORT void JNICALL +Java_ReturnJNIWeak_unregisterObject(JNIEnv* env, jclass jclazz) { + if (registered != NULL) { + (*env)->DeleteWeakGlobalRef(env, registered); + registered = NULL; + } +} + +JNIEXPORT jobject JNICALL +Java_ReturnJNIWeak_getObject(JNIEnv* env, jclass jclazz) { + // assert registered != NULL + return registered; +} diff --git a/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java b/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java index 9d744f22f40..1c3220333d4 100644 --- a/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java +++ b/hotspot/test/runtime/libadimalloc.solaris.sparc/Testlibadimalloc.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,7 @@ public class Testlibadimalloc { // Start the process, get the pid and then wait for the test to finish Process process = builder.start(); - long pid = process.getPid(); + long pid = process.pid(); int retval = process.waitFor(); // make sure the SEGVOverflow test crashed diff --git a/hotspot/test/runtime/modules/AccModuleTest.java b/hotspot/test/runtime/modules/AccModuleTest.java index 8deac7f327e..84e2de3552f 100644 --- a/hotspot/test/runtime/modules/AccModuleTest.java +++ b/hotspot/test/runtime/modules/AccModuleTest.java @@ -28,8 +28,6 @@ * @run main AccModuleTest */ -import java.io.File; - public class AccModuleTest { public static void main(String args[]) throws Throwable { diff --git a/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java b/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java index a1eb2cce85d..465c709fd86 100644 --- a/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java +++ b/hotspot/test/runtime/modules/AccessCheck/AccessExportTwice.java @@ -39,8 +39,6 @@ import static jdk.test.lib.Asserts.*; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -58,7 +56,7 @@ import myloaders.MySameClassLoader; public class AccessExportTwice { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publicly defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { @@ -68,7 +66,7 @@ public class AccessExportTwice { // Packages: none // Packages exported: none ModuleDescriptor descriptor_first_mod = - ModuleDescriptor.module("first_mod") + ModuleDescriptor.newModule("first_mod") .requires("java.base") .requires("second_mod") .build(); @@ -78,7 +76,7 @@ public class AccessExportTwice { // Packages: p2 // Packages exported: p2 is exported to first_mod ModuleDescriptor descriptor_second_mod = - ModuleDescriptor.module("second_mod") + ModuleDescriptor.newModule("second_mod") .requires("java.base") .exports("p2", Set.of("first_mod")) .build(); @@ -87,17 +85,17 @@ public class AccessExportTwice { ModuleFinder finder = ModuleLibrary.of(descriptor_first_mod, descriptor_second_mod); // Resolves "first_mod" - Configuration cf = Layer.boot() + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod")); + .resolve(finder, ModuleFinder.of(), Set.of("first_mod")); // Map each module to the same class loader Map map = new HashMap<>(); map.put("first_mod", MySameClassLoader.loader1); map.put("second_mod", MySameClassLoader.loader1); - // Create Layer that contains first_mod & second_mod - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains first_mod & second_mod + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); assertTrue(layer.findLoader("first_mod") == MySameClassLoader.loader1); assertTrue(layer.findLoader("second_mod") == MySameClassLoader.loader1); diff --git a/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java b/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java index 5d1a690a740..74752d3d136 100644 --- a/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java +++ b/hotspot/test/runtime/modules/AccessCheck/AccessReadTwice.java @@ -39,8 +39,6 @@ import static jdk.test.lib.Asserts.*; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.util.HashMap; import java.util.Map; import java.util.Set; @@ -56,7 +54,7 @@ import java.util.Set; public class AccessReadTwice { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publicly defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { @@ -66,9 +64,9 @@ public class AccessReadTwice { // Packages: p1, p4 // Packages exported: none ModuleDescriptor descriptor_first_mod = - ModuleDescriptor.module("first_mod") + ModuleDescriptor.newModule("first_mod") .requires("java.base") - .contains(Set.of("p1", "p4")) + .packages(Set.of("p1", "p4")) .build(); // Define module: second_mod @@ -76,7 +74,7 @@ public class AccessReadTwice { // Packages: p2 // Packages exported: p2 is exported to first_mod ModuleDescriptor descriptor_second_mod = - ModuleDescriptor.module("second_mod") + ModuleDescriptor.newModule("second_mod") .requires("java.base") .exports("p2", Set.of("first_mod")) .build(); @@ -85,9 +83,9 @@ public class AccessReadTwice { ModuleFinder finder = ModuleLibrary.of(descriptor_first_mod, descriptor_second_mod); // Resolves "first_mod" and "second_mod" - Configuration cf = Layer.boot() + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod")); + .resolve(finder, ModuleFinder.of(), Set.of("first_mod", "second_mod")); // Map each module to this class loader Map map = new HashMap<>(); @@ -95,8 +93,8 @@ public class AccessReadTwice { map.put("first_mod", loader); map.put("second_mod", loader); - // Create Layer that contains first_mod & second_mod - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains first_mod & second_mod + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); assertTrue(layer.findLoader("first_mod") == loader); assertTrue(layer.findLoader("second_mod") == loader); diff --git a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java index 6143f0b94b0..bc8aaeed8bd 100644 --- a/hotspot/test/runtime/modules/AccessCheck/CheckRead.java +++ b/hotspot/test/runtime/modules/AccessCheck/CheckRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can not read module m2, then class p1.c1 - * in module m1 can not access p2.c2 in module m2. + * @summary Test that if module m1x can not read module m2x, then class p1.c1 + * in module m1x can not access p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,82 +46,82 @@ import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can not read m2 -// package p2 in m2 is exported to m1 +// m1x can not read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2. -// Access denied since m1 can not read m2. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x. +// Access denied since m1x can not read m2x. // public class CheckRead { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publicly defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m3 + // Define module: m1x + // Can read: java.base, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m3") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); - map.put("m3", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + map.put("m3x", MySameClassLoader.loader1); - // Create Layer that contains m1, m2 and m3 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x, m2x and m3x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("cannot access")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java index b0b64a46d95..732c326ccc1 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_CheckRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can not read module m2, then class p1.c1 - * in module m1 can not access p2.c2 in module m2. + * @summary Test that if module m1x can not read module m2x, then class p1.c1 + * in module m1x can not access p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,82 +46,82 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can not read m2 -// package p2 in m2 is exported to m1 +// m1x can not read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2. -// Access denied since m1 can not read m2. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x. +// Access denied since m1x can not read m2x. // public class DiffCL_CheckRead { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publicly defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m3 + // Define module: m1x + // Can read: java.base, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m3") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); - map.put("m3", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); + map.put("m3x", MyDiffClassLoader.loader2); - // Create Layer that contains m1, m2 and m3 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x, m2x and m3x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); - assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1 but m2 is not readable from m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x but m2x is not readable from m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("cannot access")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java index b7088553bad..66062c4a2d9 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 - * is exported specifically to module m3, then class p1.c1 in m1 can not - * access p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x + * is exported specifically to module m3x, then class p1.c1 in m1x can not + * access p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -38,7 +38,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,83 +47,83 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can read m2 -// package p2 in m2 is exported to m3 +// m1x can read m2x +// package p2 in m2x is exported to m3x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access denied since although m1 can read m2, p2 is exported only to m3. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access denied since although m1x can read m2x, p2 is exported only to m3x. // public class DiffCL_ExpQualOther { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2, m3 + // Define module: m1x + // Can read: java.base, m2x, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") - .requires("m3") + .requires("m2x") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 - // Can read: java.base, m3 + // Define module: m2x + // Can read: java.base, m3x // Packages: p2 - // Packages exported: p2 is exported to m3 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m3x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m3")) + .exports("p2", Set.of("m3x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); - map.put("m3", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); + map.put("m3x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); - assertTrue(layer.findLoader("m3") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m3x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java index 8ca888b312f..3088a972803 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in m2. - * Access allowed since m1 can read m2 and package p2 is exported to m1. + * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in m2x. + * Access allowed since m1x can read m2x and package p2 is exported to m1x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,61 +46,61 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported to m1 +// m1x can read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access allowed since m1 can read m2 and package p2 is exported to m1. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access allowed since m1x can read m2x and package p2 is exported to m1x. // public class DiffCL_ExpQualToM1 { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported to unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: package p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: package p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -109,7 +108,7 @@ public class DiffCL_ExpQualToM1 { try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java index e38d54166ed..6cb7ea9bdcb 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, and package p2 in m2 is - * exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, and package p2 in m2x is + * exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,62 +46,62 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported to m1 +// m1x can read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access allowed since m1 can read m2 and package p2 is exported +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access allowed since m1x can read m2x and package p2 is exported // unqualifiedly. // public class DiffCL_ExpUnqual { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: package p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: package p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -110,7 +109,7 @@ public class DiffCL_ExpUnqual { try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java index 0cc88f7a69b..e235d895751 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 is not - * exported, then class p1.c1 in m1 can not read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x is not + * exported, then class p1.c1 in m1x can not read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,68 +46,68 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x // Access denied since p2 is not exported. // public class DiffCL_PkgNotExp { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java index 2a5c723c76f..fafd41af3fa 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_Umod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ /* * @test - * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module. + * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module. * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module @@ -42,18 +42,16 @@ import static jdk.test.lib.Asserts.*; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.util.HashMap; import java.util.Map; import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// package p1 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p1 +// package p1 in m1x is exported unqualifiedly // -// class p1.c1 defined in m1 tries to access p2.c2 defined in +// class p1.c1 defined in m1x tries to access p2.c2 defined in // in unnamed module. // // Three access attempts occur in this test: @@ -62,50 +60,50 @@ import myloaders.MyDiffClassLoader; // 2. In this scenario a strict module establishes readability // to the particular unnamed module it is trying to access. // Access is allowed. -// 3. Module m1 in the test_looseModuleLayer() method +// 3. Module m1x in the test_looseModuleLayer() method // is transitioned to a loose module, access // to all unnamed modules is allowed. // public class DiffCL_Umod { - // Create Layers over the boot layer to test different + // Create layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -114,109 +112,109 @@ public class DiffCL_Umod { // Attempt access try { p1_c1_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1 should not be able " + + throw new RuntimeException("Test Failed, strict module m1x should not be able " + "to access public type p2.c2 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1ReadEdgeDiffLoader Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1ReadEdgeDiffLoader"); try { - // Read edge between m1 and the unnamed module that loads p2.c2 is established in + // Read edge between m1x and the unnamed module that loads p2.c2 is established in // c1ReadEdgeDiffLoader's ctor before attempting access. p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, module m1 has established readability to p2/c2 loader's " + + throw new RuntimeException("Test Failed, module m1x has established readability to p2/c2 loader's " + "unnamed module, access should be allowed: " + e.getMessage()); } } - // Module m1 is a loose module and thus can read all unnamed modules. + // Module m1x is a loose module and thus can read all unnamed modules. public void test_looseModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1Loose Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1Loose"); - // change m1 to read all unnamed modules - Module m1 = layer.findModule("m1").get(); - jdk.internal.module.Modules.addReadsAllUnnamed(m1); + // change m1x to read all unnamed modules + Module m1x = layer.findModule("m1x").get(); + jdk.internal.module.Modules.addReadsAllUnnamed(m1x); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, loose module m1 should be able to access " + + throw new RuntimeException("Test Failed, loose module m1x should be able to access " + "public type p2.c2 defined in unnamed module: " + e.getMessage()); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java index b8420c2e5c6..8a0d6a35af9 100644 --- a/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java +++ b/hotspot/test/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ /* * @test - * @summary class p3.c3 defined in module m1 tries to access c4 defined in an unnamed package + * @summary class p3.c3 defined in module m1x tries to access c4 defined in an unnamed package * and an unnamed module. * @modules java.base/jdk.internal.misc * @library /test/lib @@ -38,7 +38,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,10 +47,10 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> packages p3 -// package p3 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p3 +// package p3 in m1x is exported unqualifiedly // -// class p3.c3 defined in m1 tries to access c4 defined in +// class p3.c3 defined in m1x tries to access c4 defined in // in unnamed module. // // Two access attempts occur in this test: @@ -63,44 +62,44 @@ import myloaders.MyDiffClassLoader; // public class DiffCL_UmodUpkg { - // Create Layers over the boot layer to test different + // Create layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that c4 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3 @@ -109,58 +108,58 @@ public class DiffCL_UmodUpkg { // Attempt access try { p3_c3_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1 should not be able to access " + + throw new RuntimeException("Test Failed, strict module m1x should not be able to access " + "public type c4 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that c4 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MyDiffClassLoader.loader1 = new MyDiffClassLoader(); MyDiffClassLoader.loader2 = new MyDiffClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader2 // to achieve differing class loaders. Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); + map.put("m1x", MyDiffClassLoader.loader1); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3ReadEdgeDiffLoader Class p3_c3_class = MyDiffClassLoader.loader1.loadClass("p3.c3ReadEdgeDiffLoader"); try { - // Read edge between m1 and the unnamed module that loads c4 is established in + // Read edge between m1x and the unnamed module that loads c4 is established in // C3ReadEdgeDiffLoader's ctor before attempting access. p3_c3_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, module m1 has established readability to " + + throw new RuntimeException("Test Failed, module m1x has established readability to " + "c4 loader's unnamed module, access should be allowed: " + e.getMessage()); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java index 330d7239f3a..d3d8395b13a 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualOther.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 - * is exported specifically to module m3, then class p1.c1 in m1 can not - * access p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x + * is exported specifically to module m3x, then class p1.c1 in m1x can not + * access p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -38,7 +38,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,83 +47,83 @@ import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can read m2 -// package p2 in m2 is exported to m3 +// m1x can read m2x +// package p2 in m2x is exported to m3x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access denied since although m1 can read m2, p2 is exported only to m3. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access denied since although m1x can read m2x, p2 is exported only to m3x. // public class ExpQualOther { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2, m3 + // Define module: m1x + // Can read: java.base, m2x, m3x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") - .requires("m3") + .requires("m2x") + .requires("m3x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m3 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m3x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m3")) + .exports("p2", Set.of("m3x")) .build(); - // Define module: m3 - // Can read: java.base, m2 + // Define module: m3x + // Can read: java.base, m2x // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") - .requires("m2") - .contains("p3") + .requires("m2x") + .packages(Set.of("p3")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); - map.put("m3", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + map.put("m3x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3 not to m1)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x not to m1x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java index 31de4576d90..1545bcb50e5 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExpQualToM1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, AND package p2 in m2 is - * exported qualifiedly to m1, then class p1.c1 in m1 can read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, AND package p2 in m2x is + * exported qualifiedly to m1x, then class p1.c1 in m1x can read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,57 +47,57 @@ import myloaders.MySameClassLoader; public class ExpQualToM1 { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported qualifiedly to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported qualifiedly to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to the same class loader for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java index 03a377027de..0daba28d73e 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExpUnqual.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, AND package p2 in module2 is - * exported unqualifiedly, then class p1.c1 in m1 can read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, AND package p2 in module_two is + * exported unqualifiedly, then class p1.c1 in m1x can read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,50 +47,50 @@ import myloaders.MySameClassLoader; public class ExpUnqual { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: p2 is exported unqualifiedly - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to the same class loader for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); diff --git a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java index c9a89c8ba9f..69f2ca14869 100644 --- a/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java +++ b/hotspot/test/runtime/modules/AccessCheck/ExportAllUnnamed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test if package p2 in module m2 is exported to all unnamed, - * then class p1.c1 in an unnamed module can read p2.c2 in module m2. + * @summary Test if package p2 in module m2x is exported to all unnamed, + * then class p1.c1 in an unnamed module can read p2.c2 in module m2x. * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module @@ -41,76 +41,74 @@ import static jdk.test.lib.Asserts.*; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.util.HashMap; import java.util.Map; import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported unqualifiedly +// m1x can read m2x +// package p2 in m2x is exported unqualifiedly // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access allowed, an unnamed module can read all modules and p2 in module -// m2 is exported to all unnamed modules. +// m2x is exported to all unnamed modules. public class ExportAllUnnamed { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: p2 is exported unqualifiedly - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); Class p2_c2_class = MySameClassLoader.loader1.loadClass("p2.c2"); - Module m2 = p2_c2_class.getModule(); + Module m2x = p2_c2_class.getModule(); - // Export m2/p2 to all unnamed modules. - jdk.internal.module.Modules.addExportsToAllUnnamed(m2, "p2"); + // Export m2x/p2 to all unnamed modules. + jdk.internal.module.Modules.addExportsToAllUnnamed(m2x, "p2"); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); diff --git a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java index 4f592a19002..baabe54cd85 100644 --- a/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/PkgNotExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if module m1 can read module m2, but package p2 in m2 is not - * exported, then class p1.c1 in m1 can not read p2.c2 in m2. + * @summary Test that if module m1x can read module m2x, but package p2 in m2x is not + * exported, then class p1.c1 in m1x can not read p2.c2 in m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,67 +46,67 @@ import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x // Access denied since p2 is not exported. // public class PkgNotExp { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to the same class loader for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 and m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x and m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod.java b/hotspot/test/runtime/modules/AccessCheck/Umod.java index 255950c7f37..20b97edd11e 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ /* * @test - * @summary class p1.c1 defined in m1 tries to access p2.c2 defined in unnamed module. + * @summary class p1.c1 defined in m1x tries to access p2.c2 defined in unnamed module. * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.module @@ -39,21 +39,19 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.Module; import java.util.HashMap; import java.util.Map; import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p1 -// package p1 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p1 +// package p1 in m1x is exported unqualifiedly // -// class p1.c1 defined in m1 tries to access p2.c2 defined in +// class p1.c1 defined in m1x tries to access p2.c2 defined in // in unnamed module. // // Three access attempts occur in this test: @@ -62,47 +60,47 @@ import myloaders.MySameClassLoader; // 2. In this scenario a strict module establishes readability // to the particular unnamed module it is trying to access. // Access is allowed. -// 3. Module m1 in the test_looseModuleLayer() method +// 3. Module m1x in the test_looseModuleLayer() method // is transitioned to a loose module, access // to all unnamed modules is allowed. // public class Umod { - // Create Layers over the boot layer to test different + // Create layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader. MySameClassLoader loader = new MySameClassLoader(); Map map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -111,103 +109,103 @@ public class Umod { // Attempt access try { p1_c1_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1, type p1.c1, should not be able " + + throw new RuntimeException("Test Failed, strict module m1x, type p1.c1, should not be able " + "to access public type p2.c2 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that p2.c2 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MySameClassLoader loader = new MySameClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader. Map map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1ReadEdge Class p1_c1_class = loader.loadClass("p1.c1ReadEdge"); try { - // Read edge between m1 and the unnamed module that loads p2.c2 is established in + // Read edge between m1x and the unnamed module that loads p2.c2 is established in // c1ReadEdge's ctor before attempting access. p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, strict module m1, type p1.c1ReadEdge, should be able to acccess public type " + + throw new RuntimeException("Test Failed, strict module m1x, type p1.c1ReadEdge, should be able to acccess public type " + "p2.c2 defined in unnamed module: " + e.getMessage()); } } - // Module m1 is a loose module and thus can read all unnamed modules. + // Module m1x is a loose module and thus can read all unnamed modules. public void test_looseModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p1 // Packages exported: p1 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p1") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MySameClassLoader loader = new MySameClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c2 will be loaded in an unnamed module/loader. Map map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1Loose Class p1_c1_class = loader.loadClass("p1.c1Loose"); - // change m1 to read all unnamed modules - Module m1 = layer.findModule("m1").get(); - jdk.internal.module.Modules.addReadsAllUnnamed(m1); + // change m1x to read all unnamed modules + Module m1x = layer.findModule("m1x").get(); + jdk.internal.module.Modules.addReadsAllUnnamed(m1x); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, strict module m1, type p1.c1Loose, should be able to acccess public type " + + throw new RuntimeException("Test Failed, strict module m1x, type p1.c1Loose, should be able to acccess public type " + "p2.c2 defined in unnamed module: " + e.getMessage()); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java index 5fcc629096c..a017c9f74b6 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ /* * @test - * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2. + * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x. * Access is denied, since an unnamed module can read all modules but p2 in module - * m2 is exported specifically to module m1, not to all modules. + * m2x is exported specifically to module m1x, not to all modules. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -38,7 +38,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,70 +47,70 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access denied, an unnamed module can read all modules but p2 in module -// m2 is exported specifically to module m1 not to all modules. +// m2x is exported specifically to module m1x not to all modules. // public class UmodDiffCL_ExpQualOther { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 - // NOTE: module m1 does not define a package named p1. + // NOTE: module m1x does not define a package named p1. // p1 will be loaded in an unnamed module. Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m1, not unqualifiedly"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m1x, not unqualifiedly"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java index ade483acd46..724a92d7748 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2. - * Access allowed, an unnamed module can read all modules and p2 in module m2 + * @summary class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x. + * Access allowed, an unnamed module can read all modules and p2 in module m2x * which is exported unqualifiedly. * @modules java.base/jdk.internal.misc * @library /test/lib @@ -38,7 +38,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,70 +47,70 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported unqualifiedly. +// m1x can read m2x +// package p2 in m2x is exported unqualifiedly. // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access allowed, an unnamed module can read all modules and p2 in module -// m2 which is exported unqualifiedly. +// m2x which is exported unqualifiedly. // public class UmodDiffCL_ExpUnqual { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); - // NOTE: module m1 does not define a package named p1. + // NOTE: module m1x does not define a package named p1. // p1 will be loaded in an unnamed module. Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2"); + throw new RuntimeException("Test Failed, p1.c1 defined in unnamed module can access p2.c2 in module m2x"); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java index b5ec6c6a6b0..c95ab7fb031 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ /* * @test - * @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2. + * @summary class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x. * Access is denied since even though unnamed module can read all modules, p2 - * in module m2 is not exported at all. + * in module m2x is not exported at all. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,70 +46,70 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in unnamed module tries to access p2.c2 defined in m2x // Access denied since even though unnamed module can read all modules, p2 -// in module m2 is not exported at all. +// in module m2x is not exported at all. // public class UmodDiffCL_PkgNotExp { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 - // NOTE: module m1 does not define a package named p1. + // NOTE: module m1x does not define a package named p1. // p1 will be loaded in an unnamed module. Class p1_c1_class = MyDiffClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported to an unnamed module)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported to an unnamed module)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java index 7cfcdabe42b..f84425ba4a6 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUPkg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ /* * @test - * @summary class p3.c3 defined in module m1 tries to access c4 defined in unnamed module. + * @summary class p3.c3 defined in module m1x tries to access c4 defined in unnamed module. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -40,18 +40,16 @@ import static jdk.test.lib.Asserts.*; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.util.HashMap; import java.util.Map; import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> packages p3 -// package p3 in m1 is exported unqualifiedly +// ClassLoader1 --> defines m1x --> packages p3 +// package p3 in m1x is exported unqualifiedly // -// class p3.c3 defined in m1 tries to access c4 defined in +// class p3.c3 defined in m1x tries to access c4 defined in // in unnamed module. // // Two access attempts occur in this test: @@ -63,41 +61,41 @@ import myloaders.MySameClassLoader; // public class UmodUPkg { - // Create Layers over the boot layer to test different + // Create layers over the boot layer to test different // accessing scenarios of a named module to an unnamed module. - // Module m1 is a strict module and has not established + // Module m1x is a strict module and has not established // readability to an unnamed module that c4 is defined in. public void test_strictModuleLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); - // map module m1 to class loader. + // map module m1x to class loader. // class c4 will be loaded in an unnamed module/loader. MySameClassLoader loader = new MySameClassLoader(); Map map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3 @@ -106,55 +104,55 @@ public class UmodUPkg { // Attempt access try { p3_c3_class.newInstance(); - throw new RuntimeException("Test Failed, strict module m1, type p3.c3, should not be able to access " + + throw new RuntimeException("Test Failed, strict module m1x, type p3.c3, should not be able to access " + "public type c4 defined in unnamed module"); } catch (IllegalAccessError e) { } } - // Module m1 is a strict module and has established + // Module m1x is a strict module and has established // readability to an unnamed module that c4 is defined in. public void test_strictModuleUnnamedReadableLayer() throws Throwable { - // Define module: m1 + // Define module: m1x // Can read: java.base // Packages: p3 // Packages exported: p3 is exported unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") .exports("p3") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); MySameClassLoader loader = new MySameClassLoader(); - // map module m1 to class loader. + // map module m1x to class loader. // class c4 will be loaded in an unnamed module/loader. Map map = new HashMap<>(); - map.put("m1", loader); + map.put("m1x", loader); - // Create Layer that contains m1 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == loader); + assertTrue(layer.findLoader("m1x") == loader); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p3.c3ReadEdge Class p3_c3_class = loader.loadClass("p3.c3ReadEdge"); try { - // Read edge between m1 and the unnamed module that loads c4 is established in + // Read edge between m1x and the unnamed module that loads c4 is established in // c3ReadEdge's ctor before attempting access. p3_c3_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, module m1, type p3.c3ReadEdge, has established readability to " + + throw new RuntimeException("Test Failed, module m1x, type p3.c3ReadEdge, has established readability to " + "c4 loader's unnamed module, access should be allowed: " + e.getMessage()); } } diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java index 01ec39aa1a5..85ecface508 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ /* * @test - * @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2. + * @summary class c5 defined in an unnamed module tries to access p6.c6 defined in m2x. * Access is denied, since an unnamed module can read all modules but p6 in module - * m2 is exported specifically to module m1, not to all modules. + * m2x is exported specifically to module m1x, not to all modules. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -38,7 +38,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -48,68 +47,68 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p6 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p6 // -// m1 can read m2 -// package p6 in m2 is not exported +// m1x can read m2x +// package p6 in m2x is not exported // -// class c5 defined in an unnamed module tries to access p6.c6 defined in m2 +// class c5 defined in an unnamed module tries to access p6.c6 defined in m2x // Access denied, an unnamed module can read all modules but p6 in module -// m2 is exported specifically to module m1 not to all modules. +// m2x is exported specifically to module m1x not to all modules. // public class UmodUpkgDiffCL_ExpQualOther { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p6 - // Packages exported: p6 exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p6 exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p6", Set.of("m1")) + .exports("p6", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class c5 Class c5_class = MyDiffClassLoader.loader1.loadClass("c5"); try { c5_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m1, not unqualifiedly"); + throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m1x, not unqualifiedly"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java index 68dd3778b5c..b55a19ea1b5 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary class c5 in an unnamed module can read module m2, but package p6 in module m2 is not exported. - * Access denied since even though unnamed module can read all modules, p6 in module m2 is not exported at all. + * @summary class c5 in an unnamed module can read module m2x, but package p6 in module m2x is not exported. + * Access denied since even though unnamed module can read all modules, p6 in module m2x is not exported at all. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MyDiffClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,70 +46,70 @@ import java.util.Set; import myloaders.MyDiffClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// ClassLoader2 --> defines m2 --> packages p6 +// ClassLoader1 --> defines m1x --> no packages +// ClassLoader2 --> defines m2x --> packages p6 // -// m1 can read m2 -// package p6 in m2 is not exported +// m1x can read m2x +// package p6 in m2x is not exported // -// class c5 defined in unnamed module tries to access p6.c6 defined in m2 +// class c5 defined in unnamed module tries to access p6.c6 defined in m2x // Access denied since even though unnamed module can read all modules, p6 -// in module m2 is not exported at all. +// in module m2x is not exported at all. // public class UmodUpkgDiffCL_NotExp { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p6 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p6") + .packages(Set.of("p6")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MyDiffClassLoader.loader1); - map.put("m2", MyDiffClassLoader.loader2); + map.put("m1x", MyDiffClassLoader.loader1); + map.put("m2x", MyDiffClassLoader.loader2); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MyDiffClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MyDiffClassLoader.loader2); + assertTrue(layer.findLoader("m1x") == MyDiffClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MyDiffClassLoader.loader2); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class c5 - // NOTE: module m1 does not define any packages. + // NOTE: module m1x does not define any packages. // c5 will be loaded in an unnamed module. Class c5_class = MyDiffClassLoader.loader1.loadClass("c5"); try { c5_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p6 in m2 is not exported to " + + throw new RuntimeException("Failed to get IAE (p6 in m2x is not exported to " + "an unnamed module that c5 is defined within)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java index 68abe56b7a1..081dc0a2ba2 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if class c5 in an unnamed module can read package p6 in module m2, but package p6 in module m2 is - * exported qualifiedly to module m3, then class c5 in an unnamed module can not read p6.c6 in module m2. + * @summary Test that if class c5 in an unnamed module can read package p6 in module m2x, but package p6 in module m2x is + * exported qualifiedly to module m3x, then class c5 in an unnamed module can not read p6.c6 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,80 +46,80 @@ import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p6 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p6 +// defines m3x --> packages p3 // -// m1 can read m2 -// package p6 in m2 is exported to m3 +// m1x can read m2x +// package p6 in m2x is exported to m3x // -// class c5 defined in m1 tries to access p6.c6 defined in m2 -// Access denied since although m1 can read m2, p6 is exported only to m3. +// class c5 defined in m1x tries to access p6.c6 defined in m2x +// Access denied since although m1x can read m2x, p6 is exported only to m3x. // public class UmodUpkg_ExpQualOther { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 (need to define m1 to establish the Layer successfully) - // Can read: java.base, m2, m3 + // Define module: m1x (need to define m1x to establish the layer successfully) + // Can read: java.base, m2x, m3x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") - .requires("m3") + .requires("m2x") + .requires("m3x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p6 - // Packages exported: p6 is exported to m3 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p6 is exported to m3x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p6", Set.of("m3")) + .exports("p6", Set.of("m3x")) .build(); - // Define module: m3 + // Define module: m3x // Can read: java.base // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); - map.put("m3", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + map.put("m3x", MySameClassLoader.loader1); - // Create Layer that contains m1, m2 and m3 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x, m2x and m3x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class c5 Class c5_class = MySameClassLoader.loader1.loadClass("c5"); try { c5_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p6 in m2 is exported to m3, not unqualifiedly to everyone)"); + throw new RuntimeException("Failed to get IAE (p6 in m2x is exported to m3x, not unqualifiedly to everyone)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java index da69805e580..d7e3287ac9d 100644 --- a/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/UmodUpkg_NotExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test if package p6 in module m2 is not exported, then class c5 - * in an unnamed module can not access p6.c2 in module m2. + * @summary Test if package p6 in module m2x is not exported, then class c5 + * in an unnamed module can not access p6.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -46,67 +45,67 @@ import java.util.Map; import java.util.Set; import myloaders.MySameClassLoader; -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p6 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p6 // -// m1 can read m2 -// package p6 in m2 is not exported +// m1x can read m2x +// package p6 in m2x is not exported // -// class c5 defined in an unnamed module tries to access p6.c2 defined in m2 +// class c5 defined in an unnamed module tries to access p6.c2 defined in m2x // Access denied since p6 is not exported. // public class UmodUpkg_NotExp { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p6 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p6") + .packages(Set.of("p6")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to the same class loader for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 and m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x and m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class c5 Class c5_class = MySameClassLoader.loader1.loadClass("c5"); try { c5_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p6 in m2 is not exported)"); + throw new RuntimeException("Failed to get IAE (p6 in m2x is not exported)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java index 0f5aaf21585..1032eecb27f 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpQualOther.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test that if package p2 in module m2 is exported to module m3, - * then class p1.c1 in an unnamed module can not read p2.c2 in module m2. + * @summary Test that if package p2 in module m2x is exported to module m3x, + * then class p1.c1 in an unnamed module can not read p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,80 +46,80 @@ import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p2 -// defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p2 +// defines m3x --> packages p3 // -// m1 can read m2 -// package p2 in m2 is exported to m3 +// m1x can read m2x +// package p2 in m2x is exported to m3x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access denied since although m1 can read m2, p2 is exported only to m3. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access denied since although m1x can read m2x, p2 is exported only to m3x. // public class Umod_ExpQualOther { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 (need to define m1 to establish the Layer successfully) - // Can read: java.base, m2, m3 + // Define module: m1x (need to define m1x to establish the layer successfully) + // Can read: java.base, m2x, m3x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") - .requires("m3") + .requires("m2x") + .requires("m3x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: p2 is exported to m3 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: p2 is exported to m3x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m3")) + .exports("p2", Set.of("m3x")) .build(); - // Define module: m3 + // Define module: m3x // Can read: java.base // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); - map.put("m3", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + map.put("m3x", MySameClassLoader.loader1); - // Create Layer that contains m1, m2 and m3 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x, m2x and m3x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m3") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m3x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is exported to m3, not unqualifiedly to everyone)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is exported to m3x, not unqualifiedly to everyone)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java index db90a08bd44..05971cec727 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_ExpUnqual.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test if package p2 in module m2 is exported unqualifiedly, - * then class p1.c1 in an unnamed module can read p2.c2 in module m2. + * @summary Test if package p2 in module m2x is exported unqualifiedly, + * then class p1.c1 in an unnamed module can read p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -47,61 +46,61 @@ import java.util.Set; import myloaders.MySameClassLoader; // -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported unqualifiedly +// m1x can read m2x +// package p2 in m2x is exported unqualifiedly // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access allowed, an unnamed module can read all modules and p2 in module -// m2 which is exported unqualifiedly. +// m2x which is exported unqualifiedly. public class Umod_ExpUnqual { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: p2 is exported unqualifiedly - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") .exports("p2") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing class loaders for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 diff --git a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java index d140cf84d69..46e692934c6 100644 --- a/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java +++ b/hotspot/test/runtime/modules/AccessCheck/Umod_PkgNotExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ /* * @test - * @summary Test if package p2 in module m2 is not exported, then class p1.c1 - * in an unnamed module can not access p2.c2 in module m2. + * @summary Test if package p2 in module m2x is not exported, then class p1.c1 + * in an unnamed module can not access p2.c2 in module m2x. * @modules java.base/jdk.internal.misc * @library /test/lib * @compile myloaders/MySameClassLoader.java @@ -37,7 +37,6 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -46,67 +45,67 @@ import java.util.Map; import java.util.Set; import myloaders.MySameClassLoader; -// ClassLoader1 --> defines m1 --> no packages -// defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> no packages +// defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is not exported +// m1x can read m2x +// package p2 in m2x is not exported // -// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2 +// class p1.c1 defined in an unnamed module tries to access p2.c2 defined in m2x // Access denied since p2 is not exported. // public class Umod_PkgNotExp { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: none // Packages exported: none - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 // Packages exported: none - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .contains("p2") + .packages(Set.of("p2")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to the same class loader for this test Map map = new HashMap<>(); - map.put("m1", MySameClassLoader.loader1); - map.put("m2", MySameClassLoader.loader1); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); - // Create Layer that contains m1 and m2 - Layer layer = Layer.boot().defineModules(cf, map::get); + // Create layer that contains m1x and m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == MySameClassLoader.loader1); - assertTrue(layer.findLoader("m2") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java b/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java index 3722927e1b4..ab03e5de9c0 100644 --- a/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java +++ b/hotspot/test/runtime/modules/AccessCheck/p1/c1Loose.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import p2.c2; public class c1Loose { public c1Loose() { - // Attempt access - access should succeed since m1 is a loose module + // Attempt access - access should succeed since m1x is a loose module p2.c2 c2_obj = new p2.c2(); c2_obj.method2(); } diff --git a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java index 55d4a8b7d13..40b31cc49f6 100644 --- a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java +++ b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdge.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,17 +22,16 @@ */ package p1; -import java.lang.reflect.*; import p2.c2; public class c1ReadEdge { public c1ReadEdge() { - // Establish read edge from module m1, where c1ReadEdge is defined, + // Establish read edge from module m1x, where c1ReadEdge is defined, // to the unnamed module, where p2.c2 will be defined. - Module m1 = c1ReadEdge.class.getModule(); + Module m1x = c1ReadEdge.class.getModule(); ClassLoader loader = c1ReadEdge.class.getClassLoader(); Module unnamed_module = loader.getUnnamedModule(); - m1.addReads(unnamed_module); + m1x.addReads(unnamed_module); // Attempt access - access should succeed p2.c2 c2_obj = new p2.c2(); diff --git a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java index daaee5843c8..51b8955673e 100644 --- a/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java +++ b/hotspot/test/runtime/modules/AccessCheck/p1/c1ReadEdgeDiffLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,38 +22,37 @@ */ package p1; -import java.lang.reflect.*; import myloaders.MyDiffClassLoader; import p2.c2; public class c1ReadEdgeDiffLoader { public c1ReadEdgeDiffLoader() { - // The goal is to establish a read edge between module m1 + // The goal is to establish a read edge between module m1x // which is the module where p1.c1ReadEdgeDiffLoader is defined, // and the unnamed module that defines p2.c2. This must be // done in 2 steps: // - // Step #1: Establish a read edge between m1, where c1ReadEdgeDiffLoader + // Step #1: Establish a read edge between m1x, where c1ReadEdgeDiffLoader // is defined, and the System ClassLoader's unnamed module, // where MyDiffClassLoader is defined. This read edge // is needed before we can obtain MyDiffClassLoader.loader2's unnamed module. // - // Step #2: Establish a read edge between m1, where c1ReadEdgeDiffLoader + // Step #2: Establish a read edge between m1x, where c1ReadEdgeDiffLoader // is defined, and the MyDiffClassLoader.loader2's unnamed module, // where p2.c2 will be defined. - // Step #1: read edge m1 -> System ClassLoader's unnamed module - Module m1 = c1ReadEdgeDiffLoader.class.getModule(); + // Step #1: read edge m1x -> System ClassLoader's unnamed module + Module m1x = c1ReadEdgeDiffLoader.class.getModule(); ClassLoader system_loader = ClassLoader.getSystemClassLoader(); - Module unnamed_module1 = system_loader.getUnnamedModule(); - m1.addReads(unnamed_module1); + Module unnamed_module_one = system_loader.getUnnamedModule(); + m1x.addReads(unnamed_module_one); - // Step #2: read edge m1 -> MyDiffClassLoader.loader2's unnamed module + // Step #2: read edge m1x -> MyDiffClassLoader.loader2's unnamed module ClassLoader loader2 = MyDiffClassLoader.loader2; - Module unnamed_module2 = loader2.getUnnamedModule(); - m1.addReads(unnamed_module2); + Module unnamed_module_two = loader2.getUnnamedModule(); + m1x.addReads(unnamed_module_two); - // Attempt access - access should succeed since m1 can read + // Attempt access - access should succeed since m1x can read // MyDiffClassLoader.loader2's unnamed module p2.c2 c2_obj = new p2.c2(); c2_obj.method2(); diff --git a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod index 50df6180233..cc529395226 100644 --- a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod +++ b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdge.jcod @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,15 +23,14 @@ /* * package p3; - * import java.lang.reflect.*; * public class c3ReadEdge { * public c3ReadEdge() { - * // Establish read edge from module m1, where c3ReadEdge is defined, + * // Establish read edge from module m1x, where c3ReadEdge is defined, * // to the unnamed module, where c4 will be defined. - * Module m1 = c3ReadEdge.class.getModule(); + * Module m1x = c3ReadEdge.class.getModule(); * ClassLoader loader = c3ReadEdge.class.getClassLoader(); * Module unnamed_module = loader.getUnnamedModule(); - * m1.addReads(unnamed_module); + * m1x.addReads(unnamed_module); * // Attempt access - access should succeed * c4 c4_obj = new c4(); * c4_obj.method4(); @@ -75,14 +74,14 @@ class p3/c3ReadEdge { Utf8 "java/lang/Object"; // #28 at 0xBC Utf8 "java/lang/Class"; // #29 at 0xCF Utf8 "getModule"; // #30 at 0xE1 - Utf8 "()Ljava/lang/reflect/Module;"; // #31 at 0xED + Utf8 "()Ljava/lang/Module;"; // #31 at 0xED Utf8 "getClassLoader"; // #32 at 0x010C Utf8 "()Ljava/lang/ClassLoader;"; // #33 at 0x011D Utf8 "java/lang/ClassLoader"; // #34 at 0x0139 Utf8 "getUnnamedModule"; // #35 at 0x0151 - Utf8 "java/lang/reflect/Module"; // #36 at 0x0164 + Utf8 "java/lang/Module"; // #36 at 0x0164 Utf8 "addReads"; // #37 at 0x017F - Utf8 "(Ljava/lang/reflect/Module;)Ljava/lang/reflect/Module;"; // #38 at 0x018A + Utf8 "(Ljava/lang/Module;)Ljava/lang/Module;"; // #38 at 0x018A Utf8 "method4"; // #39 at 0x01C3 } // Constant Pool diff --git a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod index 103f7eea2c7..e1602cdf9fb 100644 --- a/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod +++ b/hotspot/test/runtime/modules/AccessCheck/p3/c3ReadEdgeDiffLoader.jcod @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,37 +23,36 @@ /* * package p3; - * import java.lang.reflect.*; * import myloaders.MyDiffClassLoader; * * public class c3ReadEdgeDiffLoader { * public c3ReadEdgeDiffLoader() { - * // The goal is to establish a read edge between module m1 + * // The goal is to establish a read edge between module m1x * // which is the module where p3.c3ReadEdgeDiffLoader is defined, * // and the unnamed module that defines c4. This must be * // done in 2 steps: * // - * // Step #1: Establish a read edge between m1, where c3ReadEdgeDiffLoader + * // Step #1: Establish a read edge between m1x, where c3ReadEdgeDiffLoader * // is defined, and the System ClassLoader's unnamed module, * // where MyDiffClassLoader is defined. This read edge * // is needed before we can obtain MyDiffClassLoader.loader2's unnamed module. * // - * // Step #2: Establish a read edge between m1, where c3ReadEdgeDiffLoader + * // Step #2: Establish a read edge between m1x, where c3ReadEdgeDiffLoader * // is defined, and the MyDiffClassLoader.loader2's unnamed module, * // where c4 will be defined. * - * // Step #1: read edge m1 -> System ClassLoader's unnamed module - * Module m1 = c3ReadEdgeDiffLoader.class.getModule(); + * // Step #1: read edge m1x -> System ClassLoader's unnamed module + * Module m1x = c3ReadEdgeDiffLoader.class.getModule(); * ClassLoader system_loader = ClassLoader.getSystemClassLoader(); - * Module unnamed_module1 = system_loader.getUnnamedModule(); - * m1.addReads(unnamed_module1); + * Module unnamed_module_one = system_loader.getUnnamedModule(); + * m1x.addReads(unnamed_module_one); * - * // Step #2: read edge m1 -> MyDiffClassLoader.loader2's unnamed module + * // Step #2: read edge m1x -> MyDiffClassLoader.loader2's unnamed module * ClassLoader loader2 = MyDiffClassLoader.loader2; - * Module unnamed_module2 = loader2.getUnnamedModule(); - * m1.addReads(unnamed_module2); + * Module unnamed_module_two = loader2.getUnnamedModule(); + * m1x.addReads(unnamed_module_two); * - * // Attempt access - should succeed since m1 can read + * // Attempt access - should succeed since m1x can read * // MyDiffClassLoader.loader2's unnamed module * c4 c4_obj = new c4(); * c4_obj.method4(); @@ -100,14 +99,14 @@ class p3/c3ReadEdgeDiffLoader { Utf8 "java/lang/Object"; // #31 at 0xDD Utf8 "java/lang/Class"; // #32 at 0xF0 Utf8 "getModule"; // #33 at 0x0102 - Utf8 "()Ljava/lang/reflect/Module;"; // #34 at 0x010E + Utf8 "()Ljava/lang/Module;"; // #34 at 0x010E Utf8 "java/lang/ClassLoader"; // #35 at 0x012D Utf8 "getSystemClassLoader"; // #36 at 0x0145 Utf8 "()Ljava/lang/ClassLoader;"; // #37 at 0x015C Utf8 "getUnnamedModule"; // #38 at 0x0178 - Utf8 "java/lang/reflect/Module"; // #39 at 0x018B + Utf8 "java/lang/Module"; // #39 at 0x018B Utf8 "addReads"; // #40 at 0x01A6 - Utf8 "(Ljava/lang/reflect/Module;)Ljava/lang/reflect/Module;"; // #41 at 0x01B1 + Utf8 "(Ljava/lang/Module;)Ljava/lang/Module;"; // #41 at 0x01B1 Utf8 "myloaders/MyDiffClassLoader"; // #42 at 0x01EA Utf8 "loader2"; // #43 at 0x0208 Utf8 "Lmyloaders/MyDiffClassLoader;"; // #44 at 0x0212 diff --git a/hotspot/test/runtime/modules/AccessCheck/p4/c4.java b/hotspot/test/runtime/modules/AccessCheck/p4/c4.java index d0098674672..8df98a646f8 100644 --- a/hotspot/test/runtime/modules/AccessCheck/p4/c4.java +++ b/hotspot/test/runtime/modules/AccessCheck/p4/c4.java @@ -25,8 +25,6 @@ package p4; -import java.lang.reflect.Module; - public class c4 { // Add a read edge from c4's module to given module m public void addReads(Module m) { diff --git a/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java b/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java index 7872d0d3306..69ee6d6cf31 100644 --- a/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java +++ b/hotspot/test/runtime/modules/AccessCheckAllUnnamed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * questions. */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; /* @@ -31,7 +30,7 @@ import static jdk.test.lib.Asserts.*; * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckAllUnnamed @@ -43,28 +42,28 @@ public class AccessCheckAllUnnamed { // and then test that a class in the unnamed module can access a package in a // named module that has been exported to all unnamed modules. public static void main(String args[]) throws Throwable { - Object m1, m2; + Object m1x, m2x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlM = jlObject.getModule(); + assertNotNull(jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for AccessCheckWorks and assume it's also used to // load class p2.c2. ClassLoader this_cldr = AccessCheckAllUnnamed.class.getClassLoader(); // Define a module for p3. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p3" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/there", new String[] { "p3" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p3" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/there", new String[] { "p3" }); + ModuleHelper.AddReadsModule(m1x, jlM); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlM); try { ModuleHelper.AddModuleExportsToAllUnnamed((Module)null, "p2"); @@ -74,7 +73,7 @@ public class AccessCheckAllUnnamed { } try { - ModuleHelper.AddModuleExportsToAllUnnamed(m2, null); + ModuleHelper.AddModuleExportsToAllUnnamed(m2x, null); throw new RuntimeException("Failed to get the expected NPE for null package"); } catch(NullPointerException e) { // Expected @@ -88,21 +87,21 @@ public class AccessCheckAllUnnamed { } try { - ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p3"); + ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p3"); throw new RuntimeException("Failed to get the expected IAE for package in other module"); } catch(IllegalArgumentException e) { // Expected } try { - ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p4"); + ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p4"); throw new RuntimeException("Failed to get the expected IAE for package not in module"); } catch(IllegalArgumentException e) { // Expected } - // Export package p2 in m2 to allUnnamed. - ModuleHelper.AddModuleExportsToAllUnnamed(m2, "p2"); + // Export package p2 in m2x to allUnnamed. + ModuleHelper.AddModuleExportsToAllUnnamed(m2x, "p2"); // p1.c1's ctor tries to call a method in p2.c2. This should succeed because // p1 is in an unnamed module and p2.c2 is exported to all unnamed modules. diff --git a/hotspot/test/runtime/modules/AccessCheckExp.java b/hotspot/test/runtime/modules/AccessCheckExp.java index fa624b0783a..18c02937a82 100644 --- a/hotspot/test/runtime/modules/AccessCheckExp.java +++ b/hotspot/test/runtime/modules/AccessCheckExp.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,54 +28,53 @@ * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckExp */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class AccessCheckExp { - // Test that if module1 can read module2, but package p2 in module2 is not - // exported then class p1.c1 in module1 can not read p2.c2 in module2. + // Test that if module_one can read module_two, but package p2 in module_two is not + // exported then class p1.c1 in module_one can not read p2.c2 in module_two. public static void main(String args[]) throws Throwable { - Object m1, m2; + Object m1x, m2x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for AccessCheckExp and assume it's also used to // load classes p1.c1 and p2.c2. ClassLoader this_cldr = AccessCheckExp.class.getClassLoader(); // Define a module for p1. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" }); + ModuleHelper.AddReadsModule(m1x, jlObject_jlM); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); - // Make package p1 in m1 visible to everyone. - ModuleHelper.AddModuleExportsToAll(m1, "p1"); + // Make package p1 in m1x visible to everyone. + ModuleHelper.AddModuleExportsToAll(m1x, "p1"); // p1.c1's ctor tries to call a method in p2.c2, but p2.c2 is not // exported. So should get IllegalAccessError. - ModuleHelper.AddReadsModule(m1, m2); + ModuleHelper.AddReadsModule(m1x, m2x); Class p1_c1_class = Class.forName("p1.c1"); try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported"); } catch (IllegalAccessError f) { System.out.println(f.getMessage()); if (!f.getMessage().contains("does not export")) { diff --git a/hotspot/test/runtime/modules/AccessCheckJavaBase.java b/hotspot/test/runtime/modules/AccessCheckJavaBase.java index 24f2f77e115..0402f129658 100644 --- a/hotspot/test/runtime/modules/AccessCheckJavaBase.java +++ b/hotspot/test/runtime/modules/AccessCheckJavaBase.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,27 +27,26 @@ * @library /test/lib .. * @compile p2/c2.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckJavaBase */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class AccessCheckJavaBase { - // Test that a class defined to module2 always can read java.base. + // Test that a class defined to module_two always can read java.base. public static void main(String args[]) throws Throwable { // Get the class loader for AccessCheckJavaBase and assume it's also used to // load class p2.c2. ClassLoader this_cldr = AccessCheckJavaBase.class.getClassLoader(); // Define a module for p2. - Object m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); + Object m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); // p2.c2 can read its superclass java.lang.Object defined within java.base try { diff --git a/hotspot/test/runtime/modules/AccessCheckRead.java b/hotspot/test/runtime/modules/AccessCheckRead.java index a36268ace02..c25c33a61da 100644 --- a/hotspot/test/runtime/modules/AccessCheckRead.java +++ b/hotspot/test/runtime/modules/AccessCheckRead.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,45 +28,44 @@ * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckRead */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class AccessCheckRead { - // Test that a class in a package in module1 cannot access a class in - // a package n module2 if module1 cannot read module2. + // Test that a class in a package in module_one cannot access a class in + // a package in module_two if module_one cannot read module_two. public static void main(String args[]) throws Throwable { - Object m1, m2; + Object m1x, m2x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for AccessCheckRead and assume it's also used to // load classes p1.c1 and p2.c2. ClassLoader this_cldr = AccessCheckRead.class.getClassLoader(); // Define a module for p1. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" }); + ModuleHelper.AddReadsModule(m1x, jlObject_jlM); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); - // Make package p1 in m1 visible to everyone. - ModuleHelper.AddModuleExportsToAll(m1, "p1"); + // Make package p1 in m1x visible to everyone. + ModuleHelper.AddModuleExportsToAll(m1x, "p1"); Class p1_c1_class = Class.forName("p1.c1"); @@ -74,7 +73,7 @@ public class AccessCheckRead { // cannot read p2's module. So should get IllegalAccessError. try { p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (m1 can't read m2)"); + throw new RuntimeException("Failed to get IAE (m1x can't read m2x)"); } catch (IllegalAccessError e) { System.out.println(e.getMessage()); if (!e.getMessage().contains("does not read") || diff --git a/hotspot/test/runtime/modules/AccessCheckSuper.java b/hotspot/test/runtime/modules/AccessCheckSuper.java index 594c1921e0f..c227db254a1 100644 --- a/hotspot/test/runtime/modules/AccessCheckSuper.java +++ b/hotspot/test/runtime/modules/AccessCheckSuper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +28,12 @@ * @compile p2/c2.java * @compile p3/c3.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckSuper */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class AccessCheckSuper { @@ -48,17 +47,17 @@ public class AccessCheckSuper { ClassLoader this_cldr = AccessCheckSuper.class.getClassLoader(); // Define a module for p2. - Object m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); + Object m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); // Define a module for p3. - Object m3 = ModuleHelper.ModuleObject("module3", this_cldr, new String[] { "p3" }); - assertNotNull(m3, "Module should not be null"); - ModuleHelper.DefineModule(m3, "9.0", "m3/there", new String[] { "p3" }); + Object m3x = ModuleHelper.ModuleObject("module_three", this_cldr, new String[] { "p3" }); + assertNotNull(m3x, "Module should not be null"); + ModuleHelper.DefineModule(m3x, "9.0", "m3x/there", new String[] { "p3" }); - // Since a readability edge has not been established between module2 - // and module3, p3.c3 cannot read its superclass p2.c2. + // Since a readability edge has not been established between module_two + // and module_three, p3.c3 cannot read its superclass p2.c2. try { Class p3_c3_class = Class.forName("p3.c3"); throw new RuntimeException("Failed to get IAE (can't read superclass)"); diff --git a/hotspot/test/runtime/modules/AccessCheckUnnamed.java b/hotspot/test/runtime/modules/AccessCheckUnnamed.java index 4a2ab3e4951..14b48b107b6 100644 --- a/hotspot/test/runtime/modules/AccessCheckUnnamed.java +++ b/hotspot/test/runtime/modules/AccessCheckUnnamed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * questions. */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; /* @@ -31,7 +30,7 @@ import static jdk.test.lib.Asserts.*; * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckUnnamed @@ -42,29 +41,29 @@ public class AccessCheckUnnamed { // Test that a class in the unnamed module can not access a package in a // named module that has not been unqualifiedly exported. public static void main(String args[]) throws Throwable { - Object m1, m2; + Object m1x, m2x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for AccessCheckWorks and assume it's also used to // load class p2.c2. ClassLoader this_cldr = AccessCheckUnnamed.class.getClassLoader(); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); // p1.c1's ctor tries to call a method in p2.c2. This should fail because // p1 is in the unnamed module and p2.c2 is not unqualifiedly exported. Class p1_c1_class = Class.forName("p1.c1"); try { Object c1_obj = p1_c1_class.newInstance(); - throw new RuntimeException("Failed to get IAE (p2 in m2 is not exported to unnamed module)"); + throw new RuntimeException("Failed to get IAE (p2 in m2x is not exported to unnamed module)"); } catch (IllegalAccessError f) { System.out.println(f.getMessage()); if (!f.getMessage().contains("does not export p2 to unnamed module")) { diff --git a/hotspot/test/runtime/modules/AccessCheckWorks.java b/hotspot/test/runtime/modules/AccessCheckWorks.java index 48d6660f195..9cb638ade3a 100644 --- a/hotspot/test/runtime/modules/AccessCheckWorks.java +++ b/hotspot/test/runtime/modules/AccessCheckWorks.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,51 +28,50 @@ * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI AccessCheckWorks */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class AccessCheckWorks { - // Check that a class in a package in module1 can successfully access a - // class in module2 when module1 can read module2 and the class's package + // Check that a class in a package in module_one can successfully access a + // class in module_two when module_one can read module_two and the class's package // has been exported. public static void main(String args[]) throws Throwable { - Object m1, m2; + Object m1x, m2x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for AccessCheckWorks and assume it's also used to // load classes p1.c1 and p2.c2. ClassLoader this_cldr = AccessCheckWorks.class.getClassLoader(); // Define a module for p1. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" }); + ModuleHelper.AddReadsModule(m1x, jlObject_jlM); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); - // Make package p1 in m1 visible to everyone. - ModuleHelper.AddModuleExportsToAll(m1, "p1"); + // Make package p1 in m1x visible to everyone. + ModuleHelper.AddModuleExportsToAll(m1x, "p1"); // p1.c1's ctor tries to call a method in p2.c2. This should work because // p1's module can read p2's module and p2 is exported to p1's module. - ModuleHelper.AddReadsModule(m1, m2); - ModuleHelper.AddModuleExports(m2, "p2", m1); + ModuleHelper.AddReadsModule(m1x, m2x); + ModuleHelper.AddModuleExports(m2x, "p2", m1x); Class p1_c1_class = Class.forName("p1.c1"); p1_c1_class.newInstance(); } diff --git a/hotspot/test/runtime/modules/CCE_module_msg.java b/hotspot/test/runtime/modules/CCE_module_msg.java index 38ff41fde2d..7e593dfcee9 100644 --- a/hotspot/test/runtime/modules/CCE_module_msg.java +++ b/hotspot/test/runtime/modules/CCE_module_msg.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,14 +28,13 @@ * @compile p2/c2.java * @compile p4/c4.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI CCE_module_msg */ import java.io.*; -import java.lang.reflect.Module; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Path; @@ -73,31 +72,31 @@ public class CCE_module_msg { } public static void invalidClassToString() throws Throwable { - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for CCE_module_msg and assume it's also used to // load classes p1.c1 and p2.c2. ClassLoader this_cldr = CCE_module_msg.class.getClassLoader(); // Define a module for p2. - Object m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + Object m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); try { - ModuleHelper.AddModuleExportsToAll(m2, "p2"); + ModuleHelper.AddModuleExportsToAll(m2x, "p2"); Object p2Obj = new p2.c2(); System.out.println((String)p2Obj); throw new RuntimeException("ClassCastException wasn't thrown, test failed."); } catch (ClassCastException cce) { String exception = cce.getMessage(); System.out.println(exception); - if (exception.contains("module2/p2.c2") || - !(exception.contains("module2@") && + if (exception.contains("module_two/p2.c2") || + !(exception.contains("module_two@") && exception.contains("/p2.c2 cannot be cast to java.base/java.lang.String"))) { throw new RuntimeException("Wrong message: " + exception); } @@ -105,10 +104,10 @@ public class CCE_module_msg { } public static void invalidClassToStringCustomLoader() throws Throwable { - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Create a customer class loader to load class p4/c4. URL[] urls = new URL[] { CLASSES_DIR.toUri().toURL() }; diff --git a/hotspot/test/runtime/modules/ExportTwice.java b/hotspot/test/runtime/modules/ExportTwice.java index 538c65926c0..abdad3a7822 100644 --- a/hotspot/test/runtime/modules/ExportTwice.java +++ b/hotspot/test/runtime/modules/ExportTwice.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +28,12 @@ * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ExportTwice */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class ExportTwice { @@ -44,49 +43,49 @@ public class ExportTwice { // Also, check that a package can be exported to a specific package and then // exported unqualifiedly. public static void main(String args[]) throws Throwable { - Object m1, m2, m3; + Object m1x, m2x, m3x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for ExportTwice and assume it's also used to // load classes p1.c1 and p2.c2. ClassLoader this_cldr = ExportTwice.class.getClassLoader(); // Define a module for p1. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" }); + ModuleHelper.AddReadsModule(m1x, jlObject_jlM); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); // Define a module for p3. - m3 = ModuleHelper.ModuleObject("module3", this_cldr, new String[] { "p3" }); - assertNotNull(m3, "Module should not be null"); - ModuleHelper.DefineModule(m3, "9.0", "m3/there", new String[] { "p3" }); - ModuleHelper.AddReadsModule(m3, jlObject_jlrM); + m3x = ModuleHelper.ModuleObject("module_three", this_cldr, new String[] { "p3" }); + assertNotNull(m3x, "Module should not be null"); + ModuleHelper.DefineModule(m3x, "9.0", "m3x/there", new String[] { "p3" }); + ModuleHelper.AddReadsModule(m3x, jlObject_jlM); - // Make package p1 in m1 visible to everyone. - ModuleHelper.AddModuleExportsToAll(m1, "p1"); + // Make package p1 in m1x visible to everyone. + ModuleHelper.AddModuleExportsToAll(m1x, "p1"); - // Try to export p1 only to m2 after it was exported unqualifiedly. It + // Try to export p1 only to m2x after it was exported unqualifiedly. It // should silently succeed. - ModuleHelper.AddModuleExports(m1, "p1", m2); + ModuleHelper.AddModuleExports(m1x, "p1", m2x); - // Export p2 to m3 then export it again unqualifiedly. - ModuleHelper.AddModuleExports(m2, "p2", m3); - ModuleHelper.AddModuleExportsToAll(m2, "p2"); + // Export p2 to m3x then export it again unqualifiedly. + ModuleHelper.AddModuleExports(m2x, "p2", m3x); + ModuleHelper.AddModuleExportsToAll(m2x, "p2"); // p1.c1's ctor tries to call a method in p2.c2. This should work because // p1's module can read p2's module and p2 is now exported unqualifiedly. - ModuleHelper.AddReadsModule(m1, m2); + ModuleHelper.AddReadsModule(m1x, m2x); Class p1_c1_class = Class.forName("p1.c1"); p1_c1_class.newInstance(); } diff --git a/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java b/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java index e3748530fa7..0d7b2f60e14 100644 --- a/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java +++ b/hotspot/test/runtime/modules/IgnoreModulePropertiesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ public class IgnoreModulePropertiesTest { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "-D" + prop + "=" + value, "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("java version "); + output.shouldContain(" version "); output.shouldHaveExitValue(0); // Ensure that the property and its value aren't available. @@ -67,8 +67,8 @@ public class IgnoreModulePropertiesTest { } public static void main(String[] args) throws Exception { - testOption("--add-modules", "java.sqlx", "jdk.module.addmods.0", "java.lang.module.ResolutionException"); - testOption("--limit-modules", "java.sqlx", "jdk.module.limitmods", "java.lang.module.ResolutionException"); + testOption("--add-modules", "java.sqlx", "jdk.module.addmods.0", "java.lang.module.FindException"); + testOption("--limit-modules", "java.sqlx", "jdk.module.limitmods", "java.lang.module.FindException"); testOption("--add-reads", "xyzz=yyzd", "jdk.module.addreads.0", "WARNING: Unknown module: xyzz"); testOption("--add-exports", "java.base/xyzz=yyzd", "jdk.module.addexports.0", "WARNING: package xyzz not in java.base"); diff --git a/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java b/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java index 7a08787c696..71fba9816f2 100644 --- a/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java +++ b/hotspot/test/runtime/modules/JVMAddModuleExportToAllUnnamed.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,37 +30,36 @@ * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModuleExportToAllUnnamed */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class JVMAddModuleExportToAllUnnamed { - // Check that a class in a package in module1 cannot access a class + // Check that a class in a package in module_one cannot access a class // that is in the unnamed module if the accessing package is strict. public static void main(String args[]) throws Throwable { - Object m1; + Object m1x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for JVMAddModuleExportToAllUnnamed and assume it's also used to // load class p1.c1. ClassLoader this_cldr = JVMAddModuleExportToAllUnnamed.class.getClassLoader(); // Define a module for p1. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p1" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/here", new String[] { "p1" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p1" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/here", new String[] { "p1" }); + ModuleHelper.AddReadsModule(m1x, jlObject_jlM); - // Make package p1 in m1 visible to everyone. - ModuleHelper.AddModuleExportsToAll(m1, "p1"); + // Make package p1 in m1x visible to everyone. + ModuleHelper.AddModuleExportsToAll(m1x, "p1"); // p1.c1's ctor tries to call a method in p2.c2. This should not work // because p2 is in the unnamed module and p1.c1 is strict. diff --git a/hotspot/test/runtime/modules/JVMAddModuleExports.java b/hotspot/test/runtime/modules/JVMAddModuleExports.java index 689523639f4..01d441c7879 100644 --- a/hotspot/test/runtime/modules/JVMAddModuleExports.java +++ b/hotspot/test/runtime/modules/JVMAddModuleExports.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,12 @@ * @modules java.base/jdk.internal.misc * @library /test/lib .. * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModuleExports */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; public class JVMAddModuleExports { diff --git a/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java b/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java index 80db658a99d..f6499644b48 100644 --- a/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java +++ b/hotspot/test/runtime/modules/JVMAddModuleExportsToAll.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ * questions. */ -import java.lang.reflect.Module; import static jdk.test.lib.Asserts.*; /* @@ -31,7 +30,7 @@ import static jdk.test.lib.Asserts.*; * @compile p2/c2.java * @compile p1/c1.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModuleExportsToAll @@ -43,28 +42,28 @@ public class JVMAddModuleExportsToAll { // and then test that a class in the unnamed module can access a package in // a named module that has been exported unqualifiedly. public static void main(String args[]) throws Throwable { - Object m1, m2, m3; + Object m1x, m2x, m3x; - // Get the java.lang.reflect.Module object for module java.base. + // Get the java.lang.Module object for module java.base. Class jlObject = Class.forName("java.lang.Object"); - Object jlObject_jlrM = jlObject.getModule(); - assertNotNull(jlObject_jlrM, "jlrModule object of java.lang.Object should not be null"); + Object jlObject_jlM = jlObject.getModule(); + assertNotNull(jlObject_jlM, "jlModule object of java.lang.Object should not be null"); // Get the class loader for JVMAddModuleExportsToAll and assume it's also used to // load class p2.c2. ClassLoader this_cldr = JVMAddModuleExportsToAll.class.getClassLoader(); // Define a module for p3. - m1 = ModuleHelper.ModuleObject("module1", this_cldr, new String[] { "p3" }); - assertNotNull(m1, "Module should not be null"); - ModuleHelper.DefineModule(m1, "9.0", "m1/there", new String[] { "p3" }); - ModuleHelper.AddReadsModule(m1, jlObject_jlrM); + m1x = ModuleHelper.ModuleObject("module_one", this_cldr, new String[] { "p3" }); + assertNotNull(m1x, "Module should not be null"); + ModuleHelper.DefineModule(m1x, "9.0", "m1x/there", new String[] { "p3" }); + ModuleHelper.AddReadsModule(m1x, jlObject_jlM); // Define a module for p2. - m2 = ModuleHelper.ModuleObject("module2", this_cldr, new String[] { "p2" }); - assertNotNull(m2, "Module should not be null"); - ModuleHelper.DefineModule(m2, "9.0", "m2/there", new String[] { "p2" }); - ModuleHelper.AddReadsModule(m2, jlObject_jlrM); + m2x = ModuleHelper.ModuleObject("module_two", this_cldr, new String[] { "p2" }); + assertNotNull(m2x, "Module should not be null"); + ModuleHelper.DefineModule(m2x, "9.0", "m2x/there", new String[] { "p2" }); + ModuleHelper.AddReadsModule(m2x, jlObject_jlM); try { ModuleHelper.AddModuleExportsToAll((Module)null, "p2"); @@ -74,13 +73,13 @@ public class JVMAddModuleExportsToAll { } try { - ModuleHelper.AddModuleExportsToAll(m2, null); + ModuleHelper.AddModuleExportsToAll(m2x, null); throw new RuntimeException("Failed to get the expected NPE for null package"); } catch(NullPointerException e) { // Expected } - try { // Expect IAE when passing a ClassLoader object instead of a java.lang.reflect.Module object. + try { // Expect IAE when passing a ClassLoader object instead of a java.lang.Module object. ModuleHelper.AddModuleExportsToAll(this_cldr, "p2"); throw new RuntimeException("Failed to get the expected IAE for bad module"); } catch(IllegalArgumentException e) { @@ -88,26 +87,26 @@ public class JVMAddModuleExportsToAll { } try { - ModuleHelper.AddModuleExportsToAll(m2, "p3"); + ModuleHelper.AddModuleExportsToAll(m2x, "p3"); throw new RuntimeException("Failed to get the expected IAE for package that is in another module"); } catch(IllegalArgumentException e) { // Expected } try { - ModuleHelper.AddModuleExportsToAll(m2, "p4"); + ModuleHelper.AddModuleExportsToAll(m2x, "p4"); throw new RuntimeException("Failed to get the expected IAE for package not in any module"); } catch(IllegalArgumentException e) { // Expected } - // Export package p2 in m2 unqualifiedly. Then, do a qualified export - // of p2 in m2 to m3. This should not affect the unqualified export. - m3 = ModuleHelper.ModuleObject("module3", this_cldr, new String[] { "p4" }); - assertNotNull(m3, "Module m3 should not be null"); - ModuleHelper.DefineModule(m3, "9.0", "m3/there", new String[] { "p4" }); - ModuleHelper.AddModuleExportsToAll(m2, "p2"); - ModuleHelper.AddModuleExports(m2, "p2", m3); + // Export package p2 in m2x unqualifiedly. Then, do a qualified export + // of p2 in m2x to m3x. This should not affect the unqualified export. + m3x = ModuleHelper.ModuleObject("module_three", this_cldr, new String[] { "p4" }); + assertNotNull(m3x, "Module m3x should not be null"); + ModuleHelper.DefineModule(m3x, "9.0", "m3x/there", new String[] { "p4" }); + ModuleHelper.AddModuleExportsToAll(m2x, "p2"); + ModuleHelper.AddModuleExports(m2x, "p2", m3x); // p1.c1's ctor tries to call a method in p2.c2. This should succeed because // p1 is in an unnamed module and p2.c2 is exported unqualifiedly. diff --git a/hotspot/test/runtime/modules/JVMAddModulePackage.java b/hotspot/test/runtime/modules/JVMAddModulePackage.java index 3f7f2fd29a0..eb2e32581c6 100644 --- a/hotspot/test/runtime/modules/JVMAddModulePackage.java +++ b/hotspot/test/runtime/modules/JVMAddModulePackage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @modules java.base/jdk.internal.misc * @library /test/lib .. * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddModulePackage @@ -40,25 +40,25 @@ public class JVMAddModulePackage { public static void main(String args[]) throws Throwable { MyClassLoader cl1 = new MyClassLoader(); MyClassLoader cl3 = new MyClassLoader(); - Object module1, module2, module3; + Object module_one, module_two, module_three; boolean result; - module1 = ModuleHelper.ModuleObject("module1", cl1, new String[] { "mypackage" }); - assertNotNull(module1, "Module should not be null"); - ModuleHelper.DefineModule(module1, "9.0", "module1/here", new String[] { "mypackage" }); - module2 = ModuleHelper.ModuleObject("module2", cl1, new String[] { "yourpackage" }); - assertNotNull(module2, "Module should not be null"); - ModuleHelper.DefineModule(module2, "9.0", "module2/here", new String[] { "yourpackage" }); - module3 = ModuleHelper.ModuleObject("module3", cl3, new String[] { "package/num3" }); - assertNotNull(module3, "Module should not be null"); - ModuleHelper.DefineModule(module3, "9.0", "module3/here", new String[] { "package/num3" }); + module_one = ModuleHelper.ModuleObject("module_one", cl1, new String[] { "mypackage" }); + assertNotNull(module_one, "Module should not be null"); + ModuleHelper.DefineModule(module_one, "9.0", "module_one/here", new String[] { "mypackage" }); + module_two = ModuleHelper.ModuleObject("module_two", cl1, new String[] { "yourpackage" }); + assertNotNull(module_two, "Module should not be null"); + ModuleHelper.DefineModule(module_two, "9.0", "module_two/here", new String[] { "yourpackage" }); + module_three = ModuleHelper.ModuleObject("module_three", cl3, new String[] { "package/num3" }); + assertNotNull(module_three, "Module should not be null"); + ModuleHelper.DefineModule(module_three, "9.0", "module_three/here", new String[] { "package/num3" }); // Simple call - ModuleHelper.AddModulePackage(module1, "new_package"); + ModuleHelper.AddModulePackage(module_one, "new_package"); // Add a package and export it - ModuleHelper.AddModulePackage(module1, "package/num3"); - ModuleHelper.AddModuleExportsToAll(module1, "package/num3"); + ModuleHelper.AddModulePackage(module_one, "package/num3"); + ModuleHelper.AddModuleExportsToAll(module_one, "package/num3"); // Null module argument, expect an NPE try { @@ -78,7 +78,7 @@ public class JVMAddModulePackage { // Null package argument, expect an NPE try { - ModuleHelper.AddModulePackage(module1, null); + ModuleHelper.AddModulePackage(module_one, null); throw new RuntimeException("Failed to get the expected NPE"); } catch(NullPointerException e) { // Expected @@ -86,7 +86,7 @@ public class JVMAddModulePackage { // Existing package, expect an ISE try { - ModuleHelper.AddModulePackage(module1, "yourpackage"); + ModuleHelper.AddModulePackage(module_one, "yourpackage"); throw new RuntimeException("Failed to get the expected ISE"); } catch(IllegalStateException e) { // Expected @@ -94,7 +94,7 @@ public class JVMAddModulePackage { // Invalid package name, expect an IAE try { - ModuleHelper.AddModulePackage(module1, "your.package"); + ModuleHelper.AddModulePackage(module_one, "your.package"); throw new RuntimeException("Failed to get the expected IAE"); } catch(IllegalArgumentException e) { // Expected @@ -102,7 +102,7 @@ public class JVMAddModulePackage { // Invalid package name, expect an IAE try { - ModuleHelper.AddModulePackage(module1, ";your/package"); + ModuleHelper.AddModulePackage(module_one, ";your/package"); throw new RuntimeException("Failed to get the expected IAE"); } catch(IllegalArgumentException e) { // Expected @@ -110,7 +110,7 @@ public class JVMAddModulePackage { // Invalid package name, expect an IAE try { - ModuleHelper.AddModulePackage(module1, "7[743"); + ModuleHelper.AddModulePackage(module_one, "7[743"); throw new RuntimeException("Failed to get the expected IAE"); } catch(IllegalArgumentException e) { // Expected @@ -118,7 +118,7 @@ public class JVMAddModulePackage { // Empty package name, expect an IAE try { - ModuleHelper.AddModulePackage(module1, ""); + ModuleHelper.AddModulePackage(module_one, ""); throw new RuntimeException("Failed to get the expected IAE"); } catch(IllegalArgumentException e) { // Expected @@ -126,8 +126,8 @@ public class JVMAddModulePackage { // Add package named "java" to an module defined to a class loader other than the boot or platform loader. try { - // module1 is defined to a MyClassLoader class loader. - ModuleHelper.AddModulePackage(module1, "java/foo"); + // module_one is defined to a MyClassLoader class loader. + ModuleHelper.AddModulePackage(module_one, "java/foo"); throw new RuntimeException("Failed to get the expected IAE"); } catch(IllegalArgumentException e) { if (!e.getMessage().contains("prohibited package name")) { @@ -136,10 +136,10 @@ public class JVMAddModulePackage { } // Package "javabar" should be ok - ModuleHelper.AddModulePackage(module1, "javabar"); + ModuleHelper.AddModulePackage(module_one, "javabar"); // Package named "java" defined to the boot class loader, should be ok - Object module_javabase = module1.getClass().getModule(); + Object module_javabase = module_one.getClass().getModule(); ModuleHelper.AddModulePackage(module_javabase, "java/foo"); // Package named "java" defined to the platform class loader, should be ok diff --git a/hotspot/test/runtime/modules/JVMAddReadsModule.java b/hotspot/test/runtime/modules/JVMAddReadsModule.java index a25bcfc64f6..bf0b838403e 100644 --- a/hotspot/test/runtime/modules/JVMAddReadsModule.java +++ b/hotspot/test/runtime/modules/JVMAddReadsModule.java @@ -26,7 +26,7 @@ * @modules java.base/jdk.internal.misc * @library /test/lib .. * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMAddReadsModule diff --git a/hotspot/test/runtime/modules/JVMDefineModule.java b/hotspot/test/runtime/modules/JVMDefineModule.java index 9e44878490d..e3e263be291 100644 --- a/hotspot/test/runtime/modules/JVMDefineModule.java +++ b/hotspot/test/runtime/modules/JVMDefineModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @modules java.base/jdk.internal.misc * @library /test/lib .. * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMDefineModule @@ -49,7 +49,7 @@ public class JVMDefineModule { /* Invalid test, won't compile. // Invalid classloader argument, expect an IAE try { - m = ModuleHelper.ModuleObject("mymodule1", new Object(), new String[] { "mypackage1" }); + m = ModuleHelper.ModuleObject("mymodule_one", new Object(), new String[] { "mypackage1" }); ModuleHelper.DefineModule(m, "9.0", "mymodule/here", new String[] { "mypackage1" }); throw new RuntimeException("Failed to get expected IAE for bad loader"); } catch(IllegalArgumentException e) { @@ -78,7 +78,7 @@ public class JVMDefineModule { ModuleHelper.DefineModule(new Object(), "9.0", "mymodule/here", new String[] { "mypackage1" }); throw new RuntimeException("Failed to get expected IAE or NPE for bad module"); } catch(IllegalArgumentException e) { - if (!e.getMessage().contains("module is not an instance of type java.lang.reflect.Module")) { + if (!e.getMessage().contains("module is not an instance of type java.lang.Module")) { throw new RuntimeException("Failed to get expected IAE message for bad module: " + e.getMessage()); } } diff --git a/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java b/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java index 1f58193c676..da3224826eb 100644 --- a/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java +++ b/hotspot/test/runtime/modules/JVMGetModuleByPkgName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @library /test/lib .. * @compile p2/c2.java * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI JVMGetModuleByPkgName @@ -35,7 +35,6 @@ import static jdk.test.lib.Asserts.*; import java.lang.ClassLoader; -import java.lang.reflect.Module; public class JVMGetModuleByPkgName { @@ -79,10 +78,10 @@ public class JVMGetModuleByPkgName { } MyClassLoader cl1 = new MyClassLoader(); - Module module1 = (Module)ModuleHelper.ModuleObject("module1", cl1, new String[] { "mypackage" }); - assertNotNull(module1, "Module should not be null"); - ModuleHelper.DefineModule(module1, "9.0", "module1/here", new String[] { "mypackage" }); - if (ModuleHelper.GetModuleByPackageName(cl1, "mypackage") != module1) { + Module module_one = (Module)ModuleHelper.ModuleObject("module_one", cl1, new String[] { "mypackage" }); + assertNotNull(module_one, "Module should not be null"); + ModuleHelper.DefineModule(module_one, "9.0", "module_one/here", new String[] { "mypackage" }); + if (ModuleHelper.GetModuleByPackageName(cl1, "mypackage") != module_one) { throw new RuntimeException("Wrong module returned for cl1 mypackage"); } } diff --git a/hotspot/test/runtime/modules/LoadUnloadModuleStress.java b/hotspot/test/runtime/modules/LoadUnloadModuleStress.java index 1f27ba9b432..20cde3a5f60 100644 --- a/hotspot/test/runtime/modules/LoadUnloadModuleStress.java +++ b/hotspot/test/runtime/modules/LoadUnloadModuleStress.java @@ -27,7 +27,7 @@ * @modules java.base/jdk.internal.misc * @library /test/lib .. * @build sun.hotspot.WhiteBox - * @compile/module=java.base java/lang/reflect/ModuleHelper.java + * @compile/module=java.base java/lang/ModuleHelper.java * @run main ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xmx64m -Xmx64m LoadUnloadModuleStress 15000 diff --git a/hotspot/test/runtime/modules/ModuleHelper.java b/hotspot/test/runtime/modules/ModuleHelper.java index 2f0d7f6ec11..e4db0f53a18 100644 --- a/hotspot/test/runtime/modules/ModuleHelper.java +++ b/hotspot/test/runtime/modules/ModuleHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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.net.URI; import java.lang.module.ModuleDescriptor; -import java.lang.reflect.Module; import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -41,19 +40,19 @@ public class ModuleHelper { public static void AddModuleExports(Object from, String pkg, Object to) throws Throwable { WhiteBox wb = WhiteBox.getWhiteBox(); wb.AddModuleExports(from, pkg, to); - java.lang.reflect.ModuleHelper.addExportsNoSync((Module)from, pkg, (Module)to); + java.lang.ModuleHelper.addExportsNoSync((Module)from, pkg, (Module)to); } public static void AddReadsModule(Object from, Object to) throws Throwable { WhiteBox wb = WhiteBox.getWhiteBox(); wb.AddReadsModule(from, to); - java.lang.reflect.ModuleHelper.addReadsNoSync((Module)from, (Module)to); + java.lang.ModuleHelper.addReadsNoSync((Module)from, (Module)to); } public static void AddModulePackage(Object m, String pkg) throws Throwable { WhiteBox wb = WhiteBox.getWhiteBox(); wb.AddModulePackage(m, pkg); - java.lang.reflect.ModuleHelper.addPackageNoSync((Module)m, pkg); + java.lang.ModuleHelper.addPackageNoSync((Module)m, pkg); } public static Module GetModuleByPackageName(Object ldr, String pkg) throws Throwable { @@ -64,13 +63,13 @@ public class ModuleHelper { public static void AddModuleExportsToAllUnnamed(Object m, String pkg) throws Throwable { WhiteBox wb = WhiteBox.getWhiteBox(); wb.AddModuleExportsToAllUnnamed(m, pkg); - //java.lang.reflect.ModuleHelper.addExportsToAllUnnamedNoSync((Module)m, pkg); + //java.lang.ModuleHelper.addExportsToAllUnnamedNoSync((Module)m, pkg); } public static void AddModuleExportsToAll(Object m, String pkg) throws Throwable { WhiteBox wb = WhiteBox.getWhiteBox(); wb.AddModuleExportsToAll(m, pkg); - java.lang.reflect.ModuleHelper.addExportsNoSync((Module)m, pkg, (Module)null); + java.lang.ModuleHelper.addExportsNoSync((Module)m, pkg, (Module)null); } public static Module ModuleObject(String name, ClassLoader loader, String[] pkgs) throws Throwable { @@ -84,10 +83,10 @@ public class ModuleHelper { } ModuleDescriptor descriptor = - ModuleDescriptor.module(name).contains(pkg_set).build(); + ModuleDescriptor.newModule(name).packages(pkg_set).build(); URI uri = URI.create("module:/" + name); - return java.lang.reflect.ModuleHelper.newModule(loader, descriptor); + return java.lang.ModuleHelper.newModule(loader, descriptor); } } diff --git a/hotspot/test/runtime/modules/ModuleOptionsTest.java b/hotspot/test/runtime/modules/ModuleOptionsTest.java index 28064bddc27..e526e06abe1 100644 --- a/hotspot/test/runtime/modules/ModuleOptionsTest.java +++ b/hotspot/test/runtime/modules/ModuleOptionsTest.java @@ -43,7 +43,7 @@ public class ModuleOptionsTest { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( "--add-modules=i_dont_exist", "--add-modules=java.base", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("ResolutionException"); + output.shouldContain("FindException"); output.shouldContain("i_dont_exist"); output.shouldHaveExitValue(1); diff --git a/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java b/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java index dca359f6458..643e4bfd547 100644 --- a/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java +++ b/hotspot/test/runtime/modules/ModuleStress/CustomSystemClassLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO 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 @@ */ /** - * A custom system ClassLoader to define the module "m2" to during iterations of + * A custom system ClassLoader to define the module "m2x" to during iterations of * differing test runs within the test ModuleStress.java */ public class CustomSystemClassLoader extends ClassLoader { diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java b/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java index 79e56f2a457..772293f91a8 100644 --- a/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java +++ b/hotspot/test/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -35,79 +34,79 @@ import java.util.Map; import java.util.Set; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader2 --> defines m2 --> packages p2 -// Java System Class Loader --> defines m3 --> packages p3 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader2 --> defines m2x --> packages p2 +// Java System Class Loader --> defines m3x --> packages p3 // -// m1 can read m2 -// package p2 in m2 is exported to m1 and m3 +// m1x can read m2x +// package p2 in m2x is exported to m1x and m3x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access allowed since m1 can read m2 and package p2 is exported to m1. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access allowed since m1x can read m2x and package p2 is exported to m1x. // public class ModuleNonBuiltinCLMain { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported to unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 - // Can read: java.base, m3 + // Define module: m2x + // Can read: java.base, m3x // Packages: p2 - // Packages exported: package p2 is exported to m1 and m3 + // Packages exported: package p2 is exported to m1x and m3x Set targets = new HashSet<>(); - targets.add("m1"); - targets.add("m3"); - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + targets.add("m1x"); + targets.add("m3x"); + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .requires("m3") + .requires("m3x") .exports("p2", targets) .build(); - // Define module: m3 + // Define module: m3x // Can read: java.base // Packages: p3 // Packages exported: none - ModuleDescriptor descriptor_m3 = - ModuleDescriptor.module("m3") + ModuleDescriptor descriptor_m3x = + ModuleDescriptor.newModule("m3x") .requires("java.base") .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2, descriptor_m3); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x, descriptor_m3x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to differing user defined class loaders for this test Map map = new HashMap<>(); Loader1 cl1 = new Loader1(); Loader2 cl2 = new Loader2(); ClassLoader cl3 = ClassLoader.getSystemClassLoader(); - map.put("m1", cl1); - map.put("m2", cl2); - map.put("m3", cl3); + map.put("m1x", cl1); + map.put("m2x", cl2); + map.put("m3x", cl3); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == cl1); - assertTrue(layer.findLoader("m2") == cl2); - assertTrue(layer.findLoader("m3") == cl3); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); + assertTrue(layer.findLoader("m1x") == cl1); + assertTrue(layer.findLoader("m2x") == cl2); + assertTrue(layer.findLoader("m3x") == cl3); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -115,7 +114,7 @@ public class ModuleNonBuiltinCLMain { try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } } diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java b/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java index cdbc9002405..1eab8308495 100644 --- a/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java +++ b/hotspot/test/runtime/modules/ModuleStress/ModuleSameCLMain.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import static jdk.test.lib.Asserts.*; -import java.lang.reflect.Layer; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; @@ -34,61 +33,61 @@ import java.util.Map; import java.util.Set; // -// ClassLoader1 --> defines m1 --> packages p1 -// ClassLoader1 --> defines m2 --> packages p2 +// ClassLoader1 --> defines m1x --> packages p1 +// ClassLoader1 --> defines m2x --> packages p2 // -// m1 can read m2 -// package p2 in m2 is exported to m1 +// m1x can read m2x +// package p2 in m2x is exported to m1x // -// class p1.c1 defined in m1 tries to access p2.c2 defined in m2 -// Access allowed since m1 can read m2 and package p2 is exported to m1. +// class p1.c1 defined in m1x tries to access p2.c2 defined in m2x +// Access allowed since m1x can read m2x and package p2 is exported to m1x. // public class ModuleSameCLMain { - // Create a Layer over the boot layer. + // Create a layer over the boot layer. // Define modules within this layer to test access between // publically defined classes within packages of those modules. public void createLayerOnBoot() throws Throwable { - // Define module: m1 - // Can read: java.base, m2 + // Define module: m1x + // Can read: java.base, m2x // Packages: p1 // Packages exported: p1 is exported to unqualifiedly - ModuleDescriptor descriptor_m1 = - ModuleDescriptor.module("m1") + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") .requires("java.base") - .requires("m2") + .requires("m2x") .exports("p1") .build(); - // Define module: m2 + // Define module: m2x // Can read: java.base // Packages: p2 - // Packages exported: package p2 is exported to m1 - ModuleDescriptor descriptor_m2 = - ModuleDescriptor.module("m2") + // Packages exported: package p2 is exported to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") .requires("java.base") - .exports("p2", Set.of("m1")) + .exports("p2", Set.of("m1x")) .build(); // Set up a ModuleFinder containing all modules for this layer. - ModuleFinder finder = ModuleLibrary.of(descriptor_m1, descriptor_m2); + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); - // Resolves "m1" - Configuration cf = Layer.boot() + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() .configuration() - .resolveRequires(finder, ModuleFinder.of(), Set.of("m1")); + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); // map each module to the same class loader for this test Map map = new HashMap<>(); Loader1 cl1 = new Loader1(); - map.put("m1", cl1); - map.put("m2", cl1); + map.put("m1x", cl1); + map.put("m2x", cl1); - // Create Layer that contains m1 & m2 - Layer layer = Layer.boot().defineModules(cf, map::get); - assertTrue(layer.findLoader("m1") == cl1); - assertTrue(layer.findLoader("m2") == cl1); + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); + assertTrue(layer.findLoader("m1x") == cl1); + assertTrue(layer.findLoader("m2x") == cl1); assertTrue(layer.findLoader("java.base") == null); // now use the same loader to load class p1.c1 @@ -96,7 +95,7 @@ public class ModuleSameCLMain { try { p1_c1_class.newInstance(); } catch (IllegalAccessError e) { - throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1"); + throw new RuntimeException("Test Failed, an IAE should not be thrown since p2 is exported qualifiedly to m1x"); } } diff --git a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java index 2da921d4d8c..83f706d7092 100644 --- a/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java +++ b/hotspot/test/runtime/modules/ModuleStress/ModuleStress.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 ModuleStress { InMemoryJavaCompiler.compile("p1.c1", source1), System.getProperty("test.classes")); // Test #2: Load two modules defined to the same customer class loader. - // m1's module readability list and package p2's exportability should + // m1x's module readability list and package p2's exportability should // not be walked at a GC safepoint since both modules are defined to // the same loader and thus have the exact same life cycle. pb = ProcessTools.createJavaProcessBuilder( @@ -97,7 +97,7 @@ public class ModuleStress { .shouldHaveExitValue(0); // Test #3: Load two modules in differing custom class loaders. - // m1's module readability list and package p2's exportability list must + // m1x's module readability list and package p2's exportability list must // be walked at a GC safepoint since both modules are defined to non-builtin // class loaders which could die and thus be unloaded. pb = ProcessTools.createJavaProcessBuilder( @@ -106,15 +106,15 @@ public class ModuleStress { "ModuleNonBuiltinCLMain"); oa = new OutputAnalyzer(pb.start()); - oa.shouldContain("module m1 reads list must be walked") - .shouldContain("package p2 defined in module m2, exports list must be walked") - .shouldNotContain("module m2 reads list must be walked") + oa.shouldContain("module m1x reads list must be walked") + .shouldContain("package p2 defined in module m2x, exports list must be walked") + .shouldNotContain("module m2x reads list must be walked") .shouldHaveExitValue(0); // Test #4: Load two modules in differing custom class loaders, // of which one has been designated as the custom system class loader // via -Djava.system.class.loader=CustomSystemClassLoader. Since - // m3 is defined to the system class loader, m2's module readability + // m3x is defined to the system class loader, m2x's module readability // list does not have to be walked at a GC safepoint, but package p2's // exportability list does. pb = ProcessTools.createJavaProcessBuilder( @@ -124,8 +124,8 @@ public class ModuleStress { "ModuleNonBuiltinCLMain"); oa = new OutputAnalyzer(pb.start()); - oa.shouldContain("package p2 defined in module m2, exports list must be walked") - .shouldNotContain("module m2 reads list must be walked") + oa.shouldContain("package p2 defined in module m2x, exports list must be walked") + .shouldNotContain("module m2x reads list must be walked") .shouldHaveExitValue(0); } diff --git a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java index 16e8dbc79e1..3c6c84794ab 100644 --- a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java +++ b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 test; import java.lang.module.Configuration; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; import java.lang.reflect.Method; -import java.lang.reflect.Module; import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; @@ -44,11 +42,11 @@ public class Main { public static void main(String[] args) throws Exception { ModuleFinder finder = ModuleFinder.of(MODS_DIR); - Layer layerBoot = Layer.boot(); + ModuleLayer layerBoot = ModuleLayer.boot(); Configuration cf = layerBoot .configuration() - .resolveRequires(ModuleFinder.of(), finder, Set.of(MODULE_NAME)); + .resolve(ModuleFinder.of(), finder, Set.of(MODULE_NAME)); Module testModule = Main.class.getModule(); ClassLoader scl = ClassLoader.getSystemClassLoader(); @@ -58,7 +56,7 @@ public class Main { Callable task = new Callable() { @Override public Void call() throws Exception { - Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl); + ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl); Module transletModule = layer.findModule(MODULE_NAME).get(); testModule.addExports("test", transletModule); Class c = layer.findLoader(MODULE_NAME).loadClass("translet.Main"); diff --git a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java index 25c121d3625..ddc4bdc4792 100644 --- a/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java +++ b/hotspot/test/runtime/modules/ModuleStress/src/jdk.test/test/MainGC.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 test; import java.lang.module.Configuration; import java.lang.module.ModuleFinder; -import java.lang.reflect.Layer; import java.lang.reflect.Method; -import java.lang.reflect.Module; import java.nio.file.Path; import java.nio.file.Paths; import java.util.*; @@ -44,11 +42,11 @@ public class MainGC { public static void main(String[] args) throws Exception { ModuleFinder finder = ModuleFinder.of(MODS_DIR); - Layer layerBoot = Layer.boot(); + ModuleLayer layerBoot = ModuleLayer.boot(); Configuration cf = layerBoot .configuration() - .resolveRequires(ModuleFinder.of(), finder, Set.of(MODULE_NAME)); + .resolve(ModuleFinder.of(), finder, Set.of(MODULE_NAME)); Module testModule = MainGC.class.getModule(); ClassLoader scl = ClassLoader.getSystemClassLoader(); @@ -59,7 +57,7 @@ public class MainGC { Callable task = new Callable() { @Override public Void call() throws Exception { - Layer layer = Layer.boot().defineModulesWithOneLoader(cf, scl); + ModuleLayer layer = ModuleLayer.boot().defineModulesWithOneLoader(cf, scl); Module transletModule = layer.findModule(MODULE_NAME).get(); testModule.addExports("test", transletModule); testModule.addReads(transletModule); diff --git a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java index f87a582d30a..75489a665fb 100644 --- a/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java +++ b/hotspot/test/runtime/modules/PatchModule/PatchModuleDupModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ public class PatchModuleDupModule { public static void main(String args[]) throws Exception { ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( - "--patch-module=module1=module1_dir", - "--patch-module=module1=module1_dir", + "--patch-module=module_one=module_one_dir", + "--patch-module=module_one=module_one_dir", "-version"); OutputAnalyzer output = new OutputAnalyzer(pb.start()); output.shouldContain("java.lang.ExceptionInInitializerError"); diff --git a/hotspot/test/runtime/modules/acc_module.jcod b/hotspot/test/runtime/modules/acc_module.jcod index 573c7dde2a6..09b21bc0484 100644 --- a/hotspot/test/runtime/modules/acc_module.jcod +++ b/hotspot/test/runtime/modules/acc_module.jcod @@ -23,7 +23,8 @@ /* * This class consists of the following java code, but has an illegal class - * access_flags value of 0x8000, that should be ignored by the JVM. + * access_flags value of 0x8000, that should be ignored by the JVM because + * the class file version is < 53. * * public class acc_module { * public static void main(String[] args) { diff --git a/hotspot/test/runtime/modules/getModuleJNI/GetModule.java b/hotspot/test/runtime/modules/getModuleJNI/GetModule.java index 01d00648cd9..182632ac9e2 100644 --- a/hotspot/test/runtime/modules/getModuleJNI/GetModule.java +++ b/hotspot/test/runtime/modules/getModuleJNI/GetModule.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ * @run main/native GetModule */ -import java.lang.reflect.Module; import java.lang.management.LockInfo; public class GetModule { diff --git a/hotspot/test/runtime/modules/java.base/java/lang/reflect/ModuleHelper.java b/hotspot/test/runtime/modules/java.base/java/lang/ModuleHelper.java similarity index 86% rename from hotspot/test/runtime/modules/java.base/java/lang/reflect/ModuleHelper.java rename to hotspot/test/runtime/modules/java.base/java/lang/ModuleHelper.java index 19bbff48a76..6aef814acf2 100644 --- a/hotspot/test/runtime/modules/java.base/java/lang/reflect/ModuleHelper.java +++ b/hotspot/test/runtime/modules/java.base/java/lang/ModuleHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,14 +21,14 @@ * questions. */ -package java.lang.reflect; +package java.lang; import java.lang.module.ModuleDescriptor; /** - * A helper class intended to be injected into java.lang.reflect using the + * A helper class intended to be injected into java.lang using the * java --patch-module option. The helper class provides access to package private - * methods in java.lang.reflect.Module. + * methods in java.lang.Module. */ public final class ModuleHelper { @@ -56,7 +56,11 @@ public final class ModuleHelper { * {@code null} then the package is exported unconditionally. */ public static void addExportsNoSync(Module from, String pkg, Module to) { - from.implAddExportsNoSync(pkg, to); + if (to == null) { + from.implAddExportsNoSync(pkg); + } else { + from.implAddExportsNoSync(pkg, to); + } } /** diff --git a/hotspot/test/serviceability/attach/AttachSetGetFlag.java b/hotspot/test/serviceability/attach/AttachSetGetFlag.java index 2d6a28cfce3..8ec530e19c3 100644 --- a/hotspot/test/serviceability/attach/AttachSetGetFlag.java +++ b/hotspot/test/serviceability/attach/AttachSetGetFlag.java @@ -80,7 +80,7 @@ public class AttachSetGetFlag { try { waitForReady(target); - int pid = (int)target.getPid(); + int pid = (int)target.pid(); HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString()); @@ -116,7 +116,7 @@ public class AttachSetGetFlag { try { waitForReady(target); - int pid = (int)target.getPid(); + int pid = (int)target.pid(); HotSpotVirtualMachine vm = (HotSpotVirtualMachine)VirtualMachine.attach(((Integer)pid).toString()); diff --git a/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java b/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java index 1b686ec9ae4..5c919f40c49 100644 --- a/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java +++ b/hotspot/test/serviceability/jdwp/AllModulesCommandTestDebuggee.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,8 +21,6 @@ * questions. */ -import java.lang.reflect.Module; -import java.lang.reflect.Layer; import java.util.Set; import java.util.HashSet; @@ -35,10 +33,10 @@ public class AllModulesCommandTestDebuggee { public static void main(String[] args) throws InterruptedException { - int modCount = Layer.boot().modules().size(); + int modCount = ModuleLayer.boot().modules().size(); // Send all modules names via the process output - for (Module mod : Layer.boot().modules()) { + for (Module mod : ModuleLayer.boot().modules()) { String info = String.format("module %s", mod.getName()); write(info); } diff --git a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java index 04446a6c87d..94da0f081d4 100644 --- a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java +++ b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/MyPackage/AddModuleExportsAndOpensTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package MyPackage; */ import java.io.PrintStream; -import java.lang.reflect.Module; public class AddModuleExportsAndOpensTest { diff --git a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c index e028ee50c9c..b5ccf258659 100644 --- a/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c +++ b/hotspot/test/serviceability/jvmti/AddModuleExportsAndOpens/libAddModuleExportsAndOpensTest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ extern "C" { #define FAILED 2 static const char *EXC_CNAME = "java/lang/Exception"; -static const char* MOD_CNAME = "Ljava/lang/reflect/Module;"; +static const char* MOD_CNAME = "Ljava/lang/Module;"; static jvmtiEnv *jvmti = NULL; static jint result = PASSED; @@ -97,7 +97,7 @@ void throw_exc(JNIEnv *env, char *msg) { } static -jclass jlrM(JNIEnv *env) { +jclass jlM(JNIEnv *env) { jclass cls = NULL; cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME)); @@ -127,7 +127,7 @@ jboolean is_exported(JNIEnv *env, jobject module, const char* pkg, jboolean open if (mIsExported == NULL) { const char* sign = "(Ljava/lang/String;)Z"; const char* name = open ? "isOpen" : "isExported"; - mIsExported = get_method(env, jlrM(env), name, sign); + mIsExported = get_method(env, jlM(env), name, sign); } jstr = JNI_ENV_PTR(env)->NewStringUTF(JNI_ENV_ARG(env, pkg)); res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module), @@ -143,9 +143,9 @@ jboolean is_exported_to(JNIEnv *env, jobject module, const char* pkg, jobject to jboolean res = JNI_FALSE; if (mIsExportedTo == NULL) { - const char* sign = "(Ljava/lang/String;Ljava/lang/reflect/Module;)Z"; + const char* sign = "(Ljava/lang/String;Ljava/lang/Module;)Z"; const char* name = open ? "isOpen" : "isExported"; - mIsExportedTo = get_method(env, jlrM(env), name, sign); + mIsExportedTo = get_method(env, jlM(env), name, sign); } jstr = JNI_ENV_PTR(env)->NewStringUTF(JNI_ENV_ARG(env, pkg)); res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module), diff --git a/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java b/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java index 940172af807..a3915f72920 100644 --- a/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java +++ b/hotspot/test/serviceability/jvmti/AddModuleReads/MyPackage/AddModuleReadsTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package MyPackage; import java.io.PrintStream; import java.lang.instrument.Instrumentation; -import java.lang.reflect.Module; public class AddModuleReadsTest { diff --git a/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c b/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c index 4863a4aa5c9..be259ff4821 100644 --- a/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c +++ b/hotspot/test/serviceability/jvmti/AddModuleReads/libAddModuleReadsTest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ extern "C" { #define FAILED 2 static const char *EXC_CNAME = "java/lang/Exception"; -static const char* MOD_CNAME = "Ljava/lang/reflect/Module;"; +static const char* MOD_CNAME = "Ljava/lang/Module;"; static jvmtiEnv *jvmti = NULL; static jint result = PASSED; @@ -96,7 +96,7 @@ void throw_exc(JNIEnv *env, char *msg) { } static -jclass jlrM(JNIEnv *env) { +jclass jlM(JNIEnv *env) { jclass cls = NULL; cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME)); @@ -123,8 +123,8 @@ jboolean can_module_read(JNIEnv *env, jobject module, jobject to_module) { jboolean res = JNI_FALSE; if (mCanRead == NULL) { - const char* sign = "(Ljava/lang/reflect/Module;)Z"; - mCanRead = get_method(env, jlrM(env), "canRead", sign); + const char* sign = "(Ljava/lang/Module;)Z"; + mCanRead = get_method(env, jlM(env), "canRead", sign); } res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module), mCanRead, to_module); diff --git a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java index e6d9d57c01d..634b2eaf57c 100644 --- a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java +++ b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/MyPackage/AddModuleUsesAndProvidesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package MyPackage; import java.io.PrintStream; import java.lang.TestProvider; -import java.lang.reflect.Module; public class AddModuleUsesAndProvidesTest { diff --git a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c index 5ce1bf46d4f..86f9993c703 100644 --- a/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c +++ b/hotspot/test/serviceability/jvmti/AddModuleUsesAndProvides/libAddModuleUsesAndProvidesTest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ extern "C" { #define FAILED 2 static const char *EXC_CNAME = "java/lang/Exception"; -static const char* MOD_CNAME = "Ljava/lang/reflect/Module;"; +static const char* MOD_CNAME = "Ljava/lang/Module;"; static jvmtiEnv *jvmti = NULL; static jint result = PASSED; @@ -97,7 +97,7 @@ void throw_exc(JNIEnv *env, char *msg) { } static -jclass jlrM(JNIEnv *env) { +jclass jlM(JNIEnv *env) { jclass cls = NULL; cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME)); @@ -125,7 +125,7 @@ jboolean can_use_service(JNIEnv *env, jobject module, jclass service) { if (mCanUse == NULL) { const char* sign = "(Ljava/lang/Class;)Z"; - mCanUse = get_method(env, jlrM(env), "canUse", sign); + mCanUse = get_method(env, jlM(env), "canUse", sign); } res = JNI_ENV_PTR(env)->CallBooleanMethod(JNI_ENV_ARG(env, module), mCanUse, service); diff --git a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java index 7c682b5dfa0..4b700ef0b09 100644 --- a/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java +++ b/hotspot/test/serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +28,6 @@ * @run main/othervm -agentlib:JvmtiGetAllModulesTest JvmtiGetAllModulesTest * */ -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.lang.module.ModuleReference; import java.lang.module.ModuleFinder; import java.lang.module.ModuleReader; @@ -79,16 +77,15 @@ public class JvmtiGetAllModulesTest { final String MY_MODULE_NAME = "myModule"; // Verify that JVMTI reports exactly the same info as Java regarding the named modules - Asserts.assertEquals(Layer.boot().modules(), getModulesJVMTI()); + Asserts.assertEquals(ModuleLayer.boot().modules(), getModulesJVMTI()); // Load a new named module - ModuleDescriptor descriptor - = ModuleDescriptor.module(MY_MODULE_NAME).build(); + ModuleDescriptor descriptor = ModuleDescriptor.newModule(MY_MODULE_NAME).build(); ModuleFinder finder = finderOf(descriptor); ClassLoader loader = new ClassLoader() {}; - Configuration parent = Layer.boot().configuration(); - Configuration cf = parent.resolveRequires(finder, ModuleFinder.of(), Set.of(MY_MODULE_NAME)); - Layer my = Layer.boot().defineModules(cf, m -> loader); + Configuration parent = ModuleLayer.boot().configuration(); + Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of(MY_MODULE_NAME)); + ModuleLayer my = ModuleLayer.boot().defineModules(cf, m -> loader); // Verify that the loaded module is indeed reported by JVMTI Set jvmtiModules = getModulesJVMTI(); diff --git a/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c b/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c index ed83d19784c..fcabaa4bfb9 100644 --- a/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c +++ b/hotspot/test/serviceability/jvmti/GetModulesInfo/libJvmtiGetAllModulesTest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ extern "C" { return NULL; } - array = (*env)->NewObjectArray(env, modules_count, (*env)->FindClass(env, "java/lang/reflect/Module"), NULL); + array = (*env)->NewObjectArray(env, modules_count, (*env)->FindClass(env, "java/lang/Module"), NULL); for (i = 0; i < modules_count; ++i) { (*env)->SetObjectArrayElement(env, array, i, modules_ptr[i]); diff --git a/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c b/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c index 6e9b0300232..307fab0f2b0 100644 --- a/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c +++ b/hotspot/test/serviceability/jvmti/GetNamedModule/libGetNamedModuleTest.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ extern "C" { #define FAILED 2 static const char *EXC_CNAME = "java/lang/Exception"; -static const char* MOD_CNAME = "Ljava/lang/reflect/Module;"; +static const char* MOD_CNAME = "Ljava/lang/Module;"; static jvmtiEnv *jvmti = NULL; static jint result = PASSED; @@ -115,7 +115,7 @@ jobject get_class_loader(jclass cls) { } static -jclass jlrM(JNIEnv *env) { +jclass jlM(JNIEnv *env) { jclass cls = NULL; cls = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, MOD_CNAME)); @@ -142,7 +142,7 @@ jobject get_module_loader(JNIEnv *env, jobject module) { jobject loader = NULL; if (cl_method == NULL) { - cl_method = get_method(env, jlrM(env), "getClassLoader", "()Ljava/lang/ClassLoader;"); + cl_method = get_method(env, jlM(env), "getClassLoader", "()Ljava/lang/ClassLoader;"); } loader = (jobject)JNI_ENV_PTR(env)->CallObjectMethod(JNI_ENV_ARG(env, module), cl_method); return loader; @@ -157,7 +157,7 @@ const char* get_module_name(JNIEnv *env, jobject module) { const char *nstr = NULL; if (method == NULL) { - method = get_method(env, jlrM(env), "getName", "()Ljava/lang/String;"); + method = get_method(env, jlM(env), "getName", "()Ljava/lang/String;"); } jstr = (jstring)JNI_ENV_PTR(env)->CallObjectMethod(JNI_ENV_ARG(env, module), method); if (jstr != NULL) { @@ -183,7 +183,7 @@ jvmtiError get_module(JNIEnv *env, err = (*jvmti)->GetNamedModule(jvmti, loader, pkg_name, module_ptr); if (err != JVMTI_ERROR_NONE) { printf(" Error in GetNamedModule for package \"%s\": %s (%d)\n", - pkg_name, TranslateError(err), err); + name, TranslateError(err), err); return err; } printf(" returned module: %p\n", *module_ptr); diff --git a/jdk/test/demo/jvmti/HeapUser.java b/hotspot/test/serviceability/sa/LingeredAppWithInterface.java similarity index 51% rename from jdk/test/demo/jvmti/HeapUser.java rename to hotspot/test/serviceability/sa/LingeredAppWithInterface.java index ea99979dd69..4b65bf1f637 100644 --- a/jdk/test/demo/jvmti/HeapUser.java +++ b/hotspot/test/serviceability/sa/LingeredAppWithInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * 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,52 +21,38 @@ * questions. */ +import jdk.test.lib.apps.LingeredApp; -/* - * - * Sample target application - * - */ - -class Animal { - int category; - int age; +interface Language { + static final long nbrOfWords = 99999; + public abstract long getNbrOfWords(); } -class Pet extends Animal { - String owner; - String name; - String vet; - String records; - String address; - Pet(String name) { this.name = name; } -} - -class Dog extends Pet { - int breed; - int barks; - Dog(String name) { super(name); } -} - -class Cat extends Pet { - int breed; - int claws; - Cat(String name) { super(name); } -} - -public class HeapUser { - private static Dog dogs[]; - private static Cat cats[]; - public static void main(String args[]) { - System.out.println("HeapUser start, 101 dogs, 1000 cats"); - dogs = new Dog[101]; - for(int i=0; i<101; i++) { - dogs[i] = new Dog("fido " + i); - } - cats = new Cat[1000]; - for(int i=0; i<1000; i++) { - cats[i] = new Cat("feefee " + i); - } - System.out.println("HeapUser end"); +class ParselTongue implements Language { + public long getNbrOfWords() { + return nbrOfWords * 4; + } +} + +public class LingeredAppWithInterface extends LingeredApp { + + public static void main(String args[]) { + ParselTongue lang = new ParselTongue(); + Language muggleSpeak = new Language() { + public long getNbrOfWords() { + return nbrOfWords * 8; + } + }; + + // Not tested at this point. The test needs to be enhanced + // later to test for the sizes of the Lambda MetaFactory + // generated anonymous classes too. (After JDK-8160228 gets + // fixed.) + Runnable r2 = () -> System.out.println("Hello world!"); + r2.run(); + + System.out.println(lang.getNbrOfWords() + muggleSpeak.getNbrOfWords()); + + LingeredApp.main(args); } } diff --git a/jdk/test/demo/jvmti/Hello.java b/hotspot/test/serviceability/sa/LingeredAppWithLargeArray.java similarity index 80% rename from jdk/test/demo/jvmti/Hello.java rename to hotspot/test/serviceability/sa/LingeredAppWithLargeArray.java index 3161d28b7b9..44929f05b15 100644 --- a/jdk/test/demo/jvmti/Hello.java +++ b/hotspot/test/serviceability/sa/LingeredAppWithLargeArray.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * 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,15 +21,11 @@ * questions. */ +import jdk.test.lib.apps.LingeredApp; -/* - * - * Sample target application for jvmti demos - * - */ - -public class Hello { +public class LingeredAppWithLargeArray extends LingeredApp { public static void main(String args[]) { - System.out.println("Hello"); + int[] hugeArray = new int[Integer.MAX_VALUE/2]; + LingeredApp.main(args); } -} + } diff --git a/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java b/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java index e8f1fd86703..901fbab83ef 100644 --- a/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java +++ b/hotspot/test/serviceability/sa/TestCpoolForInvokeDynamic.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import jdk.test.lib.Asserts; * jdk.hotspot.agent/sun.jvm.hotspot.oops * jdk.hotspot.agent/sun.jvm.hotspot.debugger * jdk.hotspot.agent/sun.jvm.hotspot.ui.classbrowser - * @ignore 8169232 * @run main/othervm TestCpoolForInvokeDynamic */ diff --git a/hotspot/test/serviceability/sa/TestHeapDumpForLargeArray.java b/hotspot/test/serviceability/sa/TestHeapDumpForLargeArray.java new file mode 100644 index 00000000000..70f26fb48eb --- /dev/null +++ b/hotspot/test/serviceability/sa/TestHeapDumpForLargeArray.java @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.ArrayList; +import java.util.List; +import java.io.File; +import java.nio.file.Files; +import java.io.IOException; +import java.io.BufferedInputStream; +import java.util.stream.Collectors; +import java.io.FileInputStream; + +import sun.jvm.hotspot.HotSpotAgent; +import sun.jvm.hotspot.debugger.*; + +import jdk.test.lib.apps.LingeredApp; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.JDKToolFinder; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.Asserts; + +/* + * @test + * @library /test/lib + * @bug 8171084 + * @requires (vm.bits == "64" & os.maxMemory > 8g) + * @modules java.base/jdk.internal.misc + * jdk.hotspot.agent/sun.jvm.hotspot + * jdk.hotspot.agent/sun.jvm.hotspot.utilities + * jdk.hotspot.agent/sun.jvm.hotspot.oops + * jdk.hotspot.agent/sun.jvm.hotspot.debugger + * @run main/timeout=1800/othervm -Xmx8g TestHeapDumpForLargeArray + */ + +public class TestHeapDumpForLargeArray { + + private static LingeredAppWithLargeArray theApp = null; + + private static void attachAndDump(String heapDumpFileName, + long lingeredAppPid) throws Exception { + + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb"); + launcher.addToolArg("jmap"); + launcher.addToolArg("--binaryheap"); + launcher.addToolArg("--dumpfile"); + launcher.addToolArg(heapDumpFileName); + launcher.addToolArg("--pid"); + launcher.addToolArg(Long.toString(lingeredAppPid)); + + ProcessBuilder processBuilder = new ProcessBuilder(); + processBuilder.command(launcher.getCommand()); + System.out.println( + processBuilder.command().stream().collect(Collectors.joining(" "))); + + OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder); + SAOutput.shouldHaveExitValue(0); + SAOutput.shouldNotContain("Heap segment size overflow"); + SAOutput.shouldContain("truncating to"); + SAOutput.shouldContain("heap written to"); + SAOutput.shouldContain(heapDumpFileName); + System.out.println(SAOutput.getOutput()); + + } + + public static void main (String... args) throws Exception { + + String heapDumpFileName = "LargeArrayHeapDump.bin"; + + if (!Platform.shouldSAAttach()) { + System.out.println( + "SA attach not expected to work - test skipped."); + return; + } + + File heapDumpFile = new File(heapDumpFileName); + if (heapDumpFile.exists()) { + heapDumpFile.delete(); + } + + try { + List vmArgs = new ArrayList(); + vmArgs.add("-XX:+UsePerfData"); + vmArgs.add("-Xmx8g"); + vmArgs.addAll(Utils.getVmOptions()); + + theApp = new LingeredAppWithLargeArray(); + LingeredApp.startApp(vmArgs, theApp); + attachAndDump(heapDumpFileName, theApp.getPid()); + } finally { + LingeredApp.stopApp(theApp); + heapDumpFile.delete(); + } + } +} diff --git a/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java b/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java index 5369c761073..d660249ecd2 100644 --- a/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java +++ b/hotspot/test/serviceability/sa/TestInstanceKlassSizeForInterface.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +21,15 @@ * questions. */ +import java.util.ArrayList; +import java.util.List; + import sun.jvm.hotspot.HotSpotAgent; import sun.jvm.hotspot.utilities.SystemDictionaryHelper; import sun.jvm.hotspot.oops.InstanceKlass; import sun.jvm.hotspot.debugger.*; +import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.JDKToolLauncher; import jdk.test.lib.JDKToolFinder; import jdk.test.lib.Platform; @@ -45,29 +49,20 @@ import jdk.test.lib.Asserts; * @run main/othervm TestInstanceKlassSizeForInterface */ -interface Language { - static final long nbrOfWords = 99999; - public abstract long getNbrOfWords(); -} - -class ParselTongue implements Language { - public long getNbrOfWords() { - return nbrOfWords * 4; - } -} - public class TestInstanceKlassSizeForInterface { - private static void SAInstanceKlassSize(int pid, + private static LingeredAppWithInterface theApp = null; + + private static void SAInstanceKlassSize(int lingeredAppPid, String[] instanceKlassNames) { HotSpotAgent agent = new HotSpotAgent(); try { - agent.attach((int)pid); + agent.attach(lingeredAppPid); } catch (DebuggerException e) { System.out.println(e.getMessage()); - System.err.println("Unable to connect to process ID: " + pid); + System.err.println("Unable to connect to process ID: " + lingeredAppPid); agent.detach(); e.printStackTrace(); @@ -98,11 +93,9 @@ public class TestInstanceKlassSizeForInterface { } private static void createAnotherToAttach( - String[] instanceKlassNames) throws Exception { + String[] instanceKlassNames, + int lingeredAppPid) throws Exception { - ProcessBuilder pb = new ProcessBuilder(); - - // Grab the pid from the current java process and pass it String[] toolArgs = { "--add-modules=jdk.hotspot.agent", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED", @@ -110,23 +103,26 @@ public class TestInstanceKlassSizeForInterface { "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.oops=ALL-UNNAMED", "--add-exports=jdk.hotspot.agent/sun.jvm.hotspot.debugger=ALL-UNNAMED", "TestInstanceKlassSizeForInterface", - Long.toString(ProcessTools.getProcessId()) + Integer.toString(lingeredAppPid) }; + // Start a new process to attach to the LingeredApp process + ProcessBuilder processBuilder = ProcessTools + .createJavaProcessBuilder(toolArgs); + OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder); + SAOutput.shouldHaveExitValue(0); + System.out.println(SAOutput.getOutput()); + + // Run jcmd on the LingeredApp process + ProcessBuilder pb = new ProcessBuilder(); pb.command(new String[] { JDKToolFinder.getJDKTool("jcmd"), - Long.toString(ProcessTools.getProcessId()), + Long.toString(lingeredAppPid), "GC.class_stats", "VTab,ITab,OopMap,KlassBytes" } ); - // Start a new process to attach to the current process - ProcessBuilder processBuilder = ProcessTools - .createJavaProcessBuilder(toolArgs); - OutputAnalyzer SAOutput = ProcessTools.executeProcess(processBuilder); - System.out.println(SAOutput.getOutput()); - OutputAnalyzer jcmdOutput = new OutputAnalyzer(pb.start()); System.out.println(jcmdOutput.getOutput()); @@ -153,7 +149,7 @@ public class TestInstanceKlassSizeForInterface { String[] instanceKlassNames = new String[] { "Language", "ParselTongue", - "TestInstanceKlassSizeForInterface$1" + "LingeredAppWithInterface$1" }; if (!Platform.shouldSAAttach()) { @@ -163,22 +159,17 @@ public class TestInstanceKlassSizeForInterface { } if (args == null || args.length == 0) { - ParselTongue lang = new ParselTongue(); + try { + List vmArgs = new ArrayList(); + vmArgs.addAll(Utils.getVmOptions()); - Language ventro = new Language() { - public long getNbrOfWords() { - return nbrOfWords * 8; - } - }; - - // Not tested at this point. The test needs to be enhanced - // later to test for the sizes of the Lambda MetaFactory - // generated anonymous classes too. (After JDK-8160228 gets - // fixed.) - Runnable r2 = () -> System.out.println("Hello world!"); - r2.run(); - - createAnotherToAttach(instanceKlassNames); + theApp = new LingeredAppWithInterface(); + LingeredApp.startApp(vmArgs, theApp); + createAnotherToAttach(instanceKlassNames, + (int)theApp.getPid()); + } finally { + LingeredApp.stopApp(theApp); + } } else { SAInstanceKlassSize(Integer.parseInt(args[0]), instanceKlassNames); } diff --git a/hotspot/test/serviceability/sa/TestPrintMdo.java b/hotspot/test/serviceability/sa/TestPrintMdo.java new file mode 100644 index 00000000000..48b0b0840b8 --- /dev/null +++ b/hotspot/test/serviceability/sa/TestPrintMdo.java @@ -0,0 +1,176 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.ArrayList; +import java.util.Scanner; +import java.util.List; +import java.io.File; +import java.io.IOException; +import java.util.stream.Collectors; +import java.io.OutputStream; +import jdk.test.lib.apps.LingeredApp; +import jdk.test.lib.JDKToolLauncher; +import jdk.test.lib.Platform; +import jdk.test.lib.process.ProcessTools; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.Utils; +import jdk.test.lib.Asserts; + +/* + * @test + * @library /test/lib + * @requires vm.flavor == "server" & !vm.emulatedClient & !(vm.opt.TieredStopAtLevel == 1) + * @build jdk.test.lib.apps.* + * @run main/othervm TestPrintMdo + */ + +public class TestPrintMdo { + + private static final String PRINTMDO_OUT_FILE = "printmdo_out.txt"; + + private static void verifyPrintMdoOutput() throws Exception { + + Exception unexpected = null; + File printMdoFile = new File(PRINTMDO_OUT_FILE); + Asserts.assertTrue(printMdoFile.exists() && printMdoFile.isFile(), + "File with printmdo output not created: " + + printMdoFile.getAbsolutePath()); + try { + Scanner scanner = new Scanner(printMdoFile); + + String unexpectedMsg = + "One or more of 'VirtualCallData', 'CounterData', " + + "'ReceiverTypeData', 'bci', 'MethodData' " + + "or 'java/lang/Object' not found"; + boolean knownClassFound = false; + boolean knownProfileDataTypeFound = false; + boolean knownTokensFound = false; + + while (scanner.hasNextLine()) { + String line = scanner.nextLine(); + line = line.trim(); + System.out.println(line); + + if (line.contains("missing reason for ")) { + unexpected = new RuntimeException("Unexpected msg: missing reason for "); + break; + } + if (line.contains("VirtualCallData") || + line.contains("CounterData") || + line.contains("ReceiverTypeData")) { + knownProfileDataTypeFound = true; + } + if (line.contains("bci") || + line.contains("MethodData")) { + knownTokensFound = true; + } + if (line.contains("java/lang/Object")) { + knownClassFound = true; + } + } + if ((knownClassFound == false) || + (knownTokensFound == false) || + (knownProfileDataTypeFound == false)) { + unexpected = new RuntimeException(unexpectedMsg); + } + if (unexpected != null) { + throw unexpected; + } + } catch (Exception ex) { + throw new RuntimeException("Test ERROR " + ex, ex); + } finally { + printMdoFile.delete(); + } + } + + private static void startClhsdbForPrintMdo(long lingeredAppPid) throws Exception { + + Process p; + JDKToolLauncher launcher = JDKToolLauncher.createUsingTestJDK("jhsdb"); + launcher.addToolArg("clhsdb"); + launcher.addToolArg("--pid"); + launcher.addToolArg(Long.toString(lingeredAppPid)); + + ProcessBuilder pb = new ProcessBuilder(); + pb.command(launcher.getCommand()); + System.out.println( + pb.command().stream().collect(Collectors.joining(" "))); + + try { + p = pb.start(); + } catch (Exception attachE) { + throw new Error("Couldn't start jhsdb or attach to LingeredApp : " + attachE); + } + + // Issue the 'printmdo' input at the clhsdb prompt. + OutputStream input = p.getOutputStream(); + String str = "printmdo -a > " + PRINTMDO_OUT_FILE + "\nquit\n"; + try { + input.write(str.getBytes()); + input.flush(); + } catch (IOException ioe) { + throw new Error("Problem issuing the printmdo command: " + str, ioe); + } + + try { + p.waitFor(); + } catch (InterruptedException ie) { + throw new Error("Problem awaiting the child process: " + ie, ie); + } + + int exitValue = p.exitValue(); + if (exitValue != 0) { + String output; + try { + output = new OutputAnalyzer(p).getOutput(); + } catch (IOException ioe) { + throw new Error("Can't get failed clhsdb process output: " + ioe, ioe); + } + throw new AssertionError("clhsdb wasn't run successfully: " + output); + } + } + + public static void main (String... args) throws Exception { + + LingeredApp app = null; + + if (!Platform.shouldSAAttach()) { + System.out.println( + "SA attach not expected to work - test skipped."); + return; + } + + try { + List vmArgs = new ArrayList(); + vmArgs.add("-XX:+ProfileInterpreter"); + vmArgs.addAll(Utils.getVmOptions()); + + app = LingeredApp.startApp(vmArgs); + System.out.println ("Started LingeredApp with pid " + app.getPid()); + startClhsdbForPrintMdo(app.getPid()); + verifyPrintMdoOutput(); + } finally { + LingeredApp.stopApp(app); + } + } +} diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java index 2a46621d118..50531949002 100644 --- a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java +++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java @@ -53,7 +53,6 @@ import jdk.test.lib.process.ProcessTools; public class JMapHProfLargeHeapTest { private static final String HEAP_DUMP_FILE_NAME = "heap.bin"; - private static final String HPROF_HEADER_1_0_1 = "JAVA PROFILE 1.0.1"; private static final String HPROF_HEADER_1_0_2 = "JAVA PROFILE 1.0.2"; private static final long M = 1024L; private static final long G = 1024L * M; @@ -65,9 +64,7 @@ public class JMapHProfLargeHeapTest { } // All heap dumps should create 1.0.2 file format - // Hotspot internal heapdumper always use HPROF_HEADER_1_0_2 format, - // but SA heapdumper still use HPROF_HEADER_1_0_1 for small heaps - testHProfFileFormat("-Xmx1g", 22 * M, HPROF_HEADER_1_0_1); + testHProfFileFormat("-Xmx1g", 22 * M, HPROF_HEADER_1_0_2); /** * This test was deliberately commented out since the test system lacks diff --git a/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java b/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java index 80b45ecb6fd..0bbb42d4f58 100644 --- a/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java +++ b/hotspot/test/serviceability/sa/sadebugd/SADebugDTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ public class SADebugDTest { return; } - long ourPid = ProcessHandle.current().getPid(); + long ourPid = ProcessHandle.current().pid(); // The string we are expecting in the debugd ouput String golden = String.format(GOLDEN, ourPid); diff --git a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java index 23bba681fc1..29251d80378 100644 --- a/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/DaemonThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -78,7 +78,7 @@ public class DaemonThreadTest { thread.start(); // Run jstack tool and collect the output - JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid()); ToolResults results = jstackTool.measure(); // Analyze the jstack output for the correct thread type diff --git a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java index 8f3be8153c6..e3928d03731 100644 --- a/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/SpreadLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +96,7 @@ public class SpreadLockTest { debuggee.start(); // Collect output from the jstack tool - JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid()); ToolResults results1 = jstackTool.measure(); // Go to method b() diff --git a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java index 6402c2265c4..e0b6f06d125 100644 --- a/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/ThreadNamesTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,7 +61,7 @@ public class ThreadNamesTest { thread.start(); // Run jstack tool and collect the output - JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid()); ToolResults results = jstackTool.measure(); // Analyze the jstack output for the strange thread name diff --git a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java index 9a87d6bdc13..ac765997fa7 100644 --- a/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/TraveledLockTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class TraveledLockTest { debuggee.start(); // Collect output from the jstack tool - JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid()); ToolResults results1 = jstackTool.measure(); // Go to method b() diff --git a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java index 9b5a5449326..c4fe1cc8ba9 100644 --- a/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java +++ b/hotspot/test/serviceability/tmtools/jstack/WaitNotifyThreadTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 WaitNotifyThreadTest { waitThread.start(); // Collect output from the jstack tool - JstackTool jstackTool = new JstackTool(ProcessHandle.current().getPid()); + JstackTool jstackTool = new JstackTool(ProcessHandle.current().pid()); ToolResults results = jstackTool.measure(); // Analyze the jstack output for the patterns needed diff --git a/hotspot/test/serviceability/tmtools/jstat/GarbageProducerTest.java b/hotspot/test/serviceability/tmtools/jstat/GarbageProducerTest.java new file mode 100644 index 00000000000..dfe1a8f12dc --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/GarbageProducerTest.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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.lang.management.ManagementFactory; +import utils.GarbageProducer; +import common.TmTool; +import utils.JstatResults; + +/** + * Base class for jstat testing which uses GarbageProducer to allocate garbage. + */ +public class GarbageProducerTest { + + // Iterations of measurement to get consistent value of counters and jstat. + private final static int ITERATIONS = 10; + private final static float TARGET_MEMORY_USAGE = 0.7f; + private final static float MEASUREMENT_TOLERANCE = 0.05f; + private final GarbageProducer garbageProducer; + private final TmTool jstatTool; + + public GarbageProducerTest(TmTool tool) { + garbageProducer = new GarbageProducer(TARGET_MEMORY_USAGE); + // We will be running jstat tool + jstatTool = tool; + } + + public void run() throws Exception { + // Run once and get the results asserting that they are reasonable + JstatResults measurement1 = jstatTool.measure(); + measurement1.assertConsistency(); + // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable + System.gc(); + garbageProducer.allocateMetaspaceAndHeap(); + // Collect garbage. Also update VM statistics + System.gc(); + int i = 0; + long collectionCountBefore = getCollectionCount(); + JstatResults measurement2 = jstatTool.measure(); + do { + System.out.println("Measurement #" + i); + long currentCounter = getCollectionCount(); + // Check if GC cycle occured during measurement + if (currentCounter == collectionCountBefore) { + measurement2.assertConsistency(); + checkOldGenMeasurement(measurement2); + return; + } else { + System.out.println("GC happened during measurement."); + } + collectionCountBefore = getCollectionCount(); + measurement2 = jstatTool.measure(); + + } while (i++ < ITERATIONS); + // Checking will be performed without consistency guarantee. + checkOldGenMeasurement(measurement2); + } + + private void checkOldGenMeasurement(JstatResults measurement2) { + float oldGenAllocationRatio = garbageProducer.getOldGenAllocationRatio() - MEASUREMENT_TOLERANCE; + // Assert that space has been utilized accordingly + JstatResults.assertSpaceUtilization(measurement2, TARGET_MEMORY_USAGE, oldGenAllocationRatio); + } + + private static long getCollectionCount() { + return ManagementFactory.getGarbageCollectorMXBeans().stream() + .mapToLong(b -> b.getCollectionCount()) + .sum(); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java index 6723e6e02d1..820c8dab35d 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCapacityTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 GcCapacityTest { public static void main(String[] args) throws Exception { // We will be running "jstat -gc" tool - JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().getPid()); + JstatGcCapacityTool jstatGcTool = new JstatGcCapacityTool(ProcessHandle.current().pid()); // Run once and get the results asserting that they are reasonable JstatGcCapacityResults measurement1 = jstatGcTool.measure(); diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java index 9e4c5eb2e64..96f0728a349 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest01.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public class GcCauseTest01 { public static void main(String[] args) throws Exception { // We will be running "jstat -gc" tool - JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid()); // Run once and get the results asserting that they are reasonable JstatGcCauseResults measurement1 = jstatGcTool.measure(); diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java index 2bdf04d39c2..b92ea57d0a8 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest02.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,39 +25,19 @@ * @test * @summary Test checks output displayed with jstat -gccause. * Test scenario: - * tests forces debuggee application eat ~70% of heap and runs jstat. - * jstat should show that ~70% of heap (OC/OU ~= 70%). + * test forces debuggee application eat ~70% of heap and runs jstat. + * jstat should show actual usage of old gen (OC/OU ~= old gen usage). * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share - * @run main/othervm -XX:+UsePerfData -XX:InitialHeapSize=128M -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02 + * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02 */ import utils.*; public class GcCauseTest02 { - private final static float targetMemoryUsagePercent = 0.7f; - public static void main(String[] args) throws Exception { - - // We will be running "jstat -gc" tool - JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); - - // Run once and get the results asserting that they are reasonable - JstatGcCauseResults measurement1 = jstatGcTool.measure(); - measurement1.assertConsistency(); - - GcProvoker gcProvoker = new GcProvoker(); - - // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable - gcProvoker.allocateAvailableMetaspaceAndHeap(targetMemoryUsagePercent); - // Collect garbage. Also update VM statistics - System.gc(); - JstatGcCauseResults measurement2 = jstatGcTool.measure(); - measurement2.assertConsistency(); - - // Assert that space has been utilized acordingly - JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent); + new GarbageProducerTest(new JstatGcCauseTool(ProcessHandle.current().pid())).run(); } } diff --git a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java index 91ebd0ffcee..13bd73b5303 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcCauseTest03.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,7 +41,7 @@ public class GcCauseTest03 { public static void main(String[] args) throws Exception { // We will be running "jstat -gc" tool - JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().getPid()); + JstatGcCauseTool jstatGcTool = new JstatGcCauseTool(ProcessHandle.current().pid()); System.gc(); diff --git a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java index 8e1d6ae364a..4719baa6239 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcNewTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 GcNewTest { public static void main(String[] args) throws Exception { // We will be running "jstat -gc" tool - JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().getPid()); + JstatGcNewTool jstatGcTool = new JstatGcNewTool(ProcessHandle.current().pid()); // Run once and get the results asserting that they are reasonable JstatGcNewResults measurement1 = jstatGcTool.measure(); diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java index cc0bf5261e2..6ee18f3f3bb 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcTest01.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest01.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,7 @@ public class GcTest01 { public static void main(String[] args) throws Exception { // We will be running "jstat -gc" tool - JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid()); + JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().pid()); // Run once and get the results asserting that they are reasonable JstatGcResults measurement1 = jstatGcTool.measure(); diff --git a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java index 91406fa3838..a0e0cb4fcac 100644 --- a/hotspot/test/serviceability/tmtools/jstat/GcTest02.java +++ b/hotspot/test/serviceability/tmtools/jstat/GcTest02.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,43 +21,23 @@ * questions. */ -import utils.*; /* * @test * @summary Test checks output displayed with jstat -gc. * Test scenario: - * tests forces debuggee application eat ~70% of heap and runs jstat. - * jstat should show that ~70% of heap is utilized (OC/OU ~= 70%). + * test forces debuggee application eat ~70% of heap and runs jstat. + * jstat should show actual usage of old gen (OC/OU ~= old gen usage). * @requires vm.opt.ExplicitGCInvokesConcurrent != true * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share - * @run main/othervm -XX:+UsePerfData -XX:InitialHeapSize=128M -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02 + * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02 */ +import utils.*; public class GcTest02 { - private final static float targetMemoryUsagePercent = 0.7f; - public static void main(String[] args) throws Exception { - - // We will be running "jstat -gc" tool - JstatGcTool jstatGcTool = new JstatGcTool(ProcessHandle.current().getPid()); - - // Run once and get the results asserting that they are reasonable - JstatGcResults measurement1 = jstatGcTool.measure(); - measurement1.assertConsistency(); - - GcProvoker gcProvoker = new GcProvoker(); - - // Eat metaspace and heap then run the tool again and get the results asserting that they are reasonable - gcProvoker.allocateAvailableMetaspaceAndHeap(targetMemoryUsagePercent); - // Collect garbage. Also updates VM statistics - System.gc(); - JstatGcResults measurement2 = jstatGcTool.measure(); - measurement2.assertConsistency(); - - // Assert that space has been utilized acordingly - JstatResults.assertSpaceUtilization(measurement2, targetMemoryUsagePercent); + new GarbageProducerTest(new JstatGcTool(ProcessHandle.current().pid())).run(); } } diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GarbageProducer.java b/hotspot/test/serviceability/tmtools/jstat/utils/GarbageProducer.java new file mode 100644 index 00000000000..0dd7c858482 --- /dev/null +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GarbageProducer.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please 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 utils; + +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.util.ArrayList; +import java.util.List; + +/** + * This is an class used to allocate specified amount of metaspace and heap. + */ +public class GarbageProducer { + + // Uses fixed small objects to avoid Humongous objects allocation with G1 GC. + private static final int MEMORY_CHUNK = 2048; + + public static List allocatedMetaspace; + public static List allocatedMemory; + + private final MemoryMXBean memoryMXBean; + private final float targetMemoryUsagePercent; + private final long targetMemoryUsage; + + /** + * @param targetMemoryUsagePercent how many percent of metaspace and heap to + * allocate + */ + public GarbageProducer(float targetMemoryUsagePercent) { + memoryMXBean = ManagementFactory.getMemoryMXBean(); + this.targetMemoryUsagePercent = targetMemoryUsagePercent; + targetMemoryUsage = (long) (memoryMXBean.getHeapMemoryUsage().getMax() * targetMemoryUsagePercent); + } + + /** + * Allocates heap and metaspace upon exit targetMemoryUsagePercent percents + * of heap and metaspace have been consumed. + */ + public void allocateMetaspaceAndHeap() { + // Metaspace should be filled before Java Heap to prevent unexpected OOME + // in the Java Heap while filling Metaspace + allocatedMetaspace = eatMetaspace(targetMemoryUsagePercent); + allocatedMemory = allocateGarbage(targetMemoryUsage); + } + + private List eatMetaspace(float targetUsage) { + List list = new ArrayList<>(); + MemoryPoolMXBean metaspacePool = getMatchedMemoryPool(".*Metaspace.*"); + float currentUsage; + GeneratedClassProducer gp = new GeneratedClassProducer(); + do { + try { + list.add(gp.create(0)); + } catch (OutOfMemoryError oome) { + list = null; + throw new RuntimeException("Unexpected OOME '" + oome.getMessage() + "' while eating " + targetUsage + " of Metaspace."); + } + MemoryUsage memoryUsage = metaspacePool.getUsage(); + currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax()); + } while (currentUsage < targetUsage); + return list; + } + + private MemoryPoolMXBean getMatchedMemoryPool(String patternPoolName) { + return ManagementFactory.getMemoryPoolMXBeans().stream() + .filter(bean -> bean.getName().matches(patternPoolName)) + .findFirst() + .orElseThrow(() -> new RuntimeException("Cannot find '" + patternPoolName + "' memory pool.")); + } + + private List allocateGarbage(long targetMemoryUsage) { + List list = new ArrayList<>(); + do { + try { + list.add(new byte[MEMORY_CHUNK]); + } catch (OutOfMemoryError e) { + list = null; + throw new RuntimeException("Unexpected OOME '" + e.getMessage() + "'"); + } + } while (memoryMXBean.getHeapMemoryUsage().getUsed() < targetMemoryUsage); + return list; + } + + /** + * Returns allocation rate for old gen based on appropriate MemoryPoolMXBean + * memory usage. + * + * @return allocation rate + */ + public float getOldGenAllocationRatio() { + MemoryPoolMXBean oldGenBean = getMatchedMemoryPool(".*Old.*|.*Tenured.*"); + MemoryUsage usage = oldGenBean.getUsage(); + System.out.format("Memory usage for %1s.\n", oldGenBean.getName()); + System.out.format("Used: %1d\n", usage.getUsed()); + System.out.format("Commited: %1d\n", usage.getCommitted()); + System.out.format("Max: %1d\n", usage.getMax()); + return ((float) usage.getUsed()) / usage.getCommitted(); + } +} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java index f2111fa5724..8457091800c 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvoker.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO 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 @@ */ package utils; -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryPoolMXBean; -import java.lang.management.MemoryUsage; import java.util.ArrayList; import java.util.List; @@ -36,11 +33,7 @@ import java.util.List; public class GcProvoker{ // Uses fixed small objects to avoid Humongous objects allocation in G1 - public static final int MEMORY_CHUNK = 2048; - public static final float ALLOCATION_TOLERANCE = 0.05f; - - public static List allocatedMetaspace; - public static List allocatedMemory; + private static final int MEMORY_CHUNK = 2048; private final Runtime runtime; @@ -61,21 +54,6 @@ public class GcProvoker{ return list; } - private List allocateAvailableHeap(float targetUsage) { - // Calculates size of free memory after allocation with small tolerance. - long minFreeMemory = (long) ((1.0 - (targetUsage + ALLOCATION_TOLERANCE)) * runtime.maxMemory()); - List list = new ArrayList<>(); - do { - try { - list.add(new byte[MEMORY_CHUNK]); - } catch (OutOfMemoryError e) { - list = null; - throw new RuntimeException("Unexpected OOME '" + e.getMessage() + "' while eating " + targetUsage + " of heap memory."); - } - } while (runtime.freeMemory() > minFreeMemory); - return list; - } - /** * This method provokes a GC */ @@ -93,65 +71,7 @@ public class GcProvoker{ } } - /** - * Allocates heap and metaspace upon exit not less than targetMemoryUsagePercent percents - * of heap and metaspace have been consumed. - * - * @param targetMemoryUsagePercent how many percent of heap and metaspace to - * allocate - */ - - public void allocateMetaspaceAndHeap(float targetMemoryUsagePercent) { - // Metaspace should be filled before Java Heap to prevent unexpected OOME - // in the Java Heap while filling Metaspace - allocatedMetaspace = eatMetaspace(targetMemoryUsagePercent); - allocatedMemory = allocateHeap(targetMemoryUsagePercent); - } - - /** - * Allocates heap and metaspace upon exit targetMemoryUsagePercent percents - * of heap and metaspace have been consumed. - * - * @param targetMemoryUsagePercent how many percent of heap and metaspace to - * allocate - */ - public void allocateAvailableMetaspaceAndHeap(float targetMemoryUsagePercent) { - // Metaspace should be filled before Java Heap to prevent unexpected OOME - // in the Java Heap while filling Metaspace - allocatedMetaspace = eatMetaspace(targetMemoryUsagePercent); - allocatedMemory = allocateAvailableHeap(targetMemoryUsagePercent); - } - - private List eatMetaspace(float targetUsage) { - List list = new ArrayList<>(); - final String metaspacePoolName = "Metaspace"; - MemoryPoolMXBean metaspacePool = null; - for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) { - if (pool.getName().contains(metaspacePoolName)) { - metaspacePool = pool; - break; - } - } - if (metaspacePool == null) { - throw new RuntimeException("MXBean for Metaspace pool wasn't found"); - } - float currentUsage; - GeneratedClassProducer gp = new GeneratedClassProducer(); - do { - try { - list.add(gp.create(0)); - } catch (OutOfMemoryError oome) { - list = null; - throw new RuntimeException("Unexpected OOME '" + oome.getMessage() + "' while eating " + targetUsage + " of Metaspace."); - } - MemoryUsage memoryUsage = metaspacePool.getUsage(); - currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax()); - } while (currentUsage < targetUsage); - return list; - } - public GcProvoker() { runtime = Runtime.getRuntime(); } - } diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java b/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java deleted file mode 100644 index 565d86cf377..00000000000 --- a/hotspot/test/serviceability/tmtools/jstat/utils/GcProvokerImpl.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please 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 utils; - -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryPoolMXBean; -import java.lang.management.MemoryUsage; -import java.util.ArrayList; -import java.util.List; - -/** - * - * Utilities to provoke GC in various ways - */ -public class GcProvokerImpl implements GcProvoker { - - private static List eatenMetaspace; - private static List eatenMemory; - - static List eatHeapMemory(float targetUsage) { - long maxMemory = Runtime.getRuntime().maxMemory(); - // uses fixed small objects to avoid Humongous objects allocation in G1 - int memoryChunk = 2048; - List list = new ArrayList<>(); - long used = 0; - long target = (long) (maxMemory * targetUsage); - while (used < target) { - try { - list.add(new byte[memoryChunk]); - used += memoryChunk; - } catch (OutOfMemoryError e) { - list = null; - throw new RuntimeException("Unexpected OOME '" + e.getMessage() + "' while eating " + targetUsage + " of heap memory."); - } - } - return list; - } - - @Override - public void provokeGc() { - for (int i = 0; i < 3; i++) { - long edenSize = Pools.getEdenCommittedSize(); - long heapSize = Pools.getHeapCommittedSize(); - float targetPercent = ((float) edenSize) / (heapSize); - if ((targetPercent < 0) || (targetPercent > 1.0)) { - throw new RuntimeException("Error in the percent calculation" + " (eden size: " + edenSize + ", heap size: " + heapSize + ", calculated eden percent: " + targetPercent + ")"); - } - eatHeapMemory(targetPercent); - eatHeapMemory(targetPercent); - System.gc(); - } - } - - @Override - public void eatMetaspaceAndHeap(float targetMemoryUsagePercent) { - // Metaspace should be filled before Java Heap to prevent unexpected OOME - // in the Java Heap while filling Metaspace - eatenMetaspace = eatMetaspace(targetMemoryUsagePercent); - eatenMemory = eatHeapMemory(targetMemoryUsagePercent); - } - - private static List eatMetaspace(float targetUsage) { - List list = new ArrayList<>(); - final String metaspacePoolName = "Metaspace"; - MemoryPoolMXBean metaspacePool = null; - for (MemoryPoolMXBean pool : ManagementFactory.getMemoryPoolMXBeans()) { - if (pool.getName().contains(metaspacePoolName)) { - metaspacePool = pool; - break; - } - } - if (metaspacePool == null) { - throw new RuntimeException("MXBean for Metaspace pool wasn't found"); - } - float currentUsage; - GeneratedClassProducer gp = new GeneratedClassProducer(); - do { - try { - list.add(gp.create(0)); - } catch (OutOfMemoryError oome) { - list = null; - throw new RuntimeException("Unexpected OOME '" + oome.getMessage() + "' while eating " + targetUsage + " of Metaspace."); - } - MemoryUsage memoryUsage = metaspacePool.getUsage(); - currentUsage = (((float) memoryUsage.getUsed()) / memoryUsage.getMax()); - } while (currentUsage < targetUsage); - return list; - } - - public GcProvokerImpl() { - } - -} diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java index 6ac62fa48ef..350a2a6470d 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCapacityResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,6 +62,7 @@ public class JstatGcCapacityResults extends JstatResults { /** * Checks the overall consistency of the results reported by the tool */ + @Override public void assertConsistency() { // Check exit code @@ -117,8 +118,6 @@ public class JstatGcCapacityResults extends JstatResults { float MC = getFloatValue("MC"); assertThat(MC >= MCMN, "MC < MCMN (generation capacity < min generation capacity)"); assertThat(MC <= MCMX, "MGC > MCMX (generation capacity > max generation capacity)"); - - } /** @@ -139,21 +138,4 @@ public class JstatGcCapacityResults extends JstatResults { } return false; } - - private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; - - private static boolean checkFloatIsSum(float sum, float... floats) { - for (float f : floats) { - sum -= f; - } - - return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; - } - - private void assertThat(boolean b, String message) { - if (!b) { - throw new RuntimeException(message); - } - } - } diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java index 3bb708dd7ba..cf435f8dba7 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcCauseResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,7 @@ public class JstatGcCauseResults extends JstatResults { /** * Checks the overall consistency of the results reported by the tool */ + @Override public void assertConsistency() { assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); @@ -83,21 +84,4 @@ public class JstatGcCauseResults extends JstatResults { assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")"); } - - private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; - - private static boolean checkFloatIsSum(float sum, float... floats) { - for (float f : floats) { - sum -= f; - } - - return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; - } - - private void assertThat(boolean b, String message) { - if (!b) { - throw new RuntimeException(message); - } - } - } diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java index 24ff4490b80..ca3c04af67c 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcNewResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class JstatGcNewResults extends JstatResults { /** * Checks the overall consistency of the results reported by the tool */ + @Override public void assertConsistency() { assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); @@ -84,10 +85,4 @@ public class JstatGcNewResults extends JstatResults { int MTT = getIntValue("MTT"); assertThat(TT <= MTT, "TT > MTT (tenuring threshold > maximum tenuring threshold)"); } - - private void assertThat(boolean b, String message) { - if (!b) { - throw new RuntimeException(message); - } - } } diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java index 95905418a37..7b736d9f071 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatGcResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class JstatGcResults extends JstatResults { /** * Checks the overall consistency of the results reported by the tool */ + @Override public void assertConsistency() { assertThat(getExitCode() == 0, "Unexpected exit code: " + getExitCode()); @@ -112,21 +113,4 @@ public class JstatGcResults extends JstatResults { assertThat(checkFloatIsSum(GCT, YGCT, FGCT), "GCT != (YGCT + FGCT) " + "(GCT = " + GCT + ", YGCT = " + YGCT + ", FGCT = " + FGCT + ", (YCGT + FGCT) = " + (YGCT + FGCT) + ")"); } - - private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; - - private static boolean checkFloatIsSum(float sum, float... floats) { - for (float f : floats) { - sum -= f; - } - - return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; - } - - private void assertThat(boolean b, String message) { - if (!b) { - throw new RuntimeException(message); - } - } - } diff --git a/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java index d4f961051f8..f628a27d1de 100644 --- a/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java +++ b/hotspot/test/serviceability/tmtools/jstat/utils/JstatResults.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 common.ToolResults; */ abstract public class JstatResults extends ToolResults { + private static final float FLOAT_COMPARISON_TOLERANCE = 0.0011f; + public JstatResults(ToolResults rawResults) { super(rawResults); } @@ -110,38 +112,61 @@ abstract public class JstatResults extends ToolResults { * space has been utilized */ public static void assertSpaceUtilization(JstatResults measurement, float targetMemoryUsagePercent) { + assertSpaceUtilization(measurement, targetMemoryUsagePercent, targetMemoryUsagePercent); + } + + /** + * Helper function to assert the utilization of the space + * + * @param measurement - measurement results to analyze + * @param targetMetaspaceUsagePercent -assert that not less than this amount + * of metaspace has been utilized + * @param targetOldSpaceUsagePercent -assert that not less than this amount + * of old space has been utilized + */ + public static void assertSpaceUtilization(JstatResults measurement, float targetMetaspaceUsagePercent, + float targetOldSpaceUsagePercent) { if (measurement.valueExists("OU")) { float OC = measurement.getFloatValue("OC"); float OU = measurement.getFloatValue("OU"); - assertThat((OU / OC) > targetMemoryUsagePercent, "Old space utilization should be > " - + (targetMemoryUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC)); + assertThat((OU / OC) > targetOldSpaceUsagePercent, "Old space utilization should be > " + + (targetOldSpaceUsagePercent * 100) + "%, actually OU / OC = " + (OU / OC)); } if (measurement.valueExists("MU")) { float MC = measurement.getFloatValue("MC"); float MU = measurement.getFloatValue("MU"); - assertThat((MU / MC) > targetMemoryUsagePercent, "Metaspace utilization should be > " - + (targetMemoryUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC)); + assertThat((MU / MC) > targetMetaspaceUsagePercent, "Metaspace utilization should be > " + + (targetMetaspaceUsagePercent * 100) + "%, actually MU / MC = " + (MU / MC)); } if (measurement.valueExists("O")) { float O = measurement.getFloatValue("O"); - assertThat(O > targetMemoryUsagePercent * 100, "Old space utilization should be > " - + (targetMemoryUsagePercent * 100) + "%, actually O = " + O); + assertThat(O > targetOldSpaceUsagePercent * 100, "Old space utilization should be > " + + (targetOldSpaceUsagePercent * 100) + "%, actually O = " + O); } if (measurement.valueExists("M")) { float M = measurement.getFloatValue("M"); - assertThat(M > targetMemoryUsagePercent * 100, "Metaspace utilization should be > " - + (targetMemoryUsagePercent * 100) + "%, actually M = " + M); + assertThat(M > targetMetaspaceUsagePercent * 100, "Metaspace utilization should be > " + + (targetMetaspaceUsagePercent * 100) + "%, actually M = " + M); } } - private static void assertThat(boolean result, String message) { + public static void assertThat(boolean result, String message) { if (!result) { throw new RuntimeException(message); } } + public static boolean checkFloatIsSum(float sum, float... floats) { + for (float f : floats) { + sum -= f; + } + + return Math.abs(sum) <= FLOAT_COMPARISON_TOLERANCE; + } + + abstract public void assertConsistency(); } diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh index 43d1a76ed92..0c300d4fd96 100644 --- a/hotspot/test/test_env.sh +++ b/hotspot/test/test_env.sh @@ -214,6 +214,11 @@ if [ $? = 0 ] then VM_CPU="aarch64" fi +grep "arm64" vm_version.out > ${NULL} +if [ $? = 0 ] +then + VM_CPU="aarch64" +fi export VM_TYPE VM_BITS VM_OS VM_CPU echo "VM_TYPE=${VM_TYPE}" echo "VM_BITS=${VM_BITS}" diff --git a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java index 36e6ddea8be..f5347cd8242 100644 --- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java +++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/PathHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +151,9 @@ public abstract class PathHandler { if (id >= Utils.COMPILE_THE_WORLD_START_AT) { try { Class aClass = loader.loadClass(name); - if (name != "sun.reflect.misc.Trampoline" - && name != "sun.tools.jconsole.OutputViewer") { // workaround for JDK-8159155 + if (!"sun.reflect.misc.Trampoline".equals(name) + // workaround for JDK-8159155 + && !"sun.tools.jconsole.OutputViewer".equals(name)) { UNSAFE.ensureClassInitialized(aClass); } CompileTheWorld.OUT.printf("[%d]\t%s%n", id, name); diff --git a/hotspot/test/testlibrary/jittester/Makefile b/hotspot/test/testlibrary/jittester/Makefile index 14f0cb3fba1..e4dd97cff23 100644 --- a/hotspot/test/testlibrary/jittester/Makefile +++ b/hotspot/test/testlibrary/jittester/Makefile @@ -108,7 +108,7 @@ INIT: $(DIST_DIR) $(shell if [ ! -d $(CLASSES_DIR) ]; then mkdir -p $(CLASSES_DIR); fi) install: clean_testbase testgroup testroot copytestlibrary copyaot JAR cleantmp - $(JAVA) --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED -ea -jar $(DIST_JAR) $(APPLICATION_ARGS) + $(JAVA) --add-exports=java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED -ea -jar $(DIST_JAR) $(APPLICATION_ARGS) clean_testbase: @rm -rf $(TESTBASE_DIR) diff --git a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java index 3974f078d7b..952e34182a3 100644 --- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java +++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java @@ -43,6 +43,7 @@ public abstract class TestsGenerator implements BiConsumer { protected final Path generatorDir; protected final Function preRunActions; protected final String jtDriverOptions; + private static final String DISABLE_WARNINGS = "-XX:-PrintWarnings"; protected TestsGenerator(String suffix) { this(suffix, s -> new String[0], ""); @@ -57,8 +58,8 @@ public abstract class TestsGenerator implements BiConsumer { protected void generateGoldenOut(String mainClassName) { String classPath = getRoot() + File.pathSeparator + generatorDir; - ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", "-Xverify", "-cp", classPath, - mainClassName); + ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", DISABLE_WARNINGS, "-Xverify", + "-cp", classPath, mainClassName); String goldFile = mainClassName + ".gold"; try { runProcess(pb, generatorDir.resolve(goldFile).toString()); @@ -128,6 +129,8 @@ public abstract class TestsGenerator implements BiConsumer { .append("\n"); } header.append(" * @run driver jdk.test.lib.jittester.jtreg.JitTesterDriver ") + .append(DISABLE_WARNINGS) + .append(" ") .append(jtDriverOptions) .append(" ") .append(mainClassName) diff --git a/hotspot/test/testlibrary_tests/ctw/CtwTest.java b/hotspot/test/testlibrary_tests/ctw/CtwTest.java index eb6aedc1fbe..514df0e5cd0 100644 --- a/hotspot/test/testlibrary_tests/ctw/CtwTest.java +++ b/hotspot/test/testlibrary_tests/ctw/CtwTest.java @@ -37,6 +37,7 @@ import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import java.nio.charset.Charset; +import jdk.test.lib.Platform; import jdk.test.lib.JDKToolFinder; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; @@ -93,7 +94,12 @@ public abstract class CtwTest { // concat CTW_COMMAND and args w/o 0th element String[] cmd = Arrays.copyOf(CTW_COMMAND, CTW_COMMAND.length + args.length - 1); System.arraycopy(args, 1, cmd, CTW_COMMAND.length, args.length - 1); - + if (Platform.isWindows()) { + // '*' has to be escaped on windows + for (int i = 0; i < cmd.length; ++i) { + cmd[i] = cmd[i].replace("*", "\"*\""); + } + } ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, cmd); OutputAnalyzer output = new OutputAnalyzer(pb.start()); dump(output, "compile"); diff --git a/jaxp/.hgtags b/jaxp/.hgtags index bc1c0c2fae9..ec6892ef5d9 100644 --- a/jaxp/.hgtags +++ b/jaxp/.hgtags @@ -396,9 +396,11 @@ f85154af719f99a3b4d81b67a8b4c18a650d10f9 jdk-9+150 13c6906bfc861d99dc35a19c80b7a99f0b0ac58d jdk-9+151 7e3da313b1746578da648155e37dd8526e83153d jdk-9+152 1384504d2cd0e55c5e0becaeaf40ab05cae959d6 jdk-9+153 +0908877116d17c6e59092ec7d53ef687a96d3278 jdk-10+0 7fa738305436d14c0926df0f04892890cacc766b jdk-9+154 48fa77af153288b08ba794e1616a7b0685f3b67e jdk-9+155 e930c373aaa4e0e712c9a25ba4b03d473b48c294 jdk-9+156 +b4257a40e55d5dea9fe27f7cc11c430531b7ad66 jdk-10+1 412df235a8a229469a2cb9e7bb274d43277077d2 jdk-9+157 60e670a65e07cc309951bd838b484401e6dd7847 jdk-9+158 5695854e8831d0c088ab0ecf83b367ec16c9760a jdk-9+159 @@ -409,6 +411,11 @@ d02b6fbcab06c59a5f5a4a6736bd4ec6d2567855 jdk-9+162 6dc790a4e8310c86712cfdf7561a9820818546e6 jdk-9+164 55419603989707ec50c84bb379bbdc1adeec3ab2 jdk-9+165 8d3febd5c9d82e49f3e6e5f8eb10f959e7b50f83 jdk-9+166 +fb8f87183981ae0ea7afdafec64763e2f1a88227 jdk-10+2 +97423b4995a216d3fb566dcc5825f3d54dcfe17f jdk-10+3 +1f64e853c72b269a3e45878515c07dad9c533592 jdk-10+4 +ac697b2bdf486ef18caad2092bd24036e14946ac jdk-10+5 +26ed5e84fa13b8dca066b01ece5bc029323611be jdk-10+6 646567dcfa64b9a39b33d71330427737d1c1a0d5 jdk-9+167 23a87f409371fb8ce7b764cccb3a74c3f6b29900 jdk-9+168 5d9d2a65fb26aa183019346c11d9314819621665 jdk-9+169 diff --git a/jaxp/.jcheck/conf b/jaxp/.jcheck/conf index 5c6f62dc12c..b2581358014 100644 --- a/jaxp/.jcheck/conf +++ b/jaxp/.jcheck/conf @@ -1 +1 @@ -project=jdk9 +project=jdk10 diff --git a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java index 777e8cf5336..a535e631bce 100644 --- a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java +++ b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/JDKToolLauncher.java @@ -24,7 +24,6 @@ package jdk.testlibrary; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; /** @@ -60,7 +59,6 @@ public class JDKToolLauncher { } else { executable = JDKToolFinder.getTestJDKTool(tool); } - vmArgs.addAll(Arrays.asList(ProcessTools.getPlatformSpecificVMArgs())); } /** diff --git a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java index c3abe5936d8..1580dc6a521 100644 --- a/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java +++ b/jaxp/test/javax/xml/jaxp/libs/jdk/testlibrary/ProcessTools.java @@ -259,23 +259,6 @@ public final class ProcessTools { return ProcessHandle.current().pid(); } - /** - * Get platform specific VM arguments (e.g. -d64 on 64bit Solaris) - * - * @return String[] with platform specific arguments, empty if there are - * none - */ - public static String[] getPlatformSpecificVMArgs() { - String osName = System.getProperty("os.name"); - String dataModel = System.getProperty("sun.arch.data.model"); - - if (osName.equals("SunOS") && dataModel.equals("64")) { - return new String[] { "-d64" }; - } - - return new String[] {}; - } - /** * Create ProcessBuilder using the java launcher from the jdk to be tested, * and with any platform specific arguments prepended. @@ -283,8 +266,7 @@ public final class ProcessTools { * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createJavaProcessBuilder(String... command) - throws Exception { + public static ProcessBuilder createJavaProcessBuilder(String... command) { return createJavaProcessBuilder(false, command); } @@ -297,12 +279,11 @@ public final class ProcessTools { * @param command Arguments to pass to the java command. * @return The ProcessBuilder instance representing the java command. */ - public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) throws Exception { + public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions, String... command) { String javapath = JDKToolFinder.getJDKTool("java"); ArrayList args = new ArrayList<>(); args.add(javapath); - Collections.addAll(args, getPlatformSpecificVMArgs()); if (addTestVmAndJavaOptions) { // -cp is needed to make sure the same classpath is used whether the test is diff --git a/jaxws/.hgtags b/jaxws/.hgtags index b130a70170d..cb032e28820 100644 --- a/jaxws/.hgtags +++ b/jaxws/.hgtags @@ -399,5 +399,25 @@ c8c9c334743caf8155c9809b6b4ac315d3a66476 jdk-9+148 c48b4d4768b1c2b8fe5d1a844ca13732e5dfbe2a jdk-9+151 6f8fb1cf7e5f61c40dcc3654f9a623c505f6de1f jdk-9+152 7a532a9a227137155b905341d4b99939db51220e jdk-9+153 +34af95c7dbff74f3448fcdb7d745524e8a1cc88a jdk-10+0 34af95c7dbff74f3448fcdb7d745524e8a1cc88a jdk-9+154 9b9918656c97724fd89c04a8547043bbd37f5935 jdk-9+155 +7c829eba781409b4fe15392639289af1553dcf63 jdk-9+156 +6afc1d9b8c41457cc8ebe2e1a27b8fd6d887c1fb jdk-10+1 +b7e70e1e0154e1d2c69f814e03a8800ef8634fe0 jdk-9+157 +e53b322357382209fb553b9a1541ccfd12cbcb6c jdk-9+158 +0ea34706c7fa5cd71accd493eb4f54262e4a5f4e jdk-9+159 +6bff08fd5d217549aec10a20007378e52099be6c jdk-9+160 +7d5352c54fc802b3301d8433b6b2b2a92b616630 jdk-9+161 +b8aebe5292f23689f97cb8e66a9f327834dd43e6 jdk-9+162 +3890f96e8995be8c84f330d1f65269b03ac36b24 jdk-9+163 +1a52de2da827459e866fd736f9e9c62eb2ecd6bb jdk-9+164 +a987401bac0d528475e57732c9d5d93f4405804c jdk-9+165 +b1f30c27367bd286fa4eb8a767335e917a5b5b82 jdk-9+166 +06b9f0de66d3a17a10af380c950619c63b62d4cd jdk-10+2 +2e2c78f1713b2c6b760b870946d2b4341a1522e3 jdk-10+3 +ac7e572a6a6ba5bbd7e6aa94a289f88cc86256a4 jdk-10+4 +879aad463c21065254918629e6dfd7d7bf98adb2 jdk-10+5 +85e15cdc75aaaea8a1bb00563af7889869d3e602 jdk-10+6 +1c610f1b4097c64cdd722a7fb59f5a4d9cc15ca9 jdk-9+167 +2746716dcc5a8c28ccf41df0c8fb620b1a1e7098 jdk-9+168 diff --git a/jaxws/.jcheck/conf b/jaxws/.jcheck/conf index 5c6f62dc12c..b2581358014 100644 --- a/jaxws/.jcheck/conf +++ b/jaxws/.jcheck/conf @@ -1 +1 @@ -project=jdk9 +project=jdk10 diff --git a/jaxws/README b/jaxws/README deleted file mode 100644 index 4d65125b34c..00000000000 --- a/jaxws/README +++ /dev/null @@ -1,19 +0,0 @@ -README: - - This file should be located at the top of the Mercurial repository. - - See http://openjdk.java.net/ for more information about the OpenJDK. - - See ../README-builds.html for complete details on build machine requirements. - -Simple Build Instructions: - This repository can be loaded as a NetBeans project, built with ant, or - built with GNU make, e.g. - ant - -OR- - cd make && gnumake - - The built files that will be imported into the jdk build will be in the - "dist" directory. - Help information is available by running "ant -projecthelp" or "make help". - diff --git a/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default b/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default index 0c22eb2efb8..1b4056b194f 100644 --- a/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default +++ b/jaxws/src/java.activation/share/classes/META-INF/mimetypes.default @@ -7,6 +7,7 @@ image/gif gif GIF image/ief ief image/jpeg jpeg jpg jpe JPG image/tiff tiff tif +image/png png PNG image/x-xwindowdump xwd application/postscript ai eps ps application/rtf rtf diff --git a/jaxws/src/java.activation/share/classes/module-info.java b/jaxws/src/java.activation/share/classes/module-info.java index 00d40e18550..8132ff67295 100644 --- a/jaxws/src/java.activation/share/classes/module-info.java +++ b/jaxws/src/java.activation/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ /** * Defines the JavaBeans Activation Framework (JAF) API. + * + * @moduleGraph + * @since 9 */ +@Deprecated(since="9", forRemoval=true) module java.activation { requires transitive java.datatransfer; requires java.logging; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java index 2f4da84f319..0406d5b4c6b 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ public interface Localizable { public Object[] getArguments(); public String getResourceBundleName(); - public default ResourceBundle getResourceBundle(Locale locale) { - return null; - } + public ResourceBundle getResourceBundle(Locale locale); /** * Special constant that represents a message that diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java index 1d7ace5146c..747110e350f 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessage.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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.util.Arrays; import java.util.Locale; import java.util.ResourceBundle; + /** * @author WS Development Team */ @@ -42,13 +43,9 @@ public final class LocalizableMessage implements Localizable { private final String _key; private final Object[] _args; + @Deprecated public LocalizableMessage(String bundlename, String key, Object... args) { - _bundlename = bundlename; - _rbSupplier = null; - _key = key; - if(args==null) - args = new Object[0]; - _args = args; + this(bundlename, null, key, args); } public LocalizableMessage(String bundlename, ResourceBundleSupplier rbSupplier, @@ -61,15 +58,17 @@ public final class LocalizableMessage implements Localizable { _args = args; } - + @Override public String getKey() { return _key; } + @Override public Object[] getArguments() { return Arrays.copyOf(_args, _args.length); } + @Override public String getResourceBundleName() { return _bundlename; } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java index bf8a28b76f3..e4d5a126962 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/LocalizableMessageFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class LocalizableMessageFactory { private final String _bundlename; private final ResourceBundleSupplier _rbSupplier; + @Deprecated public LocalizableMessageFactory(String bundlename) { _bundlename = bundlename; _rbSupplier = null; @@ -58,4 +59,5 @@ public class LocalizableMessageFactory { */ ResourceBundle getResourceBundle(Locale locale); } + } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java index 2f78673eab0..a0436beafa1 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/Localizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 com.sun.istack.internal.localization; -import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier; import java.text.MessageFormat; import java.util.HashMap; import java.util.Locale; @@ -41,7 +40,7 @@ import java.util.ResourceBundle; public class Localizer { private final Locale _locale; - private final HashMap _resourceBundles; + private final HashMap _resourceBundles; public Localizer() { this(Locale.getDefault()); @@ -49,7 +48,7 @@ public class Localizer { public Localizer(Locale l) { _locale = l; - _resourceBundles = new HashMap(); + _resourceBundles = new HashMap<>(); } public Locale getLocale() { diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java index e0fb44621f4..f9f0b7abe09 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/istack/internal/localization/NullLocalizable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 com.sun.istack.internal.localization; +import java.util.Locale; +import java.util.ResourceBundle; + /** * {@link Localizable} that wraps a non-localizable string. * @@ -39,13 +42,20 @@ public final class NullLocalizable implements Localizable { this.msg = msg; } + @Override public String getKey() { return Localizable.NOT_LOCALIZABLE; } + @Override public Object[] getArguments() { return new Object[]{msg}; } + @Override public String getResourceBundleName() { return ""; } + @Override + public ResourceBundle getResourceBundle(Locale locale) { + return null; + } } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java index a27f0825fe8..fcf907d88ee 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/api/JAXBRIContext.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -533,4 +533,14 @@ public abstract class JAXBRIContext extends JAXBContext { * @since 2.2.6 */ public static final String DISABLE_XML_SECURITY = "com.sun.xml.internal.bind.disableXmlSecurity"; + + /** + * If true and element namespace is not specified, namespace of parent element will be used. + * The default value is false. + * + * Boolean + * @since 2.3.0 + */ + public static final String BACKUP_WITH_PARENT_NAMESPACE = "com.sun.xml.internal.bind.backupWithParentNamespace"; + } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java index a18f79e1d58..73fe277419f 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/ContextFactory.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +112,8 @@ public class ContextFactory { "is not active. Using JAXB's implementation"); } + Boolean backupWithParentNamespace = getPropertyValue(properties, JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE, Boolean.class); + RuntimeAnnotationReader ar = getPropertyValue(properties,JAXBRIContext.ANNOTATION_READER,RuntimeAnnotationReader.class); Collection tr = getPropertyValue(properties, JAXBRIContext.TYPE_REFERENCES, Collection.class); @@ -144,6 +146,7 @@ public class ContextFactory { builder.setSupressAccessorWarnings(supressAccessorWarnings); builder.setImprovedXsiTypeHandling(improvedXsiTypeHandling); builder.setDisableSecurityProcessing(disablesecurityProcessing); + builder.setBackupWithParentNamespace(backupWithParentNamespace); return builder.build(); } diff --git a/jdk/src/jdk.desktop/share/classes/module-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java similarity index 86% rename from jdk/src/jdk.desktop/share/classes/module-info.java rename to jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java index 2aac00da299..848316f6c53 100644 --- a/jdk/src/jdk.desktop/share/classes/module-info.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,12 +23,7 @@ * questions. */ -/* - * Provides non-SE desktop APIs. +/** + * Code that deals with low level byte code manipulation. */ - -module jdk.desktop { - requires transitive java.desktop; - - exports jdk.awt; -} +package com.sun.xml.internal.bind.v2.bytecode; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html deleted file mode 100644 index 092f6f3e5d2..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/bytecode/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - Code that deals with low level byte code manipulation. - - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java new file mode 100644 index 00000000000..40328931c18 --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Abstraction around reading annotations, to support internal/external annotations. + */ +package com.sun.xml.internal.bind.v2.model.annotation; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html deleted file mode 100644 index acc9be725ab..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/annotation/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Abstraction around reading annotations, to support internal/external annotations. - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java index 5b97093d3fd..c584056f611 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/ErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,24 +29,25 @@ import com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationException; /** * listen to static errors found during building a JAXB model from a set of classes. - * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. + * Implemented by the client of {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}. * *

    * All the static errors have to be reported while constructing a - * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder#link} completes. - * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder} wraps an {@link ErrorHandler} and all the model + * model, not when a model is used (IOW, until the {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} completes. + * Internally, {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI} wraps an {@link ErrorHandler} and all the model * components should report errors through it. * *

    * {@link IllegalAnnotationException} is a checked exception to remind * the model classes to report it rather than to throw it. * - * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilder + * @see com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI * @author Kohsuke Kawaguchi */ public interface ErrorHandler { /** * Receives a notification for an error in the annotated code. + * @param e */ void error( IllegalAnnotationException e ); } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java index c3406b7da6f..83caf8f4f04 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/PropertyKind.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public enum PropertyKind { public final boolean isOrdered; /** - * {@link com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to + * {@code com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory} benefits from having index numbers assigned to * {@link #ELEMENT}, {@link #REFERENCE}, and {@link #MAP} in this order. */ public final int propertyIndex; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java index 794c3396d25..9bfe5e04209 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/core/RegistryInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,22 @@ import javax.xml.bind.annotation.XmlRegistry; * *

    * This interface is only meant to be used as a return type from - * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilder}. + * {@link com.sun.xml.internal.bind.v2.model.impl.ModelBuilderI}. * * @author Kohsuke Kawaguchi + * @param + * @param */ public interface RegistryInfo { /** * Returns all the references to other types in this registry. + * @return */ Set> getReferences(); /** * Returns the class with {@link XmlRegistry}. + * @return */ C getClazz(); } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java new file mode 100644 index 00000000000..68abc10902c --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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 com.sun.xml.internal.bind.j2s.model package. + */ +package com.sun.xml.internal.bind.v2.model.impl; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html deleted file mode 100644 index e37eebd2ac4..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/impl/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -Implementation of the com.sun.xml.internal.bind.j2s.model package. - - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java new file mode 100644 index 00000000000..ea3b945f33c --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing). + */ +package com.sun.xml.internal.bind.v2.model.nav; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html deleted file mode 100644 index 319f86c97b9..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/model/nav/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Abstraction around the reflection library, to support various reflection models (such as java.lang.reflect and Annotation Processing). - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java index 3c918598348..5a03996782a 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/JAXBContextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -241,6 +241,16 @@ public final class JAXBContextImpl extends JAXBRIContext { private Set xmlNsSet = null; + /** + * If true, despite the specification, unmarshall child element with parent namespace, if child namespace is not specified. + * The default value is null for System {code}com.sun.xml.internal.bind.backupWithParentNamespace{code} property to be used, + * and false is assumed if it's not set either. + * + * Boolean + * @since 2.3.0 + */ + public Boolean backupWithParentNamespace = null; + /** * Returns declared XmlNs annotations (from package-level annotation XmlSchema * @@ -263,6 +273,7 @@ public final class JAXBContextImpl extends JAXBRIContext { this.supressAccessorWarnings = builder.supressAccessorWarnings; this.improvedXsiTypeHandling = builder.improvedXsiTypeHandling; this.disableSecurityProcessing = builder.disableSecurityProcessing; + this.backupWithParentNamespace = builder.backupWithParentNamespace; Collection typeRefs = builder.typeRefs; @@ -1024,6 +1035,7 @@ public final class JAXBContextImpl extends JAXBRIContext { private boolean allNillable; private boolean improvedXsiTypeHandling = true; private boolean disableSecurityProcessing = true; + private Boolean backupWithParentNamespace = null; // null for System property to be used public JAXBContextBuilder() {}; @@ -1039,6 +1051,7 @@ public final class JAXBContextImpl extends JAXBRIContext { this.xmlAccessorFactorySupport = baseImpl.xmlAccessorFactorySupport; this.allNillable = baseImpl.allNillable; this.disableSecurityProcessing = baseImpl.disableSecurityProcessing; + this.backupWithParentNamespace = baseImpl.backupWithParentNamespace; } public JAXBContextBuilder setRetainPropertyInfo(boolean val) { @@ -1101,6 +1114,11 @@ public final class JAXBContextImpl extends JAXBRIContext { return this; } + public JAXBContextBuilder setBackupWithParentNamespace(Boolean backupWithParentNamespace) { + this.backupWithParentNamespace = backupWithParentNamespace; + return this; + } + public JAXBContextImpl build() throws JAXBException { // fool-proof diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java new file mode 100644 index 00000000000..3ae977b9d19 --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Code that implements JAXBContext, Unmarshaller, and Marshaller. + */ +package com.sun.xml.internal.bind.v2.runtime; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html deleted file mode 100644 index 2c45e53176e..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -Code that implements JAXBContext, Unmarshaller, and Marshaller. - - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java index 1be59952231..d2154319c48 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/AccessorInjector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ class AccessorInjector { private static final Logger logger = Util.getClassLogger(); - protected static final boolean noOptimize = Runtime.version().major() >= 9 || + protected static final boolean noOptimize = Util.getSystemProperty(ClassTailor.class.getName()+".noOptimize")!=null; static { diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java index 17c99557d9f..9e00016d7e9 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/Injector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ import java.util.logging.Logger; import com.sun.xml.internal.bind.Util; import com.sun.xml.internal.bind.v2.runtime.reflect.Accessor; +import java.lang.reflect.Field; +import java.security.CodeSource; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; /** * A {@link ClassLoader} used to "inject" optimized accessor classes @@ -131,7 +136,7 @@ final class Injector { /** * Injected classes keyed by their names. */ - private final Map classes = new HashMap(); + private final Map classes = new HashMap<>(); private final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock(); private final Lock r = rwl.readLock(); private final Lock w = rwl.writeLock(); @@ -141,26 +146,59 @@ final class Injector { * False otherwise, which happens if this classloader can't see {@link Accessor}. */ private final boolean loadable; - private static final Method defineClass; - private static final Method resolveClass; - private static final Method findLoadedClass; + private static Method defineClass; + private static Method resolveClass; + private static Method findLoadedClass; + private static Object U; static { - Method[] m = AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public Method[] run() { - return new Method[]{ - getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), - getMethod(ClassLoader.class, "resolveClass", Class.class), - getMethod(ClassLoader.class, "findLoadedClass", String.class) - }; - } + try { + Method[] m = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Method[] run() { + return new Method[]{ + getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), + getMethod(ClassLoader.class, "resolveClass", Class.class), + getMethod(ClassLoader.class, "findLoadedClass", String.class) + }; } - ); - defineClass = m[0]; - resolveClass = m[1]; - findLoadedClass = m[2]; + } + ); + defineClass = m[0]; + resolveClass = m[1]; + findLoadedClass = m[2]; + } catch (Throwable t) { + try { + U = AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Object run() throws Exception { + Class u = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = u.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + return theUnsafe.get(null); + } + }); + defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Method run() throws Exception { + try { + return U.getClass().getMethod("defineClass", + new Class[]{String.class, + byte[].class, + Integer.TYPE, + Integer.TYPE, + ClassLoader.class, + ProtectionDomain.class}); + } catch (NoSuchMethodException | SecurityException ex) { + throw ex; + } + } + }); + } catch (SecurityException | PrivilegedActionException ex) { + Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex); + } + } } private static Method getMethod(final Class c, final String methodname, final Class... params) { @@ -210,13 +248,11 @@ final class Injector { rlocked = false; //find loaded class from classloader - if (c == null) { + if (c == null && findLoadedClass != null) { try { c = (Class) findLoadedClass.invoke(parent, className.replace('/', '.')); - } catch (IllegalArgumentException e) { - logger.log(Level.FINE, "Unable to find " + className, e); - } catch (IllegalAccessException e) { + } catch (IllegalArgumentException | IllegalAccessException e) { logger.log(Level.FINE, "Unable to find " + className, e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); @@ -253,9 +289,13 @@ final class Injector { // we need to inject a class into the try { - c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length); - resolveClass.invoke(parent, c); - } catch (IllegalAccessException e) { + if (resolveClass != null) { + c = (Class) defineClass.invoke(parent, className.replace('/', '.'), image, 0, image.length); + resolveClass.invoke(parent, c); + } else { + c = (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, parent, Injector.class.getProtectionDomain()); + } + } catch (IllegalAccessException e) { logger.log(Level.FINE, "Unable to inject " + className, e); return null; } catch (InvocationTargetException e) { diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java new file mode 100644 index 00000000000..70ae20ccdd9 --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package-info.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Hosts optimized + * {@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor}, + * {@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and {@link com.sun.xml.internal.bind.v2.runtime.Transducer}. + * + *

    How it works

    + *

    + * Most of the classes in this package are "templates." At run-time, A template class file is slightly modified to match + * the target Java Bean, then it will be loaded into the VM. + */ +package com.sun.xml.internal.bind.v2.runtime.reflect.opt; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html deleted file mode 100644 index 9039ffafb01..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/opt/package.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - -Hosts optimized -{@link com.sun.xml.internal.bind.v2.runtime.reflect.Accessor}, -{@link com.sun.xml.internal.bind.v2.runtime.reflect.TransducedAccessor}, and -{@link com.sun.xml.internal.bind.v2.runtime.Transducer}. - -

    How it works

    -

    - Most of the classes in this package are "templates." At run-time, - A template class file is slightly modified to match the target Java Bean, - then it will be loaded into the VM. - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java new file mode 100644 index 00000000000..35dfd4abe9d --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Abstraction around accessing data of actual objects. + */ +package com.sun.xml.internal.bind.v2.runtime.reflect; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html deleted file mode 100644 index 36c5c915cf8..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/reflect/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Abstraction around accessing data of actual objects. - diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java index d1e67292e4e..8ae68be34c0 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/LocatorEx.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ import org.xml.sax.Locator; import org.w3c.dom.Node; /** - * Object that returns the current location that the {@link com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor} + * Object that returns the current location that the {@code com.sun.xml.internal.bind.v2.runtime.unmarshaller.XmlVisitor} * is parsing. * * @author Kohsuke Kawaguchi @@ -41,6 +41,7 @@ import org.w3c.dom.Node; public interface LocatorEx extends Locator { /** * Gets the current location in a {@link ValidationEventLocator} object. + * @return */ ValidationEventLocator getLocation(); diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java index 9becb9dd086..8141e4e5178 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/runtime/unmarshaller/StructureLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 @@ import java.util.Map; import javax.xml.namespace.QName; +import com.sun.xml.internal.bind.Util; import com.sun.xml.internal.bind.api.AccessorException; +import com.sun.xml.internal.bind.api.JAXBRIContext; import com.sun.xml.internal.bind.v2.WellKnownNamespace; import com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl; import com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl; @@ -231,11 +233,26 @@ public final class StructureLoader extends Loader { @Override public void childElement(UnmarshallingContext.State state, TagName arg) throws SAXException { ChildLoader child = childUnmarshallers.get(arg.uri,arg.local); - if (child == null) { - child = catchAll; - if (child==null) { - super.childElement(state,arg); - return; + if(child == null) { + Boolean backupWithParentNamespace = ((JAXBContextImpl) state.getContext().getJAXBContext()).backupWithParentNamespace; + backupWithParentNamespace = backupWithParentNamespace != null + ? backupWithParentNamespace + : Boolean.parseBoolean(Util.getSystemProperty(JAXBRIContext.BACKUP_WITH_PARENT_NAMESPACE)); + if ((beanInfo != null) && (beanInfo.getTypeNames() != null) && backupWithParentNamespace) { + Iterator typeNamesIt = beanInfo.getTypeNames().iterator(); + QName parentQName = null; + if ((typeNamesIt != null) && (typeNamesIt.hasNext()) && (catchAll == null)) { + parentQName = (QName) typeNamesIt.next(); + String parentUri = parentQName.getNamespaceURI(); + child = childUnmarshallers.get(parentUri, arg.local); + } + } + if (child == null) { + child = catchAll; + if(child==null) { + super.childElement(state,arg); + return; + } } } diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java index fbe7ff55cb5..f7b434e49d8 100644 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java +++ b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,5 +23,8 @@ * questions. */ +/** + * XML Schema writer generated by TXW. + */ @com.sun.xml.internal.txw2.annotation.XmlNamespace("http://www.w3.org/2001/XMLSchema") package com.sun.xml.internal.bind.v2.schemagen.xmlschema; diff --git a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html b/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html deleted file mode 100644 index cce3c1b8ebf..00000000000 --- a/jaxws/src/java.xml.bind/share/classes/com/sun/xml/internal/bind/v2/schemagen/xmlschema/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - -XML Schema writer generated by TXW. - - diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java index d31a1cbe0d7..d59b0e40471 100644 --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/ContextFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -158,7 +158,7 @@ class ContextFinder { Class spFactory = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, classLoader); return newInstance(contextPath, spFactory, classLoader, properties); } catch (ClassNotFoundException x) { - throw new JAXBException(Messages.format(Messages.PROVIDER_NOT_FOUND, className), x); + throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), x); } catch (RuntimeException | JAXBException x) { // avoid wrapping RuntimeException to JAXBException, @@ -228,7 +228,7 @@ class ContextFinder { } } - private static Object instantiateProviderIfNecessary(Class implClass) throws JAXBException { + private static Object instantiateProviderIfNecessary(final Class implClass) throws JAXBException { try { if (JAXBContextFactory.class.isAssignableFrom(implClass)) { return AccessController.doPrivileged(new PrivilegedExceptionAction() { @@ -254,7 +254,7 @@ class ContextFinder { try { spi = ServiceLoaderUtil.safeLoadClass(className, PLATFORM_DEFAULT_FACTORY_CLASS, getContextClassLoader()); } catch (ClassNotFoundException e) { - throw new JAXBException(e); + throw new JAXBException(Messages.format(Messages.DEFAULT_PROVIDER_NOT_FOUND), e); } if (logger.isLoggable(Level.FINE)) { @@ -525,6 +525,7 @@ class ContextFinder { } else { return (ClassLoader) java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public java.lang.Object run() { return Thread.currentThread().getContextClassLoader(); } @@ -539,6 +540,7 @@ class ContextFinder { } else { return (ClassLoader) java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public java.lang.Object run() { return c.getClassLoader(); } @@ -552,6 +554,7 @@ class ContextFinder { } else { return (ClassLoader) java.security.AccessController.doPrivileged( new java.security.PrivilegedAction() { + @Override public java.lang.Object run() { return ClassLoader.getSystemClassLoader(); } diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java index a1ebb81f4ab..79ede4ff185 100644 --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +65,9 @@ class Messages static final String PROVIDER_NOT_FOUND = // 1 arg "ContextFinder.ProviderNotFound"; + static final String DEFAULT_PROVIDER_NOT_FOUND = // 0 args + "ContextFinder.DefaultProviderNotFound"; + static final String COULD_NOT_INSTANTIATE = // 2 args "ContextFinder.CouldNotInstantiate"; diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties index e6a930d67d4..548001abfe7 100644 --- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/Messages.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. # 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,9 @@ ContextFinder.ProviderNotFound = \ Provider {0} not found +ContextFinder.DefaultProviderNotFound = \ + Implementation of JAXB-API has not been found on module path or classpath. + ContextFinder.CouldNotInstantiate = \ Provider {0} could not be instantiated: {1} diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java new file mode 100644 index 00000000000..d52ab7fa2bd --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/package-info.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * {@link javax.xml.bind.annotation.adapters.XmlAdapter} and its spec-defined + * sub-classes to allow arbitrary Java classes to be used with JAXB. + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

    + * For overviews, tutorials, examples, guides, and tool documentation, + * please see: + *

    + * + * @see JAXB Website + */ +package javax.xml.bind.annotation.adapters; diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java new file mode 100644 index 00000000000..c5c0bec28f1 --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/helpers/package-info.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * JAXB Provider Use Only: Provides partial default implementations for + * some of the javax.xml.bind interfaces. + *

    + *

    + * JAXB Providers can extend these classes and implement the abstract + * methods. + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

    + * For overviews, tutorials, examples, guides, and tool documentation, + * please see: + *

    + * + * @see JAXB Website + */ +package javax.xml.bind.helpers; diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java new file mode 100644 index 00000000000..aa6ff577e52 --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/package-info.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Provides a runtime binding framework for client applications including + * unmarshalling, marshalling, and validation capabilities. + *

    + *

    + * JAXBContext is the client-entry point to the runtime binding + * framework. + *

    + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

    + * For overviews, tutorials, examples, guides, and tool documentation, + * please see: + *

    + * + * @see JAXB Website + */ +package javax.xml.bind; diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java new file mode 100644 index 00000000000..229d4343fc2 --- /dev/null +++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/util/package-info.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Useful client utility classes. + *

    + *

    Package Specification

    + *

    + *

    + *

    + *

    Related Documentation

    + *

    + * For overviews, tutorials, examples, guides, and tool documentation, + * please see: + *

    + * + * @see JAXB Website + */ +package javax.xml.bind.util; diff --git a/jaxws/src/java.xml.bind/share/classes/module-info.java b/jaxws/src/java.xml.bind/share/classes/module-info.java index 1a6abaf0bf0..c871b6f0d47 100644 --- a/jaxws/src/java.xml.bind/share/classes/module-info.java +++ b/jaxws/src/java.xml.bind/share/classes/module-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +25,18 @@ /** * Defines the Java Architecture for XML Binding (JAXB) API. + * + * @moduleGraph + * @since 9 */ +@Deprecated(since="9", forRemoval=true) module java.xml.bind { requires transitive java.activation; requires transitive java.xml; requires java.compiler; requires java.desktop; requires java.logging; + requires jdk.unsupported; uses javax.xml.bind.JAXBContextFactory; diff --git a/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java b/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java index 58a625918fe..6a16a31f6f6 100644 --- a/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java +++ b/jaxws/src/java.xml.ws.annotation/share/classes/module-info.java @@ -26,7 +26,11 @@ /** * Defines a subset of the Common Annotations API to support programs running * on the Java SE Platform. + * + * @moduleGraph + * @since 9 */ +@Deprecated(since="9", forRemoval=true) module java.xml.ws.annotation { exports javax.annotation; } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java index 151ae98e1fe..9136b3eb128 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/LazyEnvelopeSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +39,7 @@ import javax.xml.stream.XMLStreamWriter; public interface LazyEnvelopeSource extends javax.xml.transform.Source { /** * Retrieve payload qname without materializing its contents - * @return - * @throws SOAPException + * @return payload QName */ public QName getPayloadQName(); public XMLStreamReader readToBodyStarTag() throws XMLStreamException; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java index 7adf460cbb6..2d98512528e 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/SOAPExceptionImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class SOAPExceptionImpl extends SOAPException { /** * Constructs a SOAPExceptionImpl object initialized * with the given Throwable object. + * @param cause cause */ public SOAPExceptionImpl(Throwable cause) { super (cause.toString()); @@ -106,6 +107,7 @@ public class SOAPExceptionImpl extends SOAPException { * message of the embedded Throwable object, * if there is one */ + @Override public String getMessage() { String message = super.getMessage (); if (message == null && cause != null) { @@ -124,6 +126,7 @@ public class SOAPExceptionImpl extends SOAPException { * if there is none */ + @Override public Throwable getCause() { return cause; } @@ -157,6 +160,7 @@ public class SOAPExceptionImpl extends SOAPException { * method has already been called on this SOAPExceptionImpl * object */ + @Override public synchronized Throwable initCause(Throwable cause) { if(this.cause != null) { @@ -170,6 +174,7 @@ public class SOAPExceptionImpl extends SOAPException { return this; } + @Override public void printStackTrace() { super.printStackTrace(); if (cause != null) { @@ -178,6 +183,7 @@ public class SOAPExceptionImpl extends SOAPException { } } + @Override public void printStackTrace(PrintStream s) { super.printStackTrace(s); if (cause != null) { @@ -186,6 +192,7 @@ public class SOAPExceptionImpl extends SOAPException { } } + @Override public void printStackTrace(PrintWriter s) { super.printStackTrace(s); if (cause != null) { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java index 4ff655a0051..a032c589dfe 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/client/p2p/HttpSOAPConnection.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -512,9 +512,13 @@ class HttpSOAPConnection extends SOAPConnection { : httpConnection.getInputStream()); // If no reply message is returned, // content-Length header field value is expected to be zero. - // InputStream#available() can't be used here - it just says no data *YET*! + // java SE 6 documentation says : + // available() : an estimate of the number of bytes that can be read + //(or skipped over) from this input stream without blocking + //or 0 when it reaches the end of the input stream. if ((httpIn == null ) - || (httpConnection.getContentLength() == 0)) { + || (httpConnection.getContentLength() == 0) + || (httpIn.available() == 0)) { response = null; log.warning("SAAJ0014.p2p.content.zero"); } else { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java index ee23205714b..f21f3d02398 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/MultipartDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,7 +69,7 @@ public interface MultipartDataSource extends DataSource { * @return the MimeBodyPart * @exception IndexOutOfBoundsException if the given index * is out of range. - * @exception MessagingException + * @exception MessagingException thrown in case of error */ public MimeBodyPart getBodyPart(int index) throws MessagingException; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java index 34066fc32ac..96a7702e580 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/BMMimeMultipart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -115,6 +115,8 @@ public class BMMimeMultipart extends MimeMultipart { * contentType field.

    * * MimeBodyParts may be added later. + * + * @param subtype subtype. */ public BMMimeMultipart(String subtype) { super(subtype); @@ -142,7 +144,9 @@ public class BMMimeMultipart extends MimeMultipart { * skips the 'preamble' and reads bytes till the terminating * boundary and creates MimeBodyParts for each part of the stream. * - * @param ds DataSource, can be a MultipartDataSource + * @param ds DataSource, can be a MultipartDataSource. + * @param ct content type. + * @exception MessagingException in case of error. */ public BMMimeMultipart(DataSource ds, ContentType ct) throws MessagingException { @@ -197,6 +201,7 @@ public class BMMimeMultipart extends MimeMultipart { * * @since JavaMail 1.2 */ + @Override protected void parse() throws MessagingException { if (parsed) return; @@ -694,6 +699,7 @@ public class BMMimeMultipart extends MimeMultipart { * separated by a boundary. */ + @Override public void writeTo(OutputStream os) throws IOException, MessagingException { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java index 448cb04777c..eab91196564 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentDisposition.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +100,7 @@ public class ContentDisposition { /** * Return the specified parameter value. Returns null * if this parameter is absent. + * @param name parameter name. * @return parameter value * @since JavaMail 1.2 */ @@ -123,7 +124,7 @@ public class ContentDisposition { /** * Set the primary type. Overrides existing primary type. - * @param primaryType primary type + * @param disposition disposition value * @since JavaMail 1.2 */ public void setDisposition(String disposition) { @@ -162,6 +163,7 @@ public class ContentDisposition { * @return RFC2045 style string * @since JavaMail 1.2 */ + @Override public String toString() { if (disposition == null) return null; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java index 4cbbae3e33d..1fc677d68d9 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/ContentType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +136,7 @@ public final class ContentType { /** * Return the specified parameter value. Returns null * if this parameter is absent. + * @param name parameter name * @return parameter value */ public String getParameter(String name) { @@ -200,6 +201,7 @@ public final class ContentType { * * @return RFC2045 style string */ + @Override public String toString() { if (primaryType == null || subType == null) // need both return null; @@ -218,7 +220,7 @@ public final class ContentType { /** * Match with the specified ContentType object. This method * compares only the primaryType and - * subType . The parameters of both operands + * primaryType . The parameters of both operands * are ignored.

    * * For example, this method will return true when @@ -232,6 +234,8 @@ public final class ContentType { * and "text/*" * * @param cType to compare this against + * @return true if primaryType and subType + * match specified content type. */ public boolean match(ContentType cType) { // Match primaryType @@ -266,6 +270,10 @@ public final class ContentType { * For example, this method will return true when * comparing the ContentType for "text/plain" * with "text/*" + * + * @param s content type + * @return true if primaryType and subType + * match specified content type. */ public boolean match(String s) { try { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java index 4620bb0d484..0d9ee4ed3a5 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/HeaderTokenizer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,14 +95,15 @@ public class HeaderTokenizer { * one of the following: *

      *
    • ATOM A sequence of ASCII characters - * delimited by either SPACE, CTL, "(", <"> or the - * specified SPECIALS + * delimited by either SPACE, CTL, "(", <"> or the + * specified SPECIALS
    • *
    • QUOTEDSTRING A sequence of ASCII characters - * within quotes + * within quotes
    • *
    • COMMENT A sequence of ASCII characters - * within "(" and ")". - *
    • EOF End of header + * within "(" and ")".
    • + *
    • EOF End of header
    • *
    + * @return type */ public int getType() { return type; @@ -176,6 +177,7 @@ public class HeaderTokenizer { * Constructor. The RFC822 defined delimiters - RFC822 - are * used to delimit ATOMS. Also comments are skipped and not * returned as tokens + * @param header The header that is tokenized. */ public HeaderTokenizer(String header) { this(header, RFC822); @@ -317,7 +319,7 @@ public class HeaderTokenizer { currentPos++; // re-position currentPos char ch[] = new char[1]; ch[0] = c; - return new Token((int)c, new String(ch)); + return new Token(c, new String(ch)); } // Check for ATOM diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java index bf39ee7540b..84616c89b96 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/InternetHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +48,12 @@ import java.util.NoSuchElementException; * until the blank line that indicates end of header. The input stream * is positioned at the start of the body. The lines are stored * within the object and can be extracted as either Strings or - * {@link Header} objects.

    - *

    + * {@link Header} objects. + *

    * This class is mostly intended for service providers. MimeMessage - * and MimeBody use this class for holding their headers.

    - *

    - *


    A note on RFC822 and MIME headers

    - *

    + * and MimeBody use this class for holding their headers. + *


    A note on RFC822 and MIME headers + *

    * RFC822 and MIME header fields must contain only * US-ASCII characters. If a header contains non US-ASCII characters, * it must be encoded as per the rules in RFC 2047. The MimeUtility @@ -65,7 +64,7 @@ import java.util.NoSuchElementException; * header fields must be folded (wrapped) before being sent if they * exceed the line length limitation for the transport (1000 bytes for * SMTP). Received headers may have been folded. The application is - * responsible for folding and unfolding headers as appropriate.

    + * responsible for folding and unfolding headers as appropriate. * * @author John Mani * @author Bill Shannon @@ -90,12 +89,13 @@ public final class InternetHeaders { * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. The input * stream is left positioned at the start of the body. The - * header lines are stored internally.

    - *

    + * header lines are stored internally. + *

    * For efficiency, wrap a BufferedInputStream around the actual * input stream and pass it as the parameter. * * @param is RFC822 input stream + * @exception MessagingException in case of error */ public InternetHeaders(InputStream is) throws MessagingException { load(is); @@ -104,13 +104,14 @@ public final class InternetHeaders { /** * Read and parse the given RFC822 message stream till the * blank line separating the header from the body. Store the - * header lines inside this InternetHeaders object.

    - *

    + * header lines inside this InternetHeaders object. + *

    * Note that the header lines are added into this InternetHeaders * object, so any existing headers in this object will not be * affected. * * @param is RFC822 input stream + * @exception MessagingException in case of error */ public void load(InputStream is) throws MessagingException { // Read header lines until a blank line. It is valid @@ -208,9 +209,9 @@ public final class InternetHeaders { /** * Change the first header line that matches name * to have value, adding a new header if no existing header - * matches. Remove all matching headers but the first.

    - *

    - * Note that RFC822 headers can only contain US-ASCII characters + * matches. Remove all matching headers but the first. + *

    + * Note that RFC822 headers can only contain US-ASCII characters. * * @param name header name * @param value header value @@ -242,8 +243,7 @@ public final class InternetHeaders { } /** - * Add a header with the specified name and value to the header list.

    - *

    + * Add a header with the specified name and value to the header list. * Note that RFC822 headers can only contain US-ASCII characters. * * @param name header name @@ -285,15 +285,15 @@ public final class InternetHeaders { * * @return Header objects */ - public List getAllHeaders() { + public FinalArrayList getAllHeaders() { return headers; // conceptually it should be read-only, but for performance reason I'm not wrapping it here } /** * Add an RFC822 header line to the header store. * If the line starts with a space or tab (a continuation line), - * add it to the last header line in the list.

    - *

    + * add it to the last header line in the list. + *

    * Note that RFC822 headers can only contain US-ASCII characters * * @param line raw RFC822 header line @@ -316,15 +316,19 @@ public final class InternetHeaders { /** * Return all the header lines as a collection + * + * @return list of header lines. */ public List getAllHeaderLines() { if(headerValueView==null) headerValueView = new AbstractList() { - public String get(int index) { + @Override + public String get(int index) { return headers.get(index).line; } - public int size() { + @Override + public int size() { return headers.size(); } }; @@ -368,6 +372,7 @@ class hdr implements Header { /* * Return the "name" part of the header line. */ + @Override public String getName() { return name; } @@ -375,6 +380,7 @@ class hdr implements Header { /* * Return the "value" part of the header line. */ + @Override public String getValue() { int i = line.indexOf(':'); if (i < 0) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java index 6642dfa19ce..8aa7fe3f864 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeBodyPart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package com.sun.xml.internal.messaging.saaj.packaging.mime.internet; -import com.sun.xml.internal.messaging.saaj.packaging.mime.Header; import com.sun.xml.internal.messaging.saaj.packaging.mime.MessagingException; import com.sun.xml.internal.messaging.saaj.packaging.mime.util.OutputUtil; import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; @@ -52,12 +51,12 @@ import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart; /** * This class represents a MIME body part. * MimeBodyParts are contained in MimeMultipart - * objects.

    - * + * objects. + *

    * MimeBodyPart uses the InternetHeaders class to parse - * and store the headers of that body part.

    + * and store the headers of that body part. * - *


    A note on RFC 822 and MIME headers

    + *


    A note on RFC 822 and MIME headers * * RFC 822 header fields must contain only * US-ASCII characters. MIME allows non ASCII characters to be present @@ -70,7 +69,7 @@ import com.sun.xml.internal.org.jvnet.mimepull.MIMEPart; * header fields must be folded (wrapped) before being sent if they * exceed the line length limitation for the transport (1000 bytes for * SMTP). Received headers may have been folded. The application is - * responsible for folding and unfolding headers as appropriate.

    + * responsible for folding and unfolding headers as appropriate. * * @author John Mani * @author Bill Shannon @@ -179,6 +178,8 @@ public final class MimeBodyPart { * the delimiter strings. * * @param is the body part Input Stream + * + * @exception MessagingException in case of error */ public MimeBodyPart(InputStream is) throws MessagingException { if (!(is instanceof ByteArrayInputStream) && @@ -216,6 +217,7 @@ public final class MimeBodyPart { * * @param headers The header of this part * @param content bytes representing the body of this part. + * @param len content length. */ public MimeBodyPart(InternetHeaders headers, byte[] content, int len) { this.headers = headers; @@ -242,6 +244,7 @@ public final class MimeBodyPart { /** * Return the containing MimeMultipart object, * or null if not known. + * @return parent part. */ public MimeMultipart getParent() { return parent; @@ -253,6 +256,7 @@ public final class MimeBodyPart { * addBodyPart method. parent may be * null if the MimeBodyPart is being removed * from its containing MimeMultipart. + * @param parent parent part * @since JavaMail 1.1 */ public void setParent(MimeMultipart parent) { @@ -351,6 +355,9 @@ public final class MimeBodyPart { * If the subType of mimeType is the * special character '*', then the subtype is ignored during the * comparison. + * + * @param mimeType string + * @return true if it is valid mime type */ public boolean isMimeType(String mimeType) { boolean result; @@ -375,6 +382,9 @@ public final class MimeBodyPart { * This implementation uses getHeader(name) * to obtain the requisite header field. * + * @return content disposition + * @exception MessagingException in case of error + * * @see #headers */ public String getDisposition() throws MessagingException { @@ -392,6 +402,9 @@ public final class MimeBodyPart { * If the disposition is null, any existing "Content-Disposition" * header field is removed. * + * @param disposition value + * + * @exception MessagingException in case of error * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. */ @@ -423,6 +436,9 @@ public final class MimeBodyPart { * This implementation uses getHeader(name) * to obtain the requisite header field. * + * @return encoding + * @exception MessagingException in case of error + * * @see #headers */ public String getEncoding() throws MessagingException { @@ -465,6 +481,8 @@ public final class MimeBodyPart { * * This implementation uses getHeader(name) * to obtain the requisite header field. + * + * @return conent id */ public String getContentID() { return getHeader("Content-ID", null); @@ -475,6 +493,7 @@ public final class MimeBodyPart { * If the cid parameter is null, any existing * "Content-ID" is removed. * + * @param cid content id * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. * @since JavaMail 1.3 @@ -493,6 +512,8 @@ public final class MimeBodyPart { * * This implementation uses getHeader(name) * to obtain the requisite header field. + * + * @return content MD5 sum */ public String getContentMD5() { return getHeader("Content-MD5", null); @@ -501,6 +522,8 @@ public final class MimeBodyPart { /** * Set the "Content-MD5" header field of this body part. * + * @param md5 content md5 sum + * * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. */ @@ -516,6 +539,9 @@ public final class MimeBodyPart { * * This implementation uses getHeader(name) * to obtain the requisite header field. + * + * @return array of language tags + * @exception MessagingException in case of error */ public String[] getContentLanguage() throws MessagingException { String s = getHeader("Content-Language", null); @@ -663,6 +689,7 @@ public final class MimeBodyPart { * Returns null if both are absent. * * @return filename + * @exception MessagingException in case of error */ public String getFileName() throws MessagingException { String filename = null; @@ -692,6 +719,9 @@ public final class MimeBodyPart { * Sets the "filename" parameter of the "Content-Disposition" * header field of this body part. * + * @param filename filename + * + * @exception MessagingException in case of error * @exception IllegalStateException if this body part is * obtained from a READ_ONLY folder. */ @@ -769,9 +799,14 @@ public final class MimeBodyPart { * This implementation simply calls the getContentStream * method. * + * @return input stream + * + * @exception MessagingException in case of error + * * @see #getInputStream * @see #getContentStream * @since JavaMail 1.2 + * */ public InputStream getRawInputStream() throws MessagingException { return getContentStream(); @@ -782,24 +817,30 @@ public final class MimeBodyPart { * * The implementation provided here works just like the * the implementation in MimeMessage. + * + * @return data handler */ public DataHandler getDataHandler() { if (mimePart != null) { //return an inputstream return new DataHandler(new DataSource() { + @Override public InputStream getInputStream() throws IOException { return mimePart.read(); } + @Override public OutputStream getOutputStream() throws IOException { throw new UnsupportedOperationException("getOutputStream cannot be supported : You have enabled LazyAttachments Option"); } + @Override public String getContentType() { return mimePart.getContentType(); } + @Override public String getName() { return "MIMEPart Wrapped DataSource"; } @@ -890,6 +931,8 @@ public final class MimeBodyPart { * If the charset is already known, use the * setText() version that takes the charset parameter. * + * @param text string + * * @see #setText(String text, String charset) */ public void setText(String text) { @@ -902,6 +945,9 @@ public final class MimeBodyPart { * charset. The given Unicode string will be charset-encoded * using the specified charset. The charset is also used to set * the "charset" parameter. + * + * @param text string + * @param charset character set */ public void setText(String text, String charset) { if (charset == null) { @@ -932,7 +978,9 @@ public final class MimeBodyPart { /** * Output the body part as an RFC 822 format stream. * - * @exception MessagingException + * @param os output stream + * + * @exception MessagingException in case of error * @exception IOException if an error occurs writing to the * stream or if an error is generated * by the javax.activation layer. @@ -1033,6 +1081,8 @@ public final class MimeBodyPart { /** * Remove all headers with this name. + * + * @param name header name */ public void removeHeader(String name) { headers.removeHeader(name); @@ -1041,14 +1091,18 @@ public final class MimeBodyPart { /** * Return all the headers from this Message as an Enumeration of * Header objects. + * + * @return all headers */ - public List getAllHeaders() { + public FinalArrayList getAllHeaders() { return headers.getAllHeaders(); } /** * Add a header line to this body part + * + * @param line header line to add */ public void addHeaderLine(String line) { headers.addHeaderLine(line); @@ -1075,6 +1129,8 @@ public final class MimeBodyPart { *
    * In both cases this method is typically called by the * Message.saveChanges method. + * + * @exception MessagingException in case of error. */ protected void updateHeaders() throws MessagingException { DataHandler dh = getDataHandler(); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java index c9bc1170f0f..6c5bf210d13 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,6 +133,7 @@ public class MimeMultipart { * contentType field.

    * * MimeBodyParts may be added later. + * @param subtype subtype. */ public MimeMultipart(String subtype) { //super(); @@ -163,6 +164,8 @@ public class MimeMultipart { * This must be the same information as {@link DataSource#getContentType()}. * All the callers of this method seem to have this object handy, so * for performance reason this method accepts it. Can be null. + * + * @exception MessagingException in case of error */ public MimeMultipart(DataSource ds, ContentType ct) throws MessagingException { // 'ds' was not a MultipartDataSource, we have @@ -189,7 +192,8 @@ public class MimeMultipart { /** * Return the number of enclosed MimeBodyPart objects. * - * @return number of parts + * @return number of parts. + * @throws MessagingException in case of error. */ public int getCount() throws MessagingException { parse(); @@ -202,8 +206,8 @@ public class MimeMultipart { /** * Get the specified MimeBodyPart. BodyParts are numbered starting at 0. * - * @param index the index of the desired MimeBodyPart - * @return the MimeBodyPart + * @param index the index of the desired MimeBodyPart. + * @return the MimeBodyPart. * @exception MessagingException if no such MimeBodyPart exists */ public MimeBodyPart getBodyPart(int index) @@ -221,6 +225,7 @@ public class MimeMultipart { * * @param CID the ContentID of the desired part * @return the MimeBodyPart + * @exception MessagingException if no such MimeBodyPart exists. */ public MimeBodyPart getBodyPart(String CID) throws MessagingException { @@ -256,6 +261,8 @@ public class MimeMultipart { * expensive for a specific MimeMultipart subclass, then it * might itself want to track whether its internal state actually * did change, and do the header updating only if necessary. + * + * @exception MessagingException in case of error. */ protected void updateHeaders() throws MessagingException { for (int i = 0; i < parts.size(); i++) @@ -265,6 +272,11 @@ public class MimeMultipart { /** * Iterates through all the parts and outputs each Mime part * separated by a boundary. + * + * @param os output stream. + * + * @exception IOException if an I/O Error occurs. + * @exception MessagingException in case of error. */ public void writeTo(OutputStream os) throws IOException, MessagingException { @@ -291,6 +303,8 @@ public class MimeMultipart { * method is called by all other methods that need data for * the body parts, to make sure the data has been parsed. * + * @exception MessagingException in case of error. + * * @since JavaMail 1.2 */ protected void parse() throws MessagingException { @@ -490,8 +504,9 @@ public class MimeMultipart { * necessary. This implementation simply constructs and returns * an InternetHeaders object. * - * @param is the InputStream to read the headers from - * @exception MessagingException + * @param is the InputStream to read the headers from. + * @return headers. + * @exception MessagingException in case of error. * @since JavaMail 1.2 */ protected InternetHeaders createInternetHeaders(InputStream is) @@ -506,8 +521,10 @@ public class MimeMultipart { * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * - * @param headers the headers for the body part - * @param content the content of the body part + * @param headers the headers for the body part. + * @param content the content of the body part. + * @param len the content length. + * @return MimeBodyPart * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) { @@ -521,8 +538,9 @@ public class MimeMultipart { * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * - * @param is InputStream containing the body part - * @exception MessagingException + * @param is InputStream containing the body part. + * @return MimeBodyPart. + * @exception MessagingException in case of error. * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException { @@ -543,8 +561,8 @@ public class MimeMultipart { * a specific multipart subtype. * * @param mp MimeMultipart datasource + * @exception MessagingException in case of error. */ - protected void setMultipartDataSource(MultipartDataSource mp) throws MessagingException { contentType = new ContentType(mp.getContentType()); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java index 8d08e39e1eb..eb7b46c5656 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimePartDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +50,8 @@ public final class MimePartDataSource implements DataSource { /** * Constructor, that constructs a DataSource from a MimeBodyPart. + * + * @param part body part */ public MimePartDataSource(MimeBodyPart part) { this.part = part; @@ -68,6 +70,7 @@ public final class MimePartDataSource implements DataSource { * * @return decoded input stream */ + @Override public InputStream getInputStream() throws IOException { try { @@ -88,7 +91,8 @@ public final class MimePartDataSource implements DataSource { * * This implementation throws the UnknownServiceException. */ - public OutputStream getOutputStream() throws IOException { + @Override + public OutputStream getOutputStream() throws IOException { throw new UnknownServiceException(); } @@ -98,6 +102,7 @@ public final class MimePartDataSource implements DataSource { * This implementation just invokes the getContentType * method on the MimeBodyPart. */ + @Override public String getContentType() { return part.getContentType(); } @@ -107,7 +112,8 @@ public final class MimePartDataSource implements DataSource { * * This implementation just returns an empty string. */ - public String getName() { + @Override + public String getName() { try { return part.getFileName(); } catch (MessagingException mex) { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java index 45f6cea11c1..87bdd6e6f5f 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +65,11 @@ import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; *

    * Note that to get the actual bytes of a mail-safe String (say, * for sending over SMTP), one must do - *

    + * 
      *
      *      byte[] bytes = string.getBytes("iso-8859-1");
      *
    - * 

    + *

    * * The setHeader and addHeader methods * on MimeMessage and MimeBodyPart assume that the given header values @@ -222,6 +222,10 @@ public class MimeUtility { * DataHandler uses a thread, a pair of pipe streams, * and the writeTo method to produce the data.

    * + * @param dh data handler + * + * @return encoding + * * @since JavaMail 1.2 */ public static String getEncoding(DataHandler dh) { @@ -294,6 +298,7 @@ public class MimeUtility { * @param is input stream * @param encoding the encoding of the stream. * @return decoded input stream. + * @exception MessagingException in case of error */ public static InputStream decode(InputStream is, String encoding) throws MessagingException { @@ -323,6 +328,7 @@ public class MimeUtility { * @param encoding the encoding of the stream. * @return output stream that applies the * specified encoding. + * @exception MessagingException in case of error */ public static OutputStream encode(OutputStream os, String encoding) throws MessagingException { @@ -358,6 +364,7 @@ public class MimeUtility { * with uuencode) * @return output stream that applies the * specified encoding. + * @exception MessagingException in case of error * @since JavaMail 1.2 */ public static OutputStream encode(OutputStream os, String encoding, @@ -397,7 +404,7 @@ public class MimeUtility { * "unstructured" RFC 822 headers.

    * * Example of usage: - *

    +     * 
          *
          *  MimeBodyPart part = ...
          *  String rawvalue = "FooBar Mailer, Japanese version 1.1"
    @@ -411,7 +418,7 @@ public class MimeUtility {
          *   // setHeader() failure
          *  }
          *
    -     * 

    + *

    * * @param text unicode string * @return Unicode string containing only US-ASCII characters @@ -446,6 +453,7 @@ public class MimeUtility { * encoded are in the ASCII charset, otherwise "B" encoding * is used. * @return Unicode string containing only US-ASCII characters + * @exception UnsupportedEncodingException in case of unsupported encoding */ public static String encodeText(String text, String charset, String encoding) @@ -464,7 +472,7 @@ public class MimeUtility { * returned as-is

    * * Example of usage: - *

    +     * 
          *
          *  MimeBodyPart part = ...
          *  String rawvalue = null;
    @@ -479,9 +487,10 @@ public class MimeUtility {
          *
          *  return value;
          *
    -     * 

    + *

    * * @param etext the possibly encoded value + * @return decoded text * @exception UnsupportedEncodingException if the charset * conversion failed. */ @@ -568,7 +577,7 @@ public class MimeUtility { * The InternetAddress class, for example, uses this to encode * it's 'phrase' component. * - * @param text unicode string + * @param word unicode string * @return Array of Unicode strings containing only US-ASCII * characters. * @exception UnsupportedEncodingException if the encoding fails @@ -590,7 +599,7 @@ public class MimeUtility { * The resulting bytes are then returned as a Unicode string * containing only ASCII characters.

    * - * @param text unicode string + * @param word unicode string * @param charset the MIME charset * @param encoding the encoding to be used. Currently supported * values are "B" and "Q". If this parameter is null, then @@ -720,6 +729,7 @@ public class MimeUtility { * fails, an UnsupportedEncodingException is thrown.

    * * @param eword the possibly encoded value + * @return deocoded word * @exception ParseException if the string is not an * encoded-word as per RFC 2047. * @exception UnsupportedEncodingException if the charset @@ -847,8 +857,8 @@ public class MimeUtility { * @param word word to be quoted * @param specials the set of special characters * @return the possibly quoted word - * @see javax.mail.internet.HeaderTokenizer#MIME - * @see javax.mail.internet.HeaderTokenizer#RFC822 + * @see com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#MIME + * @see com.sun.xml.internal.messaging.saaj.packaging.mime.internet.HeaderTokenizer#RFC822 */ public static String quote(String word, String specials) { int len = word.length(); @@ -1111,7 +1121,8 @@ public class MimeUtility { } catch (SecurityException sex) { class NullInputStream extends InputStream { - public int read() { + @Override + public int read() { return 0; } } @@ -1277,7 +1288,7 @@ public class MimeUtility { int l = s.length(); for (int i = 0; i < l; i++) { - if (nonascii((int)s.charAt(i))) // non-ascii + if (nonascii(s.charAt(i))) // non-ascii non_ascii++; else ascii++; @@ -1444,14 +1455,17 @@ class AsciiOutputStream extends OutputStream { checkEOL = encodeEolStrict && breakOnNonAscii; } + @Override public void write(int b) throws IOException { check(b); } + @Override public void write(byte b[]) throws IOException { write(b, 0, b.length); } + @Override public void write(byte b[], int off, int len) throws IOException { len += off; for (int i = off; i < len ; i++) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java index c650b6b39cc..4619c4dcd87 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/SharedInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -73,6 +73,9 @@ public interface SharedInputStream { /** * Writes the specified region to another {@link OutputStream}. + * @param start the starting position + * @param end the ending position + 1 + * @param out output stream */ public void writeTo(long start,long end, OutputStream out); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java index 48a56e8068c..a85fc85dc67 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/ASCIIUtility.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 +43,17 @@ public class ASCIIUtility { /** * Convert the bytes within the specified range of the given byte * array into a signed integer in the given radix . The range extends - * from start till, but not including end.

    + * from start till, but not including end. + * + * Based on java.lang.Integer.parseInt(). + * + * @param b bytes to convert to integer. + * @param start start of the range. + * @param end end of the range (not including). + * @param radix radix. + * + * @return integer. * - * Based on java.lang.Integer.parseInt() */ public static int parseInt(byte[] b, int start, int end, int radix) throws NumberFormatException { @@ -110,7 +118,14 @@ public class ASCIIUtility { /** * Convert the bytes within the specified range of the given byte * array into a String. The range extends from start - * till, but not including end.

    + * till, but not including end. + * + * @param b bytes to convert to integer. + * @param start start of the range. + * @param end end of the range (not including). + * + * @return integer. + * */ public static String toString(byte[] b, int start, int end) { int size = end - start; @@ -122,6 +137,15 @@ public class ASCIIUtility { return new String(theChars); } + /** + * Encodes specified String into a sequence of bytes using the platform's + * default charset, storing the result into a new byte array. + * + * @param s string to encode into byte array. + * + * @return byte array. + * + */ public static byte[] getBytes(String s) { char [] chars= s.toCharArray(); int size = chars.length; @@ -133,6 +157,13 @@ public class ASCIIUtility { } /** + * Converts input stream to array. + * + * @param is stream to convert to array. + * + * @return byte array. + * + * @throws IOException if an I/O error occurs. * * @deprecated * this is an expensive operation that require an additional @@ -140,6 +171,7 @@ public class ASCIIUtility { * Unless you absolutely need the exact size array, don't use this. * Use {@link ByteOutputStream} and {@link ByteOutputStream#write(InputStream)}. */ + @Deprecated public static byte[] getBytes(InputStream is) throws IOException { ByteOutputStream bos = null; try { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java index 31f3e3695a6..972ccd2dba0 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64DecoderStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class BASE64DecoderStream extends FilterInputStream { * @exception IOException if an I/O error occurs. * @see java.io.FilterInputStream#in */ + @Override public int read() throws IOException { if (index >= bufsize) { decode(); // Fills up buffer @@ -94,6 +95,7 @@ public class BASE64DecoderStream extends FilterInputStream { * the stream has been reached. * @exception IOException if an I/O error occurs. */ + @Override public int read(byte[] buf, int off, int len) throws IOException { int i, c; for (i = 0; i < len; i++) { @@ -112,6 +114,7 @@ public class BASE64DecoderStream extends FilterInputStream { * Tests if this input stream supports marks. Currently this class * does not support marks */ + @Override public boolean markSupported() { return false; // Maybe later .. } @@ -122,6 +125,7 @@ public class BASE64DecoderStream extends FilterInputStream { * a close approximation in case the original encoded stream * contains embedded CRLFs; since the CRLFs are discarded, not decoded */ + @Override public int available() throws IOException { // This is only an estimate, since in.available() // might include CRLFs too .. @@ -200,6 +204,10 @@ public class BASE64DecoderStream extends FilterInputStream { * in the IMAP AUTHENTICATE protocol, but not to decode the * entire content of a MIME part. * + * @param inbuf byte array to decode + * + * @return decoded byte array + * * NOTE: inbuf may only contain valid base64 characters. * Whitespace is not ignored. */ diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java index d1c3350146b..843a334f933 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BASE64EncoderStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ public class BASE64EncoderStream extends FilterOutputStream { * @param len the number of bytes to write. * @exception IOException if an I/O error occurs. */ + @Override public void write(byte[] b, int off, int len) throws IOException { for (int i = 0; i < len; i++) write(b[off + i]); @@ -90,6 +91,7 @@ public class BASE64EncoderStream extends FilterOutputStream { * @param b the data to be written. * @exception IOException if an I/O error occurs. */ + @Override public void write(byte[] b) throws IOException { write(b, 0, b.length); } @@ -99,6 +101,7 @@ public class BASE64EncoderStream extends FilterOutputStream { * @param c the byte. * @exception IOException if an I/O error occurs. */ + @Override public void write(int c) throws IOException { buffer[bufsize++] = (byte)c; if (bufsize == 3) { // Encoding unit = 3 bytes @@ -112,6 +115,7 @@ public class BASE64EncoderStream extends FilterOutputStream { * to be encoded out to the stream. * @exception IOException if an I/O error occurs. */ + @Override public void flush() throws IOException { if (bufsize > 0) { // If there's unencoded characters in the buffer .. encode(); // .. encode them @@ -124,6 +128,7 @@ public class BASE64EncoderStream extends FilterOutputStream { * Forces any buffered output bytes to be encoded out to the stream * and closes this output stream */ + @Override public void close() throws IOException { flush(); out.close(); @@ -186,6 +191,10 @@ public class BASE64EncoderStream extends FilterOutputStream { * This method is suitable for short strings, such as those * in the IMAP AUTHENTICATE protocol, but not to encode the * entire content of a MIME part. + * + * @param inbuf byte array to encode. + * + * @return encoded byte array. */ public static byte[] encode(byte[] inbuf) { if (inbuf.length == 0) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java index ec13f9e106d..a2a23d697b5 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/BEncoderStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public class BEncoderStream extends BASE64EncoderStream { /** * Returns the length of the encoded version of this byte array. + * + * @param b byte array. + * + * @return length of the byte array. */ public static int encodedLength(byte[] b) { return ((b.length + 2)/3) * 4; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java index 50390f56d2f..1d0533f5f43 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/LineInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +64,10 @@ public final class LineInputStream extends FilterInputStream { * * This class is similar to the deprecated * DataInputStream.readLine() + * + * @return line. + * + * @throws IOException if an I/O error occurs. */ public String readLine() throws IOException { InputStream in = this.in; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java index 92bd21eaa19..88239e07c19 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/OutputUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ public abstract class OutputUtil { /** * Writes a string as ASCII string. + * + * @param s string. + * @param out output stream. + * + * @throws IOException if an I/O error occurs. */ public static void writeAsAscii(String s,OutputStream out) throws IOException { int len = s.length(); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java index 2cf6e31e7c5..272806bd591 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/QEncoderStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 QEncoderStream extends QPEncoderStream { * @param c the byte. * @exception IOException if an I/O error occurs. */ + @Override public void write(int c) throws IOException { c = c & 0xff; // Turn off the MSB. if (c == ' ') @@ -82,6 +83,11 @@ public class QEncoderStream extends QPEncoderStream { /** * Returns the length of the encoded version of this byte array. + * + * @param b byte array. + * @param encodingWord whether use word or text specials. + * + * @return length. */ public static int encodedLength(byte[] b, boolean encodingWord) { int len = 0; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java index 9cd0216291d..49d9ec7a6e8 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/util/UUEncoderStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,23 +83,29 @@ public class UUEncoderStream extends FilterOutputStream { /** * Set up the buffer name and permission mode. * This method has any effect only if it is invoked before - * you start writing into the output stream + * you start writing into the output stream. + * + * @param name name to set for the buffer. + * @param mode permission mode. */ public void setNameMode(String name, int mode) { this.name = name; this.mode = mode; } + @Override public void write(byte[] b, int off, int len) throws IOException { for (int i = 0; i < len; i++) write(b[off + i]); } + @Override public void write(byte[] data) throws IOException { write(data, 0, data.length); } - public void write(int c) throws IOException { + @Override + public void write(int c) throws IOException { /* buffer up characters till we get a line's worth, then encode * and write them out. Max number of characters allowed per * line is 45. @@ -112,6 +118,7 @@ public class UUEncoderStream extends FilterOutputStream { } } + @Override public void flush() throws IOException { if (bufsize > 0) { // If there's unencoded characters in the buffer writePrefix(); @@ -121,6 +128,7 @@ public class UUEncoderStream extends FilterOutputStream { out.flush(); } + @Override public void close() throws IOException { flush(); out.close(); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java index 607e8c36c68..50ed0edaf98 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/Envelope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,16 +41,25 @@ import javax.xml.transform.Source; public interface Envelope extends SOAPEnvelope { /** * Get the content as a JAXP Source. + * + * @return source */ Source getContent(); /** * Output the content. + * + * @param out output stream. + * @exception IOException in case of an I/O error. */ void output(OutputStream out) throws IOException; /** * Output the content. + * + * @param out output stream + * @param isFastInfoset true if it is fast infoset. + * @exception IOException in case of an I/O error. */ void output(OutputStream out, boolean isFastInfoset) throws IOException; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java index e7223cca00e..4c8fb5a78f4 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/FastInfosetDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public class FastInfosetDataContentHandler implements DataContentHandler { } /** - * return the DataFlavors for this DataContentHandler + * Return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; DataFlavor flavors[] = new DataFlavor[1]; flavors[0] = new ActivationDataFlavor( @@ -59,11 +60,13 @@ public class FastInfosetDataContentHandler implements DataContentHandler { } /** - * return the Transfer Data of type DataFlavor from InputStream - * @param df The DataFlavor. - * @param ins The InputStream corresponding to the data. + * Return the Transfer Data of type DataFlavor from InputStream + * @param flavor The DataFlavor. + * @param dataSource DataSource. * @return The constructed Object. + * @exception IOException in case of an I/O error */ + @Override public Object getTransferData(DataFlavor flavor, DataSource dataSource) throws IOException { @@ -81,6 +84,7 @@ public class FastInfosetDataContentHandler implements DataContentHandler { return null; } + @Override public Object getContent(DataSource dataSource) throws IOException { try { return FastInfosetReflection.FastInfosetSource_new( @@ -92,10 +96,11 @@ public class FastInfosetDataContentHandler implements DataContentHandler { } /** - * construct an object from a byte stream + * Construct an object from a byte stream * (similar semantically to previous method, we are deciding * which one to support) */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java index 2ac41fcbe77..48ddb7a7d6e 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/GifDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public class GifDataContentHandler extends Component implements DataContentHandl * * @return The DataFlavors */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; return new DataFlavor[] { getDF()}; } @@ -60,9 +61,11 @@ public class GifDataContentHandler extends Component implements DataContentHandl * Return the Transfer Data of type DataFlavor from InputStream. * * @param df The DataFlavor - * @param ins The InputStream corresponding to the data + * @param ds The DataSource * @return String object + * @exception IOException in case of an I/O error */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, @@ -73,6 +76,7 @@ public class GifDataContentHandler extends Component implements DataContentHandl return null; } + @Override public Object getContent(DataSource ds) throws IOException { InputStream is = ds.getInputStream(); int pos = 0; @@ -98,7 +102,11 @@ public class GifDataContentHandler extends Component implements DataContentHandl /** * Write the object to the output stream, using the specified MIME type. + * @param obj object to write + * @param type requested MIME type of the resulting byte stream + * @param os OutputStream */ + @Override public void writeTo(Object obj, String type, OutputStream os) throws IOException { if (obj != null && !(obj instanceof Image)) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java index b66cbbdfa6c..8f063f155c9 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ImageDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +67,9 @@ public class ImageDataContentHandler extends Component * * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { - return (DataFlavor[]) Arrays.copyOf(flavor, flavor.length); + return Arrays.copyOf(flavor, flavor.length); } /** @@ -80,6 +81,7 @@ public class ImageDataContentHandler extends Component * @param ds The DataSource representing the data to be converted. * @return The constructed Object. */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { for (int i=0; i < flavor.length; i++) { @@ -98,6 +100,7 @@ public class ImageDataContentHandler extends Component * @param ds The DataSource representing the data to be converted. * @return The constructed Object. */ + @Override public Object getContent(DataSource ds) throws IOException { return ImageIO.read(new BufferedInputStream(ds.getInputStream())); } @@ -107,11 +110,11 @@ public class ImageDataContentHandler extends Component * and write it to the output stream. * * @param obj The object to be converted. - * @param mimeType The requested MIME type of the resulting byte stream. + * @param type The requested MIME type of the resulting byte stream. * @param os The output stream into which to write the converted * byte stream. */ - + @Override public void writeTo(Object obj, String type, OutputStream os) throws IOException { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java index 083c1de6bf7..83cfbe55b48 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/JpegDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public class JpegDataContentHandler public static final String STR_SRC = "java.awt.Image"; /** - * return the DataFlavors for this DataContentHandler + * Return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; DataFlavor flavors[] = new DataFlavor[1]; @@ -67,11 +68,12 @@ public class JpegDataContentHandler } /** - * return the Transfer Data of type DataFlavor from InputStream - * @param df The DataFlavor. - * @param ins The InputStream corresponding to the data. + * Return the Transfer Data of type DataFlavor from InputStream + * @param df The DataFlavor + * @param ds The DataSource * @return The constructed Object. */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) { // this is sort of hacky, but will work for the @@ -98,6 +100,7 @@ public class JpegDataContentHandler /** * */ + @Override public Object getContent(DataSource ds) { // throws Exception; InputStream inputStream = null; BufferedImage jpegLoadImage = null; @@ -109,14 +112,18 @@ public class JpegDataContentHandler } catch (Exception e) { } - return (Image) jpegLoadImage; + return jpegLoadImage; } /** - * construct an object from a byte stream + * Construct an object from a byte stream * (similar semantically to previous method, we are deciding * which one to support) + * @param obj object to write + * @param mimeType requested MIME type of the resulting byte stream + * @param os OutputStream */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (!mimeType.equals("image/jpeg")) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java index 1f83ca5cfde..5cf8b7addb7 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/LazyEnvelope.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * 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,24 +38,24 @@ public interface LazyEnvelope extends Envelope { /** * Retrieve payload qname without materializing its contents - * @return - * @throws SOAPException + * @return QName + * @throws SOAPException in case of an error */ public QName getPayloadQName() throws SOAPException; /** * Retrieve payload attribute value without materializing its contents - * @param localName - * @return - * @throws SOAPException + * @param localName local name + * @return payload attribute value + * @throws SOAPException in case of an error */ public String getPayloadAttributeValue(String localName) throws SOAPException; /** * Retrieve payload attribute value without materializing its contents - * @param qName - * @return - * @throws SOAPException + * @param qName QName + * @return payload attribute value + * @throws SOAPException in case of an error */ public String getPayloadAttributeValue(QName qName) throws SOAPException; } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java index c760f4a8502..a7df70323a4 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MessageImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ public abstract class MessageImpl /** * True if this part is encoded using Fast Infoset. - * MIME -> application/fastinfoset + * MIME -> application/fastinfoset */ protected boolean isFastInfoset = false; @@ -202,6 +202,9 @@ public abstract class MessageImpl /** * Construct a new message. This will be invoked before message * sends. + * + * @param isFastInfoset whether it is fast infoset + * @param acceptFastInfoset whether to accept fast infoset */ protected MessageImpl(boolean isFastInfoset, boolean acceptFastInfoset) { this.isFastInfoset = isFastInfoset; @@ -214,6 +217,8 @@ public abstract class MessageImpl /** * Shallow copy. + * + * @param msg SoapMessage */ protected MessageImpl(SOAPMessage msg) { if (!(msg instanceof MessageImpl)) { @@ -233,14 +238,17 @@ public abstract class MessageImpl /** * @param stat * the mask value obtained from {@link #identifyContentType(ContentType)} + * @return true if SOAP 1.1 Content */ protected static boolean isSoap1_1Content(int stat) { return (stat & SOAP1_1_FLAG) != 0; } /** + * Check whether it is SOAP 1.2 content. * @param stat * the mask value obtained from {@link #identifyContentType(ContentType)} + * @return true if it is SOAP 1.2 content */ protected static boolean isSoap1_2Content(int stat) { return (stat & SOAP1_2_FLAG) != 0; @@ -298,6 +306,9 @@ public abstract class MessageImpl * Construct a message from an input stream. When messages are * received, there's two parts -- the transport headers and the * message content in a transport specific stream. + * @param headers MimeHeaders + * @param in InputStream + * @exception SOAPExceptionImpl in case of I/O error */ protected MessageImpl(MimeHeaders headers, final InputStream in) throws SOAPExceptionImpl { @@ -332,6 +343,7 @@ public abstract class MessageImpl * received, there's two parts -- the transport headers and the * message content in a transport specific stream. * + * @param headers headers * @param contentType * The parsed content type header from the headers variable. * This is redundant parameter, but it avoids reparsing this header again. @@ -339,6 +351,8 @@ public abstract class MessageImpl * The result of {@link #identifyContentType(ContentType)} over * the contentType parameter. This redundant parameter, but it avoids * recomputing this information again. + * @param in input stream + * @exception SOAPExceptionImpl in case of an error */ protected MessageImpl(MimeHeaders headers, final ContentType contentType, int stat, final InputStream in) throws SOAPExceptionImpl { init(headers, stat, contentType, in); @@ -425,18 +439,22 @@ public abstract class MessageImpl } else if ((stat & MIME_MULTIPART_FLAG) != 0) { final InputStream finalIn = in; DataSource ds = new DataSource() { + @Override public InputStream getInputStream() { return finalIn; } + @Override public OutputStream getOutputStream() { return null; } + @Override public String getContentType() { return contentType.toString(); } + @Override public String getName() { return ""; } @@ -591,10 +609,12 @@ public abstract class MessageImpl return Boolean.valueOf(lazyParsingProp.toString()); } } + @Override public Object getProperty(String property) { - return (String) properties.get(property); + return properties.get(property); } + @Override public void setProperty(String property, Object value) { verify(property, value); properties.put(property, value); @@ -722,6 +742,7 @@ public abstract class MessageImpl return "text/xml"; } + @Override public MimeHeaders getMimeHeaders() { return this.headers; } @@ -805,10 +826,12 @@ public abstract class MessageImpl saved = false; } + @Override public boolean saveRequired() { return saved != true; } + @Override public String getContentDescription() { String[] values = headers.getHeader("Content-Description"); if (values != null && values.length > 0) @@ -816,13 +839,16 @@ public abstract class MessageImpl return null; } + @Override public void setContentDescription(String description) { headers.setHeader("Content-Description", description); needsSave(); } + @Override public abstract SOAPPart getSOAPPart(); + @Override public void removeAllAttachments() { try { initializeAllAttachments(); @@ -836,6 +862,7 @@ public abstract class MessageImpl } } + @Override public int countAttachments() { try { initializeAllAttachments(); @@ -847,6 +874,7 @@ public abstract class MessageImpl return 0; } + @Override public void addAttachmentPart(AttachmentPart attachment) { try { initializeAllAttachments(); @@ -864,6 +892,7 @@ public abstract class MessageImpl static private final Iterator nullIter = Collections.EMPTY_LIST.iterator(); + @Override public Iterator getAttachments() { try { initializeAllAttachments(); @@ -897,12 +926,14 @@ public abstract class MessageImpl private MimeHeaders headers; private AttachmentPart nextAttachment; + @Override public boolean hasNext() { if (nextAttachment == null) nextAttachment = nextMatch(); return nextAttachment != null; } + @Override public AttachmentPart next() { if (nextAttachment != null) { AttachmentPart ret = nextAttachment; @@ -925,11 +956,13 @@ public abstract class MessageImpl return null; } + @Override public void remove() { iter.remove(); } } + @Override public Iterator getAttachments(MimeHeaders headers) { try { initializeAllAttachments(); @@ -942,6 +975,7 @@ public abstract class MessageImpl return new MimeMatchingIterator(headers); } + @Override public void removeAttachments(MimeHeaders headers) { try { initializeAllAttachments(); @@ -966,10 +1000,12 @@ public abstract class MessageImpl // needsSave(); } + @Override public AttachmentPart createAttachmentPart() { return new AttachmentPartImpl(); } + @Override public AttachmentPart getAttachment(SOAPElement element) throws SOAPException { try { @@ -1187,6 +1223,7 @@ public abstract class MessageImpl } } + @Override public void saveChanges() throws SOAPException { // suck in all the data from the attachments and have it @@ -1340,6 +1377,7 @@ public abstract class MessageImpl } + @Override public void writeTo(OutputStream out) throws SOAPException, IOException { if (saveRequired()){ this.optimizeAttachmentProcessing = true; @@ -1397,6 +1435,7 @@ public abstract class MessageImpl needsSave(); } + @Override public SOAPBody getSOAPBody() throws SOAPException { SOAPBody body = getSOAPPart().getEnvelope().getBody(); /*if (body == null) { @@ -1405,6 +1444,7 @@ public abstract class MessageImpl return body; } + @Override public SOAPHeader getSOAPHeader() throws SOAPException { SOAPHeader hdr = getSOAPPart().getEnvelope().getHeader(); /*if (hdr == null) { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java index fd31cd9533f..cc7696e5ee9 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/MultipartDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ public class MultipartDataContentHandler implements DataContentHandler { * * @return The DataFlavors */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; return new DataFlavor[] { myDF }; } @@ -51,9 +52,10 @@ public class MultipartDataContentHandler implements DataContentHandler { * Return the Transfer Data of type DataFlavor from InputStream. * * @param df The DataFlavor - * @param ins The InputStream corresponding to the data + * @param ds The DataSource * @return String object */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) { // use myDF.equals to be sure to get ActivationDataFlavor.equals, // which properly ignores Content-Type parameters in comparison @@ -65,7 +67,11 @@ public class MultipartDataContentHandler implements DataContentHandler { /** * Return the content. + * + * @param ds The DataSource + * @return content */ + @Override public Object getContent(DataSource ds) { try { return new MimeMultipart( @@ -78,6 +84,7 @@ public class MultipartDataContentHandler implements DataContentHandler { /** * Write the object to the output stream, using the specific MIME type. */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (obj instanceof MimeMultipart) { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java index 7dac69841a9..417cd9a9cc9 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPDocumentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,16 +29,42 @@ */ package com.sun.xml.internal.messaging.saaj.soap; -import java.util.logging.Logger; - -import com.sun.org.apache.xerces.internal.dom.DocumentImpl; -import org.w3c.dom.*; - -import com.sun.xml.internal.messaging.saaj.soap.impl.*; +import com.sun.xml.internal.messaging.saaj.soap.impl.CDATAImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.ElementFactory; +import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPCommentImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.SOAPTextImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import org.w3c.dom.Attr; +import org.w3c.dom.CDATASection; +import org.w3c.dom.Comment; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.EntityReference; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.dom.UserDataHandler; -public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.soap.SOAPElement; +import javax.xml.soap.SOAPException; +import java.text.MessageFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Logger; + +public class SOAPDocumentImpl implements SOAPDocument, javax.xml.soap.Node, Document { private static final String XMLNS = "xmlns".intern(); protected static final Logger log = @@ -47,8 +73,24 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { SOAPPartImpl enclosingSOAPPart; + private Document document; + + private Map domToSoap = new HashMap<>(); + public SOAPDocumentImpl(SOAPPartImpl enclosingDocument) { + document = createDocument(); this.enclosingSOAPPart = enclosingDocument; + register(this); + } + + private Document createDocument() { + DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader()); + try { + final DocumentBuilder documentBuilder = docFactory.newDocumentBuilder(); + return documentBuilder.newDocument(); + } catch (ParserConfigurationException e) { + throw new RuntimeException("Error creating xml document", e); + } } // public SOAPDocumentImpl(boolean grammarAccess) { @@ -81,7 +123,7 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { } public DOMImplementation getImplementation() { - return super.getImplementation(); + return document.getImplementation(); } public Element getDocumentElement() { @@ -91,7 +133,7 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { } protected Element doGetDocumentElement() { - return super.getDocumentElement(); + return document.getDocumentElement(); } public Element createElement(String tagName) throws DOMException { @@ -103,7 +145,7 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { } public DocumentFragment createDocumentFragment() { - return new SOAPDocumentFragment(this); + return document.createDocumentFragment(); } public org.w3c.dom.Text createTextNode(String data) { @@ -139,7 +181,7 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { } } - return super.createAttribute(name); + return document.createAttribute(name); } public EntityReference createEntityReference(String name) @@ -149,12 +191,15 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { } public NodeList getElementsByTagName(String tagname) { - return super.getElementsByTagName(tagname); + return document.getElementsByTagName(tagname); } public org.w3c.dom.Node importNode(Node importedNode, boolean deep) throws DOMException { - return super.importNode(importedNode, deep); + final Node node = document.importNode(getDomNode(importedNode), deep); + return node instanceof Element ? + ElementFactory.createElement(this, (Element) node) + : node; } public Element createElementNS(String namespaceURI, String qualifiedName) @@ -168,26 +213,386 @@ public class SOAPDocumentImpl extends DocumentImpl implements SOAPDocument { public Attr createAttributeNS(String namespaceURI, String qualifiedName) throws DOMException { - return super.createAttributeNS(namespaceURI, qualifiedName); + return document.createAttributeNS(namespaceURI, qualifiedName); } public NodeList getElementsByTagNameNS( String namespaceURI, String localName) { - return super.getElementsByTagNameNS(namespaceURI, localName); + return document.getElementsByTagNameNS(namespaceURI, localName); } public Element getElementById(String elementId) { - return super.getElementById(elementId); + return document.getElementById(elementId); } + @Override + public String getInputEncoding() { + return document.getInputEncoding(); + } + + @Override + public String getXmlEncoding() { + return document.getXmlEncoding(); + } + + @Override + public boolean getXmlStandalone() { + return document.getXmlStandalone(); + } + + @Override + public void setXmlStandalone(boolean xmlStandalone) throws DOMException { + document.setXmlStandalone(xmlStandalone); + } + + @Override + public String getXmlVersion() { + return document.getXmlVersion(); + } + + @Override + public void setXmlVersion(String xmlVersion) throws DOMException { + document.setXmlVersion(xmlVersion); + } + + @Override + public boolean getStrictErrorChecking() { + return document.getStrictErrorChecking(); + } + + @Override + public void setStrictErrorChecking(boolean strictErrorChecking) { + document.setStrictErrorChecking(strictErrorChecking); + } + + @Override + public String getDocumentURI() { + return document.getDocumentURI(); + } + + @Override + public void setDocumentURI(String documentURI) { + document.setDocumentURI(documentURI); + } + + @Override + public Node adoptNode(Node source) throws DOMException { + return document.adoptNode(source); + } + + @Override + public DOMConfiguration getDomConfig() { + return document.getDomConfig(); + } + + @Override + public void normalizeDocument() { + document.normalizeDocument(); + } + + @Override + public Node renameNode(Node n, String namespaceURI, String qualifiedName) throws DOMException { + return document.renameNode(n, namespaceURI, qualifiedName); + } + + @Override + public String getNodeName() { + return document.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return document.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + document.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return document.getNodeType(); + } + + @Override + public Node getParentNode() { + return document.getParentNode(); + } + + @Override + public NodeList getChildNodes() { + return document.getChildNodes(); + } + + @Override + public Node getFirstChild() { + return document.getFirstChild(); + } + + @Override + public Node getLastChild() { + return document.getLastChild(); + } + + @Override + public Node getPreviousSibling() { + return document.getPreviousSibling(); + } + + @Override + public Node getNextSibling() { + return document.getNextSibling(); + } + + @Override + public NamedNodeMap getAttributes() { + return document.getAttributes(); + } + + @Override + public Document getOwnerDocument() { + return document.getOwnerDocument(); + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return document.insertBefore(getDomNode(newChild), getDomNode(refChild)); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return document.replaceChild(getDomNode(newChild), getDomNode(oldChild)); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return document.removeChild(getDomNode(oldChild)); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return document.appendChild(getDomNode(newChild)); + } + + @Override + public boolean hasChildNodes() { + return document.hasChildNodes(); + } + + @Override public Node cloneNode(boolean deep) { - SOAPPartImpl newSoapPart = getSOAPPart().doCloneNode(); - super.cloneNode(newSoapPart.getDocument(), deep); - return newSoapPart; + return document.cloneNode(deep); } - public void cloneNode(SOAPDocumentImpl newdoc, boolean deep) { - super.cloneNode(newdoc, deep); + @Override + public void normalize() { + document.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return document.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return document.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return document.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + document.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return document.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return document.hasAttributes(); + } + + @Override + public String getBaseURI() { + return document.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return document.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return document.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + document.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return document.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return document.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return document.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return document.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return document.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return document.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return document.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return document.getUserData(key); + } + + public Document getDomDocument() { + return document; + } + + /** + * Insert a mapping information for {@link org.w3c.dom.Node} - {@link javax.xml.soap.Node}. + * + * In SAAJ, elements in DOM are expected to be interfaces of SAAJ, on the other hand in JDKs Xerces, + * they are casted to internal impl classes. After removal of SAAJ dependency + * to JDKs internal classes elements in DOM can never be both of them. + * + * @param node SAAJ wrapper node for w3c DOM node + */ + public void register(javax.xml.soap.Node node) { + final Node domElement = getDomNode(node); + if (domToSoap.containsKey(domElement)) { + throw new IllegalStateException("Element " + domElement.getNodeName() + + " is already registered"); + } + domToSoap.put(domElement, node); + } + + /** + * Find a soap wrapper for w3c dom node. + * + * @param node w3c dom node nullable + * @return soap wrapper for w3c dom node + * + * @throws + */ + public javax.xml.soap.Node find(Node node) { + return find(node, true); + } + + private javax.xml.soap.Node find(Node node, boolean required) { + if (node == null) { + return null; + } + if (node instanceof javax.xml.soap.Node) { + return (javax.xml.soap.Node) node; + } + final javax.xml.soap.Node found = domToSoap.get(node); + if (found == null && required) { + throw new IllegalArgumentException(MessageFormat.format("Cannot find SOAP wrapper for element {0}", node)); + } + return found; + } + + /** + * If corresponding soap wrapper exists for w3c dom node it is returned, + * if not passed dom element is returned. + * + * @param node w3c dom node + * @return soap wrapper or passed w3c dom node if not found + */ + public Node findIfPresent(Node node) { + final javax.xml.soap.Node found = find(node, false); + return found != null ? found : node; + } + + /** + * Extracts w3c dom node from corresponding soap wrapper. + * + * @param node soap or dom nullable + * @return dom node + */ + public Node getDomNode(Node node) { + if (node instanceof SOAPDocumentImpl) { + return ((SOAPDocumentImpl)node).getDomElement(); + } else if (node instanceof ElementImpl) { + return ((ElementImpl) node).getDomElement(); + } else if (node instanceof SOAPTextImpl) { + return ((SOAPTextImpl)node).getDomElement(); + } else if (node instanceof SOAPCommentImpl) { + return ((SOAPCommentImpl)node).getDomElement(); + } else if (node instanceof CDATAImpl) { + return ((CDATAImpl) node).getDomElement(); + } + return node; + } + + public Document getDomElement() { + return document; + } + + @Override + public String getValue() { + throw new UnsupportedOperationException(); + } + + @Override + public void setValue(String value) { + throw new UnsupportedOperationException(); + } + + @Override + public void setParentElement(SOAPElement parent) throws SOAPException { + throw new UnsupportedOperationException(); + } + + @Override + public SOAPElement getParentElement() { + throw new UnsupportedOperationException(); + } + + @Override + public void detachNode() { + throw new UnsupportedOperationException(); + } + + @Override + public void recycleNode() { + throw new UnsupportedOperationException(); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java index 19cc1b4ec30..49abddb9f94 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPPartImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,29 +25,56 @@ package com.sun.xml.internal.messaging.saaj.soap; -import java.io.*; -import java.util.Iterator; -import java.util.logging.Logger; -import java.util.logging.Level; - -import javax.activation.DataHandler; -import javax.activation.DataSource; -import javax.xml.soap.*; -import javax.xml.transform.Source; -import javax.xml.transform.stream.StreamSource; - -import org.w3c.dom.*; - -import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart; - import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; +import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeBodyPart; import com.sun.xml.internal.messaging.saaj.soap.impl.ElementImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; -import com.sun.xml.internal.messaging.saaj.util.*; +import com.sun.xml.internal.messaging.saaj.util.ByteInputStream; +import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream; +import com.sun.xml.internal.messaging.saaj.util.FastInfosetReflection; +import com.sun.xml.internal.messaging.saaj.util.JAXMStreamSource; +import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import com.sun.xml.internal.messaging.saaj.util.MimeHeadersUtil; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import com.sun.xml.internal.messaging.saaj.util.XMLDeclarationParser; +import org.w3c.dom.Attr; +import org.w3c.dom.CDATASection; +import org.w3c.dom.Comment; +import org.w3c.dom.DOMConfiguration; +import org.w3c.dom.DOMException; +import org.w3c.dom.DOMImplementation; +import org.w3c.dom.Document; +import org.w3c.dom.DocumentFragment; +import org.w3c.dom.DocumentType; +import org.w3c.dom.Element; +import org.w3c.dom.EntityReference; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.NodeList; +import org.w3c.dom.ProcessingInstruction; +import org.w3c.dom.UserDataHandler; +import javax.activation.DataHandler; +import javax.activation.DataSource; +import javax.xml.soap.MimeHeaders; +import javax.xml.soap.SOAPElement; +import javax.xml.soap.SOAPEnvelope; +import javax.xml.soap.SOAPException; +import javax.xml.soap.SOAPPart; +import javax.xml.transform.Source; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamSource; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.PushbackReader; +import java.io.Reader; +import java.io.UnsupportedEncodingException; +import java.util.Iterator; +import java.util.logging.Level; +import java.util.logging.Logger; /** * SOAPPartImpl is the first attachment. This contains the XML/SOAP document. @@ -128,20 +155,21 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { envelope = createEnvelopeFromSource(); } else { envelope = createEmptyEnvelope(null); - document.insertBefore(envelope, null); + document.insertBefore(((EnvelopeImpl) envelope).getDomElement(), null); } return envelope; } protected void lookForEnvelope() throws SOAPException { Element envelopeChildElement = document.doGetDocumentElement(); - if (envelopeChildElement == null || envelopeChildElement instanceof Envelope) { - envelope = (EnvelopeImpl) envelopeChildElement; - } else if (!(envelopeChildElement instanceof ElementImpl)) { + org.w3c.dom.Node soapEnvelope = document.findIfPresent(envelopeChildElement); + if (soapEnvelope == null || soapEnvelope instanceof Envelope) { + envelope = (EnvelopeImpl) soapEnvelope; + } else if (document.find(envelopeChildElement) == null) { log.severe("SAAJ0512.soap.incorrect.factory.used"); throw new SOAPExceptionImpl("Unable to create envelope: incorrect factory used during tree construction"); } else { - ElementImpl soapElement = (ElementImpl) envelopeChildElement; + ElementImpl soapElement = (ElementImpl) document.find(envelopeChildElement); if (soapElement.getLocalName().equalsIgnoreCase("Envelope")) { String prefix = soapElement.getPrefix(); String uri = (prefix == null) ? soapElement.getNamespaceURI() : soapElement.getNamespaceURI(prefix); @@ -498,7 +526,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public NamedNodeMap getAttributes() { - return document.getAttributes(); + return document.getDomDocument().getAttributes(); } public NodeList getChildNodes() { @@ -517,11 +545,11 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public String getLocalName() { - return document.getLocalName(); + return document.getDomDocument().getLocalName(); } public String getNamespaceURI() { - return document.getNamespaceURI(); + return document.getDomDocument().getNamespaceURI(); } public org.w3c.dom.Node getNextSibling() { @@ -530,11 +558,11 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public String getNodeName() { - return document.getNodeName(); + return document.getDomDocument().getNodeName(); } public short getNodeType() { - return document.getNodeType(); + return document.getDomDocument().getNodeType(); } public String getNodeValue() throws DOMException { @@ -542,23 +570,23 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public Document getOwnerDocument() { - return document.getOwnerDocument(); + return document.getDomDocument().getOwnerDocument(); } public org.w3c.dom.Node getParentNode() { - return document.getParentNode(); + return document.getDomDocument().getParentNode(); } public String getPrefix() { - return document.getPrefix(); + return document.getDomDocument().getPrefix(); } public org.w3c.dom.Node getPreviousSibling() { - return document.getPreviousSibling(); + return document.getDomDocument().getPreviousSibling(); } public boolean hasAttributes() { - return document.hasAttributes(); + return document.getDomDocument().hasAttributes(); } public boolean hasChildNodes() { @@ -575,7 +603,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public boolean isSupported(String arg0, String arg1) { - return document.isSupported(arg0, arg1); + return document.getDomDocument().isSupported(arg0, arg1); } public void normalize() { @@ -686,7 +714,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public DOMConfiguration getDomConfig() { - return document.getDomConfig(); + return document.getDomDocument().getDomConfig(); } public org.w3c.dom.Node adoptNode(org.w3c.dom.Node source) throws DOMException { @@ -699,7 +727,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public String getDocumentURI() { - return document.getDocumentURI(); + return document.getDomDocument().getDocumentURI(); } public void setStrictErrorChecking(boolean strictErrorChecking) { @@ -707,15 +735,15 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public String getInputEncoding() { - return document.getInputEncoding(); + return document.getDomDocument().getInputEncoding(); } public String getXmlEncoding() { - return document.getXmlEncoding(); + return document.getDomDocument().getXmlEncoding(); } public boolean getXmlStandalone() { - return document.getXmlStandalone(); + return document.getDomDocument().getXmlStandalone(); } public void setXmlStandalone(boolean xmlStandalone) throws DOMException { @@ -723,7 +751,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public String getXmlVersion() { - return document.getXmlVersion(); + return document.getDomDocument().getXmlVersion(); } public void setXmlVersion(String xmlVersion) throws DOMException { @@ -731,12 +759,12 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public boolean getStrictErrorChecking() { - return document.getStrictErrorChecking(); + return document.getDomDocument().getStrictErrorChecking(); } // DOM L3 methods from org.w3c.dom.Node public String getBaseURI() { - return document.getBaseURI(); + return document.getDomDocument().getBaseURI(); } public short compareDocumentPosition(org.w3c.dom.Node other) @@ -758,7 +786,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public String lookupPrefix(String namespaceURI) { - return document.lookupPrefix(namespaceURI); + return document.getDomDocument().lookupPrefix(namespaceURI); } public boolean isDefaultNamespace(String namespaceURI) { @@ -770,7 +798,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public boolean isEqualNode(org.w3c.dom.Node arg) { - return document.isEqualNode(arg); + return document.getDomDocument().isEqualNode(arg); } public Object getFeature(String feature, @@ -785,7 +813,7 @@ public abstract class SOAPPartImpl extends SOAPPart implements SOAPDocument { } public Object getUserData(String key) { - return document.getUserData(key); + return document.getDomDocument().getUserData(key); } public void recycleNode() { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java index 96fcb591336..d4bd32cd9ef 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/SOAPVersionMismatchException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +63,9 @@ public class SOAPVersionMismatchException extends SOAPExceptionImpl { /** * Constructs a SOAPExceptionImpl object initialized * with the given Throwable object. + * + * @param cause a Throwable object that is to + * be embedded in this SOAPExceptionImpl object */ public SOAPVersionMismatchException(Throwable cause) { super(cause); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java index 1ee09435fb7..491f9eac303 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/StringDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,7 +33,7 @@ import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.MimeUtility; import com.sun.xml.internal.messaging.saaj.packaging.mime.internet.ContentType; /** - * JAF data content handler for text/plain --> String + * JAF data content handler for text/plain --> String * */ public class StringDataContentHandler implements DataContentHandler { @@ -51,6 +51,7 @@ public class StringDataContentHandler implements DataContentHandler { * * @return The DataFlavors */ + @Override public DataFlavor[] getTransferDataFlavors() { return new DataFlavor[] { getDF() }; } @@ -62,6 +63,7 @@ public class StringDataContentHandler implements DataContentHandler { * @param ds The DataSource corresponding to the data * @return String object */ + @Override public Object getTransferData(DataFlavor df, DataSource ds) throws IOException { // use myDF.equals to be sure to get ActivationDataFlavor.equals, @@ -72,6 +74,7 @@ public class StringDataContentHandler implements DataContentHandler { return null; } + @Override public Object getContent(DataSource ds) throws IOException { String enc = null; InputStreamReader is = null; @@ -120,6 +123,7 @@ public class StringDataContentHandler implements DataContentHandler { /** * Write the object to the output stream, using the specified MIME type. */ + @Override public void writeTo(Object obj, String type, OutputStream os) throws IOException { if (!(obj instanceof String)) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java index dc5e06dca5b..5dea4672a3d 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/XmlDataContentHandler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,6 +56,7 @@ public class XmlDataContentHandler implements DataContentHandler { * return the DataFlavors for this DataContentHandler * @return The DataFlavors. */ + @Override public DataFlavor[] getTransferDataFlavors() { // throws Exception; DataFlavor flavors[] = new DataFlavor[2]; @@ -69,10 +70,11 @@ public class XmlDataContentHandler implements DataContentHandler { /** * return the Transfer Data of type DataFlavor from InputStream - * @param df The DataFlavor. - * @param ins The InputStream corresponding to the data. + * @param flavor The DataFlavor. + * @param dataSource The DataSource. * @return The constructed Object. */ + @Override public Object getTransferData(DataFlavor flavor, DataSource dataSource) throws IOException { if (flavor.getMimeType().startsWith("text/xml") || @@ -87,6 +89,7 @@ public class XmlDataContentHandler implements DataContentHandler { /** * */ + @Override public Object getContent(DataSource dataSource) throws IOException { return new StreamSource(dataSource.getInputStream()); } @@ -96,6 +99,7 @@ public class XmlDataContentHandler implements DataContentHandler { * (similar semantically to previous method, we are deciding * which one to support) */ + @Override public void writeTo(Object obj, String mimeType, OutputStream os) throws IOException { if (!mimeType.startsWith("text/xml") && !mimeType.startsWith("application/xml")) diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java index 8da4d8a59f8..4993bf71e7e 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/BodyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 javax.xml.stream.XMLStreamReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; import org.w3c.dom.*; import org.w3c.dom.Node; @@ -60,6 +61,10 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody { super(ownerDoc, bodyName); } + public BodyImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract NameImpl getFaultName(String name); protected abstract boolean isFault(SOAPElement child); protected abstract SOAPBodyElement createBodyElement(Name name); @@ -155,7 +160,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody { if (hasFault()) { if (fault == null) { //initialize fault member - fault = (SOAPFault) getFirstChildElement(); + fault = (SOAPFault) getSoapDocument().find(getFirstChildElement()); } return fault; } @@ -259,11 +264,12 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody { } protected SOAPElement convertToSoapElement(Element element) { - if ((element instanceof SOAPBodyElement) && + final Node soapNode = getSoapDocument().findIfPresent(element); + if ((soapNode instanceof SOAPBodyElement) && //this check is required because ElementImpl currently // implements SOAPBodyElement - !(element.getClass().equals(ElementImpl.class))) { - return (SOAPElement) element; + !(soapNode.getClass().equals(ElementImpl.class))) { + return (SOAPElement) soapNode; } else { return replaceElementWithSOAPElement( element, @@ -314,7 +320,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody { Document document = null; try { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl", SAAJUtil.getSystemClassLoader()); factory.setNamespaceAware(true); DocumentBuilder builder = factory.newDocumentBuilder(); document = builder.newDocument(); @@ -440,7 +446,7 @@ public abstract class BodyImpl extends ElementImpl implements SOAPBody { //not lazy -Just get first child element and return its attribute Element elem = getFirstChildElement(); if (elem != null) { - return elem.getAttribute(localName); + return elem.getAttribute(getLocalName()); } } return null; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java index c64e3f80772..b406caf111e 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/CDATAImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 +32,17 @@ import javax.xml.soap.SOAPException; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import org.w3c.dom.CDATASection; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.w3c.dom.UserDataHandler; -public class CDATAImpl - extends com.sun.org.apache.xerces.internal.dom.CDATASectionImpl - implements javax.xml.soap.Text { +public class CDATAImpl implements CDATASection, javax.xml.soap.Text { protected static final Logger log = Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, @@ -44,8 +51,256 @@ public class CDATAImpl static final String cdataUC = " 0); + //this is because of BugfixTest#testCR7020991, after removal internal dependencies + //SOAPDocumentImpl#createAttribute is not called anymore from xerces parent + if (isQualifiedName) { + String nsUri = null; + String prefix = name.substring(0, name.indexOf(":")); + //cannot do anything to resolve the URI if prefix is not + //XMLNS. + if (XMLNS.equals(prefix)) { + nsUri = ElementImpl.XMLNS_URI; + setAttributeNS(nsUri, name, value); + return; + } + } + element.setAttribute(name, value); + } + + @Override + public void removeAttribute(String name) throws DOMException { + element.removeAttribute(name); + } + + @Override + public Attr getAttributeNode(String name) { + return element.getAttributeNode(name); + } + + @Override + public Attr setAttributeNode(Attr newAttr) throws DOMException { + return element.setAttributeNode(newAttr); + } + + @Override + public Attr removeAttributeNode(Attr oldAttr) throws DOMException { + return element.removeAttributeNode(oldAttr); + } + + @Override + public NodeList getElementsByTagName(String name) { + return new NodeListImpl(getSoapDocument(), element.getElementsByTagName(name)); + } + + @Override + public String getAttributeNS(String namespaceURI, String localName) throws DOMException { + return element.getAttributeNS(namespaceURI, localName); + } + protected static final Logger log = Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); @@ -72,22 +133,27 @@ public class ElementImpl */ public final static String XML_URI = "http://www.w3.org/XML/1998/namespace".intern(); + private final static String XMLNS = "xmlns".intern(); + public ElementImpl(SOAPDocumentImpl ownerDoc, Name name) { - super( - ownerDoc, - name.getURI(), - name.getQualifiedName(), - name.getLocalName()); + this.soapDocument = ownerDoc; + this.element = ownerDoc.getDomDocument().createElementNS(name.getURI(), name.getQualifiedName()); elementQName = NameImpl.convertToQName(name); + getSoapDocument().register(this); } public ElementImpl(SOAPDocumentImpl ownerDoc, QName name) { - super( - ownerDoc, - name.getNamespaceURI(), - getQualifiedName(name), - name.getLocalPart()); + this.soapDocument = ownerDoc; + this.element = ownerDoc.getDomDocument().createElementNS(name.getNamespaceURI(), getQualifiedName(name)); elementQName = name; + getSoapDocument().register(this); + } + + public ElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + this.element = domElement; + this.soapDocument = ownerDoc; + this.elementQName = new QName(domElement.getNamespaceURI(), domElement.getLocalName()); + getSoapDocument().register(this); } public ElementImpl( @@ -95,9 +161,11 @@ public class ElementImpl String uri, String qualifiedName) { - super(ownerDoc, uri, qualifiedName); + this.soapDocument = ownerDoc; + this.element = ownerDoc.getDomDocument().createElementNS(uri, qualifiedName); elementQName = new QName(uri, getLocalPart(qualifiedName), getPrefix(qualifiedName)); + getSoapDocument().register(this); } public void ensureNamespaceIsDeclared(String prefix, String uri) { @@ -111,11 +179,132 @@ public class ElementImpl } public Document getOwnerDocument() { - Document doc = super.getOwnerDocument(); - if (doc instanceof SOAPDocument) - return ((SOAPDocument) doc).getDocument(); - else - return doc; + return soapDocument; + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return element.insertBefore(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(refChild)); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return element.replaceChild(getSoapDocument().getDomNode(newChild), getSoapDocument().getDomNode(oldChild)); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return element.removeChild(getSoapDocument().getDomNode(oldChild)); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return element.appendChild(getSoapDocument().getDomNode(newChild)); + } + + @Override + public boolean hasChildNodes() { + return element.hasChildNodes(); + } + + @Override + public Node cloneNode(boolean deep) { + return element.cloneNode(deep); + } + + @Override + public void normalize() { + element.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return element.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return element.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return element.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + element.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return element.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return element.hasAttributes(); + } + + @Override + public String getBaseURI() { + return element.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return element.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return element.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + element.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return element.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return element.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return element.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return element.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return element.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return element.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return element.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return element.getUserData(key); } public SOAPElement addChildElement(Name name) throws SOAPException { @@ -353,13 +542,16 @@ public class ElementImpl // preserve the encodingStyle attr as it may get lost in the import String encodingStyle = element.getEncodingStyle(); - ElementImpl importedElement = (ElementImpl) importElement(element); + final Element domElement = ((ElementImpl) element).getDomElement(); + final Element importedElement = importElement(domElement); addNode(importedElement); - if (encodingStyle != null) - importedElement.setEncodingStyle(encodingStyle); + final SOAPElement converted = convertToSoapElement(importedElement); - return convertToSoapElement(importedElement); + if (encodingStyle != null) + converted.setEncodingStyle(encodingStyle); + + return converted; } protected Element importElement(Element element) { @@ -374,7 +566,7 @@ public class ElementImpl protected SOAPElement addElement(Name name) throws SOAPException { SOAPElement newElement = createElement(name); - addNode(newElement); + addNode(((ElementImpl) newElement).getDomElement()); return newElement; } @@ -411,7 +603,7 @@ public class ElementImpl } protected void addNode(org.w3c.dom.Node newElement) throws SOAPException { - insertBefore(newElement, null); + insertBefore(getSoapDocument().getDomNode(newElement), null); if (getOwnerDocument() instanceof DocumentFragment) return; @@ -431,7 +623,7 @@ public class ElementImpl Node child = getFirstChild(); while (child != null) { if (child instanceof Element) { - return ((Element) child); + return (Element) getSoapDocument().find(child); } child = child.getNextSibling(); } @@ -441,10 +633,12 @@ public class ElementImpl protected SOAPElement findChild(NameImpl name) { Node eachChild = getFirstChild(); while (eachChild != null) { - if (eachChild instanceof SOAPElement) { - SOAPElement eachChildSoap = (SOAPElement) eachChild; - if (eachChildSoap.getElementName().equals(name)) { - return eachChildSoap; + if (eachChild instanceof Element) { + SOAPElement eachChildSoap = (SOAPElement) getSoapDocument().find(eachChild); + if (eachChildSoap != null) { + if (eachChildSoap.getElementName().equals(name)) { + return eachChildSoap; + } } } eachChild = eachChild.getNextSibling(); @@ -474,14 +668,14 @@ public class ElementImpl protected SOAPElement addCDATA(String text) throws SOAPException { org.w3c.dom.Text cdata = - (org.w3c.dom.Text) getOwnerDocument().createCDATASection(text); + getOwnerDocument().createCDATASection(text); addNode(cdata); return this; } protected SOAPElement addText(String text) throws SOAPException { org.w3c.dom.Text textNode = - (org.w3c.dom.Text) getOwnerDocument().createTextNode(text); + getOwnerDocument().createTextNode(text); addNode(textNode); return this; } @@ -684,8 +878,9 @@ public class ElementImpl } protected SOAPElement convertToSoapElement(Element element) { - if (element instanceof SOAPElement) { - return (SOAPElement) element; + final Node soapNode = getSoapDocument().findIfPresent(element); + if (soapNode instanceof SOAPElement) { + return (SOAPElement) soapNode; } else { return replaceElementWithSOAPElement( element, @@ -693,7 +888,7 @@ public class ElementImpl } } - protected static SOAPElement replaceElementWithSOAPElement( + protected SOAPElement replaceElementWithSOAPElement( Element element, ElementImpl copy) { @@ -709,7 +904,7 @@ public class ElementImpl copy.insertBefore(nextChild, null); } - Node parent = element.getParentNode(); + Node parent = getSoapDocument().find(element.getParentNode()); if (parent != null) { parent.replaceChild(copy, element); } // XXX else throw an exception? @@ -727,8 +922,8 @@ public class ElementImpl if (next == null) { while (eachNode.hasNext()) { Node node = eachNode.next(); - if (node instanceof SOAPElement) { - next = node; + if (node instanceof Element) { + next = getSoapDocument().findIfPresent(node); break; } } @@ -899,14 +1094,14 @@ public class ElementImpl protected javax.xml.soap.Node getValueNode() { Iterator i = getChildElements(); while (i.hasNext()) { - javax.xml.soap.Node n = (javax.xml.soap.Node) i.next(); + Node n = i.next(); if (n.getNodeType() == org.w3c.dom.Node.TEXT_NODE || n.getNodeType() == org.w3c.dom.Node.CDATA_SECTION_NODE) { // TODO: Hack to fix text node split into multiple lines. normalize(); // Should remove the normalization step when this gets fixed in // DOM/Xerces. - return (javax.xml.soap.Node) n; + return getSoapDocument().find(n); } } return null; @@ -948,7 +1143,7 @@ public class ElementImpl if (parentNode instanceof SOAPDocument) { return null; } - return (SOAPElement) parentNode; + return (SOAPElement) getSoapDocument().find(parentNode); } protected String getSOAPNamespace() { @@ -975,7 +1170,7 @@ public class ElementImpl public void detachNode() { Node parent = getParentNode(); if (parent != null) { - parent.removeChild(this); + parent.removeChild(element); } encodingStyleAttribute.clearNameAndValue(); // Fix for CR: 6474641 @@ -1136,17 +1331,18 @@ public class ElementImpl return attribute == null ? null : attribute.getValue(); } - protected static Iterator getChildElementsFrom(final Element element) { + protected Iterator getChildElementsFrom(final Element element) { return new Iterator() { Node next = element.getFirstChild(); Node nextNext = null; Node last = null; + Node soapElement = getSoapDocument().findIfPresent(element); public boolean hasNext() { if (next != null) { return true; } - if (next == null && nextNext != null) { + if (nextNext != null) { next = nextNext; } @@ -1158,15 +1354,15 @@ public class ElementImpl last = next; next = null; - if ((element instanceof ElementImpl) - && (last instanceof Element)) { + if ((soapElement instanceof ElementImpl) + && (last instanceof Element)) { last = - ((ElementImpl) element).convertToSoapElement( - (Element) last); + ((ElementImpl) soapElement).convertToSoapElement( + (Element) last); } nextNext = last.getNextSibling(); - return last; + return getSoapDocument().findIfPresent(last); } throw new NoSuchElementException(); } @@ -1251,7 +1447,7 @@ public class ElementImpl // SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(value))) // return; - super.setAttributeNS(namespaceURI,qualifiedName,value); + element.setAttributeNS(namespaceURI,qualifiedName,value); //String tmpLocalName = this.getLocalName(); String tmpURI = this.getNamespaceURI(); boolean isIDNS = false; @@ -1270,4 +1466,116 @@ public class ElementImpl } + @Override + public void removeAttributeNS(String namespaceURI, String localName) throws DOMException { + element.removeAttributeNS(namespaceURI, localName); + } + + @Override + public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException { + return element.getAttributeNodeNS(namespaceURI, localName); + } + + @Override + public Attr setAttributeNodeNS(Attr newAttr) throws DOMException { + return element.setAttributeNodeNS(newAttr); + } + + @Override + public NodeList getElementsByTagNameNS(String namespaceURI, String localName) throws DOMException { + return new NodeListImpl(getSoapDocument(), element.getElementsByTagNameNS(namespaceURI, localName)); + } + + @Override + public boolean hasAttribute(String name) { + return element.hasAttribute(name); + } + + @Override + public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException { + return element.hasAttributeNS(namespaceURI, localName); + } + + @Override + public TypeInfo getSchemaTypeInfo() { + return element.getSchemaTypeInfo(); + } + + @Override + public void setIdAttribute(String name, boolean isId) throws DOMException { + element.setIdAttribute(name, isId); + } + + @Override + public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { + element.setIdAttributeNS(namespaceURI, localName, isId); + } + + @Override + public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException { + element.setIdAttributeNode(idAttr, isId); + } + + @Override + public String getNodeName() { + return element.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return element.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + element.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return element.getNodeType(); + } + + @Override + public Node getParentNode() { + return getSoapDocument().find(element.getParentNode()); + } + + @Override + public NodeList getChildNodes() { + return new NodeListImpl(getSoapDocument(), element.getChildNodes()); + } + + @Override + public Node getFirstChild() { + return getSoapDocument().findIfPresent(element.getFirstChild()); + } + + @Override + public Node getLastChild() { + return getSoapDocument().findIfPresent(element.getLastChild()); + } + + @Override + public Node getPreviousSibling() { + return getSoapDocument().findIfPresent(element.getPreviousSibling()); + } + + @Override + public Node getNextSibling() { + return getSoapDocument().findIfPresent(element.getNextSibling()); + } + + @Override + public NamedNodeMap getAttributes() { + return element.getAttributes(); + } + + public Element getDomElement() { + return element; + } + + public SOAPDocumentImpl getSoapDocument() { + return soapDocument; + } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java index d73ba5b0cea..faaa3d8f61a 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/EnvelopeImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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.xml.internal.messaging.saaj.util.transform.EfficientStreamingTran import com.sun.xml.internal.org.jvnet.staxex.util.DOMStreamReader; import com.sun.xml.internal.org.jvnet.staxex.util.XMLStreamReaderToXMLStreamWriter; +import org.w3c.dom.Element; /** * Our implementation of the SOAP envelope. @@ -92,6 +93,10 @@ public abstract class EnvelopeImpl extends ElementImpl implements LazyEnvelope { addBody(); } + public EnvelopeImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract NameImpl getHeaderName(String prefix); protected abstract NameImpl getBodyName(String prefix); @@ -122,7 +127,7 @@ public abstract class EnvelopeImpl extends ElementImpl implements LazyEnvelope { } header = (HeaderImpl) createElement(headerName); - insertBefore(header, firstChild); + insertBefore(header.getDomElement(), firstChild); header.ensureNamespaceIsDeclared(headerName.getPrefix(), headerName.getURI()); return header; @@ -161,7 +166,7 @@ public abstract class EnvelopeImpl extends ElementImpl implements LazyEnvelope { if (body == null) { NameImpl bodyName = getBodyName(prefix); body = (BodyImpl) createElement(bodyName); - insertBefore(body, null); + insertBefore(body.getDomElement(), null); body.ensureNamespaceIsDeclared(bodyName.getPrefix(), bodyName.getURI()); } else { log.severe("SAAJ0122.impl.body.already.exists"); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java index 2cf604af0cc..447039ed8e6 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultElementImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 javax.xml.soap.SOAPFaultElement; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public abstract class FaultElementImpl extends ElementImpl @@ -47,6 +48,10 @@ public abstract class FaultElementImpl super(ownerDoc, qname); } + public FaultElementImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract boolean isStandardFaultElement(); public SOAPElement setElementQName(QName newName) throws SOAPException { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java index 218ce0a7f5c..86fdfcf3314 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/FaultImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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.util.logging.Level; import javax.xml.namespace.QName; import javax.xml.soap.*; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; import org.w3c.dom.Element; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; @@ -53,6 +54,9 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { super(ownerDoc, name); } + public FaultImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } protected abstract NameImpl getDetailName(); protected abstract NameImpl getFaultCodeName(); @@ -83,6 +87,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { (SOAPFaultElement) findAndConvertChildElement(getFaultStringName()); } + @Override public void setFaultCode(String faultCode) throws SOAPException { setFaultCode( NameImpl.getLocalNameFromTagName(faultCode), @@ -131,6 +136,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { } } + @Override public void setFaultCode(Name faultCodeQName) throws SOAPException { setFaultCode( faultCodeQName.getLocalName(), @@ -138,6 +144,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { faultCodeQName.getURI()); } + @Override public void setFaultCode(QName faultCodeQName) throws SOAPException { setFaultCode( faultCodeQName.getLocalPart(), @@ -165,6 +172,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { detail = (Detail) findAndConvertChildElement(detailName); } + @Override public Detail getDetail() { if (detail == null) initializeDetail(); @@ -175,6 +183,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { return detail; } + @Override public Detail addDetail() throws SOAPException { if (detail == null) initializeDetail(); @@ -188,12 +197,15 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { } } + @Override public boolean hasDetail() { return (getDetail() != null); } + @Override public abstract void setFaultActor(String faultActor) throws SOAPException; + @Override public String getFaultActor() { if (this.faultActorElement == null) findFaultActorElement(); @@ -203,6 +215,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { return null; } + @Override public SOAPElement setElementQName(QName newName) throws SOAPException { log.log( @@ -213,11 +226,13 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { "Cannot change name for " + elementQName.getLocalPart() + " to " + newName.getLocalPart()); } + @Override protected SOAPElement convertToSoapElement(Element element) { - if (element instanceof SOAPFaultElement) { - return (SOAPElement) element; - } else if (element instanceof SOAPElement) { - SOAPElement soapElement = (SOAPElement) element; + final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element); + if (soapNode instanceof SOAPFaultElement) { + return (SOAPElement) soapNode; + } else if (soapNode instanceof SOAPElement) { + SOAPElement soapElement = (SOAPElement) soapNode; if (getDetailName().equals(soapElement.getElementName())) { return replaceElementWithSOAPElement(element, createDetail()); } else { @@ -233,12 +248,12 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { Name elementName = NameImpl.copyElementName(element); ElementImpl newElement; if (getDetailName().equals(elementName)) { - newElement = (ElementImpl) createDetail(); + newElement = createDetail(); } else { String localName = elementName.getLocalName(); if (isStandardFaultElement(localName)) newElement = - (ElementImpl) createSOAPFaultElement(elementName); + createSOAPFaultElement(elementName); else newElement = (ElementImpl) createElement(elementName); } @@ -284,6 +299,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { } } + @Override protected SOAPElement addElement(Name name) throws SOAPException { if (getDetailName().equals(name)) { return addDetail(); @@ -297,6 +313,7 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { return super.addElement(name); } + @Override protected SOAPElement addElement(QName name) throws SOAPException { return addElement(NameImpl.convertToName(name)); } @@ -311,6 +328,8 @@ public abstract class FaultImpl extends ElementImpl implements SOAPFault { /** * Convert an xml:lang attribute value into a Locale object + * @param xmlLang xml:lang attribute value + * @return Locale */ protected static Locale xmlLangToLocale(String xmlLang) { if (xmlLang == null) { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java index a9e4adb086d..0d9f7ad8ae4 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/HeaderImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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.util.logging.Level; import javax.xml.namespace.QName; import javax.xml.soap.*; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; import org.w3c.dom.Element; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; @@ -45,6 +46,10 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader { super(ownerDoc, name); } + public HeaderImpl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected abstract SOAPHeaderElement createHeaderElement(Name name) throws SOAPException; protected abstract SOAPHeaderElement createHeaderElement(QName name) @@ -276,8 +281,9 @@ public abstract class HeaderImpl extends ElementImpl implements SOAPHeader { } protected SOAPElement convertToSoapElement(Element element) { - if (element instanceof SOAPHeaderElement) { - return (SOAPElement) element; + final org.w3c.dom.Node soapNode = getSoapDocument().findIfPresent(element); + if (soapNode instanceof SOAPHeaderElement) { + return (SOAPElement) soapNode; } else { SOAPHeaderElement headerElement; try { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java new file mode 100644 index 00000000000..141265ac20f --- /dev/null +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/NodeListImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.xml.internal.messaging.saaj.soap.impl; + +import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import java.util.Objects; + +/** + * Node list wrapper, finding SOAP elements automatically when possible. + * + * @author Roman Grigoriadi + */ +public class NodeListImpl implements NodeList { + + private final SOAPDocumentImpl soapDocument; + + private final NodeList nodeList; + + public NodeListImpl(SOAPDocumentImpl soapDocument, NodeList nodeList) { + Objects.requireNonNull(soapDocument); + Objects.requireNonNull(soapDocument); + this.soapDocument = soapDocument; + this.nodeList = nodeList; + } + + @Override + public Node item(int index) { + return soapDocument.findIfPresent(nodeList.item(index)); + } + + @Override + public int getLength() { + return nodeList.getLength(); + } +} diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java index c306beb74f9..85fbb14aacd 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPCommentImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,14 +31,20 @@ import java.util.logging.Logger; import javax.xml.soap.SOAPElement; import javax.xml.soap.SOAPException; +import com.sun.xml.internal.messaging.saaj.util.SAAJUtil; +import org.w3c.dom.Comment; import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; import org.w3c.dom.Text; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.UserDataHandler; public class SOAPCommentImpl - extends com.sun.org.apache.xerces.internal.dom.CommentImpl implements javax.xml.soap.Text, org.w3c.dom.Comment { protected static final Logger log = @@ -47,8 +53,236 @@ public class SOAPCommentImpl protected static ResourceBundle rb = log.getResourceBundle(); + @Override + public String getData() throws DOMException { + return comment.getData(); + } + + @Override + public void setData(String data) throws DOMException { + comment.setData(data); + } + + @Override + public int getLength() { + return comment.getLength(); + } + + @Override + public String substringData(int offset, int count) throws DOMException { + return comment.substringData(offset, count); + } + + @Override + public void appendData(String arg) throws DOMException { + comment.appendData(arg); + } + + @Override + public void insertData(int offset, String arg) throws DOMException { + comment.insertData(offset, arg); + } + + @Override + public void deleteData(int offset, int count) throws DOMException { + comment.deleteData(offset, count); + } + + @Override + public void replaceData(int offset, int count, String arg) throws DOMException { + comment.replaceData(offset, count, arg); + } + + @Override + public String getNodeName() { + return comment.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return comment.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + comment.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return comment.getNodeType(); + } + + @Override + public Node getParentNode() { + return comment.getParentNode(); + } + + @Override + public NodeList getChildNodes() { + return comment.getChildNodes(); + } + + @Override + public Node getFirstChild() { + return comment.getFirstChild(); + } + + @Override + public Node getLastChild() { + return comment.getLastChild(); + } + + @Override + public Node getPreviousSibling() { + return comment.getPreviousSibling(); + } + + @Override + public Node getNextSibling() { + return comment.getNextSibling(); + } + + @Override + public NamedNodeMap getAttributes() { + return comment.getAttributes(); + } + + @Override + public Document getOwnerDocument() { + return comment.getOwnerDocument(); + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return comment.insertBefore(newChild, refChild); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return comment.replaceChild(newChild, oldChild); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return comment.removeChild(oldChild); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return comment.appendChild(newChild); + } + + @Override + public boolean hasChildNodes() { + return comment.hasChildNodes(); + } + + @Override + public Node cloneNode(boolean deep) { + return comment.cloneNode(deep); + } + + @Override + public void normalize() { + comment.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return comment.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return comment.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return comment.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + comment.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return comment.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return comment.hasAttributes(); + } + + @Override + public String getBaseURI() { + return comment.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return comment.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return comment.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + comment.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return comment.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return comment.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return comment.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return comment.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return comment.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return comment.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return comment.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return comment.getUserData(key); + } + + private Comment comment; + public SOAPCommentImpl(SOAPDocumentImpl ownerDoc, String text) { - super(ownerDoc, text); + comment = ownerDoc.getDomDocument().createComment(text); + ownerDoc.register(this); } public String getValue() { @@ -111,4 +345,7 @@ public class SOAPCommentImpl throw new UnsupportedOperationException("Not Supported"); } + public Comment getDomElement() { + return comment; + } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java index c088928ba90..076cacb202d 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/impl/SOAPTextImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,17 +32,271 @@ import javax.xml.soap.SOAPException; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.Text; +import org.w3c.dom.UserDataHandler; public class SOAPTextImpl - extends com.sun.org.apache.xerces.internal.dom.TextImpl implements javax.xml.soap.Text, org.w3c.dom.Text { + @Override + public Text splitText(int offset) throws DOMException { + return textNode.splitText(offset); + } + + @Override + public boolean isElementContentWhitespace() { + return textNode.isElementContentWhitespace(); + } + + @Override + public String getWholeText() { + return textNode.getWholeText(); + } + + @Override + public Text replaceWholeText(String content) throws DOMException { + return textNode.replaceWholeText(content); + } + + @Override + public String getData() throws DOMException { + return textNode.getData(); + } + + @Override + public void setData(String data) throws DOMException { + textNode.setData(data); + } + + @Override + public int getLength() { + return textNode.getLength(); + } + + @Override + public String substringData(int offset, int count) throws DOMException { + return textNode.substringData(offset, count); + } + + @Override + public void appendData(String arg) throws DOMException { + textNode.appendData(arg); + } + + @Override + public void insertData(int offset, String arg) throws DOMException { + textNode.insertData(offset, arg); + } + + @Override + public void deleteData(int offset, int count) throws DOMException { + textNode.deleteData(offset, count); + } + + @Override + public void replaceData(int offset, int count, String arg) throws DOMException { + textNode.replaceData(offset, count, arg); + } + + @Override + public String getNodeName() { + return textNode.getNodeName(); + } + + @Override + public String getNodeValue() throws DOMException { + return textNode.getNodeValue(); + } + + @Override + public void setNodeValue(String nodeValue) throws DOMException { + textNode.setNodeValue(nodeValue); + } + + @Override + public short getNodeType() { + return textNode.getNodeType(); + } + + @Override + public Node getParentNode() { + return textNode.getParentNode(); + } + + @Override + public NodeList getChildNodes() { + return textNode.getChildNodes(); + } + + @Override + public Node getFirstChild() { + return textNode.getFirstChild(); + } + + @Override + public Node getLastChild() { + return textNode.getLastChild(); + } + + @Override + public Node getPreviousSibling() { + return textNode.getPreviousSibling(); + } + + @Override + public Node getNextSibling() { + return textNode.getNextSibling(); + } + + @Override + public NamedNodeMap getAttributes() { + return textNode.getAttributes(); + } + + @Override + public Document getOwnerDocument() { + return textNode.getOwnerDocument(); + } + + @Override + public Node insertBefore(Node newChild, Node refChild) throws DOMException { + return textNode.insertBefore(newChild, refChild); + } + + @Override + public Node replaceChild(Node newChild, Node oldChild) throws DOMException { + return textNode.replaceChild(newChild, oldChild); + } + + @Override + public Node removeChild(Node oldChild) throws DOMException { + return textNode.removeChild(oldChild); + } + + @Override + public Node appendChild(Node newChild) throws DOMException { + return textNode.appendChild(newChild); + } + + @Override + public boolean hasChildNodes() { + return textNode.hasChildNodes(); + } + + @Override + public Node cloneNode(boolean deep) { + return textNode.cloneNode(deep); + } + + @Override + public void normalize() { + textNode.normalize(); + } + + @Override + public boolean isSupported(String feature, String version) { + return textNode.isSupported(feature, version); + } + + @Override + public String getNamespaceURI() { + return textNode.getNamespaceURI(); + } + + @Override + public String getPrefix() { + return textNode.getPrefix(); + } + + @Override + public void setPrefix(String prefix) throws DOMException { + textNode.setPrefix(prefix); + } + + @Override + public String getLocalName() { + return textNode.getLocalName(); + } + + @Override + public boolean hasAttributes() { + return textNode.hasAttributes(); + } + + @Override + public String getBaseURI() { + return textNode.getBaseURI(); + } + + @Override + public short compareDocumentPosition(Node other) throws DOMException { + return textNode.compareDocumentPosition(other); + } + + @Override + public String getTextContent() throws DOMException { + return textNode.getTextContent(); + } + + @Override + public void setTextContent(String textContent) throws DOMException { + textNode.setTextContent(textContent); + } + + @Override + public boolean isSameNode(Node other) { + return textNode.isSameNode(other); + } + + @Override + public String lookupPrefix(String namespaceURI) { + return textNode.lookupPrefix(namespaceURI); + } + + @Override + public boolean isDefaultNamespace(String namespaceURI) { + return textNode.isDefaultNamespace(namespaceURI); + } + + @Override + public String lookupNamespaceURI(String prefix) { + return textNode.lookupNamespaceURI(prefix); + } + + @Override + public boolean isEqualNode(Node arg) { + return textNode.isEqualNode(arg); + } + + @Override + public Object getFeature(String feature, String version) { + return textNode.getFeature(feature, version); + } + + @Override + public Object setUserData(String key, Object data, UserDataHandler handler) { + return textNode.setUserData(key, data, handler); + } + + @Override + public Object getUserData(String key) { + return textNode.getUserData(key); + } + protected static final Logger log = Logger.getLogger(LogDomainConstants.SOAP_IMPL_DOMAIN, "com.sun.xml.internal.messaging.saaj.soap.impl.LocalStrings"); + private Text textNode; + public SOAPTextImpl(SOAPDocumentImpl ownerDoc, String text) { - super(ownerDoc, text); + textNode = ownerDoc.getDomDocument().createTextNode(text); + ownerDoc.register(this); } public String getValue() { @@ -70,7 +324,7 @@ public class SOAPTextImpl public void detachNode() { org.w3c.dom.Node parent = getParentNode(); if (parent != null) { - parent.removeChild(this); + parent.removeChild(getDomElement()); } } @@ -88,4 +342,8 @@ public class SOAPTextImpl } return txt.startsWith(""); } + + public Text getDomElement() { + return textNode; + } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java index 52399329148..86af99025eb 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/name/NameImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ public class NameImpl implements Name { return prefix + ":" + localName; } + @Override public boolean equals(Object obj) { if (!(obj instanceof Name)) { return false; @@ -236,6 +237,7 @@ public class NameImpl implements Name { return true; } + @Override public int hashCode() { return localName.hashCode(); } @@ -245,6 +247,7 @@ public class NameImpl implements Name { * * @return a string for the local name. */ + @Override public String getLocalName() { return localName; } @@ -256,6 +259,7 @@ public class NameImpl implements Name { * * @return the prefix as a string. */ + @Override public String getPrefix() { return prefix; } @@ -265,6 +269,7 @@ public class NameImpl implements Name { * * @return the uri as a string. */ + @Override public String getURI() { return uri; } @@ -272,6 +277,7 @@ public class NameImpl implements Name { /** * Returns a String version of the name suitable for use in an XML document. */ + @Override public String getQualifiedName() { if (qualifiedName == null) { if (prefix != null && prefix.length() > 0) { @@ -285,6 +291,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.1 Envelope. + * + * @param prefix prefix + * @return Envelope Name */ public static NameImpl createEnvelope1_1Name(String prefix) { return new Envelope1_1Name(prefix); @@ -292,6 +301,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.2 Envelope. + * + * @param prefix prefix + * @return Envelope Name */ public static NameImpl createEnvelope1_2Name(String prefix) { return new Envelope1_2Name(prefix); @@ -299,6 +311,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.1 Header. + * + * @param prefix prefix + * @return Header Name */ public static NameImpl createHeader1_1Name(String prefix) { return new Header1_1Name(prefix); @@ -306,6 +321,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.2 Header. + * + * @param prefix prefix + * @return Header Name */ public static NameImpl createHeader1_2Name(String prefix) { return new Header1_2Name(prefix); @@ -313,6 +331,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.1 Body. + * + * @param prefix prefix + * @return Body Name */ public static NameImpl createBody1_1Name(String prefix) { return new Body1_1Name(prefix); @@ -320,6 +341,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.2 Body. + * + * @param prefix prefix + * @return Body Name */ public static NameImpl createBody1_2Name(String prefix) { return new Body1_2Name(prefix); @@ -327,20 +351,29 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.1 Fault. + * + * @param prefix prefix + * @return Fault Name */ public static NameImpl createFault1_1Name(String prefix) { return new Fault1_1Name(prefix); } /** - * Create a name object for a SOAP1.2 NotUnderstood element. - */ + * Create a name object for a SOAP1.2 NotUnderstood element. + * + * @param prefix prefix + * @return NotUnderstood Name + */ public static NameImpl createNotUnderstood1_2Name(String prefix) { return new NotUnderstood1_2Name(prefix); } /** * Create a name object for a SOAP1.2 Upgrade element. + * + * @param prefix prefix + * @return Upgrade Name */ public static NameImpl createUpgrade1_2Name(String prefix) { return new Upgrade1_2Name(prefix); @@ -348,6 +381,9 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.2 SupportedEnvelope Upgrade element. + * + * @param prefix prefix + * @return Supported Envelope Name */ public static NameImpl createSupportedEnvelope1_2Name(String prefix) { return new SupportedEnvelope1_2Name(prefix); @@ -358,6 +394,8 @@ public class NameImpl implements Name { * Fault, Reason or Detail. * * @param localName Local Name of element + * @param prefix prefix + * @return Fault Name */ public static NameImpl createFault1_2Name( String localName, @@ -369,6 +407,8 @@ public class NameImpl implements Name { * Create a name object for a SOAP1.2 Fault/Code or Subcode. * * @param localName Either "Code" or "Subcode" + * @param prefix prefix + * @return CodeSubcode Name */ public static NameImpl createCodeSubcode1_2Name( String prefix, @@ -378,6 +418,8 @@ public class NameImpl implements Name { /** * Create a name object for a SOAP1.1 Fault Detail. + * + * @return Detail Name */ public static NameImpl createDetail1_1Name() { return new Detail1_1Name(); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java index 12fb6d02a4e..453abec8d51 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Body1_1Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,12 +38,17 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.BodyImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Body1_1Impl extends BodyImpl { public Body1_1Impl(SOAPDocumentImpl ownerDocument, String prefix) { super(ownerDocument, NameImpl.createBody1_1Name(prefix)); } + public Body1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + public SOAPFault addSOAP12Fault(QName faultCode, String faultReason, Locale locale) { // log message here throw new UnsupportedOperationException("Not supported in SOAP 1.1"); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java index 480ca25f8d2..acd4612488f 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Detail1_1Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 javax.xml.soap.Name; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Detail1_1Impl extends DetailImpl { @@ -45,6 +46,11 @@ public class Detail1_1Impl extends DetailImpl { public Detail1_1Impl(SOAPDocumentImpl ownerDoc) { super(ownerDoc, NameImpl.createDetail1_1Name()); } + + public Detail1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected DetailEntry createDetailEntry(Name name) { return new DetailEntry1_1Impl( (SOAPDocumentImpl) getOwnerDocument(), diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java index c517fab54f2..de55d8fa86c 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Envelope1_1Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 javax.xml.soap.SOAPException; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Envelope1_1Impl extends EnvelopeImpl { @@ -52,6 +53,11 @@ public class Envelope1_1Impl extends EnvelopeImpl { createHeader, createBody); } + + public Envelope1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getBodyName(String prefix) { return NameImpl.createBody1_1Name(prefix); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java index 00b8fb65618..58c00c4823e 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Fault1_1Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 com.sun.xml.internal.messaging.saaj.soap.impl.*; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; +import org.w3c.dom.Element; public class Fault1_1Impl extends FaultImpl { @@ -59,6 +60,10 @@ public class Fault1_1Impl extends FaultImpl { super(ownerDocument, NameImpl.createFault1_1Name(prefix)); } + public Fault1_1Impl(Element domElement, SOAPDocumentImpl ownerDoc) { + super(ownerDoc, domElement); + } + protected NameImpl getDetailName() { return NameImpl.createDetail1_1Name(); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java index a30911edbda..75b76d513f5 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_1/Header1_1Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.Element; public class Header1_1Impl extends HeaderImpl { @@ -51,6 +52,10 @@ public class Header1_1Impl extends HeaderImpl { super(ownerDocument, NameImpl.createHeader1_1Name(prefix)); } + public Header1_1Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getNotUnderstoodName() { log.log( Level.SEVERE, diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java index abef584186d..1e57365b01c 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Body1_2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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.logging.Logger; import javax.xml.namespace.QName; import javax.xml.soap.*; +import org.w3c.dom.Element; import org.w3c.dom.Node; import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; @@ -52,6 +53,10 @@ public class Body1_2Impl extends BodyImpl { super(ownerDocument, NameImpl.createBody1_2Name(prefix)); } + public Body1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getFaultName(String name) { return NameImpl.createFault1_2Name(name, null); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java index 32fb78ddfe4..455d6e4ee9d 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Detail1_2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocument; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.DetailImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Detail1_2Impl extends DetailImpl { @@ -54,6 +55,10 @@ public class Detail1_2Impl extends DetailImpl { super(ownerDocument, NameImpl.createSOAP12Name("Detail")); } + public Detail1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected DetailEntry createDetailEntry(Name name) { return new DetailEntry1_2Impl( ((SOAPDocument) getOwnerDocument()).getDocument(), diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java index 53840bccead..075a848b91b 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Envelope1_2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl; import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.EnvelopeImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; +import org.w3c.dom.Element; public class Envelope1_2Impl extends EnvelopeImpl { @@ -50,6 +51,10 @@ public class Envelope1_2Impl extends EnvelopeImpl { super(ownerDoc, NameImpl.createEnvelope1_2Name(prefix)); } + public Envelope1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + public Envelope1_2Impl( SOAPDocumentImpl ownerDoc, String prefix, diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java index 6d655f1ee12..3f206c13031 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Fault1_2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +42,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.*; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.Element; public class Fault1_2Impl extends FaultImpl { @@ -68,6 +69,10 @@ public class Fault1_2Impl extends FaultImpl { super(ownerDocument, NameImpl.createFault1_2Name(null, prefix)); } + public Fault1_2Impl(Element domElement, SOAPDocumentImpl ownerDoc) { + super(ownerDoc, domElement); + } + protected NameImpl getDetailName() { return NameImpl.createSOAP12Name("Detail", getPrefix()); } @@ -521,7 +526,7 @@ public class Fault1_2Impl extends FaultImpl { } } if (element instanceof Detail1_2Impl) { - ElementImpl importedElement = (ElementImpl) importElement(element); + Element importedElement = importElement(element); addNode(importedElement); return convertToSoapElement(importedElement); } else diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java index e860c511885..ee9eeaac427 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/soap/ver1_2/Header1_2Impl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,6 +41,7 @@ import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.messaging.saaj.soap.name.NameImpl; import com.sun.xml.internal.messaging.saaj.util.LogDomainConstants; +import org.w3c.dom.Element; public class Header1_2Impl extends HeaderImpl { @@ -54,6 +55,10 @@ public class Header1_2Impl extends HeaderImpl { super(ownerDocument, NameImpl.createHeader1_2Name(prefix)); } + public Header1_2Impl(SOAPDocumentImpl ownerDoc, Element domElement) { + super(ownerDoc, domElement); + } + protected NameImpl getNotUnderstoodName() { return NameImpl.createNotUnderstood1_2Name(null); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java index 30243489e5c..6e8aa0bd5f5 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/Base64.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package com.sun.xml.internal.messaging.saaj.util; * This class is used by XML Schema binary format validation * * @author Jeffrey Rodriguez - * @version */ public final class Base64 { @@ -173,7 +172,7 @@ public final class Base64 { /** * Decodes Base64 data into octects * - * @param binaryData Byte array containing Base64 data + * @param base64Data Byte array containing Base64 data * @return Array containind decoded data. */ public byte[] decode( byte[] base64Data ) { diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java index c00da8308f6..5763bd78396 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ByteOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +42,7 @@ import java.io.ByteArrayInputStream; *

  • doesn't do synchronization *
  • allows access to the raw buffer *
  • almost no parameter check + * */ public final class ByteOutputStream extends OutputStream { /** @@ -64,6 +65,9 @@ public final class ByteOutputStream extends OutputStream { /** * Copies all the bytes from this input into this buffer. + * + * @param in input stream. + * @exception IOException in case of an I/O error. */ public void write(InputStream in) throws IOException { if (in instanceof ByteArrayInputStream) { @@ -84,6 +88,7 @@ public final class ByteOutputStream extends OutputStream { } } + @Override public void write(int b) { ensureCapacity(1); buf[count] = (byte) b; @@ -102,18 +107,22 @@ public final class ByteOutputStream extends OutputStream { } } + @Override public void write(byte[] b, int off, int len) { ensureCapacity(len); System.arraycopy(b, off, buf, count, len); count += len; } + @Override public void write(byte[] b) { write(b, 0, b.length); } /** * Writes a string as ASCII string. + * + * @param s string to write. */ public void writeAsAscii(String s) { int len = s.length(); @@ -138,9 +147,12 @@ public final class ByteOutputStream extends OutputStream { * Evil buffer reallocation method. * Don't use it unless you absolutely have to. * + * @return byte array + * * @deprecated * because this is evil! */ + @Deprecated public byte toByteArray()[] { byte[] newbuf = new byte[count]; System.arraycopy(buf, 0, newbuf, 0, count); @@ -162,10 +174,12 @@ public final class ByteOutputStream extends OutputStream { * @return String translated from the buffer's contents. * @since JDK1.1 */ + @Override public String toString() { return new String(buf, 0, count); } + @Override public void close() { } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java index 4d9178876b2..131f1f5e5c1 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/JaxmURI.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +39,9 @@ import java.io.Serializable; * string and fragment) that may constitute a URI. *

    * Parsing of a URI specification is done according to the URI -* syntax described in RFC 2396. -* Every URI consists of a scheme, followed by a colon (':'), followed by a scheme-specific +* syntax described in +* RFC 2396. Every URI consists +* of a scheme, followed by a colon (':'), followed by a scheme-specific * part. For URIs that follow the "generic URI" syntax, the scheme- * specific part begins with two slashes ("//") and may be followed * by an authority segment (comprised of user information, host, and @@ -60,8 +61,6 @@ import java.io.Serializable; * default port for a specific scheme). Rather, it only knows the * grammar and basic set of operations that can be applied to a URI. * -* @version -* **********************************************************************/ public class JaxmURI implements Serializable { @@ -1106,6 +1105,7 @@ import java.io.Serializable; * @return true if p_test is a URI with all values equal to this * URI, false otherwise */ + @Override public boolean equals(Object p_test) { if (p_test instanceof JaxmURI) { JaxmURI testURI = (JaxmURI) p_test; @@ -1134,6 +1134,7 @@ import java.io.Serializable; return false; } + @Override public int hashCode() { // No members safe to use, just default to a constant. return 153214; @@ -1144,6 +1145,7 @@ import java.io.Serializable; * * @return the URI string specification */ + @Override public String toString() { StringBuilder uriSpecString = new StringBuilder(); @@ -1173,6 +1175,8 @@ import java.io.Serializable; * A scheme is conformant if it starts with an alphanumeric, and * contains only alphanumerics, '+','-' and '.'. * + * @param p_scheme scheme name + * * @return true if the scheme is conformant, false otherwise */ public static boolean isConformantSchemeName(String p_scheme) { @@ -1202,7 +1206,9 @@ import java.io.Serializable; * IPv4 address consists of four decimal digit groups separated by a * '.'. A hostname consists of domain labels (each of which must * begin and end with an alphanumeric but may contain '-') separated - & by a '.'. See RFC 2396 Section 3.2.2. + * by a '.'. See RFC 2396 Section 3.2.2. + * + * @param p_address address * * @return true if the string is a syntactically valid IPv4 address * or hostname diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java index 5d3c2d4e0db..032abd18430 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParseUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 @@ public class ParseUtil { * Returns a new String constructed from the specified String by replacing * the URL escape sequences and UTF8 encoding with the characters they * represent. + * + * @param s string + * + * @return decoded string */ public static String decode(String s) { StringBuilder sb = new StringBuilder(); diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java index b9c503c9f7f..9cfa57e00ee 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/ParserPool.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 +45,11 @@ public class ParserPool { public ParserPool(int capacity) { queue = new ArrayBlockingQueue(capacity); - //factory = SAXParserFactory.newInstance(); - factory = new com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl(); + factory = SAXParserFactory.newInstance("com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl", SAAJUtil.getSystemClassLoader()); + try { + factory.setFeature("jdk.xml.resetSymbolTable", true); + } catch(SAXException | ParserConfigurationException e) { + } factory.setNamespaceAware(true); for (int i = 0; i < capacity; i++) { try { @@ -79,30 +82,7 @@ public class ParserPool { public void returnParser(SAXParser saxParser) { saxParser.reset(); - resetSaxParser(saxParser); put(saxParser); } - - /** - * SAAJ Issue 46 :https://saaj.dev.java.net/issues/show_bug.cgi?id=46 - * Xerces does not provide a way to reset the SymbolTable - * So we are trying to reset it using the proprietary code below. - * Temporary Until the bug : https://jaxp.dev.java.net/issues/show_bug.cgi?id=59 - * is fixed. - * @param parser the parser from the pool whose Symbol Table needs to be reset. - */ - private void resetSaxParser(SAXParser parser) { - try { - //Object obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table"); - com.sun.org.apache.xerces.internal.util.SymbolTable table = new com.sun.org.apache.xerces.internal.util.SymbolTable(); - parser.setProperty("http://apache.org/xml/properties/internal/symbol-table", table); - //obj = parser.getProperty("http://apache.org/xml/properties/internal/symbol-table"); - } catch (SAXNotRecognizedException ex) { - //nothing to do - } catch (SAXNotSupportedException ex) { - //nothing to do - } - } - } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java index 7f9cdc40a98..eafc1863f80 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/SAAJUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ package com.sun.xml.internal.messaging.saaj.util; import java.security.AccessControlException; +import java.security.AccessController; +import java.security.PrivilegedAction; /** * @@ -48,4 +50,13 @@ public final class SAAJUtil { return null; } } + + public static ClassLoader getSystemClassLoader() { + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + return ClassLoader.getSystemClassLoader(); + } + }); + } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java index e11fb63f15d..94f4f3d67cf 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/util/transform/EfficientStreamingTransformer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 +107,13 @@ public class EfficientStreamingTransformer } } + @Override public void clearParameters() { if (m_realTransformer != null) m_realTransformer.clearParameters(); } + @Override public javax.xml.transform.ErrorListener getErrorListener() { try { materialize(); @@ -122,6 +124,7 @@ public class EfficientStreamingTransformer return null; } + @Override public java.util.Properties getOutputProperties() { try { materialize(); @@ -132,6 +135,7 @@ public class EfficientStreamingTransformer return null; } + @Override public String getOutputProperty(String str) throws java.lang.IllegalArgumentException { try { @@ -143,6 +147,7 @@ public class EfficientStreamingTransformer return null; } + @Override public Object getParameter(String str) { try { materialize(); @@ -153,6 +158,7 @@ public class EfficientStreamingTransformer return null; } + @Override public javax.xml.transform.URIResolver getURIResolver() { try { materialize(); @@ -163,6 +169,7 @@ public class EfficientStreamingTransformer return null; } + @Override public void setErrorListener( javax.xml.transform.ErrorListener errorListener) throws java.lang.IllegalArgumentException { @@ -174,6 +181,7 @@ public class EfficientStreamingTransformer } } + @Override public void setOutputProperties(java.util.Properties properties) throws java.lang.IllegalArgumentException { try { @@ -184,6 +192,7 @@ public class EfficientStreamingTransformer } } + @Override public void setOutputProperty(String str, String str1) throws java.lang.IllegalArgumentException { try { @@ -194,6 +203,7 @@ public class EfficientStreamingTransformer } } + @Override public void setParameter(String str, Object obj) { try { materialize(); @@ -203,6 +213,7 @@ public class EfficientStreamingTransformer } } + @Override public void setURIResolver(javax.xml.transform.URIResolver uRIResolver) { try { materialize(); @@ -272,6 +283,7 @@ public class EfficientStreamingTransformer //------------------------------------------------------------------------ + @Override public void transform( javax.xml.transform.Source source, javax.xml.transform.Result result) @@ -409,6 +421,8 @@ public class EfficientStreamingTransformer * Return Transformer instance for this thread, allocating a new one if * necessary. Note that this method does not clear global parameters, * properties or any other data set on a previously used transformer. + * + * @return Transformer instance */ public static Transformer newTransformer() { //CR : 6813167 diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java index e1f39b91ea9..6321da30dcb 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/addressing/EPRSDDocumentFilter.java @@ -26,6 +26,7 @@ package com.sun.xml.internal.ws.addressing; import com.sun.xml.internal.ws.api.server.*; +import com.sun.xml.internal.ws.api.server.Module; import com.sun.xml.internal.ws.api.addressing.WSEndpointReference; import com.sun.xml.internal.ws.api.addressing.AddressingVersion; import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java index 220dd8ea343..80f7d3bb6ea 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/message/saaj/SAAJMessageHeaders.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import javax.xml.soap.SOAPHeader; import javax.xml.soap.SOAPHeaderElement; import javax.xml.soap.SOAPMessage; +import com.sun.xml.internal.messaging.saaj.soap.SOAPDocumentImpl; +import com.sun.xml.internal.messaging.saaj.soap.impl.HeaderImpl; import com.sun.xml.internal.ws.api.SOAPVersion; import com.sun.xml.internal.ws.api.WSBinding; import com.sun.xml.internal.ws.api.message.Header; @@ -234,11 +236,12 @@ public class SAAJMessageHeaders implements MessageHeaders { if (soapHeader == null) { return null; } + SOAPDocumentImpl soapDocument = ((HeaderImpl)soapHeader).getSoapDocument(); SOAPHeaderElement headerElem = find(nsUri, localName); if (headerElem == null) { return null; } - headerElem = (SOAPHeaderElement) soapHeader.removeChild(headerElem); + headerElem = (SOAPHeaderElement) soapDocument.find(soapHeader.removeChild(headerElem)); //it might have been a nonSAAJHeader - remove from that map removeNonSAAJHeader(headerElem); @@ -330,7 +333,7 @@ public class SAAJMessageHeaders implements MessageHeaders { private void addNonSAAJHeader(SOAPHeaderElement headerElem, Header header) { if (nonSAAJHeaders == null) { - nonSAAJHeaders = new HashMap(); + nonSAAJHeaders = new HashMap<>(); } nonSAAJHeaders.put(headerElem, header); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java index 25e0462c3bb..12fbb26e8bd 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/pipe/ThreadHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 +68,7 @@ final class ThreadHelper { Class cls = Class.forName(SAFE_THREAD_NAME); Constructor ctr = cls.getConstructor(Runnable.class); return new SunMiscThreadFactory(ctr); - } catch (ClassNotFoundException ignored) { - } catch (NoSuchMethodException ignored) { - } + } catch (ClassNotFoundException | NoSuchMethodException ignored) {} return new LegacyThreadFactory(); } } @@ -90,7 +88,9 @@ final class ThreadHelper { try { return ctr.newInstance(null, r, "toBeReplaced", 0, false); } catch (ReflectiveOperationException x) { - throw new InternalError(x); + InternalError ie = new InternalError(x.getMessage()); + ie.initCause(ie); + throw ie; } } } @@ -99,7 +99,7 @@ final class ThreadHelper { private static class SunMiscThreadFactory implements ThreadFactory { final Constructor ctr; SunMiscThreadFactory(Constructor ctr) { this.ctr = ctr; } - @Override public Thread newThread(Runnable r) { + @Override public Thread newThread(final Runnable r) { return AccessController.doPrivileged( new PrivilegedAction() { @Override diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java index c8497055678..b976434a7bd 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/MethodUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * Utility class to invoke com.sun.xml.internal.ws.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks * to java.lang,reflect.Method.invoke() * * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too! @@ -39,43 +39,17 @@ import java.util.logging.Logger; class MethodUtil { private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); - private static final Method INVOKE_METHOD; - - static { - Method method; - try { - Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); - method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); - } - } catch (Throwable t) { - method = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); - } - } - INVOKE_METHOD = method; - } static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { - if (INVOKE_METHOD != null) { - // sun.reflect.misc.MethodUtil.invoke(method, owner, args) - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); - } - try { - return INVOKE_METHOD.invoke(null, method, target, args); - } catch (InvocationTargetException ite) { - // unwrap invocation exception added by reflection code ... - throw unwrapException(ite); - } - } else { - // other then Oracle JDK ... - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); - } - return method.invoke(target, args); + // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil"); + } + try { + return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java index 0c774aa0308..3ba900a13da 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/server/SDDocumentSource.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 +26,9 @@ package com.sun.xml.internal.ws.api.server; import com.sun.xml.internal.stream.buffer.XMLStreamBuffer; +import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import com.sun.xml.internal.ws.server.ServerRtException; import com.sun.xml.internal.ws.streaming.TidyXMLStreamReader; -import com.sun.xml.internal.ws.api.streaming.XMLStreamReaderFactory; import javax.xml.stream.XMLInputFactory; import javax.xml.stream.XMLStreamException; @@ -42,7 +42,7 @@ import java.net.URL; * SPI that provides the source of {@link SDDocument}. * *

    - * This abstract class could be implemented by appliations, or one of the + * This abstract class could be implemented by applications, or one of the * {@link #create} methods can be used. * * @author Kohsuke Kawaguchi @@ -85,28 +85,38 @@ public abstract class SDDocumentSource { /** * System ID of this document. + * @return */ public abstract URL getSystemId(); + public static SDDocumentSource create(final Class implClass, final String url) { + return create(url, implClass); + } + /** * Creates {@link SDDocumentSource} from an URL. + * @param url + * @return */ public static SDDocumentSource create(final URL url) { return new SDDocumentSource() { private final URL systemId = url; + @Override public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException { InputStream is = url.openStream(); return new TidyXMLStreamReader( xif.createXMLStreamReader(systemId.toExternalForm(),is), is); } + @Override public XMLStreamReader read() throws IOException, XMLStreamException { InputStream is = url.openStream(); return new TidyXMLStreamReader( XMLStreamReaderFactory.create(systemId.toExternalForm(),is,false), is); } + @Override public URL getSystemId() { return systemId; } @@ -120,19 +130,22 @@ public abstract class SDDocumentSource { * @param resolvingClass class used to read resource * @param path resource path */ - public static SDDocumentSource create(final Class resolvingClass, final String path) { + private static SDDocumentSource create(final String path, final Class resolvingClass) { return new SDDocumentSource() { + @Override public XMLStreamReader read(XMLInputFactory xif) throws IOException, XMLStreamException { InputStream is = inputStream(); return new TidyXMLStreamReader(xif.createXMLStreamReader(path,is), is); } + @Override public XMLStreamReader read() throws IOException, XMLStreamException { InputStream is = inputStream(); return new TidyXMLStreamReader(XMLStreamReaderFactory.create(path,is,false), is); } + @Override public URL getSystemId() { try { return new URL("file://" + path); @@ -142,12 +155,10 @@ public abstract class SDDocumentSource { } private InputStream inputStream() throws IOException { - java.lang.reflect.Module module = resolvingClass.getModule(); - if (module != null) { - InputStream stream = module.getResourceAsStream(path); - if (stream != null) { - return stream; - } + java.lang.Module module = resolvingClass.getModule(); + InputStream stream = module.getResourceAsStream(path); + if (stream != null) { + return stream; } throw new ServerRtException("cannot.load.wsdl", path); } @@ -157,17 +168,23 @@ public abstract class SDDocumentSource { /** * Creates a {@link SDDocumentSource} from {@link XMLStreamBuffer}. + * @param systemId + * @param xsb + * @return */ public static SDDocumentSource create(final URL systemId, final XMLStreamBuffer xsb) { return new SDDocumentSource() { + @Override public XMLStreamReader read(XMLInputFactory xif) throws XMLStreamException { return xsb.readAsXMLStreamReader(); } + @Override public XMLStreamReader read() throws XMLStreamException { return xsb.readAsXMLStreamReader(); } + @Override public URL getSystemId() { return systemId; } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java index d62cb623a86..6c76e261341 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/api/streaming/ContextClassloaderLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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.xml.internal.ws.api.streaming; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ import java.util.WeakHashMap; */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ abstract class ContextClassloaderLocal { try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java index 927fad4d4b0..536e388a4e8 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/BindingImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +75,7 @@ public abstract class BindingImpl implements WSBinding { //This is reset when ever Binding.setHandlerChain() or SOAPBinding.setRoles() is called. private HandlerConfiguration handlerConfig; private final Set addedHeaders = new HashSet(); - private final Set knownHeaders = new HashSet(); + private final Set knownHeaders = Collections.synchronizedSet(new HashSet()); private final Set unmodKnownHeaders = Collections.unmodifiableSet(knownHeaders); private final BindingID bindingId; // Features that are set(enabled/disabled) on the binding diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java index 292ed73c135..f61114eb632 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/binding/SOAPBindingImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 +42,8 @@ import javax.xml.ws.handler.Handler; import javax.xml.ws.soap.MTOMFeature; import javax.xml.ws.soap.SOAPBinding; import java.util.*; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; /** * @author WS Development Team @@ -57,6 +59,7 @@ public final class SOAPBindingImpl extends BindingImpl implements SOAPBinding { private Set portKnownHeaders = Collections.emptySet(); private Set bindingUnderstoodHeaders = new HashSet(); + private final Lock lock = new ReentrantLock(); /** * Use {@link BindingImpl#create(BindingID)} to create this. @@ -95,7 +98,13 @@ public final class SOAPBindingImpl extends BindingImpl implements SOAPBinding { * @param headers SOAP header names */ public void setPortKnownHeaders(@NotNull Set headers) { - this.portKnownHeaders = headers; + + try{ + lock.lock(); + this.portKnownHeaders = headers; + } finally { + lock.unlock(); + } } /** diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java index f0daea51faf..9194ce4ddd0 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/client/sei/MethodUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * Utility class to invoke com.sun.xml.internal.ws.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks * to java.lang,reflect.Method.invoke() *

    * Be careful, copy of this class exists in several packages, iny modification must be done to other copies too! @@ -39,43 +39,17 @@ import java.util.logging.Logger; class MethodUtil { private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); - private static final Method INVOKE_METHOD; - - static { - Method method; - try { - Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); - method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); - } - } catch (Throwable t) { - method = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); - } - } - INVOKE_METHOD = method; - } static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { - if (INVOKE_METHOD != null) { - // sun.reflect.misc.MethodUtil.invoke(method, owner, args) - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); - } - try { - return INVOKE_METHOD.invoke(null, method, target, args); - } catch (InvocationTargetException ite) { - // unwrap invocation exception added by reflection code ... - throw unwrapException(ite); - } - } else { - // other then Oracle JDK ... - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); - } - return method.invoke(target, args); + // com.sun.xml.internal.ws.util.MethodUtil.invoke(method, owner, args) + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.util.MethodUtil"); + } + try { + return com.sun.xml.internal.ws.util.MethodUtil.invoke(method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java index 63809b00875..7ae8158bbf8 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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.xml.internal.ws.commons.xmlutil; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ import java.util.WeakHashMap; */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ abstract class ContextClassloaderLocal { try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java index e7d0050e775..957607e8cae 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/developer/ContextClassloaderLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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.xml.internal.ws.developer; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ import java.util.WeakHashMap; */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ abstract class ContextClassloaderLocal { try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java index 158e0a9f8ef..adbcb7967bf 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/Injector.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. * 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,16 @@ package com.sun.xml.internal.ws.model; +import java.lang.reflect.Field; import javax.xml.ws.WebServiceException; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.security.ProtectionDomain; import java.util.logging.Level; import java.util.logging.Logger; @@ -44,31 +48,68 @@ final class Injector { private static final Logger LOGGER = Logger.getLogger(Injector.class.getName()); - private static final Method defineClass; - private static final Method resolveClass; - private static final Method getPackage; - private static final Method definePackage; + private static Method defineClass; + private static Method resolveClass; + private static Method getPackage; + private static Method definePackage; + private static Object U; static { - Method[] m = AccessController.doPrivileged( - new PrivilegedAction() { - @Override - public Method[] run() { - return new Method[]{ - getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), - getMethod(ClassLoader.class, "resolveClass", Class.class), - getMethod(ClassLoader.class, "getPackage", String.class), - getMethod(ClassLoader.class, "definePackage", - String.class, String.class, String.class, String.class, - String.class, String.class, String.class, URL.class) - }; - } + try { + Method[] m = AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public Method[] run() { + return new Method[]{ + getMethod(ClassLoader.class, "defineClass", String.class, byte[].class, Integer.TYPE, Integer.TYPE), + getMethod(ClassLoader.class, "resolveClass", Class.class), + getMethod(ClassLoader.class, "getPackage", String.class), + getMethod(ClassLoader.class, "definePackage", + String.class, String.class, String.class, String.class, + String.class, String.class, String.class, URL.class) + }; } - ); - defineClass = m[0]; - resolveClass = m[1]; - getPackage = m[2]; - definePackage = m[3]; + } + ); + defineClass = m[0]; + resolveClass = m[1]; + getPackage = m[2]; + definePackage = m[3]; + + } catch (Throwable t) { + try { + U = AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Object run() throws Exception { + Class u = Class.forName("sun.misc.Unsafe"); + Field theUnsafe = u.getDeclaredField("theUnsafe"); + theUnsafe.setAccessible(true); + return theUnsafe.get(null); + } + }); + defineClass = AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Method run() throws Exception { + try { + return U.getClass().getMethod("defineClass", + new Class[]{String.class, + byte[].class, + Integer.TYPE, + Integer.TYPE, + ClassLoader.class, + ProtectionDomain.class}); + } catch (NoSuchMethodException | SecurityException ex) { + throw ex; + } + } + }); + } catch (SecurityException | PrivilegedActionException ex) { + Logger.getLogger(Injector.class.getName()).log(Level.SEVERE, null, ex); + WebServiceException we = new WebServiceException(ex); + we.addSuppressed(t); + throw we; + } + } } private static Method getMethod(final Class c, final String methodname, final Class... params) { @@ -91,24 +132,26 @@ final class Injector { // nothing to do } try { + if (definePackage == null) { + return (Class) defineClass.invoke(U, className.replace('/', '.'), image, 0, image.length, cl, Injector.class.getProtectionDomain()); + } int packIndex = className.lastIndexOf('.'); if (packIndex != -1) { String pkgname = className.substring(0, packIndex); // Check if package already loaded. - Package pkg = (Package)getPackage.invoke(cl, pkgname); + Package pkg = (Package) getPackage.invoke(cl, pkgname); if (pkg == null) { definePackage.invoke(cl, pkgname, null, null, null, null, null, null, null); } } - Class c = (Class)defineClass.invoke(cl,className.replace('/','.'),image,0,image.length); + Class c = (Class) defineClass.invoke(cl, className.replace('/', '.'), image, 0, image.length); resolveClass.invoke(cl, c); return c; - } catch (IllegalAccessException e) { - LOGGER.log(Level.FINE,"Unable to inject "+className,e); - throw new WebServiceException(e); - } catch (InvocationTargetException e) { - LOGGER.log(Level.FINE,"Unable to inject "+className,e); + } catch (IllegalAccessException | InvocationTargetException e) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Unable to inject " + className, e); + } throw new WebServiceException(e); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java index 29f852ed033..ad6f52f342e 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/RuntimeModeler.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -346,7 +346,6 @@ public class RuntimeModeler { } private boolean noWrapperGen() { - if (Runtime.version().major() >= 9) return true; Object o = config.properties().get(SuppressDocLitWrapperGeneration); return (o!= null && o instanceof Boolean) ? ((Boolean) o) : false; } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java index 6879a6062dc..4e72aac154b 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/model/SOAPSEIModel.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ import javax.xml.namespace.QName; import java.util.HashSet; import java.util.Iterator; import java.util.Set; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; /** * Creates SOAP specific RuntimeModel @@ -41,6 +43,8 @@ import java.util.Set; */ public class SOAPSEIModel extends AbstractSEIModelImpl { + private final Lock lock = new ReentrantLock(); + public SOAPSEIModel(WebServiceFeatureList features) { super(features); } @@ -72,15 +76,22 @@ public class SOAPSEIModel extends AbstractSEIModelImpl { public Set getKnownHeaders() { Set headers = new HashSet(); - for (JavaMethodImpl method : getJavaMethods()) { - // fill in request headers - Iterator params = method.getRequestParameters().iterator(); - fillHeaders(params, headers, Mode.IN); + + try{ + lock.lock(); + for (JavaMethodImpl method : getJavaMethods()) { + // fill in request headers + Iterator params = method.getRequestParameters().iterator(); + fillHeaders(params, headers, Mode.IN); // fill in response headers - params = method.getResponseParameters().iterator(); - fillHeaders(params, headers, Mode.OUT); - } + params = method.getResponseParameters().iterator(); + fillHeaders(params, headers, Mode.OUT); + } + }finally + { + lock.unlock(); + } return headers; } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java index ad2ad4a6ef5..127f74476b3 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/privateutil/MethodUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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,49 +31,22 @@ import java.util.logging.Level; import java.util.logging.Logger; /** - * Utility class to invoke sun.reflect.misc.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks + * Utility class to invoke com.sun.xml.internal.ws.policy.util.MethodUtil.invoke() if available. If not (other then Oracle JDK) fallbacks * to java.lang,reflect.Method.invoke() */ class MethodUtil { private static final Logger LOGGER = Logger.getLogger(MethodUtil.class.getName()); - private static final Method INVOKE_METHOD; - - static { - Method method; - try { - Class clazz = Class.forName("sun.reflect.misc.MethodUtil"); - method = clazz.getMethod("invoke", Method.class, Object.class, Object[].class); - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil found; it will be used to invoke methods."); - } - } catch (Throwable t) { - method = null; - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Class sun.reflect.misc.MethodUtil not found, probably non-Oracle JVM"); - } - } - INVOKE_METHOD = method; - } static Object invoke(Object target, Method method, Object[] args) throws IllegalAccessException, InvocationTargetException { - if (INVOKE_METHOD != null) { - // sun.reflect.misc.MethodUtil.invoke(method, owner, args) - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method using sun.reflect.misc.MethodUtil"); - } - try { - return INVOKE_METHOD.invoke(null, method, target, args); - } catch (InvocationTargetException ite) { - // unwrap invocation exception added by reflection code ... - throw unwrapException(ite); - } - } else { - // other then Oracle JDK ... - if (LOGGER.isLoggable(Level.FINE)) { - LOGGER.log(Level.FINE, "Invoking method directly, probably non-Oracle JVM"); - } - return method.invoke(target, args); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, "Invoking method using com.sun.xml.internal.ws.policy.util.MethodUtil"); + } + try { + return com.sun.xml.internal.ws.policy.util.MethodUtil.invoke(method, target, args); + } catch (InvocationTargetException ite) { + // unwrap invocation exception added by reflection code ... + throw unwrapException(ite); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java new file mode 100644 index 00000000000..b8af4d28a37 --- /dev/null +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/policy/util/MethodUtil.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.xml.internal.ws.policy.util; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.security.AccessController; +import java.security.AllPermission; +import java.security.CodeSource; +import java.security.PermissionCollection; +import java.security.PrivilegedExceptionAction; +import java.security.SecureClassLoader; +import java.util.Arrays; + +/* + * This copies from sun.reflect.misc.MethodUtil to implement the trampoline + * code such that when a Method is invoked, it will be called through + * the trampoline that is defined by this MethodUtil class loader. + */ +class Trampoline { + static { + if (Trampoline.class.getClassLoader() == null) { + throw new Error( + "Trampoline must not be defined by the bootstrap classloader"); + } + } + + private static void ensureInvocableMethod(Method m) + throws InvocationTargetException { + Class clazz = m.getDeclaringClass(); + if (clazz.equals(AccessController.class) || + clazz.equals(Method.class) || + clazz.getName().startsWith("java.lang.invoke.")) + throw new InvocationTargetException( + new UnsupportedOperationException("invocation not supported")); + } + + private static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException { + ensureInvocableMethod(m); + return m.invoke(obj, params); + } +} + +/* + * Create a trampoline class. + */ +public final class MethodUtil extends SecureClassLoader { + private static final String WS_UTIL_POLICY_PKG = "com.sun.xml.internal.ws.policy.util."; + private static final String TRAMPOLINE = WS_UTIL_POLICY_PKG + "Trampoline"; + private static final Method bounce = getTrampoline(); + private static final int DEFAULT_BUFFER_SIZE = 8192; + private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8; + + + private MethodUtil() { + super(); + } + + /* + * Bounce through the trampoline. + */ + public static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException { + try { + return bounce.invoke(null, m, obj, params); + } catch (InvocationTargetException ie) { + Throwable t = ie.getCause(); + + if (t instanceof InvocationTargetException) { + throw (InvocationTargetException) t; + } else if (t instanceof IllegalAccessException) { + throw (IllegalAccessException) t; + } else if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } else if (t instanceof Error) { + throw (Error) t; + } else { + throw new Error("Unexpected invocation error", t); + } + } catch (IllegalAccessException iae) { + // this can't happen + throw new Error("Unexpected invocation error", iae); + } + } + + private static Method getTrampoline() { + try { + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Method run() throws Exception { + Class t = getTrampolineClass(); + Method b = t.getDeclaredMethod("invoke", + Method.class, Object.class, Object[].class); + b.setAccessible(true); + return b; + } + }); + } catch (Exception e) { + throw new InternalError("bouncer cannot be found", e); + } + } + + + protected synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException { + // First, check if the class has already been loaded + checkPackageAccess(name); + Class c = findLoadedClass(name); + if (c == null) { + try { + c = findClass(name); + } catch (ClassNotFoundException e) { + // Fall through ... + } + if (c == null) { + c = getParent().loadClass(name); + } + } + if (resolve) { + resolveClass(c); + } + return c; + } + + + protected Class findClass(final String name) + throws ClassNotFoundException { + if (!name.startsWith(WS_UTIL_POLICY_PKG)) { + throw new ClassNotFoundException(name); + } + String path = "/".concat(name.replace('.', '/').concat(".class")); + try (InputStream in = MethodUtil.class.getResourceAsStream(path)) { + byte[] b = readAllBytes(in); + return defineClass(name, b); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } + + /** + * JDK9 {@link InputStream#readAllBytes()} substitution. + */ + private byte[] readAllBytes(InputStream in) throws IOException { + byte[] buf = new byte[DEFAULT_BUFFER_SIZE]; + int capacity = buf.length; + int nread = 0; + int n; + for (; ; ) { + // read to EOF which may read more or less than initial buffer size + while ((n = in.read(buf, nread, capacity - nread)) > 0) + nread += n; + + // if the last call to read returned -1, then we're done + if (n < 0) + break; + + // need to allocate a larger buffer + if (capacity <= MAX_BUFFER_SIZE - capacity) { + capacity = capacity << 1; + } else { + if (capacity == MAX_BUFFER_SIZE) + throw new OutOfMemoryError("Required array size too large"); + capacity = MAX_BUFFER_SIZE; + } + buf = Arrays.copyOf(buf, capacity); + } + return (capacity == nread) ? buf : Arrays.copyOf(buf, nread); + } + + + /* + * Define the proxy classes + */ + private Class defineClass(String name, byte[] b) throws IOException { + CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[]) null); + if (!name.equals(TRAMPOLINE)) { + throw new IOException("MethodUtil: bad name " + name); + } + return defineClass(name, b, 0, b.length, cs); + } + + protected PermissionCollection getPermissions(CodeSource codesource) { + PermissionCollection perms = super.getPermissions(codesource); + perms.add(new AllPermission()); + return perms; + } + + private static Class getTrampolineClass() { + try { + return Class.forName(TRAMPOLINE, true, new MethodUtil()); + } catch (ClassNotFoundException e) { + } + return null; + } + + /** + * Checks package access on the given classname. + * This method is typically called when the Class instance is not + * available and the caller attempts to load a class on behalf + * the true caller (application). + */ + private static void checkPackageAccess(String name) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + String cname = name.replace('/', '.'); + if (cname.startsWith("[")) { + int b = cname.lastIndexOf('[') + 2; + if (b > 1 && b < cname.length()) { + cname = cname.substring(b); + } + } + int i = cname.lastIndexOf('.'); + if (i != -1) { + s.checkPackageAccess(cname.substring(0, i)); + } + } + } + + /** + * Checks package access on the given class. + *

    + * If it is a {@link Proxy#isProxyClass(Class)} that implements + * a non-public interface (i.e. may be in a non-restricted package), + * also check the package access on the proxy interfaces. + */ + private static void checkPackageAccess(Class clazz) { + checkPackageAccess(clazz.getName()); + if (isNonPublicProxyClass(clazz)) { + checkProxyPackageAccess(clazz); + } + } + + // Note that bytecode instrumentation tools may exclude 'sun.*' + // classes but not generated proxy classes and so keep it in com.sun.* + private static final String PROXY_PACKAGE = "com.sun.proxy"; + + /** + * Test if the given class is a proxy class that implements + * non-public interface. Such proxy class may be in a non-restricted + * package that bypasses checkPackageAccess. + */ + private static boolean isNonPublicProxyClass(Class cls) { + String name = cls.getName(); + int i = name.lastIndexOf('.'); + String pkg = (i != -1) ? name.substring(0, i) : ""; + return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE); + } + + /** + * Check package access on the proxy interfaces that the given proxy class + * implements. + * + * @param clazz Proxy class object + */ + private static void checkProxyPackageAccess(Class clazz) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + // check proxy interfaces if the given class is a proxy class + if (Proxy.isProxyClass(clazz)) { + for (Class intf : clazz.getInterfaces()) { + checkPackageAccess(intf); + } + } + } + } +} diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties similarity index 94% rename from jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties rename to jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties index c0267b823ea..d79956811cb 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/commons/xmlutil/ContextClassloaderLocal.properties +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocal.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java new file mode 100644 index 00000000000..d52a1ab00d3 --- /dev/null +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/resources/ContextClassloaderLocalMessages.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.xml.internal.ws.resources; + +import java.util.Locale; +import java.util.ResourceBundle; +import javax.annotation.Generated; +import com.sun.istack.internal.localization.Localizable; +import com.sun.istack.internal.localization.LocalizableMessageFactory; +import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier; +import com.sun.istack.internal.localization.Localizer; + + +/** + * Defines string formatting method for each constant in the resource file + * + */ +@Generated("com.sun.istack.internal.maven.ResourceGenMojo") +public final class ContextClassloaderLocalMessages { + + private final static String BUNDLE_NAME = "com.sun.xml.internal.ws.resources.ContextClassloaderLocal"; + private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier()); + private final static Localizer LOCALIZER = new Localizer(); + + public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) { + return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0); + } + + /** + * Failed to create new instance of {0} + * + */ + public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) { + return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0)); + } + + private static class BundleSupplier + implements ResourceBundleSupplier + { + + + public ResourceBundle getResourceBundle(Locale locale) { + return ResourceBundle.getBundle(BUNDLE_NAME, locale); + } + + } + +} diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java index cf0bf26eec3..976cdd1e7b5 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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.xml.internal.ws.spi; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ import java.util.WeakHashMap; */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ abstract class ContextClassloaderLocal { try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java index 9f23f51b43a..944dd388df6 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/EndpointImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,13 +69,11 @@ import org.w3c.dom.Element; /** * Implements {@link Endpoint}. - *

    - *

    + * * This class accumulates the information necessary to create * {@link WSEndpoint}, and then when {@link #publish} method * is called it will be created. - *

    - *

    + * * This object also allows accumulated information to be retrieved. * * @author Jitendra Kotamraju @@ -205,14 +203,17 @@ public class EndpointImpl extends Endpoint { invoker = null; } + @Override public Binding getBinding() { return binding; } + @Override public Object getImplementor() { return implementor; } + @Override public void publish(String address) { canPublish(); URL url; @@ -232,6 +233,7 @@ public class EndpointImpl extends Endpoint { ((HttpEndpoint) actualEndpoint).publish(address); } + @Override public void publish(Object serverContext) { canPublish(); if (!com.sun.net.httpserver.HttpContext.class.isAssignableFrom(serverContext.getClass())) { @@ -241,12 +243,14 @@ public class EndpointImpl extends Endpoint { ((HttpEndpoint) actualEndpoint).publish(serverContext); } + @Override public void publish(HttpContext serverContext) { canPublish(); createEndpoint(serverContext.getPath()); ((HttpEndpoint) actualEndpoint).publish(serverContext); } + @Override public void stop() { if (isPublished()) { ((HttpEndpoint) actualEndpoint).stop(); @@ -255,14 +259,17 @@ public class EndpointImpl extends Endpoint { } } + @Override public boolean isPublished() { return actualEndpoint != null; } + @Override public List getMetadata() { return metadata; } + @Override public void setMetadata(java.util.List metadata) { if (isPublished()) { throw new IllegalStateException("Cannot set Metadata. Endpoint is already published"); @@ -270,20 +277,24 @@ public class EndpointImpl extends Endpoint { this.metadata = metadata; } + @Override public Executor getExecutor() { return executor; } + @Override public void setExecutor(Executor executor) { this.executor = executor; } + @Override public Map getProperties() { - return new HashMap(properties); + return new HashMap<>(properties); } + @Override public void setProperties(Map map) { - this.properties = new HashMap(map); + this.properties = new HashMap<>(map); } /* @@ -335,7 +346,7 @@ public class EndpointImpl extends Endpoint { * reuse the Source object multiple times. */ private List buildDocList() { - List r = new ArrayList(); + List r = new ArrayList<>(); if (metadata != null) { for (Source source : metadata) { @@ -344,14 +355,8 @@ public class EndpointImpl extends Endpoint { String systemId = source.getSystemId(); r.add(SDDocumentSource.create(new URL(systemId), xsbr.getXMLStreamBuffer())); - } catch (TransformerException te) { + } catch (TransformerException | IOException | SAXException | ParserConfigurationException te) { throw new ServerRtException("server.rt.err", te); - } catch (IOException te) { - throw new ServerRtException("server.rt.err", te); - } catch (SAXException e) { - throw new ServerRtException("server.rt.err", e); - } catch (ParserConfigurationException e) { - throw new ServerRtException("server.rt.err", e); } } } @@ -367,11 +372,6 @@ public class EndpointImpl extends Endpoint { EndpointFactory.verifyImplementorClass(implClass, metadataReader); String wsdlLocation = EndpointFactory.getWsdlLocation(implClass, metadataReader); if (wsdlLocation != null) { - ClassLoader cl = implClass.getClassLoader(); - URL url = cl.getResource(wsdlLocation); - if (url != null) { - return SDDocumentSource.create(url); - } return SDDocumentSource.create(implClass, wsdlLocation); } return null; @@ -388,10 +388,12 @@ public class EndpointImpl extends Endpoint { } } + @Override public EndpointReference getEndpointReference(Element...referenceParameters) { return getEndpointReference(W3CEndpointReference.class, referenceParameters); } + @Override public T getEndpointReference(Class clazz, Element...referenceParameters) { if (!isPublished()) { throw new WebServiceException("Endpoint is not published yet"); @@ -458,13 +460,12 @@ public class EndpointImpl extends Endpoint { public void start(@NotNull WSWebServiceContext wsc, @NotNull WSEndpoint endpoint) { try { spiInvoker.inject(wsc); - } catch (IllegalAccessException e) { - throw new WebServiceException(e); - } catch (InvocationTargetException e) { + } catch (IllegalAccessException | InvocationTargetException e) { throw new WebServiceException(e); } } + @Override public Object invoke(@NotNull Packet p, @NotNull Method m, @NotNull Object... args) throws InvocationTargetException, IllegalAccessException { return spiInvoker.invoke(m, args); } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java index 6455b83efa9..2d8ecee4cfc 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/transport/http/server/ServerMgr.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.logging.Level; import java.util.logging.Logger; -import java.util.Optional; /** @@ -49,10 +49,10 @@ import java.util.Optional; final class ServerMgr { private static final ServerMgr serverMgr = new ServerMgr(); - private static final Logger logger = + private static final Logger LOGGER = Logger.getLogger( com.sun.xml.internal.ws.util.Constants.LoggingDomain + ".server.http"); - private final Map servers = new HashMap(); + private final Map servers = new HashMap<>(); private ServerMgr() {} @@ -83,25 +83,26 @@ final class ServerMgr { synchronized(servers) { state = servers.get(inetAddress); if (state == null) { - final int finalPortNum = port; - Optional stateOpt = - servers.values() - .stream() - .filter(s -> s.getServer() - .getAddress() - .getPort() == finalPortNum) - .findAny(); - - if (inetAddress.getAddress().isAnyLocalAddress() && - stateOpt.isPresent()) { - state = stateOpt.get(); + ServerState free = null; + for (ServerState ss : servers.values()) { + if (port == ss.getServer().getAddress().getPort()) { + free = ss; + break; + } + } + if (inetAddress.getAddress().isAnyLocalAddress() && free != null) { + state = free; } else { - logger.fine("Creating new HTTP Server at "+inetAddress); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Creating new HTTP Server at "+inetAddress); + } // Creates server with default socket backlog server = HttpServer.create(inetAddress, 0); server.setExecutor(Executors.newCachedThreadPool()); String path = url.toURI().getPath(); - logger.fine("Creating HTTP Context at = "+path); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Creating HTTP Context at = "+path); + } HttpContext context = server.createContext(path); server.start(); @@ -110,7 +111,9 @@ final class ServerMgr { // or IP: 0.0.0.0 - which is used to monitor network traffic from any valid IP address inetAddress = server.getAddress(); - logger.fine("HTTP server started = "+inetAddress); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("HTTP server started = "+inetAddress); + } state = new ServerState(server, path); servers.put(inetAddress, state); return context; @@ -121,11 +124,15 @@ final class ServerMgr { if (state.getPaths().contains(url.getPath())) { String err = "Context with URL path "+url.getPath()+ " already exists on the server "+server.getAddress(); - logger.fine(err); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine(err); + } throw new IllegalArgumentException(err); } - logger.fine("Creating HTTP Context at = "+url.getPath()); + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.fine("Creating HTTP Context at = "+url.getPath()); + } HttpContext context = server.createContext(url.getPath()); state.oneMoreContext(url.getPath()); return context; @@ -157,7 +164,7 @@ final class ServerMgr { private static final class ServerState { private final HttpServer server; private int instances; - private Set paths = new HashSet(); + private final Set paths = new HashSet<>(); ServerState(HttpServer server, String path) { this.server = server; diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java index 42385239f3f..53d37f3dee8 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/HandlerAnnotationProcessor.java @@ -234,17 +234,15 @@ public class HandlerAnnotationProcessor { } private static InputStream moduleResource(Class resolvingClass, String name) { - java.lang.reflect.Module module = resolvingClass.getModule(); - if (module != null) { - try { - InputStream stream = module.getResourceAsStream(name); - if (stream != null) { - return stream; - } - } catch(IOException e) { - throw new UtilException("util.failed.to.find.handlerchain.file", - resolvingClass.getName(), name); + Module module = resolvingClass.getModule(); + try { + InputStream stream = module.getResourceAsStream(name); + if (stream != null) { + return stream; } + } catch(IOException e) { + throw new UtilException("util.failed.to.find.handlerchain.file", + resolvingClass.getName(), name); } return null; } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java new file mode 100644 index 00000000000..8eaf51e461f --- /dev/null +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/MethodUtil.java @@ -0,0 +1,293 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.xml.internal.ws.util; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.security.AccessController; +import java.security.AllPermission; +import java.security.CodeSource; +import java.security.PermissionCollection; +import java.security.PrivilegedExceptionAction; +import java.security.SecureClassLoader; +import java.util.Arrays; + +/* + * This copies from sun.reflect.misc.MethodUtil to implement the trampoline + * code such that when a Method is invoked, it will be called through + * the trampoline that is defined by this MethodUtil class loader. + */ +class Trampoline { + static { + if (Trampoline.class.getClassLoader() == null) { + throw new Error( + "Trampoline must not be defined by the bootstrap classloader"); + } + } + + private static void ensureInvocableMethod(Method m) + throws InvocationTargetException { + Class clazz = m.getDeclaringClass(); + if (clazz.equals(AccessController.class) || + clazz.equals(Method.class) || + clazz.getName().startsWith("java.lang.invoke.")) + throw new InvocationTargetException( + new UnsupportedOperationException("invocation not supported")); + } + + private static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException { + ensureInvocableMethod(m); + return m.invoke(obj, params); + } +} + +/* + * Create a trampoline class. + */ +public final class MethodUtil extends SecureClassLoader { + private static final String WS_UTIL_PKG = "com.sun.xml.internal.ws.util."; + private static final String TRAMPOLINE = WS_UTIL_PKG + "Trampoline"; + private static final Method bounce = getTrampoline(); + private static final int DEFAULT_BUFFER_SIZE = 8192; + private static final int MAX_BUFFER_SIZE = Integer.MAX_VALUE - 8; + + + private MethodUtil() { + super(); + } + + /* + * Bounce through the trampoline. + */ + public static Object invoke(Method m, Object obj, Object[] params) + throws InvocationTargetException, IllegalAccessException { + try { + return bounce.invoke(null, m, obj, params); + } catch (InvocationTargetException ie) { + Throwable t = ie.getCause(); + + if (t instanceof InvocationTargetException) { + throw (InvocationTargetException) t; + } else if (t instanceof IllegalAccessException) { + throw (IllegalAccessException) t; + } else if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } else if (t instanceof Error) { + throw (Error) t; + } else { + throw new Error("Unexpected invocation error", t); + } + } catch (IllegalAccessException iae) { + // this can't happen + throw new Error("Unexpected invocation error", iae); + } + } + + private static Method getTrampoline() { + try { + return AccessController.doPrivileged( + new PrivilegedExceptionAction() { + public Method run() throws Exception { + Class t = getTrampolineClass(); + Method b = t.getDeclaredMethod("invoke", + Method.class, Object.class, Object[].class); + b.setAccessible(true); + return b; + } + }); + } catch (Exception e) { + throw new InternalError("bouncer cannot be found", e); + } + } + + + protected synchronized Class loadClass(String name, boolean resolve) + throws ClassNotFoundException { + // First, check if the class has already been loaded + checkPackageAccess(name); + Class c = findLoadedClass(name); + if (c == null) { + try { + c = findClass(name); + } catch (ClassNotFoundException e) { + // Fall through ... + } + if (c == null) { + c = getParent().loadClass(name); + } + } + if (resolve) { + resolveClass(c); + } + return c; + } + + + protected Class findClass(final String name) + throws ClassNotFoundException { + if (!name.startsWith(WS_UTIL_PKG)) { + throw new ClassNotFoundException(name); + } + String path = "/".concat(name.replace('.', '/').concat(".class")); + try (InputStream in = MethodUtil.class.getResourceAsStream(path)) { + byte[] b = readAllBytes(in); + return defineClass(name, b); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } + + /** + * JDK9 {@link InputStream#readAllBytes()} substitution. + */ + private byte[] readAllBytes(InputStream in) throws IOException { + byte[] buf = new byte[DEFAULT_BUFFER_SIZE]; + int capacity = buf.length; + int nread = 0; + int n; + for (; ; ) { + // read to EOF which may read more or less than initial buffer size + while ((n = in.read(buf, nread, capacity - nread)) > 0) + nread += n; + + // if the last call to read returned -1, then we're done + if (n < 0) + break; + + // need to allocate a larger buffer + if (capacity <= MAX_BUFFER_SIZE - capacity) { + capacity = capacity << 1; + } else { + if (capacity == MAX_BUFFER_SIZE) + throw new OutOfMemoryError("Required array size too large"); + capacity = MAX_BUFFER_SIZE; + } + buf = Arrays.copyOf(buf, capacity); + } + return (capacity == nread) ? buf : Arrays.copyOf(buf, nread); + } + + + /* + * Define the proxy classes + */ + private Class defineClass(String name, byte[] b) throws IOException { + CodeSource cs = new CodeSource(null, (java.security.cert.Certificate[]) null); + if (!name.equals(TRAMPOLINE)) { + throw new IOException("MethodUtil: bad name " + name); + } + return defineClass(name, b, 0, b.length, cs); + } + + protected PermissionCollection getPermissions(CodeSource codesource) { + PermissionCollection perms = super.getPermissions(codesource); + perms.add(new AllPermission()); + return perms; + } + + private static Class getTrampolineClass() { + try { + return Class.forName(TRAMPOLINE, true, new MethodUtil()); + } catch (ClassNotFoundException e) { + } + return null; + } + + /** + * Checks package access on the given classname. + * This method is typically called when the Class instance is not + * available and the caller attempts to load a class on behalf + * the true caller (application). + */ + private static void checkPackageAccess(String name) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + String cname = name.replace('/', '.'); + if (cname.startsWith("[")) { + int b = cname.lastIndexOf('[') + 2; + if (b > 1 && b < cname.length()) { + cname = cname.substring(b); + } + } + int i = cname.lastIndexOf('.'); + if (i != -1) { + s.checkPackageAccess(cname.substring(0, i)); + } + } + } + + /** + * Checks package access on the given class. + *

    + * If it is a {@link Proxy#isProxyClass(Class)} that implements + * a non-public interface (i.e. may be in a non-restricted package), + * also check the package access on the proxy interfaces. + */ + private static void checkPackageAccess(Class clazz) { + checkPackageAccess(clazz.getName()); + if (isNonPublicProxyClass(clazz)) { + checkProxyPackageAccess(clazz); + } + } + + // Note that bytecode instrumentation tools may exclude 'sun.*' + // classes but not generated proxy classes and so keep it in com.sun.* + private static final String PROXY_PACKAGE = "com.sun.proxy"; + + /** + * Test if the given class is a proxy class that implements + * non-public interface. Such proxy class may be in a non-restricted + * package that bypasses checkPackageAccess. + */ + private static boolean isNonPublicProxyClass(Class cls) { + String name = cls.getName(); + int i = name.lastIndexOf('.'); + String pkg = (i != -1) ? name.substring(0, i) : ""; + return Proxy.isProxyClass(cls) && !pkg.startsWith(PROXY_PACKAGE); + } + + /** + * Check package access on the proxy interfaces that the given proxy class + * implements. + * + * @param clazz Proxy class object + */ + private static void checkProxyPackageAccess(Class clazz) { + SecurityManager s = System.getSecurityManager(); + if (s != null) { + // check proxy interfaces if the given class is a proxy class + if (Proxy.isProxyClass(clazz)) { + for (Class intf : clazz.getInterfaces()) { + checkPackageAccess(intf); + } + } + } + } +} diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties index eedc7c2b359..82452acb3d7 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. # 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,4 +26,4 @@ build-id=2.3.0-SNAPSHOT build-version=JAX-WS RI 2.3.0-SNAPSHOT major-version=2.3.0 -svn-revision=5c2c1fd2f2ab3b5c7cea25f79aa49e54cb84b7cc +svn-revision=e8c5e9697d9b27d83ff35d767939b2f55e667621 diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java index 93a44b68050..715db421328 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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.xml.internal.ws.util.xml; +import com.sun.xml.internal.ws.resources.ContextClassloaderLocalMessages; + import java.security.AccessController; import java.security.PrivilegedAction; -import java.text.MessageFormat; -import java.util.ResourceBundle; import java.util.WeakHashMap; /** @@ -36,9 +36,7 @@ import java.util.WeakHashMap; */ abstract class ContextClassloaderLocal { - private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE"; - - private WeakHashMap CACHE = new WeakHashMap(); + private WeakHashMap CACHE = new WeakHashMap<>(); public V get() throws Error { ClassLoader tccl = getContextClassLoader(); @@ -60,26 +58,21 @@ abstract class ContextClassloaderLocal { try { return initialValue(); } catch (Exception e) { - throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e); + throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e); } } - private static String format(String property, Object... args) { - String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property); - return MessageFormat.format(text, args); - } - private static ClassLoader getContextClassLoader() { - return (ClassLoader) - AccessController.doPrivileged(new PrivilegedAction() { - public Object run() { - ClassLoader cl = null; - try { - cl = Thread.currentThread().getContextClassLoader(); - } catch (SecurityException ex) { - } - return cl; - } - }); + return AccessController.doPrivileged(new PrivilegedAction() { + @Override + public ClassLoader run() { + ClassLoader cl = null; + try { + cl = Thread.currentThread().getContextClassLoader(); + } catch (SecurityException ex) { + } + return cl; + } + }); } } diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties deleted file mode 100644 index c0267b823ea..00000000000 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/ContextClassloaderLocal.properties +++ /dev/null @@ -1,26 +0,0 @@ -# -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# This code is free software; you can redistribute 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. -# - -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0} diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java new file mode 100644 index 00000000000..d1ef8648bfc --- /dev/null +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlCatalogUtil.java @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.xml.internal.ws.util.xml; + +import com.sun.istack.internal.Nullable; +import com.sun.xml.internal.ws.server.ServerRtException; +import java.io.File; +import java.net.URI; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import javax.xml.catalog.CatalogFeatures; +import javax.xml.catalog.CatalogFeatures.Feature; +import javax.xml.catalog.CatalogManager; +import javax.xml.ws.WebServiceException; +import org.xml.sax.EntityResolver; + +/** + * + * @author lukas + */ +public class XmlCatalogUtil { + + // Cache CatalogFeatures instance for future usages. + // Resolve feature is set to "continue" value for backward compatibility. + private static final CatalogFeatures CATALOG_FEATURES + = CatalogFeatures.builder().with(Feature.RESOLVE, "continue").build(); + + /** + * Gets an EntityResolver using XML catalog + * + * @param catalogUrl + * @return + */ + public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) { + ArrayList urlsArray = new ArrayList<>(); + EntityResolver er; + if (catalogUrl != null) { + urlsArray.add(catalogUrl); + } + try { + er = createCatalogResolver(urlsArray); + } catch (Exception e) { + throw new ServerRtException("server.rt.err", e); + } + return er; + } + + /** + * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml + * + * @return + */ + public static EntityResolver createDefaultCatalogResolver() { + EntityResolver er; + try { + /** + * Gets a URLs for catalog defined at META-INF/jaxws-catalog.xml + */ + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + Enumeration catalogEnum; + if (cl == null) { + catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml"); + } else { + catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml"); + } + er = createCatalogResolver(Collections.list(catalogEnum)); + } catch (Exception e) { + throw new WebServiceException(e); + } + + return er; + } + + /** + * Instantiate catalog resolver using new catalog API (javax.xml.catalog.*) + * added in JDK9. Usage of new API removes dependency on internal API + * (com.sun.org.apache.xml.internal) for modular runtime. + */ + private static EntityResolver createCatalogResolver(ArrayList urls) throws Exception { + // Prepare array of catalog URIs + URI[] uris = urls.stream() + .map(u -> URI.create(u.toExternalForm())) + .toArray(URI[]::new); + + //Create CatalogResolver with new JDK9+ API + return (EntityResolver) CatalogManager.catalogResolver(CATALOG_FEATURES, uris); + } + +} diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java index d84fa5e7d11..213b584b15a 100644 --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java +++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/xml/XmlUtil.java @@ -26,30 +26,21 @@ package com.sun.xml.internal.ws.util.xml; import com.sun.istack.internal.Nullable; -import com.sun.xml.internal.ws.server.ServerRtException; import com.sun.xml.internal.ws.util.ByteArrayBuffer; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.io.Writer; -import java.lang.reflect.Method; -import java.net.URI; import java.net.URL; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.ArrayList; -import java.util.Collections; -import java.util.Enumeration; import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.Logger; -import java.util.stream.Collectors; import javax.xml.XMLConstants; -import javax.xml.catalog.CatalogFeatures; -import javax.xml.catalog.CatalogFeatures.Feature; -import javax.xml.catalog.CatalogManager; import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; @@ -65,7 +56,6 @@ import javax.xml.transform.sax.SAXTransformerFactory; import javax.xml.transform.sax.TransformerHandler; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.SchemaFactory; -import javax.xml.ws.WebServiceException; import javax.xml.xpath.XPathFactory; import javax.xml.xpath.XPathFactoryConfigurationException; import org.w3c.dom.Attr; @@ -78,6 +68,8 @@ import org.xml.sax.EntityResolver; import org.xml.sax.ErrorHandler; import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import org.xml.sax.SAXNotRecognizedException; +import org.xml.sax.SAXNotSupportedException; import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; @@ -184,7 +176,7 @@ public class XmlUtil { } public static List parseTokenList(String tokenList) { - List result = new ArrayList(); + List result = new ArrayList<>(); StringTokenizer tokenizer = new StringTokenizer(tokenList, " "); while (tokenizer.hasMoreTokens()) { result.add(tokenizer.nextToken()); @@ -247,6 +239,7 @@ public class XmlUtil { /** * Creates a new identity transformer. + * @return */ public static Transformer newTransformer() { try { @@ -258,9 +251,17 @@ public class XmlUtil { /** * Performs identity transformation. + * @param + * @param src + * @param result + * @return + * @throws javax.xml.transform.TransformerException + * @throws java.io.IOException + * @throws org.xml.sax.SAXException + * @throws javax.xml.parsers.ParserConfigurationException */ - public static - T identityTransform(Source src, T result) throws TransformerException, SAXException, ParserConfigurationException, IOException { + public static T identityTransform(Source src, T result) + throws TransformerException, SAXException, ParserConfigurationException, IOException { if (src instanceof StreamSource) { // work around a bug in JAXP in JDK6u4 and earlier where the namespace processing // is not turned on by default @@ -286,68 +287,25 @@ public class XmlUtil { return is; } - /* - * Gets an EntityResolver using XML catalog - */ - public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) { - ArrayList urlsArray = new ArrayList(); - EntityResolver er; - if (catalogUrl != null) { - urlsArray.add(catalogUrl); - } - try { - er = createCatalogResolver(urlsArray); - } catch (Exception e) { - throw new ServerRtException("server.rt.err",e); - } - return er; + /** + * Gets an EntityResolver using XML catalog + * + * @param catalogUrl + * @return + */ + public static EntityResolver createEntityResolver(@Nullable URL catalogUrl) { + return XmlCatalogUtil.createEntityResolver(catalogUrl); } /** * Gets a default EntityResolver for catalog at META-INF/jaxws-catalog.xml + * + * @return */ public static EntityResolver createDefaultCatalogResolver() { - EntityResolver er; - try { - /** - * Gets a URLs for catalog defined at META-INF/jaxws-catalog.xml - */ - ClassLoader cl = Thread.currentThread().getContextClassLoader(); - Enumeration catalogEnum; - if (cl == null) { - catalogEnum = ClassLoader.getSystemResources("META-INF/jax-ws-catalog.xml"); - } else { - catalogEnum = cl.getResources("META-INF/jax-ws-catalog.xml"); - } - er = createCatalogResolver(Collections.list(catalogEnum)); - } catch (Exception e) { - throw new WebServiceException(e); - } - - return er; + return XmlCatalogUtil.createDefaultCatalogResolver(); } - /** - * Instantiate catalog resolver using new catalog API (javax.xml.catalog.*) - * added in JDK9. Usage of new API removes dependency on internal API - * (com.sun.org.apache.xml.internal) for modular runtime. - */ - private static EntityResolver createCatalogResolver(ArrayList urls) throws Exception { - // Prepare array of catalog URIs - URI[] uris = urls.stream() - .map(u -> URI.create(u.toExternalForm())) - .toArray(URI[]::new); - - //Create CatalogResolver with new JDK9+ API - return (EntityResolver) CatalogManager.catalogResolver(catalogFeatures, uris); - } - - // Cache CatalogFeatures instance for future usages. - // Resolve feature is set to "continue" value for backward compatibility. - private static CatalogFeatures catalogFeatures = CatalogFeatures.builder() - .with(Feature.RESOLVE, "continue") - .build(); - /** * {@link ErrorHandler} that always treat the error as fatal. */ @@ -391,7 +349,7 @@ public class XmlUtil { SAXParserFactory factory = SAXParserFactory.newInstance(); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, !xmlSecurityDisabled(disableSecurity)); - } catch (Exception e) { + } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) { LOGGER.log(Level.WARNING, "Factory [{0}] doesn't support secure xml processing!", new Object[]{factory.getClass().getName()}); } return factory; diff --git a/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java index ef5500a0627..190471cd9d5 100644 --- a/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java +++ b/jaxws/src/java.xml.ws/share/classes/javax/xml/soap/FactoryFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 +245,14 @@ class FactoryFinder { return null; } - private static String getSystemProperty(String property) { + private static String getSystemProperty(final String property) { logger.log(Level.FINE, "Checking system property {0}", property); - String value = AccessController.doPrivileged( - (PrivilegedAction) () -> System.getProperty(property)); + String value = AccessController.doPrivileged(new PrivilegedAction() { + @Override + public String run() { + return System.getProperty(property); + } + }); logFound(value); return value; } diff --git a/jaxws/src/java.xml.ws/share/classes/module-info.java b/jaxws/src/java.xml.ws/share/classes/module-info.java index 4a0175eeae2..a1f9cfb66bb 100644 --- a/jaxws/src/java.xml.ws/share/classes/module-info.java +++ b/jaxws/src/java.xml.ws/share/classes/module-info.java @@ -26,7 +26,11 @@ /** * Defines the Java API for XML-Based Web Services (JAX-WS), and * the Web Services Metadata API. + * + * @moduleGraph + * @since 9 */ +@Deprecated(since="9", forRemoval=true) module java.xml.ws { requires transitive java.activation; requires transitive java.xml; @@ -36,6 +40,7 @@ module java.xml.ws { requires java.logging; requires java.management; requires jdk.httpserver; + requires jdk.unsupported; uses javax.xml.ws.spi.Provider; uses javax.xml.soap.MessageFactory; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java index 1af2c5d9a31..fe7813ebc4e 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JJavaName.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,8 @@ public class JJavaName { * ("my_children","MyChildren","myChildren", and "MY-CHILDREN", "CODE003-children" respectively) *

    * Although this method only works for English words, it handles non-English - * words gracefully (by just returning it as-is.) For example, "日本語" - * will be returned as-is without modified, not "日本語s" + * words gracefully (by just returning it as-is.) For example, "{@literal 日本語}" + * will be returned as-is without modified, not "{@literal 日本語s}" *

    * This method doesn't handle suffixes very well. For example, passing * "person56" will return "person56s", not "people56". diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java index 472aa508b28..af71cbd9218 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/JModuleDirective.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -101,7 +101,7 @@ public abstract class JModuleDirective { */ @Override public int hashCode() { - return 97 * (Integer.hashCode(getType().ordinal() + 1)) + name.hashCode(); + return 97 * (Integer.valueOf(getType().ordinal() + 1)).hashCode() + name.hashCode(); } /** diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java index 9a9fae31705..a824946273c 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/codemodel/internal/util/JavadocEscapeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.io.Writer; * *

    * Note that this class doesn't escape other Unicode characters - * that are typically unsafe. For example, 愛 (A kanji + * that are typically unsafe. For example, {@literal 愛} (A kanji * that means "love") can be considered as unsafe because * javac with English Windows cannot accept this character in the * source code. diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java index d4feaeecb91..c149697ea1c 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/DefaultAuthenticator.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ import java.io.IOException; import java.io.InputStreamReader; import java.io.UnsupportedEncodingException; import java.lang.reflect.Field; +import java.lang.reflect.Method; import java.net.Authenticator; import java.net.Authenticator.RequestorType; import java.net.MalformedURLException; @@ -42,6 +43,8 @@ import java.net.URLDecoder; import java.net.URLEncoder; import java.security.AccessController; import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; import java.util.ArrayList; import java.util.List; import java.util.logging.Level; @@ -56,11 +59,12 @@ import org.xml.sax.helpers.LocatorImpl; */ public class DefaultAuthenticator extends Authenticator { + private static final Logger LOGGER = Logger.getLogger(DefaultAuthenticator.class.getName()); private static DefaultAuthenticator instance; private static Authenticator systemAuthenticator = getCurrentAuthenticator(); private String proxyUser; private String proxyPasswd; - private final List authInfo = new ArrayList(); + private final List authInfo = new ArrayList<>(); private static int counter = 0; DefaultAuthenticator() { @@ -145,10 +149,7 @@ public class DefaultAuthenticator extends Authenticator { fi = new FileInputStream(f); is = new InputStreamReader(fi, "UTF-8"); in = new BufferedReader(is); - } catch (UnsupportedEncodingException e) { - listener.onError(e, locator); - return; - } catch (FileNotFoundException e) { + } catch (UnsupportedEncodingException | FileNotFoundException e) { listener.onError(e, locator); return; } @@ -170,7 +171,7 @@ public class DefaultAuthenticator extends Authenticator { } } catch (IOException e) { listener.onError(e, locator); - Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, e.getMessage(), e); + LOGGER.log(Level.SEVERE, e.getMessage(), e); } } finally { try { @@ -184,7 +185,7 @@ public class DefaultAuthenticator extends Authenticator { fi.close(); } } catch (IOException ex) { - Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, null, ex); + LOGGER.log(Level.SEVERE, null, ex); } } } @@ -225,6 +226,29 @@ public class DefaultAuthenticator extends Authenticator { } static Authenticator getCurrentAuthenticator() { + try { + return AccessController.doPrivileged(new PrivilegedExceptionAction() { + @Override + public Authenticator run() throws Exception { + Method method = Authenticator.class.getMethod("getDefault"); + return (Authenticator) method.invoke(null); + } + + }); + } catch (PrivilegedActionException pae) { + if (LOGGER.isLoggable(Level.FINE)) { + LOGGER.log(Level.FINE, null, pae); + } + Exception ex = pae.getException(); + if (!(ex instanceof NoSuchMethodException)) { + // if Authenticator.getDefault has not been found, + // we likely didn't get through sec, so return null + // and don't care about JDK version we're on + return null; + } + // or we're on JDK <9, so let's continue the old way... + } + final Field f = getTheAuthenticator(); if (f == null) { return null; @@ -239,7 +263,7 @@ public class DefaultAuthenticator extends Authenticator { } }); return (Authenticator) f.get(null); - } catch (Exception ex) { + } catch (IllegalAccessException | IllegalArgumentException ex) { return null; } finally { AccessController.doPrivileged(new PrivilegedAction() { @@ -255,7 +279,7 @@ public class DefaultAuthenticator extends Authenticator { private static Field getTheAuthenticator() { try { return Authenticator.class.getDeclaredField("theAuthenticator"); - } catch (Exception ex) { + } catch (NoSuchFieldException | SecurityException ex) { return null; } } @@ -277,7 +301,7 @@ public class DefaultAuthenticator extends Authenticator { @Override public void onError(Exception e, Locator loc) { System.err.println(getLocationString(loc) + ": " + e.getMessage()); - Logger.getLogger(DefaultAuthenticator.class.getName()).log(Level.SEVERE, e.getMessage(), e); + LOGGER.log(Level.SEVERE, e.getMessage(), e); } private String getLocationString(Locator l) { diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java index 4c08e4da25f..4061f18702d 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/istack/internal/tools/SecureLoader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 com.sun.istack.internal.tools; +import java.security.AccessController; +import java.security.PrivilegedAction; + /** * Class defined for safe calls of getClassLoader methods of any kind (context/system/class * classloader. This MUST be package private and defined in every package which @@ -37,9 +40,10 @@ class SecureLoader { if (System.getSecurityManager() == null) { return Thread.currentThread().getContextClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return Thread.currentThread().getContextClassLoader(); } }); @@ -50,9 +54,10 @@ class SecureLoader { if (System.getSecurityManager() == null) { return c.getClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return c.getClassLoader(); } }); @@ -63,9 +68,10 @@ class SecureLoader { if (System.getSecurityManager() == null) { return ClassLoader.getSystemClassLoader(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return ClassLoader.getSystemClassLoader(); } }); @@ -76,9 +82,10 @@ class SecureLoader { if (System.getSecurityManager() == null) { return cl.getParent(); } else { - return (ClassLoader) java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + return AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { return cl.getParent(); } }); @@ -89,9 +96,10 @@ class SecureLoader { if (System.getSecurityManager() == null) { Thread.currentThread().setContextClassLoader(cl); } else { - java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction() { - public java.lang.Object run() { + AccessController.doPrivileged( + new PrivilegedAction() { + @Override + public ClassLoader run() { Thread.currentThread().setContextClassLoader(cl); return null; } diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties index 0cc3e21ee84..0f2b377cc5b 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \ Non-existent directory: {0} VERSION = \ - schemagen 2.3.0-SNAPSHOT + schemagen 2.3.0-b170215.1712 FULLVERSION = \ - schemagen full version "2.3.0-SNAPSHOT" + schemagen full version "2.3.0-b170215.1712" USAGE = \ Usage: schemagen [-options ...] \n\ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties index 3158ce32236..be77744f1df 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2} BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = schemagen vollst\u00E4ndige Version "2.3.0-SNAPSHOT" +FULLVERSION = schemagen vollst\u00E4ndige Version "2.3.0-b170215.1712" USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties index 81d9274dc3c..632f594e2b5 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu BASEDIR_DOESNT_EXIST = Directorio no existente: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = versi\u00F3n completa de schemagen "2.3.0-SNAPSHOT" +FULLVERSION = versi\u00F3n completa de schemagen "2.3.0-b170215.1712" USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties index 597ce0e512b..6acdbba38d8 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0 BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = version compl\u00E8te de schemagen "2.3.0-SNAPSHOT" +FULLVERSION = version compl\u00E8te de schemagen "2.3.0-b170215.1712" USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties index c7ef575e06e..00fe597645f 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2} BASEDIR_DOESNT_EXIST = Directory non esistente: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = versione completa schemagen "2.3.0-SNAPSHOT" +FULLVERSION = versione completa schemagen "2.3.0-b170215.1712" USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties index e07c234ff85..638e47d9ce5 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-SNAPSHOT" +FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-b170215.1712" USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059 diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties index f4e5fa4d62e..416931124b3 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.3.0-SNAPSHOT" +FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.3.0-b170215.1712" USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4. diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties index d56ca3894d5..6da2bc93337 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2} BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0} -VERSION = gera\u00E7\u00E3o do esquema 2.3.0-SNAPSHOT +VERSION = gera\u00E7\u00E3o do esquema 2.3.0-b170215.1712 -FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.3.0-SNAPSHOT" +FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.3.0-b170215.1712" USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties index c1be9f0f704..beed169c9ae 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties index dcd7976be7c..01744696586 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1 BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0} -VERSION = schemagen 2.3.0-SNAPSHOT +VERSION = schemagen 2.3.0-b170215.1712 -FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712" USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java new file mode 100644 index 00000000000..52b29b23e93 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package-info.java @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Annotation Processing related code. + * + * This package hosts a driver that runs annotation processing for java-to-schema processing, + * and additional implementations that deal primarily with AP. + */ +package com.sun.tools.internal.jxc.ap; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html deleted file mode 100644 index 8f893b55ef2..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/ap/package.html +++ /dev/null @@ -1,33 +0,0 @@ - - - - - Annotation Processing related code. - - This package hosts a driver that runs annotation processing for java-to-schema processing, - and additional implementations that deal primarily with AP. - - diff --git a/jdk/test/java/awt/jdk/TestJDKAWTUtils.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java similarity index 52% rename from jdk/test/java/awt/jdk/TestJDKAWTUtils.java rename to jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java index 6f0439cc11a..0d3dbc5839f 100644 --- a/jdk/test/java/awt/jdk/TestJDKAWTUtils.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/CatalogUtil.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. * 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,37 +23,31 @@ * questions. */ -/* - * @test - * @bug 8167126 +package com.sun.tools.internal.xjc; + +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import javax.xml.catalog.CatalogFeatures; +import javax.xml.catalog.CatalogFeatures.Feature; +import javax.xml.catalog.CatalogManager; +import org.xml.sax.EntityResolver; + +/** + * + * @author lukas */ -import java.awt.BorderLayout; -import java.awt.Font; -import java.awt.Rectangle; -import javax.swing.JButton; -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.SwingUtilities; +final class CatalogUtil { -public class TestJDKAWTUtils { + // Cache CatalogFeatures instance for future usages. + // Resolve feature is set to "continue" value for backward compatibility. + private static final CatalogFeatures CATALOG_FEATURES = CatalogFeatures.builder() + .with(Feature.RESOLVE, "continue") + .build(); - static JFrame f; - public static void main(String[] args) throws Exception { - - SwingUtilities.invokeAndWait(() -> { - f = new JFrame("test"); - JPanel p = new JPanel(); - JButton b = new JButton("Hello"); - b.setFont(new Font(Font.DIALOG, Font.PLAIN, 80)); - p.setLayout(new BorderLayout()); - p.add("Center", b); - f.getContentPane().add(p); - f.pack(); - f.setVisible(true); - Rectangle r = new Rectangle(0, 0, 50, 50); - jdk.awt.AWTUtils.setComponentMixingCutoutShape(b, r); - }); - Thread.sleep(2000); - SwingUtilities.invokeAndWait(() -> f.dispose()); + static EntityResolver getCatalog(EntityResolver entityResolver, File catalogFile, ArrayList catalogUrls) throws IOException { + return CatalogManager.catalogResolver( + CATALOG_FEATURES, catalogUrls.stream().toArray(URI[]::new)); } } diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties index 6a418f594ad..fa3f5b2f8f3 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,20 +173,20 @@ Driver.CompilingSchema = \ Driver.FailedToGenerateCode = \ Failed to produce code. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn Driver.FilePrologComment = \ - This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT \n\ + This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170215.1712 \n\ See https://jaxb.java.net/ \n\ Any modifications to this file will be lost upon recompilation of the source schema. \n\ Generated on: {0} \n Driver.Version = \ - xjc 2.3.0-SNAPSHOT + xjc 2.3.0-b170215.1712 Driver.FullVersion = \ - xjc full version "2.3.0-SNAPSHOT" + xjc full version "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties index 7d645e92472..57e1bb38224 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ... Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT generiert \nSiehe https://jaxb.java.net/ \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170215.1712 generiert \nSiehe https://jaxb.java.net/ \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = xjc vollst\u00E4ndige Version "2.3.0-SNAPSHOT" +Driver.FullVersion = xjc vollst\u00E4ndige Version "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties index e7196a558f3..63de1fab45b 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = Compilando un esquema... Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.3.0-SNAPSHOT \nVisite https://jaxb.java.net/ \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.3.0-b170215.1712 \nVisite https://jaxb.java.net/ \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = versi\u00F3n completa de xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = versi\u00F3n completa de xjc "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties index 6a1719d4042..5ad5ff87055 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -131,14 +131,14 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma... Driver.FailedToGenerateCode = Echec de la production du code. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.3.0-SNAPSHOT \nVoir https://jaxb.java.net/ \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.3.0-b170215.1712 \nVoir https://jaxb.java.net/ \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = version compl\u00E8te xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = version compl\u00E8te xjc "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties index a1762e7b93d..9d00dd77f4e 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = compilazione di uno schema in corso... Driver.FailedToGenerateCode = Produzione del codice non riuscita. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.3.0-SNAPSHOT \nVedere https://jaxb.java.net/ \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.3.0-b170215.1712 \nVedere https://jaxb.java.net/ \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = versione completa xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = versione completa xjc "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties index abdf441ddf4..c7a60c6e59a 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\ Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002 -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.3.0-SNAPSHOT\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttps://jaxb.java.net/\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.3.0-b170215.1712\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttps://jaxb.java.net/\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-SNAPSHOT" +Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties index d129d33031c..31018022265 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294 Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.3.0-SNAPSHOT \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttps://jaxb.java.net/\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.3.0-b170215.1712 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttps://jaxb.java.net/\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n -Driver.Version = XJC 2.3.0-SNAPSHOT +Driver.Version = XJC 2.3.0-b170215.1712 -Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.3.0-SNAPSHOT" +Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties index 58083953f6d..71c827a099b 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = compilando um esquema... Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.3.0-SNAPSHOT \nConsulte https://jaxb.java.net/ \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.3.0-b170215.1712 \nConsulte https://jaxb.java.net/ \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = vers\u00E3o completa de xjc "2.3.0-SNAPSHOT" +Driver.FullVersion = vers\u00E3o completa de xjc "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties index 34397261515..efd45c540e8 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -131,14 +131,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f... Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002 -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.3.0-SNAPSHOT \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee https://jaxb.java.net/ \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.3.0-b170215.1712 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee https://jaxb.java.net/ \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties index 2685c64a2bf..4889fc512ae 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. # 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,14 +127,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981... Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc. -# DO NOT localize the 2.3.0-SNAPSHOT string - it is a token for an mvn -Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-SNAPSHOT \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 https://jaxb.java.net/ \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n +# DO NOT localize the 2.3.0-b170215.1712 string - it is a token for an mvn +Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.3.0-b170215.1712 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 https://jaxb.java.net/ \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n -Driver.Version = xjc 2.3.0-SNAPSHOT +Driver.Version = xjc 2.3.0-b170215.1712 -Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-SNAPSHOT" +Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.3.0-b170215.1712" -Driver.BuildID = 2.3.0-SNAPSHOT +Driver.BuildID = 2.3.0-b170215.1712 # for JDK integration - include version in source zip jaxb.jdk.version=@@JAXB_JDK_VERSION@@ diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java index 10c1bda5157..e1603cb9aaa 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java @@ -25,6 +25,27 @@ package com.sun.tools.internal.xjc; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.List; +import java.util.ServiceLoader; +import java.util.Set; + import com.sun.codemodel.internal.CodeWriter; import com.sun.codemodel.internal.JPackage; import com.sun.codemodel.internal.JResourceFile; @@ -37,40 +58,16 @@ import com.sun.tools.internal.xjc.generator.bean.field.FieldRendererFactory; import com.sun.tools.internal.xjc.model.Model; import com.sun.tools.internal.xjc.reader.Util; import com.sun.xml.internal.bind.api.impl.NameConverter; -import org.xml.sax.EntityResolver; -import org.xml.sax.InputSource; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; -import java.net.URL; -import java.net.URLClassLoader; import java.nio.charset.Charset; import java.nio.charset.IllegalCharsetNameException; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Date; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.List; import java.util.Locale; -import java.util.ServiceLoader; -import java.util.Set; import java.util.logging.Level; import java.util.logging.Logger; -import javax.xml.catalog.CatalogFeatures; -import javax.xml.catalog.CatalogFeatures.Feature; -import javax.xml.catalog.CatalogManager; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; /** * Global options. @@ -181,7 +178,7 @@ public class Options public File targetDir = new File("."); /** - * Actually stores {@link CatalogResolver}, but the field + * On JDK 8 an odler stores {@code CatalogResolver}, but the field * type is made to {@link EntityResolver} so that XJC can be * used even if resolver.jar is not available in the classpath. */ @@ -208,9 +205,9 @@ public class Options /** * Input schema files as a list of {@link InputSource}s. */ - private final List grammars = new ArrayList(); + private final List grammars = new ArrayList<>(); - private final List bindFiles = new ArrayList(); + private final List bindFiles = new ArrayList<>(); // Proxy setting. private String proxyHost = null; @@ -220,7 +217,7 @@ public class Options /** * {@link Plugin}s that are enabled in this compilation. */ - public final List activePlugins = new ArrayList(); + public final List activePlugins = new ArrayList<>(); /** * All discovered {@link Plugin}s. @@ -233,7 +230,7 @@ public class Options /** * Set of URIs that plug-ins recognize as extension bindings. */ - public final Set pluginURIs = new HashSet(); + public final Set pluginURIs = new HashSet<>(); /** * This allocator has the final say on deciding the class name. @@ -357,6 +354,7 @@ public class Options * A plugins are enumerated when this method is called for the first time, * by taking {@link #classpaths} into account. That means * "-cp plugin.jar" has to come before you specify options to enable it. + * @return */ public List getAllPlugins() { if(allPlugins==null) { @@ -375,13 +373,15 @@ public class Options this.schemaLanguage = _schemaLanguage; } - /** Input schema files. */ + /** Input schema files. + * @return */ public InputSource[] getGrammars() { return grammars.toArray(new InputSource[grammars.size()]); } /** * Adds a new input schema. + * @param is */ public void addGrammar( InputSource is ) { grammars.add(absolutize(is)); @@ -402,6 +402,7 @@ public class Options /** * Recursively scan directories and add all XSD files in it. + * @param dir */ public void addGrammarRecursive( File dir ) { addRecursive(dir,".xsd",grammars); @@ -432,13 +433,15 @@ public class Options return is; } - /** Input external binding files. */ + /** Input external binding files. + * @return */ public InputSource[] getBindFiles() { return bindFiles.toArray(new InputSource[bindFiles.size()]); } /** * Adds a new binding file. + * @param is */ public void addBindFile( InputSource is ) { bindFiles.add(absolutize(is)); @@ -446,6 +449,7 @@ public class Options /** * Adds a new binding file. + * @param bindFile */ public void addBindFile( File bindFile ) { bindFiles.add(fileToInputSource(bindFile)); @@ -453,15 +457,18 @@ public class Options /** * Recursively scan directories and add all ".xjb" files in it. + * @param dir */ public void addBindFileRecursive( File dir ) { addRecursive(dir,".xjb",bindFiles); } - public final List classpaths = new ArrayList(); + public final List classpaths = new ArrayList<>(); /** * Gets a classLoader that can load classes specified via the * -classpath option. + * @param parent + * @return */ public ClassLoader getUserClassLoader( ClassLoader parent ) { if (classpaths.isEmpty()) @@ -482,6 +489,8 @@ public class Options * Parses an option {@code args[i]} and return * the number of tokens consumed. * + * @param args + * @param i * @return * 0 if the argument is not understood. Returning 0 * will let the caller report an error. @@ -610,10 +619,8 @@ public class Options Messages.format(Messages.NO_SUCH_FILE,file)); } - try { - BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8")); + try (BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"))) { parseProxy(in.readLine()); - in.close(); } catch (IOException e) { throw new BadCommandLineException( Messages.format(Messages.FAILED_TO_PARSE,file,e.getMessage()),e); @@ -639,7 +646,9 @@ public class Options return 2; } if( args[i].equals("-catalog") ) { - // use javax.xml.catalog to resolve external entities. + // use Sun's "XML Entity and URI Resolvers" by Norman Walsh + // to resolve external entities. + // https://xerces.apache.org/xml-commons/components/resolver/resolver-article.html File catalogFile = new File(requireArgument("-catalog",args,++i)); try { @@ -652,6 +661,7 @@ public class Options } if( args[i].equals("-Xtest-class-name-allocator") ) { classNameAllocator = new ClassNameAllocator() { + @Override public String assignClassName(String packageName, String className) { System.out.printf("assignClassName(%s,%s)\n",packageName,className); return className+"_Type"; @@ -736,6 +746,11 @@ public class Options /** * Obtains an operand and reports an error if it's not there. + * @param optionName + * @param args + * @param i + * @return + * @throws com.sun.tools.internal.xjc.BadCommandLineException */ public String requireArgument(String optionName, String[] args, int i) throws BadCommandLineException { if (i == args.length || args[i].startsWith("-")) { @@ -773,34 +788,27 @@ public class Options } } - /** - * Adds a new catalog file. - */ - public void addCatalog(File catalogFile) throws IOException { - URI newUrl = catalogFile.toURI(); - if (!catalogUrls.contains(newUrl)) { - catalogUrls.add(newUrl); - } - try { - entityResolver = CatalogManager.catalogResolver(catalogFeatures, - catalogUrls.stream().toArray(URI[]::new)); - } catch (Exception ex) { - entityResolver = null; - } - } - // Since javax.xml.catalog is unmodifiable we need to track catalog // URLs added and create new catalog each time addCatalog is called private final ArrayList catalogUrls = new ArrayList<>(); - // Cache CatalogFeatures instance for future usages. - // Resolve feature is set to "continue" value for backward compatibility. - private static CatalogFeatures catalogFeatures = CatalogFeatures.builder() - .with(Feature.RESOLVE, "continue") - .build(); + /** + * Adds a new catalog file.Use created or existed resolver to parse new catalog file. + * @param catalogFile + * @throws java.io.IOException + */ + public void addCatalog(File catalogFile) throws IOException { + URI newUri = catalogFile.toURI(); + if (!catalogUrls.contains(newUri)) { + catalogUrls.add(newUri); + } + entityResolver = CatalogUtil.getCatalog(entityResolver, catalogFile, catalogUrls); + } + /** * Parses arguments and fill fields of this object. * + * @param args * @exception BadCommandLineException * thrown when there's a problem in the command-line arguments */ @@ -861,6 +869,8 @@ public class Options /** * Finds the {@code META-INF/sun-jaxb.episode} file to add as a binding customization. + * @param jar + * @throws com.sun.tools.internal.xjc.BadCommandLineException */ public void scanEpisodeFile(File jar) throws BadCommandLineException { try { @@ -879,6 +889,7 @@ public class Options /** * Guesses the schema language. + * @return */ public Language guessSchemaLanguage() { @@ -899,6 +910,8 @@ public class Options /** * Creates a configured CodeWriter that produces files into the specified directory. + * @return + * @throws java.io.IOException */ public CodeWriter createCodeWriter() throws IOException { return createCodeWriter(new FileCodeWriter( targetDir, readOnly, encoding )); @@ -906,6 +919,8 @@ public class Options /** * Creates a configured CodeWriter that produces files into the specified directory. + * @param core + * @return */ public CodeWriter createCodeWriter( CodeWriter core ) { if(noFileHeader) @@ -915,8 +930,8 @@ public class Options } /** - * Gets the string suitable to be used as the prolog comment baked into artifacts. - * This is the string like "This file was generated by the JAXB RI on YYYY/mm/dd..." + * Gets the string suitable to be used as the prolog comment baked into artifacts.This is the string like "This file was generated by the JAXB RI on YYYY/mm/dd..." + * @return */ public String getPrologComment() { // generate format syntax: 'at'

    + * This package provides a way to invoke XJC from within another program. The primary target of this API is the JAX-WS + * RI, but we hope that this API would be useful for other integration purposes as well. + * + *

    Getting Started: Using XJC

    + *

    + * To invoke XJC, a typical client would do something like this: + *

    + *    SchemaCompiler sc = XJC.createSchemaCompiler();
    + *    sc.parseSchema(new InputSource(schema1Url.toExternalForm()));
    + *    sc.parseSchema(new InputSource(schema2Url.toExternalForm()));
    + *    ...
    + *    S2JModel model = sc.bind();
    + * 
    + *

    + * The bind operation causes XJC to do the bulk of the work, such as figuring out what classes to generate, what + * methods/fields to generate, etc. The obtained model contains useful introspective information about how the binding + * was performed (such as the mapping between XML types and generated Java classes) + * + *

    + * Once the model is obtained, generate the code into the file system as follows: + *

    + *   JCodeModel cm = model.generateCode( null, ... );
    + *   cm.build(new FileCodeWriter(outputDir));
    + * 
    + * + *

    Implementation Note

    + *

    + * This package shouldn't contain any implementation code. + */ +package com.sun.tools.internal.xjc.api; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html deleted file mode 100644 index 5ec97a80e19..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/package.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - - -API for programmatic invocation of XJC and schemagen. - -

    -This package provides a way to invoke XJC from within another program. -The primary target of this API is the JAX-WS RI, but we hope that -this API would be useful for other integration purposes as well. - -

    Getting Started: Using XJC

    -

    -To invoke XJC, a typical client would do something like this: -

    -    SchemaCompiler sc = XJC.createSchemaCompiler();
    -    sc.parseSchema(new InputSource(schema1Url.toExternalForm()));
    -    sc.parseSchema(new InputSource(schema2Url.toExternalForm()));
    -    ...
    -    S2JModel model = sc.bind();
    -
    -

    -The bind operation causes XJC to do the bulk of the work, such as -figuring out what classes to generate, what methods/fields to generate, etc. -The obtained model contains useful introspective information about -how the binding was performed (such as the mapping between XML types -and generated Java classes) - -

    -Once the model is obtained, generate the code into the file system as follows: -

    -    JCodeModel cm = model.generateCode( null, ... );
    -    cm.build(new FileCodeWriter(outputDir));
    -
    - - -

    Implementation Note

    -

    -This package shouldn't contain any implementation code. - diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java new file mode 100644 index 00000000000..28d16b99d11 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package-info.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * FieldRenderer and its implementation classes. + * Unless you are deriving from these classes to define your own custom renderer, + * you shouldn't be using these classes directly. Use the outline package. + */ +package com.sun.tools.internal.xjc.generator.bean.field; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html deleted file mode 100644 index 149a2f33f39..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/package.html +++ /dev/null @@ -1,30 +0,0 @@ - - -

    -FieldRenderer and its implementation classes. -Unless you are deriving from these classes to define your own custom renderer, -you shouldn't be using these classes directly. Use the outline package. -

    diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java new file mode 100644 index 00000000000..f40b82a7150 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package-info.java @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + *

    + * Compile-time representation of Java type system. + * + *

    + * These classes are used as TypeT and ClassDeclT of the model parameterization. This implementaion is designed to be + * capable of representing pre-existing classes (such as java.lang.String) as well as the generated classes (represented + * as JDefinedClass.) + * + *

    Handling of Primitive Types

    + *

    + * Primitive types have two forms (int and Integer), and this complicates the binding process. For this reason, inside + * the front end, we always use the boxed types. We'll use the unboxed form only in the back end when we know the field + * doesn't need to represent the null value. + */ +package com.sun.tools.internal.xjc.model.nav; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html deleted file mode 100644 index 24ecf544b4d..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/package.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - -

    - Compile-time representation of Java type system. - -

    - These classes are used as TypeT and ClassDeclT of the model parameterization. - This implementaion is designed to be capable of representing pre-existing classes - (such as java.lang.String) as well as the generated classes (represented as JDefinedClass.) - -

    Handling of Primitive Types

    -

    - Primitive types have two forms (int and Integer), and this complicates the binding process. - For this reason, inside the front end, we always use the boxed types. We'll use the unboxed - form only in the back end when we know the field doesn't need to represent the null value. - diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java new file mode 100644 index 00000000000..271f84ccebf --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package-info.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Provides the outline of the generated Java source code so that + * additional processing (such as adding more annotations) can be + * done on the generated code. + * + *

    + * Code generation phase builds an outline little by little, while each step is using the outline built by the prior + * steps. + */ +package com.sun.tools.internal.xjc.outline; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html deleted file mode 100644 index 371364c7a27..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/package.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Provides the outline of the generated Java source code so that - additional processings (such as adding more annotations) can be - done on the generated code. - -

    - Code generation phase builds an outline little by little, while - each step is using the outline built by the prior steps. - diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java new file mode 100644 index 00000000000..11e9f94d952 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Object Model that represents DTD binding information. + */ +package com.sun.tools.internal.xjc.reader.dtd.bindinfo; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html deleted file mode 100644 index 87bbd14bc37..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/dtd/bindinfo/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - -

    Object Model that represents DTD binding information.

    diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java new file mode 100644 index 00000000000..1faa04caa10 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C)). + */ +package com.sun.tools.internal.xjc.reader.gbind; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html deleted file mode 100644 index 36465475b32..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/gbind/package.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - Binary expressions are left-associative. IOW, ((A,B),C) instead of (A,(B,C)) - - diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java new file mode 100644 index 00000000000..e32f91f28e4 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * internalization of external binding files and <jaxb:bindings> customizations. + */ +package com.sun.tools.internal.xjc.reader.internalizer; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html deleted file mode 100644 index e6f2aa14379..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/internalizer/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - -

    internalization of external binding files and <jaxb:bindings> customizations.

    diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java new file mode 100644 index 00000000000..d6719858a56 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Front-end that reads schema(s) and produce BGM. + */ +package com.sun.tools.internal.xjc.reader; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html deleted file mode 100644 index 7da51871e6a..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/package.html +++ /dev/null @@ -1,26 +0,0 @@ - - -

    Front-end that reads schema(s) and produce BGM.

    diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java index 0c313cbcd1d..898bfcaab34 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,6 +23,12 @@ * questions. */ +/** + * Object Model that represents customization declarations. + * RelaxNGCC is used to parse + * XML syntax into this representation, and the other parts of XJC will use + * this object model. + */ @XmlSchema(elementFormDefault = QUALIFIED, namespace=Const.JAXB_NSURI) package com.sun.tools.internal.xjc.reader.xmlschema.bindinfo; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html deleted file mode 100644 index e71625d1171..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/reader/xmlschema/bindinfo/package.html +++ /dev/null @@ -1,34 +0,0 @@ - - - -Object Model that represents customization declarations. - -

    - RelaxNGCC is used to parse - XML syntax into this representation, and the other parts of XJC will use - this object model. -

    - diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java new file mode 100644 index 00000000000..5387ad02145 --- /dev/null +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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. + */ + +/** + * Code generated into the user's packages in certain compilation mode. + */ +package com.sun.tools.internal.xjc.runtime; diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html deleted file mode 100644 index 3e675192b04..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/runtime/package.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Code generated into the user's packages in certain compilation mode. - - diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java index c4a9f35d90b..e74b7e0a494 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/ElementDecl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +70,7 @@ public class ElementDecl extends DeclarationImpl implements XSElementDecl, Ref.T this.substHead = _substHead; this.substDisallowed = _substDisallowed; this.substExcluded = _substExcluded; - this.idConstraints = Collections.unmodifiableList((List)idConstraints); + this.idConstraints = (List) Collections.unmodifiableList((List)idConstraints); for (IdentityConstraintImpl idc : idConstraints) idc.setParent(this); @@ -80,42 +80,52 @@ public class ElementDecl extends DeclarationImpl implements XSElementDecl, Ref.T } private XmlString defaultValue; + @Override public XmlString getDefaultValue() { return defaultValue; } private XmlString fixedValue; + @Override public XmlString getFixedValue() { return fixedValue; } private boolean nillable; + @Override public boolean isNillable() { return nillable; } private boolean _abstract; + @Override public boolean isAbstract() { return _abstract; } private Ref.Type type; + @Override public XSType getType() { return type.getType(); } private Ref.Element substHead; + @Override public XSElementDecl getSubstAffiliation() { if(substHead==null) return null; return substHead.get(); } private int substDisallowed; + @Override public boolean isSubstitutionDisallowed( int method ) { return (substDisallowed&method)!=0; } private int substExcluded; + @Override public boolean isSubstitutionExcluded( int method ) { return (substExcluded&method)!=0; } private final List idConstraints; + @Override public List getIdentityConstraints() { return idConstraints; } private Boolean form; + @Override public Boolean getForm() { return form; } @@ -124,6 +134,7 @@ public class ElementDecl extends DeclarationImpl implements XSElementDecl, Ref.T /** * @deprecated */ + @Override public XSElementDecl[] listSubstitutables() { Set s = getSubstitutables(); return s.toArray(new XSElementDecl[s.size()]); @@ -135,6 +146,7 @@ public class ElementDecl extends DeclarationImpl implements XSElementDecl, Ref.T /** Unmodifieable view of {@link #substitutables}. */ private Set substitutablesView = null; + @Override public Set getSubstitutables() { if( substitutables==null ) { // if the field is null by the time this method @@ -194,42 +206,57 @@ public class ElementDecl extends DeclarationImpl implements XSElementDecl, Ref.T } } + @Override public boolean canBeSubstitutedBy(XSElementDecl e) { return getSubstitutables().contains(e); } + @Override public boolean isWildcard() { return false; } + @Override public boolean isModelGroupDecl() { return false; } + @Override public boolean isModelGroup() { return false; } + @Override public boolean isElementDecl() { return true; } + @Override public XSWildcard asWildcard() { return null; } + @Override public XSModelGroupDecl asModelGroupDecl() { return null; } + @Override public XSModelGroup asModelGroup() { return null; } + @Override public XSElementDecl asElementDecl() { return this; } + @Override public void visit( XSVisitor visitor ) { visitor.elementDecl(this); } + @Override public void visit( XSTermVisitor visitor ) { visitor.elementDecl(this); } + @Override public Object apply( XSTermFunction function ) { return function.elementDecl(this); } + @Override public T apply(XSTermFunctionWithParam function, P param) { return function.elementDecl(this,param); } + @Override public Object apply( XSFunction function ) { return function.elementDecl(this); } // Ref.Term implementation + @Override public XSTerm getTerm() { return this; } } diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java index 2a4c69475e8..4ca87b29c52 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/IdentityConstraintImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,17 +59,19 @@ public class IdentityConstraintImpl extends ComponentImpl implements XSIdentityC this.name = name; this.selector = selector; selector.setParent(this); - this.fields = Collections.unmodifiableList((List)fields); + this.fields = (List) Collections.unmodifiableList((List)fields); for( XPathImpl xp : fields ) xp.setParent(this); this.refer = refer; } + @Override public void visit(XSVisitor visitor) { visitor.identityConstraint(this); } + @Override public T apply(XSFunction function) { return function.identityConstraint(this); } @@ -79,30 +81,37 @@ public class IdentityConstraintImpl extends ComponentImpl implements XSIdentityC parent.getOwnerSchema().addIdentityConstraint(this); } + @Override public XSElementDecl getParent() { return parent; } + @Override public String getName() { return name; } + @Override public String getTargetNamespace() { return getParent().getTargetNamespace(); } + @Override public short getCategory() { return category; } + @Override public XSXPath getSelector() { return selector; } + @Override public List getFields() { return fields; } + @Override public XSIdentityConstraint getReferencedKey() { if(category==KEYREF) return refer.get(); @@ -110,6 +119,7 @@ public class IdentityConstraintImpl extends ComponentImpl implements XSIdentityC throw new IllegalStateException("not a keyref"); } + @Override public XSIdentityConstraint get() { return this; } diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java index 4e600c32e55..297ff889b6d 100644 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java +++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/parser/NGCCRuntimeEx.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ import com.sun.xml.internal.xsom.impl.UName; import com.sun.xml.internal.xsom.impl.Const; import com.sun.xml.internal.xsom.impl.parser.state.NGCCRuntime; import com.sun.xml.internal.xsom.impl.parser.state.Schema; -import com.sun.xml.internal.xsom.impl.util.Uri; import com.sun.xml.internal.xsom.parser.AnnotationParser; import com.sun.xml.internal.org.relaxng.datatype.ValidationContext; import org.xml.sax.Attributes; @@ -48,8 +47,10 @@ import org.xml.sax.helpers.LocatorImpl; import java.io.IOException; import java.net.URI; +import java.net.URL; import java.text.MessageFormat; import java.util.Stack; +import java.util.regex.Pattern; /** * NGCCRuntime extended with various utility methods for @@ -150,12 +151,15 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { /* registers a patcher that will run after all the parsing has finished. */ + @Override public void addPatcher( Patch patcher ) { parser.patcherManager.addPatcher(patcher); } + @Override public void addErrorChecker( Patch patcher ) { parser.patcherManager.addErrorChecker(patcher); } + @Override public void reportError( String msg, Locator loc ) throws SAXException { parser.patcherManager.reportError(msg,loc); } @@ -188,8 +192,15 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { EntityResolver er = parser.getEntityResolver(); String systemId = null; - if (relativeUri!=null) - systemId = Uri.resolve(baseUri,relativeUri); + if (relativeUri!=null) { + if (isAbsolute(relativeUri)) { + systemId = relativeUri; + } + if (baseUri == null || !isAbsolute(baseUri)) { + throw new IOException("Unable to resolve relative URI " + relativeUri + " because base URI is not absolute: " + baseUri); + } + systemId = new URL(new URL(baseUri), relativeUri).toString(); + } if (er!=null) { InputSource is = er.resolveEntity(namespaceURI,systemId); @@ -217,7 +228,21 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { } } - /** Includes the specified schema. */ + private static final Pattern P = Pattern.compile(".*[/#?].*"); + + private static boolean isAbsolute(String uri) { + int i = uri.indexOf(':'); + if (i < 0) { + return false; + } + return !P.matcher(uri.substring(0, i)).matches(); + } + + /** + * Includes the specified schema. + * + * @param schemaLocation + * @throws org.xml.sax.SAXException */ public void includeSchema( String schemaLocation ) throws SAXException { NGCCRuntimeEx runtime = new NGCCRuntimeEx(parser,chameleonMode,this); runtime.currentSchema = this.currentSchema; @@ -235,7 +260,12 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { true, currentSchema.getTargetNamespace(), getLocator() ); } - /** Imports the specified schema. */ + /** + * Imports the specified schema. + * + * @param ns + * @param schemaLocation + * @throws org.xml.sax.SAXException */ public void importSchema( String ns, String schemaLocation ) throws SAXException { NGCCRuntimeEx newRuntime = new NGCCRuntimeEx(parser,false,this); InputSource source = resolveRelativeURL(ns,schemaLocation); @@ -317,9 +347,13 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { /** * Parses the specified entity. * + * @param source * @param importLocation * The source location of the import/include statement. * Used for reporting errors. + * @param includeMode + * @param expectedNamespace + * @throws org.xml.sax.SAXException */ public void parseEntity( InputSource source, boolean includeMode, String expectedNamespace, Locator importLocation ) throws SAXException { @@ -342,6 +376,8 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { /** * Creates a new instance of annotation parser. + * + * @return Annotation parser */ public AnnotationParser createAnnotationParser() { if(parser.getAnnotationParserFactory()==null) @@ -351,14 +387,19 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { } /** - * Gets the element name that contains the annotation element. - * This method works correctly only when called by the annotation handler. + * Gets the element name that contains the annotation element.This method works correctly only when called by the annotation handler. + * + * @return Element name */ public String getAnnotationContextElementName() { return elementNames.get( elementNames.size()-2 ); } - /** Creates a copy of the current locator object. */ + /** + * Creates a copy of the current locator object. + * + * @return Locator copy + */ public Locator copyLocator() { return new LocatorImpl(getLocator()); } @@ -397,6 +438,7 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { this.uri = _uri; } + @Override public String resolveNamespacePrefix(String p) { if(p.equals(prefix)) return uri; if(previous==null) return null; @@ -408,14 +450,20 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { private final Context previous; // XSDLib don't use those methods, so we cut a corner here. + @Override public String getBaseUri() { return null; } + @Override public boolean isNotation(String arg0) { return false; } + @Override public boolean isUnparsedEntity(String arg0) { return false; } } private Context currentContext=null; - /** Returns an immutable snapshot of the current context. */ + /** Returns an immutable snapshot of the current context. + * + * @return Snapshot of current context + */ public ValidationContext createValidationContext() { return currentContext; } @@ -446,6 +494,7 @@ public class NGCCRuntimeEx extends NGCCRuntime implements PatcherManager { * Parses UName under the given context. * @param qname Attribute name. * @return New {@link UName} instance based on attribute name. + * @throws org.xml.sax.SAXException */ public UName parseUName(final String qname ) throws SAXException { int idx = qname.indexOf(':'); diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java deleted file mode 100644 index d6cddc7529b..00000000000 --- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/xml/internal/xsom/impl/util/Uri.java +++ /dev/null @@ -1,187 +0,0 @@ -/* -Copyright (c) 2001, 2002 Thai Open Source Software Center Ltd -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 the Thai Open Source Software Center Ltd 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 REGENTS 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. -*/ -// @@3RD PARTY CODE@@ - -package com.sun.xml.internal.xsom.impl.util; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URL; - -public class Uri { - private static String utf8 = "UTF-8"; - - public static boolean isValid(String s) { - return isValidPercent(s) && isValidFragment(s) && isValidScheme(s); - } - - private static final String HEX_DIGITS = "0123456789abcdef"; - - public static String escapeDisallowedChars(String s) { - StringBuffer buf = null; - int len = s.length(); - int done = 0; - for (;;) { - int i = done; - for (;;) { - if (i == len) { - if (done == 0) - return s; - break; - } - if (isExcluded(s.charAt(i))) - break; - i++; - } - if (buf == null) - buf = new StringBuffer(); - if (i > done) { - buf.append(s.substring(done, i)); - done = i; - } - if (i == len) - break; - for (i++; i < len && isExcluded(s.charAt(i)); i++) - ; - String tem = s.substring(done, i); - byte[] bytes; - try { - bytes = tem.getBytes(utf8); - } - catch (UnsupportedEncodingException e) { - utf8 = "UTF8"; - try { - bytes = tem.getBytes(utf8); - } - catch (UnsupportedEncodingException e2) { - // Give up - return s; - } - } - for (int j = 0; j < bytes.length; j++) { - buf.append('%'); - buf.append(HEX_DIGITS.charAt((bytes[j] & 0xFF) >> 4)); - buf.append(HEX_DIGITS.charAt(bytes[j] & 0xF)); - } - done = i; - } - return buf.toString(); - } - - private static String excluded = "<>\"{}|\\^`"; - - private static boolean isExcluded(char c) { - return c <= 0x20 || c >= 0x7F || excluded.indexOf(c) >= 0; - } - - private static boolean isAlpha(char c) { - return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'); - } - - private static boolean isHexDigit(char c) { - return ('a' <= c && c <= 'f') || ('A' <= c && c <= 'F') || isDigit(c); - } - - private static boolean isDigit(char c) { - return '0' <= c && c <= '9'; - } - - private static boolean isSchemeChar(char c) { - return isAlpha(c) || isDigit(c) || c == '+' || c == '-' || c =='.'; - } - - private static boolean isValidPercent(String s) { - int len = s.length(); - for (int i = 0; i < len; i++) - if (s.charAt(i) == '%') { - if (i + 2 >= len) - return false; - else if (!isHexDigit(s.charAt(i + 1)) - || !isHexDigit(s.charAt(i + 2))) - return false; - } - return true; - } - - private static boolean isValidFragment(String s) { - int i = s.indexOf('#'); - return i < 0 || s.indexOf('#', i + 1) < 0; - } - - private static boolean isValidScheme(String s) { - if (!isAbsolute(s)) - return true; - int i = s.indexOf(':'); - if (i == 0 - || i + 1 == s.length() - || !isAlpha(s.charAt(0))) - return false; - while (--i > 0) - if (!isSchemeChar(s.charAt(i))) - return false; - return true; - } - - public static String resolve(String baseUri, String uriReference) throws IOException { - if (isAbsolute(uriReference)) - return uriReference; - - if(baseUri==null) - throw new IOException("Unable to resolve relative URI "+uriReference+" without a base URI"); - - if(!isAbsolute(baseUri)) - throw new IOException("Unable to resolve relative URI "+uriReference+" because base URI is not absolute: "+baseUri); - - return new URL(new URL(baseUri), uriReference).toString(); - } - - public static boolean hasFragmentId(String uri) { - return uri.indexOf('#') >= 0; - } - - public static boolean isAbsolute(String uri) { - int i = uri.indexOf(':'); - if (i < 0) - return false; - while (--i >= 0) { - switch (uri.charAt(i)) { - case '#': - case '/': - case '?': - return false; - } - } - return true; - } -} diff --git a/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md b/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md index 54343b7483d..2555613c67c 100644 --- a/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md +++ b/jaxws/src/jdk.xml.bind/share/legal/relaxngdatatype.md @@ -3,7 +3,7 @@ ### RelaxNG Datatype License
     
    -Copyright (c) 2001, Thai Open Source Software Center Ltd, Sun Microsystems.
    +Copyright (c) 2005, 2010 Thai Open Source Software Center Ltd
     All rights reserved.
     
     Redistribution and use in source and binary forms, with or without
    diff --git a/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md b/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md
    index cf18bb439b3..696f8d3e148 100644
    --- a/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md
    +++ b/jaxws/src/jdk.xml.bind/share/legal/xmlresolver.md
    @@ -1,6 +1,6 @@
     ## Apache XML Resolver Library v1.2
     
    -### Notice
    +### Apache XML Resolver Notice
     
     
     Apache XML Commons Resolver
    diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties
    similarity index 94%
    rename from jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties
    rename to jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties
    index c0267b823ea..d79956811cb 100644
    --- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/spi/ContextClassloaderLocal.properties
    +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocal.properties
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java
    new file mode 100644
    index 00000000000..24584fa50aa
    --- /dev/null
    +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/resources/ContextClassloaderLocalMessages.java
    @@ -0,0 +1,69 @@
    +/*
    + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute 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.internal.ws.resources;
    +
    +import java.util.Locale;
    +import java.util.ResourceBundle;
    +import com.sun.istack.internal.localization.Localizable;
    +import com.sun.istack.internal.localization.LocalizableMessageFactory;
    +import com.sun.istack.internal.localization.LocalizableMessageFactory.ResourceBundleSupplier;
    +import com.sun.istack.internal.localization.Localizer;
    +
    +
    +/**
    + * Defines string formatting method for each constant in the resource file
    + *
    + */
    +public final class ContextClassloaderLocalMessages {
    +
    +    private final static String BUNDLE_NAME = "com.sun.tools.internal.ws.resources.ContextClassloaderLocal";
    +    private final static LocalizableMessageFactory MESSAGE_FACTORY = new LocalizableMessageFactory(BUNDLE_NAME, new ContextClassloaderLocalMessages.BundleSupplier());
    +    private final static Localizer LOCALIZER = new Localizer();
    +
    +    public static Localizable localizableFAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
    +        return MESSAGE_FACTORY.getMessage("FAILED_TO_CREATE_NEW_INSTANCE", arg0);
    +    }
    +
    +    /**
    +     * Failed to create new instance of {0}
    +     *
    +     */
    +    public static String FAILED_TO_CREATE_NEW_INSTANCE(Object arg0) {
    +        return LOCALIZER.localize(localizableFAILED_TO_CREATE_NEW_INSTANCE(arg0));
    +    }
    +
    +    private static class BundleSupplier
    +        implements ResourceBundleSupplier
    +    {
    +
    +
    +        public ResourceBundle getResourceBundle(Locale locale) {
    +            return ResourceBundle.getBundle(BUNDLE_NAME, locale);
    +        }
    +
    +    }
    +
    +}
    diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
    index eedc7c2b359..82452acb3d7 100644
    --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
    +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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,4 +26,4 @@
     build-id=2.3.0-SNAPSHOT
     build-version=JAX-WS RI 2.3.0-SNAPSHOT
     major-version=2.3.0
    -svn-revision=5c2c1fd2f2ab3b5c7cea25f79aa49e54cb84b7cc
    +svn-revision=e8c5e9697d9b27d83ff35d767939b2f55e667621
    diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
    index 4f29dc67fb4..e730c8e4ebb 100644
    --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
    +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsgenTool.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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,12 +144,9 @@ public class WsgenTool {
         public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException {
             final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener);
     
    -        List args = new ArrayList(6 + (options.nocompile ? 1 : 0)
    +        List args = new ArrayList<>(6 + (options.nocompile ? 1 : 0)
                     + (options.encoding != null ? 2 : 0));
     
    -        args.add("--add-modules");
    -        args.add("java.xml.ws");
    -
             args.add("-d");
             args.add(options.destDir.getAbsolutePath());
             args.add("-classpath");
    @@ -163,8 +160,27 @@ public class WsgenTool {
                 args.add("-encoding");
                 args.add(options.encoding);
             }
    +
    +        boolean addModules = true;
             if (options.javacOptions != null) {
    -            args.addAll(options.getJavacOptions(args, listener));
    +            List javacOptions = options.getJavacOptions(args, listener);
    +            for (int i = 0; i < javacOptions.size(); i++) {
    +                String opt = javacOptions.get(i);
    +                if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
    +                    addModules = false;
    +                }
    +                if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
    +                    addModules = false;
    +                }
    +                if ("--release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
    +                    addModules = false;
    +                }
    +                args.add(opt);
    +            }
    +        }
    +        if (addModules) {
    +            args.add("--add-modules");
    +            args.add("java.xml.ws");
             }
     
             JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
    @@ -227,7 +243,7 @@ public class WsgenTool {
                 com.sun.xml.internal.ws.db.DatabindingImpl rt = (com.sun.xml.internal.ws.db.DatabindingImpl) fac.createRuntime(config);
     
                 final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file.
    -            final Map schemaFiles = new HashMap();
    +            final Map schemaFiles = new HashMap<>();
     
                 WSDLGenInfo wsdlGenInfo = new WSDLGenInfo();
                 wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity);
    @@ -299,7 +315,7 @@ public class WsgenTool {
         }
     
         private List getExternalFiles(List exts) {
    -        List files = new ArrayList();
    +        List files = new ArrayList<>();
             for (String ext : exts) {
                 // first try absolute path ...
                 File file = new File(ext);
    @@ -341,6 +357,10 @@ public class WsgenTool {
             }
         }
     
    +    private float getVersion(String s) {
    +        return Float.parseFloat(s);
    +    }
    +
         /**
          * "Namespace" for code needed to generate the report file.
          */
    diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
    index 3768118feb2..33664a05c7d 100644
    --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
    +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wscompile/WsimportTool.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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 @@ public class WsimportTool {
         }
     
         private void deleteGeneratedFiles() {
    -        Set trackedRootPackages = new HashSet();
    +        Set trackedRootPackages = new HashSet<>();
     
             if (options.clientjar != null) {
                 //remove all non-java artifacts as they will packaged in jar.
    @@ -282,7 +282,7 @@ public class WsimportTool {
     
         private void addClassesToGeneratedFiles() throws IOException {
             Iterable generatedFiles = options.getGeneratedFiles();
    -        final List trackedClassFiles = new ArrayList();
    +        final List trackedClassFiles = new ArrayList<>();
             for(File f: generatedFiles) {
                 if(f.getName().endsWith(".java")) {
                     String relativeDir = DirectoryUtil.getRelativePathfromCommonBase(f.getParentFile(),options.sourceDir);
    @@ -504,7 +504,7 @@ public class WsimportTool {
         }
     
         protected boolean compileGeneratedClasses(ErrorReceiver receiver, WsimportListener listener){
    -        List sourceFiles = new ArrayList();
    +        List sourceFiles = new ArrayList<>();
     
             for (File f : options.getGeneratedFiles()) {
                 if (f.exists() && f.getName().endsWith(".java")) {
    @@ -515,10 +515,7 @@ public class WsimportTool {
             if (sourceFiles.size() > 0) {
                 String classDir = options.destDir.getAbsolutePath();
                 String classpathString = createClasspathString();
    -            List args = new ArrayList();
    -
    -            args.add("--add-modules");
    -            args.add("java.xml.ws");
    +            List args = new ArrayList<>();
     
                 args.add("-d");
                 args.add(classDir);
    @@ -534,8 +531,26 @@ public class WsimportTool {
                     args.add(options.encoding);
                 }
     
    +            boolean addModules = true;
                 if (options.javacOptions != null) {
    -                args.addAll(options.getJavacOptions(args, listener));
    +                List javacOptions = options.getJavacOptions(args, listener);
    +                for (int i = 0; i < javacOptions.size(); i++) {
    +                    String opt = javacOptions.get(i);
    +                    if ("-source".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
    +                        addModules = false;
    +                    }
    +                    if ("-target".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
    +                        addModules = false;
    +                    }
    +                    if ("--release".equals(opt) && 9 >= getVersion(javacOptions.get(i + 1))) {
    +                        addModules = false;
    +                    }
    +                    args.add(opt);
    +                }
    +            }
    +            if (addModules) {
    +                args.add("--add-modules");
    +                args.add("java.xml.ws");
                 }
     
                 for (int i = 0; i < sourceFiles.size(); ++i) {
    @@ -572,4 +587,8 @@ public class WsimportTool {
             System.out.println(WscompileMessages.WSIMPORT_USAGE_EXTENSIONS());
             System.out.println(WscompileMessages.WSIMPORT_USAGE_EXAMPLES());
         }
    +
    +    private float getVersion(String s) {
    +        return Float.parseFloat(s);
    +    }
     }
    diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java
    index c8c847907cd..e15ab93b9c1 100644
    --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java
    +++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.java
    @@ -1,5 +1,5 @@
     /*
    - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
      * 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.internal.ws.wsdl.parser;
     
    +import com.sun.tools.internal.ws.resources.ContextClassloaderLocalMessages;
    +
     import java.security.AccessController;
     import java.security.PrivilegedAction;
    -import java.text.MessageFormat;
    -import java.util.ResourceBundle;
     import java.util.WeakHashMap;
     
     /**
    @@ -36,9 +36,7 @@ import java.util.WeakHashMap;
      */
     abstract class ContextClassloaderLocal {
     
    -    private static final String FAILED_TO_CREATE_NEW_INSTANCE = "FAILED_TO_CREATE_NEW_INSTANCE";
    -
    -    private WeakHashMap CACHE = new WeakHashMap();
    +    private WeakHashMap CACHE = new WeakHashMap<>();
     
         public V get() throws Error {
             ClassLoader tccl = getContextClassLoader();
    @@ -60,26 +58,21 @@ abstract class ContextClassloaderLocal {
             try {
                 return initialValue();
             } catch (Exception e) {
    -            throw new Error(format(FAILED_TO_CREATE_NEW_INSTANCE, getClass().getName()), e);
    +            throw new Error(ContextClassloaderLocalMessages.FAILED_TO_CREATE_NEW_INSTANCE(getClass().getName()), e);
             }
         }
     
    -    private static String format(String property, Object... args) {
    -        String text = ResourceBundle.getBundle(ContextClassloaderLocal.class.getName()).getString(property);
    -        return MessageFormat.format(text, args);
    -    }
    -
         private static ClassLoader getContextClassLoader() {
    -        return (ClassLoader)
    -                AccessController.doPrivileged(new PrivilegedAction() {
    -                    public Object run() {
    -                        ClassLoader cl = null;
    -                        try {
    -                            cl = Thread.currentThread().getContextClassLoader();
    -                        } catch (SecurityException ex) {
    -                        }
    -                        return cl;
    -                    }
    -                });
    +        return AccessController.doPrivileged(new PrivilegedAction() {
    +            @Override
    +            public ClassLoader run() {
    +                ClassLoader cl = null;
    +                try {
    +                    cl = Thread.currentThread().getContextClassLoader();
    +                } catch (SecurityException ex) {
    +                }
    +                return cl;
    +            }
    +        });
         }
     }
    diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties
    deleted file mode 100644
    index c0267b823ea..00000000000
    --- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/wsdl/parser/ContextClassloaderLocal.properties
    +++ /dev/null
    @@ -1,26 +0,0 @@
    -#
    -# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    -#
    -# This code is free software; you can redistribute 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.
    -#
    -
    -FAILED_TO_CREATE_NEW_INSTANCE=Failed to create new instance of {0}
    diff --git a/jdk/.hgtags b/jdk/.hgtags
    index 5a7c6ba2850..c986d9efba3 100644
    --- a/jdk/.hgtags
    +++ b/jdk/.hgtags
    @@ -396,5 +396,25 @@ c41140100bf1e5c10c7b8f3bde91c16eff7485f5 jdk-9+147
     d27bab22ff62823902d93d1d35ca397cfd50d059 jdk-9+151
     a20f2cf90762673e1bc4980fd6597e70a2578045 jdk-9+152
     1c4411322327aea3f91011ec3977a12a05b09629 jdk-9+153
    +f2325d80b37c2817e15039bf64189a08e29c6d39 jdk-10+0
     c97e7a8b8da062b9070df442f9cf308e10845fb7 jdk-9+154
     e170c858888e83d5c0994504599b6ed7a1fb0cfc jdk-9+155
    +7d64e541a6c04c714bcad4c8b553db912f827cd5 jdk-9+156
    +e209a98d40a1c353199285f31ca0ff6f0d68264a jdk-10+1
    +fdfa7b2fe9a7db06792eae20f97748f3e85bb83a jdk-9+157
    +c476ca73750698fa5654e101af699ee45db38e2a jdk-9+158
    +49b54a4d9e84b7ba956b8c27fced5035465146ae jdk-9+159
    +cac788454598b95d8b0153c021a7fae3cd7e6fda jdk-9+160
    +09b92d3067a38ee07bc14efa336b14790c93f7e7 jdk-9+161
    +f6bf027e88e9a4dd19f721001a7af00157af42c4 jdk-9+162
    +50171f8c47961710cbf87aead6f03fa431d8d240 jdk-9+163
    +6dea581453d7c0e767e3169cfec8b423a381e71d jdk-9+164
    +a7942c3b1e59495dbf51dc7c41aab355fcd253d7 jdk-9+165
    +5d2b48f1f0a322aca719b49ff02ab421705bffc7 jdk-9+166
    +5adecda6cf9a5623f983ea29e5511755ccfd1273 jdk-10+2
    +4723e1d233195e253f018e8a46732c7ffbe6ce90 jdk-10+3
    +37f8b938b680cf8fb551e9a48bffc5536b061fa8 jdk-10+4
    +d1436b2945383cef15edbdba9bb41ef1656c987b jdk-10+5
    +329609d00aef2443cf1e44ded94637c5ed55a143 jdk-10+6
    +7828aedcb525df40b7c8122bcc3f997c75ebaf7f jdk-9+167
    +e78da9db6299b3fcba49300d52e2359e82fdd218 jdk-9+168
    diff --git a/jdk/.jcheck/conf b/jdk/.jcheck/conf
    index 5c6f62dc12c..b2581358014 100644
    --- a/jdk/.jcheck/conf
    +++ b/jdk/.jcheck/conf
    @@ -1 +1 @@
    -project=jdk9
    +project=jdk10
    diff --git a/jdk/README b/jdk/README
    deleted file mode 100644
    index 9817e93b584..00000000000
    --- a/jdk/README
    +++ /dev/null
    @@ -1,27 +0,0 @@
    -README:
    -  This file should be located at the top of the jdk Mercurial repository.
    -
    -  See http://openjdk.java.net/ for more information about the OpenJDK.
    -
    -Simple Build Instructions:
    -
    -  1. 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.
    -
    -  2. Either download and install the latest JDK7 from
    -     http://download.java.net/openjdk/jdk7/, or build your own complete
    -     OpenJDK7 by using the top level Makefile in the OpenJDK Mercurial forest.
    -     Set the environment variable ALT_JDK_IMPORT_PATH to the location of
    -     this latest JDK7 or OpenJDK7 build.
    -     
    -  3. Check the sanity of doing a build with the current machine:
    -       cd make && gnumake sanity
    -     See README-builds.html if you run into problems.
    -  
    -  4. Do a partial build of the jdk:
    -       cd make && gnumake all
    -  
    -  5. Construct the images:
    -       cd make && gnumake images
    -     The resulting JDK image should be found in build/*/j2sdk-image
    diff --git a/jdk/make/CompileDemos.gmk b/jdk/make/CompileDemos.gmk
    index 5982ea02592..336a2538e83 100644
    --- a/jdk/make/CompileDemos.gmk
    +++ b/jdk/make/CompileDemos.gmk
    @@ -263,239 +263,13 @@ $(eval $(call SetupBuildDemo, TransparentRuler, \
         MAIN_CLASS := transparentruler.Ruler, \
     ))
     
    -$(eval $(call SetupBuildDemo, jconsole-plugin, \
    -    DEMO_SUBDIR := scripting, \
    -    SRC_SUB_DIR := src, \
    -    MAIN_CLASS := NONE, \
    -))
    -
    -$(eval $(call SetupBuildDemo, FullThreadDump, \
    -    DEMO_SUBDIR := management, \
    -))
    -
    -$(eval $(call SetupBuildDemo, JTop, \
    -    DEMO_SUBDIR := management, \
    -))
    -
    -$(eval $(call SetupBuildDemo, MemoryMonitor, \
    -    DEMO_SUBDIR := management, \
    -))
    -
    -$(eval $(call SetupBuildDemo, VerboseGC, \
    -    DEMO_SUBDIR := management, \
    -))
    -
    -################################################################################
    -# Build JVMTI demos.
    -
    -# Setup make rules for building a JVMTI demo.
    -#
    -# Parameter 1 is the name of the rule. This name is used as variable prefix,
    -# and the targets generated are listed in a variable by that name.
    -#
    -# Remaining parameters are named arguments. These include:
    -# EXTRA_SRC_SUBDIR   Also include these subdirectories
    -# TOOLCHAIN   Optionally specify toolchain to use
    -SetupBuildJvmtiDemo = $(NamedParamsMacroTemplate)
    -define SetupBuildJvmtiDemoBody
    -  $1_SRC := \
    -      $(DEMO_SHARE_SRC)/jvmti/$1 \
    -      $$(wildcard $$(addprefix $(DEMO_SHARE_SRC)/jvmti/, \
    -          agent_util $$($1_EXTRA_SRC_SUBDIR)))
    -
    -  ### Build the native lib
    -  $1_CFLAGS_INCLUDE := $$(addprefix -I, $$($1_SRC))
    -
    -  $1_CXXFLAGS := $$($1_CFLAGS_INCLUDE) $(CXXFLAGS_JDKLIB) $(CXXFLAGS_DEBUG_SYMBOLS)
    -
    -  ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX)
    -    # For C++, we also need some special treatment.
    -    $1_LDFLAGS := $$(LDFLAGS_CXX_JDK)
    -    $1_LIBS := $(LIBCXX)
    -
    -    ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
    -      $1_CXXFLAGS := $$(filter-out -xregs=no%appl, $$($1_CXXFLAGS))
    -    endif
    -  endif
    -
    -  # Remove the -incremental:no setting to get .ilk-files like in the old build.
    -  $$(eval $$(call SetupNativeCompilation, BUILD_DEMO_JVMTI_NATIVE_$1, \
    -      SRC := $$($1_SRC), \
    -      TOOLCHAIN := $$($1_TOOLCHAIN), \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \
    -      CXXFLAGS := $$($1_CXXFLAGS), \
    -      LDFLAGS := $(filter-out -incremental:no -opt:ref, $$(LDFLAGS_JDKLIB)) \
    -          $$($1_LDFLAGS), \
    -      LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN), \
    -      LIBS := $$($1_LIBS), \
    -      LIBS_solaris := -lc, \
    -      VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
    -      RC_FLAGS := $$(RC_FLAGS) \
    -          -D "JDK_FNAME=$1.dll" \
    -          -D "JDK_INTERNAL_NAME=$1" \
    -          -D "JDK_FTYPE=0x2L", \
    -      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1, \
    -      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib, \
    -      LIBRARY := $1, \
    -      STRIP_SYMBOLS := false, \
    -  ))
    -
    -  $1 += $$(BUILD_DEMO_JVMTI_NATIVE_$1)
    -
    -  ### Build the jar, if we have java sources
    -  ifneq ($$(wildcard $(DEMO_SHARE_SRC)/jvmti/$1/*.java), )
    -    $$(eval $$(call SetupJavaCompilation, BUILD_DEMO_JVMTI_JAVA_$1, \
    -        SETUP := GENERATE_USINGJDKBYTECODE, \
    -        SRC := $(DEMO_SHARE_SRC)/jvmti/$1, \
    -        BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jvmti/$1, \
    -        COPY := $(COPY_TO_JAR), \
    -        JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/$1.jar, \
    -        EXTRA_MANIFEST_ATTR := Main-Class: \n, \
    -        MANIFEST := $(DEMO_MANIFEST), \
    -    ))
    -
    -    $1 += $$(BUILD_DEMO_JVMTI_JAVA_$1_JAR)
    -  endif
    -
    -  ### Build the source zip
    -  $1_EXCLUDE_FILES := \
    -      $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/README.txt, \
    -          agent_util $$($1_EXTRA_SRC_SUBDIR))) \
    -      $$(wildcard $$(patsubst %, $(DEMO_SHARE_SRC)/jvmti/%/sample.makefile.txt, \
    -          agent_util $$($1_EXTRA_SRC_SUBDIR)))
    -
    -  $$(eval $$(call SetupZipArchive, BUILD_DEMO_JVMTI_SRC_$1, \
    -      SRC := $$($1_SRC), \
    -      EXCLUDE_FILES := $$($1_EXCLUDE_FILES), \
    -      ZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/src.zip, \
    -  ))
    -
    -  $1 += $$(BUILD_DEMO_JVMTI_SRC_$1)
    -
    -  # Copy files to image
    -  $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt: $(DEMO_SHARE_SRC)/jvmti/$1/README.txt
    -	$$(call install-file)
    -	$(CHMOD) -f ug+w $$@
    -
    -  $1 += $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/README.txt
    -
    -  ifeq ($(OPENJDK_TARGET_OS), windows)
    -    # These lib and exp files normally end up in OBJECT_DIR but for demos they
    -    # are supposed to be included in the distro. Since they are created as
    -    # a side-effect of the library compilation, make does not know about them.
    -    $1_SUPPORT_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/native/jvmti/$1
    -    $1_IMAGE_OUTPUTDIR := $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/$1/lib
    -
    -    $$($1_SUPPORT_OUTPUTDIR)/$1.lib: $$(BUILD_DEMO_JVMTI_NATIVE_$1)
    -
    -    $$($1_SUPPORT_OUTPUTDIR)/$1.exp: $$(BUILD_DEMO_JVMTI_NATIVE_$1)
    -
    -    $$($1_IMAGE_OUTPUTDIR)/$1.lib: $$($1_SUPPORT_OUTPUTDIR)/$1.lib
    -	$$(call install-file)
    -
    -    $$($1_IMAGE_OUTPUTDIR)/$1.exp: $$($1_SUPPORT_OUTPUTDIR)/$1.exp
    -	$$(call install-file)
    -
    -    $1 += $$($1_IMAGE_OUTPUTDIR)/$1.lib $$($1_IMAGE_OUTPUTDIR)/$1.exp
    -  endif
    -
    -  TARGETS += $$($1)
    -endef
    -
    -$(eval $(call SetupBuildJvmtiDemo, compiledMethodLoad))
    -$(eval $(call SetupBuildJvmtiDemo, gctest))
    -$(eval $(call SetupBuildJvmtiDemo, heapViewer))
    -$(eval $(call SetupBuildJvmtiDemo, versionCheck))
    -
    -$(eval $(call SetupBuildJvmtiDemo, heapTracker, \
    -    EXTRA_SRC_SUBDIR := java_crw_demo, \
    -))
    -
    -$(eval $(call SetupBuildJvmtiDemo, minst, \
    -    EXTRA_SRC_SUBDIR := java_crw_demo, \
    -))
    -
    -$(eval $(call SetupBuildJvmtiDemo, mtrace, \
    -    EXTRA_SRC_SUBDIR := java_crw_demo, \
    -))
    -
    -$(eval $(call SetupBuildJvmtiDemo, waiters, \
    -    TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
    -))
    -
    -################################################################################
    -# Build the Poller demo (on Solaris only).
    -
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  DEMO_SOLARIS_SRC := $(JDK_TOPDIR)/src/demo/solaris
    -
    -  $(eval $(call SetupJavaCompilation, BUILD_DEMO_JAVA_Poller, \
    -      SETUP := GENERATE_USINGJDKBYTECODE, \
    -      SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
    -      BIN := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
    -      HEADERS := $(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
    -      JAR := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/Poller.jar, \
    -      MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf, \
    -      SRCZIP := $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/src.zip, \
    -      COPY := README.txt Poller.c, \
    -      JARMAIN := Client, \
    -  ))
    -
    -  TARGETS += $(BUILD_DEMO_JAVA_Poller)
    -
    -  $(eval $(call SetupNativeCompilation, BUILD_DEMO_NATIVE_Poller, \
    -      SRC := $(DEMO_SOLARIS_SRC)/jni/Poller, \
    -      OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKLIB) \
    -          -I$(SUPPORT_OUTPUTDIR)/demos/classes/jni/Poller, \
    -      LDFLAGS := $(LDFLAGS_JDKLIB), \
    -      LIBS_solaris := -lc, \
    -      OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller, \
    -      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/demos/native, \
    -      LIBRARY := Poller, \
    -      STRIP_SYMBOLS := false, \
    -  ))
    -
    -  TARGETS += $(BUILD_DEMO_NATIVE_Poller)
    -
    -  # We can only compile native code after java has been compiled (since we
    -  # depend on generated .h files)
    -  $(SUPPORT_OUTPUTDIR)/demos/native/jni/Poller/Poller.o: \
    -      $(BUILD_DEMO_JAVA_Poller)
    -
    -  # Copy to image
    -  $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt: \
    -      $(DEMO_SOLARIS_SRC)/jni/Poller/README.txt
    -	$(call install-file)
    -	$(CHMOD) -f ug+w $@
    -
    -  TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/README.txt
    -
    -  $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so: \
    -      $(SUPPORT_OUTPUTDIR)/demos/native/libPoller.so
    -	$(call install-file)
    -
    -  TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/jni/Poller/lib/libPoller.so
    -endif
    -
     ################################################################################
     # Copy html and README files.
     
    -$(SUPPORT_OUTPUTDIR)/demos/image/management/index.html: $(DEMO_SHARE_SRC)/management/index.html
    -	$(call install-file)
    -	$(CHMOD) -f ug+w $@
    -
    -$(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html: $(DEMO_SHARE_SRC)/jvmti/index.html
    -	$(call install-file)
    -	$(CHMOD) -f ug+w $@
    -
     $(SUPPORT_OUTPUTDIR)/demos/image/README: $(DEMO_SHARE_SRC)/README
     	$(call install-file)
     
    -TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/management/index.html \
    -    $(SUPPORT_OUTPUTDIR)/demos/image/jvmti/index.html \
    -    $(SUPPORT_OUTPUTDIR)/demos/image/README
    +TARGETS += $(SUPPORT_OUTPUTDIR)/demos/image/README
     
     ################################################################################
     # Copy netbeans project files.
    diff --git a/jdk/make/CompileModuleTools.gmk b/jdk/make/CompileModuleTools.gmk
    index 2bfe520b233..4a9fcdc9809 100644
    --- a/jdk/make/CompileModuleTools.gmk
    +++ b/jdk/make/CompileModuleTools.gmk
    @@ -37,5 +37,7 @@ $(eval $(call SetupJavaCompilation,BUILD_JIGSAW_TOOLS, \
                     build/tools/jigsaw, \
         BIN := $(TOOLS_CLASSES_DIR), \
         ADD_JAVAC_FLAGS := \
    +        --add-modules jdk.jdeps \
             --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
    +        --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
     ))
    diff --git a/jdk/make/CompileTools.gmk b/jdk/make/CompileTools.gmk
    index 9d76d660e2d..4fd1406d4eb 100644
    --- a/jdk/make/CompileTools.gmk
    +++ b/jdk/make/CompileTools.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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,9 +32,19 @@ include SetupJavaCompilers.gmk
     
     ################################################################################
     
    +$(eval $(call IncludeCustomExtension, jdk, CompileTools.gmk))
    +
    +################################################################################
    +
    +# Use += to be able to add to this from a custom extension
    +BUILD_TOOLS_SRC_DIRS += \
    +    $(JDK_TOPDIR)/make/src/classes \
    +    $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes \
    +    #
    +
     $(eval $(call SetupJavaCompilation,BUILD_TOOLS_JDK, \
         SETUP := GENERATE_OLDBYTECODE, \
    -    SRC := $(JDK_TOPDIR)/make/src/classes $(BUILDTOOLS_OUTPUTDIR)/interim_cldrconverter_classes, \
    +    SRC := $(BUILD_TOOLS_SRC_DIRS), \
         EXCLUDES := build/tools/deps \
                     build/tools/jigsaw, \
         BIN := $(BUILDTOOLS_OUTPUTDIR)/jdk_tools_classes))
    diff --git a/jdk/make/CopySamples.gmk b/jdk/make/CopySamples.gmk
    deleted file mode 100644
    index 09d0bf7ba44..00000000000
    --- a/jdk/make/CopySamples.gmk
    +++ /dev/null
    @@ -1,65 +0,0 @@
    -#
    -# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
    -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    -#
    -# This code is free software; you can redistribute 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.
    -#
    -
    -default: all
    -
    -include $(SPEC)
    -include MakeBase.gmk
    -
    -################################################################################
    -
    -SAMPLE_TARGET_DIR := $(SUPPORT_OUTPUTDIR)/sample/image
    -SAMPLE_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/share
    -SAMPLE_SOLARIS_SOURCE_DIR := $(JDK_TOPDIR)/src/sample/solaris
    -
    -# Exclude the vm directory
    -$(eval $(call SetupCopyFiles, COPY_SHARE_SAMPLES, \
    -    SRC := $(SAMPLE_SOURCE_DIR), \
    -    DEST := $(SAMPLE_TARGET_DIR), \
    -    FILES := $(filter-out $(SAMPLE_SOURCE_DIR)/vm/%, \
    -        $(call CacheFind, $(SAMPLE_SOURCE_DIR))), \
    -))
    -
    -TARGETS += $(COPY_SHARE_SAMPLES)
    -
    -ifneq (, $(filter $(OPENJDK_TARGET_OS), solaris macosx))
    -  $(eval $(call SetupCopyFiles, COPY_SOLARIS_SAMPLES, \
    -      SRC := $(SAMPLE_SOLARIS_SOURCE_DIR), \
    -      DEST := $(SAMPLE_TARGET_DIR), \
    -      FILES := $(call CacheFind, $(SAMPLE_SOLARIS_SOURCE_DIR)), \
    -  ))
    -
    -  TARGETS += $(COPY_SOLARIS_SAMPLES)
    -endif
    -
    -################################################################################
    -
    -$(eval $(call IncludeCustomExtension, jdk, CopySamples.gmk))
    -
    -################################################################################
    -
    -all: $(TARGETS)
    -
    -.PHONY: all default
    diff --git a/jdk/make/GenerateModuleSummary.gmk b/jdk/make/GenerateModuleSummary.gmk
    index 38d9985c263..b96e9ded8ca 100644
    --- a/jdk/make/GenerateModuleSummary.gmk
    +++ b/jdk/make/GenerateModuleSummary.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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,16 @@ include MakeBase.gmk
     include ModuleTools.gmk
     
     GENGRAPHS_DIR := $(IMAGES_OUTPUTDIR)/gengraphs
    +SPEC_DOTFILES_DIR := $(GENGRAPHS_DIR)/spec-dotfiles
     TOOLS_MODULE_SRCDIR := $(JDK_TOPDIR)/make/src/classes/build/tools/jigsaw
     
     $(GENGRAPHS_DIR)/jdk.dot: $(BUILD_JIGSAW_TOOLS)
     	$(MKDIR) -p $(@D)
    -	$(TOOL_GENGRAPHS) $(GENGRAPHS_DIR)
    +	$(TOOL_GENGRAPHS) --output $(GENGRAPHS_DIR)
    +
    +$(SPEC_DOTFILES_DIR)/java.se.dot: $(BUILD_JIGSAW_TOOLS)
    +	$(MKDIR) -p $(@D)
    +	$(TOOL_GENGRAPHS) --spec --output $(SPEC_DOTFILES_DIR)
     
     $(GENGRAPHS_DIR)/technology-summary.html: $(TOOLS_MODULE_SRCDIR)/technology-summary.html
     	$(install-file)
    @@ -44,4 +49,4 @@ $(GENGRAPHS_DIR)/module-summary.html: $(BUILD_JIGSAW_TOOLS) $(GENGRAPHS_DIR)/tec
     	$(MKDIR) -p $(@D)
     	$(TOOL_MODULESUMMARY) -o $@ --module-path $(IMAGES_OUTPUTDIR)/jmods
     
    -all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html
    +all: $(GENGRAPHS_DIR)/jdk.dot $(GENGRAPHS_DIR)/module-summary.html $(SPEC_DOTFILES_DIR)/java.se.dot
    diff --git a/jdk/make/ModuleTools.gmk b/jdk/make/ModuleTools.gmk
    index 71ca1cf8eaa..c48a1b6ec3d 100644
    --- a/jdk/make/ModuleTools.gmk
    +++ b/jdk/make/ModuleTools.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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 @@
     # questions.
     #
     
    -include $(SPEC)
    -include MakeBase.gmk
    +ifndef _MODULE_TOOLS_GMK
    +_MODULE_TOOLS_GMK := 1
    +
     include JavaCompilation.gmk
     
     TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
    @@ -32,10 +33,12 @@ TOOLS_CLASSES_DIR := $(BUILDTOOLS_OUTPUTDIR)/tools_jigsaw_classes
     # To avoid reevaluating the compilation setup for the tools each time this file
     # is included, the actual compilation is handled by CompileModuleTools.gmk. The
     # following trick is used to be able to declare a dependency on the built tools.
    -BUILD_TOOLS_JDK := $(call SetupJavaCompilationCompileTarget, \
    +BUILD_JIGSAW_TOOLS := $(call SetupJavaCompilationCompileTarget, \
         BUILD_JIGSAW_TOOLS, $(TOOLS_CLASSES_DIR))
     
     TOOL_GENGRAPHS := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
    +    --add-modules jdk.jdeps \
    +    --add-exports jdk.jdeps/com.sun.tools.jdeps=ALL-UNNAMED \
         build.tools.jigsaw.GenGraphs
     
     TOOL_MODULESUMMARY := $(BUILD_JAVA) -esa -ea -cp $(TOOLS_CLASSES_DIR) \
    @@ -45,3 +48,5 @@ TOOL_ADD_PACKAGES_ATTRIBUTE := $(BUILD_JAVA) $(JAVA_FLAGS_SMALL) \
         -cp $(TOOLS_CLASSES_DIR) \
         --add-exports java.base/jdk.internal.module=ALL-UNNAMED \
         build.tools.jigsaw.AddPackagesAttribute
    +
    +endif # _MODULE_TOOLS_GMK
    diff --git a/jdk/make/Tools.gmk b/jdk/make/Tools.gmk
    index 92af1ee102f..153da84124d 100644
    --- a/jdk/make/Tools.gmk
    +++ b/jdk/make/Tools.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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,9 @@ _TOOLS_GMK := 1
     
     include JavaCompilation.gmk
     
    +# Hook to include the corresponding custom file, if present.
    +$(eval $(call IncludeCustomExtension, jdk, Tools.gmk))
    +
     ################################################################################
     # To avoid reevaluating the compilation setup for the tools each time this file
     # is included, the actual compilation is handled by CompileTools.gmk. The
    diff --git a/jdk/make/copy/Copy-java.base.gmk b/jdk/make/copy/Copy-java.base.gmk
    index 2f26a834718..01764904187 100644
    --- a/jdk/make/copy/Copy-java.base.gmk
    +++ b/jdk/make/copy/Copy-java.base.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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,10 @@ endif
     
     # JDK license and assembly exception files to be packaged in JMOD
     
    -JDK_LICENSE ?= $(JDK_TOPDIR)/LICENSE
    -JDK_NOTICE  ?= $(JDK_TOPDIR)/ASSEMBLY_EXCEPTION
    +# The license files may not be present if the source has been obtained using a
    +# different license.
    +JDK_LICENSE ?= $(wildcard $(TOPDIR)/LICENSE)
    +JDK_NOTICE  ?= $(wildcard $(TOPDIR)/ASSEMBLY_EXCEPTION)
     
     $(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \
         FILES := $(JDK_LICENSE) $(JDK_NOTICE), \
    @@ -245,4 +247,3 @@ $(eval $(call SetupCopyFiles, COPY_JDK_NOTICES, \
     ))
     
     TARGETS += $(COPY_JDK_NOTICES)
    -
    diff --git a/jdk/make/data/charsetmapping/stdcs-linux b/jdk/make/data/charsetmapping/stdcs-linux
    index 3bb08875a9d..0a870b754e1 100644
    --- a/jdk/make/data/charsetmapping/stdcs-linux
    +++ b/jdk/make/data/charsetmapping/stdcs-linux
    @@ -24,3 +24,5 @@ JIS_X_0208
     JIS_X_0212
     JIS_X_0208_Solaris
     JIS_X_0212_Solaris
    +MS932
    +SJIS       # SJIS must go together with MS932 to support sun.nio.cs.map
    diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION
    index 016d94c21fa..eb5b4595f3e 100644
    --- a/jdk/make/data/tzdata/VERSION
    +++ b/jdk/make/data/tzdata/VERSION
    @@ -21,4 +21,4 @@
     # or visit www.oracle.com if you need additional information or have any
     # questions.
     #
    -tzdata2016j
    +tzdata2017b
    diff --git a/jdk/make/data/tzdata/africa b/jdk/make/data/tzdata/africa
    index 67918afea67..d3de96d1431 100644
    --- a/jdk/make/data/tzdata/africa
    +++ b/jdk/make/data/tzdata/africa
    @@ -29,15 +29,15 @@
     # tz@iana.org for general use in the future).  For more, please see
     # the file CONTRIBUTING in the tz distribution.
     
    -# From Paul Eggert (2014-10-31):
    +# From Paul Eggert (2017-02-20):
     #
     # Unless otherwise specified, the source for data through 1990 is:
     # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
     # San Diego: ACS Publications, Inc. (2003).
     # Unfortunately this book contains many errors and cites no sources.
     #
    -# Gwillim Law writes that a good source
    -# for recent time zone data is the International Air Transport
    +# Many years ago Gwillim Law wrote that a good source
    +# for time zone data was the International Air Transport
     # Association's Standard Schedules Information Manual (IATA SSIM),
     # published semiannually.  Law sent in several helpful summaries
     # of the IATA's data after 1990.  Except where otherwise noted,
    @@ -54,39 +54,33 @@
     # A reliable and entertaining source about time zones is
     # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
     #
    +# European-style abbreviations are commonly used along the Mediterranean.
    +# For sub-Saharan Africa abbreviations were less standardized.
     # Previous editions of this database used WAT, CAT, SAT, and EAT
    -# for +0:00 through +3:00, respectively,
    -# but Mark R V Murray reports that
    -# 'SAST' is the official abbreviation for +2:00 in the country of South Africa,
    -# 'CAT' is commonly used for +2:00 in countries north of South Africa, and
    -# 'WAT' is probably the best name for +1:00, as the common phrase for
    +# for UT +00 through +03, respectively,
    +# but in 1997 Mark R V Murray reported that
    +# 'SAST' is the official abbreviation for +02 in the country of South Africa,
    +# 'CAT' is commonly used for +02 in countries north of South Africa, and
    +# 'WAT' is probably the best name for +01, as the common phrase for
     # the area that includes Nigeria is "West Africa".
    -# He has heard of "Western Sahara Time" for +0:00 but can find no reference.
     #
    -# To make things confusing, 'WAT' seems to have been used for -1:00 long ago;
    -# I'd guess that this was because people needed _some_ name for -1:00,
    -# and at the time, far west Africa was the only major land area in -1:00.
    -# This usage is now obsolete, as the last use of -1:00 on the African
    -# mainland seems to have been 1976 in Western Sahara.
    -#
    -# To summarize, the following abbreviations seem to have some currency:
    -#	-1:00	WAT	West Africa Time (no longer used)
    -#	 0:00	GMT	Greenwich Mean Time
    -#	 2:00	CAT	Central Africa Time
    -#	 2:00	SAST	South Africa Standard Time
    -# and Murray suggests the following abbreviation:
    -#	 1:00	WAT	West Africa Time
    -# I realize that this leads to 'WAT' being used for both -1:00 and 1:00
    -# for times before 1976, but this is the best I can think of
    -# until we get more information.
    +# To summarize, the following abbreviations seemed to have some currency:
    +#	 +00	GMT	Greenwich Mean Time
    +#	 +02	CAT	Central Africa Time
    +#	 +02	SAST	South Africa Standard Time
    +# and Murray suggested the following abbreviation:
    +#	 +01	WAT	West Africa Time
    +# Murray's suggestion seems to have caught on in news reports and the like.
    +# I vaguely recall 'WAT' also being used for -01 in the past but
    +# cannot now come up with solid citations.
     #
     # I invented the following abbreviations; corrections are welcome!
    -#	 2:00	WAST	West Africa Summer Time
    -#	 2:30	BEAT	British East Africa Time (no longer used)
    -#	 2:45	BEAUT	British East Africa Unified Time (no longer used)
    -#	 3:00	CAST	Central Africa Summer Time (no longer used)
    -#	 3:00	SAST	South Africa Summer Time (no longer used)
    -#	 3:00	EAT	East Africa Time
    +#	 +02	WAST	West Africa Summer Time
    +#	 +03	CAST	Central Africa Summer Time (no longer used)
    +#	 +03	SAST	South Africa Summer Time (no longer used)
    +#	 +03	EAT	East Africa Time
    +# 'EAT' also seems to have caught on; the others are rare but are paired
    +# with better-attested non-DST abbreviations.
     
     # Algeria
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    @@ -144,17 +138,17 @@ Zone	Africa/Algiers	0:12:12 -	LMT	1891 Mar 15  0:01
     
     # Cape Verde / Cabo Verde
     #
    -# Shanks gives 1907 for the transition to CVT.
    +# Shanks gives 1907 for the transition to +02.
     # Perhaps the 1911-05-26 Portuguese decree
    -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
    +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
     # merely made it official?
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Atlantic/Cape_Verde -1:34:04 -	LMT	1907        # Praia
    -			-2:00	-	CVT	1942 Sep
    -			-2:00	1:00	CVST	1945 Oct 15
    -			-2:00	-	CVT	1975 Nov 25  2:00
    -			-1:00	-	CVT
    +			-2:00	-	-02	1942 Sep
    +			-2:00	1:00	-01	1945 Oct 15
    +			-2:00	-	-02	1975 Nov 25  2:00
    +			-1:00	-	-01
     
     # Central African Republic
     # See Africa/Lagos.
    @@ -411,7 +405,7 @@ Rule	Ghana	1920	1942	-	Sep	 1	0:00	0:20	GHST
     Rule	Ghana	1920	1942	-	Dec	31	0:00	0	GMT
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Africa/Accra	-0:00:52 -	LMT	1918
    -			 0:00	Ghana	%s
    +			 0:00	Ghana	GMT/+0020
     
     # Guinea
     # See Africa/Abidjan.
    @@ -420,20 +414,20 @@ Zone	Africa/Accra	-0:00:52 -	LMT	1918
     #
     # Shanks gives 1911-05-26 for the transition to WAT,
     # evidently confusing the date of the Portuguese decree
    -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
    +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
     # with the date that it took effect, namely 1912-01-01.
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Africa/Bissau	-1:02:20 -	LMT	1912 Jan  1
    -			-1:00	-	WAT	1975
    +			-1:00	-	-01	1975
     			 0:00	-	GMT
     
     # Kenya
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Africa/Nairobi	2:27:16	-	LMT	1928 Jul
     			3:00	-	EAT	1930
    -			2:30	-	BEAT	1940
    -			2:45	-	BEAUT	1960
    +			2:30	-	+0230	1940
    +			2:45	-	+0245	1960
     			3:00	-	EAT
     Link Africa/Nairobi Africa/Addis_Ababa	 # Ethiopia
     Link Africa/Nairobi Africa/Asmara	 # Eritrea
    @@ -449,18 +443,25 @@ Link Africa/Nairobi Indian/Mayotte
     # See Africa/Johannesburg.
     
     # Liberia
    -# From Paul Eggert (2006-03-22):
    -# In 1972 Liberia was the last country to switch
    -# from a UTC offset that was not a multiple of 15 or 20 minutes.
    -# Howse reports that it was in honor of their president's birthday.
    -# Shank & Pottenger report the date as May 1, whereas Howse reports Jan;
    -# go with Shanks & Pottenger.
    -# For Liberia before 1972, Shanks & Pottenger report -0:44, whereas Howse and
    -# Whitman each report -0:44:30; go with the more precise figure.
    +#
    +# From Paul Eggert (2017-03-02):
    +#
    +# The Nautical Almanac for the Year 1970, p 264, is the source for -0:44:30.
    +#
    +# In 1972 Liberia was the last country to switch from a UTC offset
    +# that was not a multiple of 15 or 20 minutes.  The 1972 change was on
    +# 1972-01-07, according to an entry dated 1972-01-04 on p 330 of:
    +# Presidential Papers: First year of the administration of
    +# President William R. Tolbert, Jr., July 23, 1971-July 31, 1972.
    +# Monrovia: Executive Mansion.
    +#
    +# Use the abbreviation "MMT" before 1972, as the more-accurate numeric
    +# abbreviation "-004430" would be one byte over the POSIX limit.
    +#
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Africa/Monrovia	-0:43:08 -	LMT	1882
     			-0:43:08 -	MMT	1919 Mar # Monrovia Mean Time
    -			-0:44:30 -	LRT	1972 May # Liberia Time
    +			-0:44:30 -	MMT	1972 Jan 7 # approximately MMT
     			 0:00	-	GMT
     
     ###############################################################################
    @@ -619,7 +620,7 @@ Rule Mauritius	2008	only	-	Oct	lastSun	2:00	1:00	S
     Rule Mauritius	2009	only	-	Mar	lastSun	2:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Indian/Mauritius	3:50:00 -	LMT	1907 # Port Louis
    -			4:00 Mauritius	MU%sT	# Mauritius Time
    +			4:00 Mauritius	+04/+05
     # Agalega Is, Rodriguez
     # no information; probably like Indian/Mauritius
     
    @@ -938,14 +939,14 @@ Zone Africa/Casablanca	-0:30:20 -	LMT	1913 Oct 26
     # since most of it was then controlled by Morocco.
     
     Zone Africa/El_Aaiun	-0:52:48 -	LMT	1934 Jan # El Aaiún
    -			-1:00	-	WAT	1976 Apr 14
    +			-1:00	-	-01	1976 Apr 14
     			 0:00	Morocco	WE%sT
     
     # Mozambique
     #
     # Shanks gives 1903-03-01 for the transition to CAT.
     # Perhaps the 1911-05-26 Portuguese decree
    -# http://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
    +# https://dre.pt/pdf1sdip/1911/05/12500/23132313.pdf
     # merely made it official?
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -972,16 +973,19 @@ Link Africa/Maputo Africa/Lusaka	# Zambia
     # the country are close to 40 minutes earlier in sunrise than the rest
     # of the country.
     #
    -# From Paul Eggert (2007-03-31):
    -# Apparently the Caprivi Strip informally observes Botswana time, but
    -# we have no details.  In the meantime people there can use Africa/Gaborone.
    +# From Paul Eggert (2017-02-22):
    +# Although the Zambezi Region (formerly known as Caprivi) informally
    +# observes Botswana time, we have no details about historical practice.
    +# In the meantime people there can use Africa/Gaborone.
    +# See: Immanuel S. The Namibian. 2017-02-23.
    +# http://www.namibian.com.na/51480/read/Time-change-divides-lawmakers
     
     # RULE	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Namibia	1994	max	-	Sep	Sun>=1	2:00	1:00	S
     Rule	Namibia	1995	max	-	Apr	Sun>=1	2:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Africa/Windhoek	1:08:24 -	LMT	1892 Feb 8
    -			1:30	-	SWAT	1903 Mar    # SW Africa Time
    +			1:30	-	+0130	1903 Mar
     			2:00	-	SAST	1942 Sep 20  2:00
     			2:00	1:00	SAST	1943 Mar 21  2:00
     			2:00	-	SAST	1990 Mar 21 # independence
    @@ -1008,7 +1012,7 @@ Link Africa/Lagos Africa/Porto-Novo  # Benin
     # Réunion
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Indian/Reunion	3:41:52 -	LMT	1911 Jun # Saint-Denis
    -			4:00	-	RET	# Réunion Time
    +			4:00	-	+04
     #
     # Crozet Islands also observes Réunion time; see the 'antarctica' file.
     #
    @@ -1043,7 +1047,7 @@ Zone	Indian/Reunion	3:41:52 -	LMT	1911 Jun # Saint-Denis
     # Seychelles
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Indian/Mahe	3:41:48 -	LMT	1906 Jun # Victoria
    -			4:00	-	SCT	# Seychelles Time
    +			4:00	-	+04
     # From Paul Eggert (2001-05-30):
     # Aldabra, Farquhar, and Desroches, originally dependencies of the
     # Seychelles, were transferred to the British Indian Ocean Territory
    diff --git a/jdk/make/data/tzdata/antarctica b/jdk/make/data/tzdata/antarctica
    index 2398ac51b07..c88c0b4107b 100644
    --- a/jdk/make/data/tzdata/antarctica
    +++ b/jdk/make/data/tzdata/antarctica
    @@ -133,7 +133,8 @@ Zone Antarctica/Mawson	0	-	-00	1954 Feb 13
     # O'Higgins, Antarctic Peninsula, -6319-05704, since 1948-02
     # Prat, -6230-05941
     # Villa Las Estrellas (a town), around the Frei base, since 1984-04-09
    -# These locations have always used Santiago time; use TZ='America/Santiago'.
    +# These locations employ Region of Magallanes time; use
    +# TZ='America/Punta_Arenas'.
     
     # China - year-round bases
     # Great Wall, King George Island, -6213-05858, since 1985-02-20
    diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia
    index ac207403859..306a2aa8bc2 100644
    --- a/jdk/make/data/tzdata/asia
    +++ b/jdk/make/data/tzdata/asia
    @@ -29,15 +29,15 @@
     # tz@iana.org for general use in the future).  For more, please see
     # the file CONTRIBUTING in the tz distribution.
     
    -# From Paul Eggert (2015-08-08):
    +# From Paul Eggert (2017-01-13):
     #
     # Unless otherwise specified, the source for data through 1990 is:
     # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
     # San Diego: ACS Publications, Inc. (2003).
     # Unfortunately this book contains many errors and cites no sources.
     #
    -# Gwillim Law writes that a good source
    -# for recent time zone data is the International Air Transport
    +# Many years ago Gwillim Law wrote that a good source
    +# for time zone data was the International Air Transport
     # Association's Standard Schedules Information Manual (IATA SSIM),
     # published semiannually.  Law sent in several helpful summaries
     # of the IATA's data after 1990.  Except where otherwise noted,
    @@ -58,29 +58,24 @@
     # A reliable and entertaining source about time zones is
     # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
     #
    -# I invented the abbreviations marked '*' in the following table;
    -# the rest are from earlier versions of this file, or from other sources.
    -# Corrections are welcome!
    +# The following alphabetic abbreviations appear in these tables:
     #	     std  dst
     #	     LMT	Local Mean Time
     #	2:00 EET  EEST	Eastern European Time
     #	2:00 IST  IDT	Israel
    -#	3:00 AST  ADT	Arabia*
    -#	3:30 IRST IRDT	Iran*
    -#	4:00 GST	Gulf*
     #	5:30 IST	India
    -#	7:00 ICT	Indochina, most times and locations*
     #	7:00 WIB	west Indonesia (Waktu Indonesia Barat)
     #	8:00 WITA	central Indonesia (Waktu Indonesia Tengah)
     #	8:00 CST	China
    -#	8:00 IDT	Indochina, 1943-45, 1947-55, 1960-75 (some locations)*
    -#	8:00 JWST	Western Standard Time (Japan, 1896/1937)*
    -#	8:30 KST  KDT	Korea when at +0830*
    -#	9:00 JCST	Central Standard Time (Japan, 1896/1937)
    +#	8:30 KST  KDT	Korea when at +0830
     #	9:00 WIT	east Indonesia (Waktu Indonesia Timur)
     #	9:00 JST  JDT	Japan
     #	9:00 KST  KDT	Korea when at +09
     #	9:30 ACST	Australian Central Standard Time
    +# Otherwise, these tables typically use numeric abbreviations like +03
    +# and +0330 for integer hour and minute UTC offsets.  Although earlier
    +# editions invented alphabetic time zone abbreviations for every
    +# offset, this did not reflect common practice.
     #
     # See the 'europe' file for Russia and Turkey in Asia.
     
    @@ -88,7 +83,7 @@
     # Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
     # additional information from Tom Yap, Sun Microsystems Intercontinental
     # Technical Support (including a page from the Official Airline Guide -
    -# Worldwide Edition).  The names for time zones are guesses.
    +# Worldwide Edition).
     
     ###############################################################################
     
    @@ -109,8 +104,8 @@ Rule RussiaAsia	1996	2011	-	Oct	lastSun	 2:00s	0	-
     # Afghanistan
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Kabul	4:36:48 -	LMT	1890
    -			4:00	-	AFT	1945
    -			4:30	-	AFT
    +			4:00	-	+04	1945
    +			4:30	-	+0430
     
     # Armenia
     # From Paul Eggert (2006-03-22):
    @@ -253,18 +248,17 @@ Rule	Dhaka	2009	only	-	Dec	31	24:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Dhaka	6:01:40 -	LMT	1890
     			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
    -			6:30	-	BURT	1942 May 15 # Burma Time
    -			5:30	-	IST	1942 Sep
    -			6:30	-	BURT	1951 Sep 30
    -			6:00	-	DACT	1971 Mar 26 # Dacca Time
    -			6:00	-	BDT	2009
    -			6:00	Dhaka	BD%sT
    +			6:30	-	+0630	1942 May 15
    +			5:30	-	+0530	1942 Sep
    +			6:30	-	+0630	1951 Sep 30
    +			6:00	-	+06	2009
    +			6:00	Dhaka	+06/+07
     
     # Bhutan
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Thimphu	5:58:36 -	LMT	1947 Aug 15 # or Thimbu
    -			5:30	-	IST	1987 Oct
    -			6:00	-	BTT	# Bhutan Time
    +			5:30	-	+0530	1987 Oct
    +			6:00	-	+06
     
     # British Indian Ocean Territory
     # Whitman and the 1995 CIA time zone map say 5:00, but the
    @@ -274,14 +268,14 @@ Zone	Asia/Thimphu	5:58:36 -	LMT	1947 Aug 15 # or Thimbu
     # then contained the Chagos Archipelago).
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Indian/Chagos	4:49:40	-	LMT	1907
    -			5:00	-	IOT	1996 # BIOT Time
    -			6:00	-	IOT
    +			5:00	-	+05	1996
    +			6:00	-	+06
     
     # Brunei
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Brunei	7:39:40 -	LMT	1926 Mar # Bandar Seri Begawan
    -			7:30	-	BNT	1933
    -			8:00	-	BNT
    +			7:30	-	+0730	1933
    +			8:00	-	+08
     
     # Burma / Myanmar
     
    @@ -290,9 +284,9 @@ Zone	Asia/Brunei	7:39:40 -	LMT	1926 Mar # Bandar Seri Begawan
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Yangon	6:24:40 -	LMT	1880        # or Rangoon
     			6:24:40	-	RMT	1920        # Rangoon Mean Time?
    -			6:30	-	BURT	1942 May    # Burma Time
    -			9:00	-	JST	1945 May  3
    -			6:30	-	MMT	# Myanmar Time
    +			6:30	-	+0630	1942 May
    +			9:00	-	+09	1945 May  3
    +			6:30	-	+0630
     
     # Cambodia
     # See Asia/Bangkok.
    @@ -355,7 +349,7 @@ Rule	PRC	1987	1991	-	Apr	Sun>=10	0:00	1:00	D
     # (could be true), for the moment I am assuming that those two
     # counties are mistakes in the astro.com data.
     
    -# From Paul Eggert (2014-06-30):
    +# From Paul Eggert (2017-01-05):
     # Alois Treindl kindly sent me translations of the following two sources:
     #
     # (1)
    @@ -413,28 +407,26 @@ Rule	PRC	1987	1991	-	Apr	Sun>=10	0:00	1:00	D
     # mainly observed in coastal areas), the five zones were:
     #
     # Changbai Time ("Long-white Time", Long-white = Heilongjiang area) UT +08:30
    -# Asia/Harbin (currently a link to Asia/Shanghai)
    +# Now part of Asia/Shanghai; its pre-1970 times are not recorded here.
     # Heilongjiang (except Mohe county), Jilin
     #
     # Zhongyuan Time ("Central plain Time") UT +08
    -# Asia/Shanghai
    +# Now part of Asia/Shanghai.
     # most of China
    -# This currently represents most other zones as well,
    -# as apparently these regions have been the same since 1970.
     # Milne gives 8:05:43.2 for Xujiahui Observatory time; round to nearest.
     # Guo says Shanghai switched to UT +08 "from the end of the 19th century".
     #
    -# Long-shu Time (probably due to Long and Shu being two names of the area) UT +07
    -# Asia/Chongqing (currently a link to Asia/Shanghai)
    +# Long-shu Time (probably as Long and Shu were two names of the area) UT +07
    +# Now part of Asia/Shanghai; its pre-1970 times are not recorded here.
     # Guangxi, Guizhou, Hainan, Ningxia, Sichuan, Shaanxi, and Yunnan;
    -# most of Gansu; west Inner Mongolia; west Qinghai; and the Guangdong
    +# most of Gansu; west Inner Mongolia; east Qinghai; and the Guangdong
     # counties Deqing, Enping, Kaiping, Luoding, Taishan, Xinxing,
     # Yangchun, Yangjiang, Yu'nan, and Yunfu.
     #
     # Xin-zang Time ("Xinjiang-Tibet Time") UT +06
    -# Asia/Urumqi
    -# This currently represents Kunlun Time as well,
    -# as apparently the two regions have been the same since 1970.
    +# This region is now part of either Asia/Urumqi or Asia/Shanghai with
    +# current boundaries uncertain; times before 1970 for areas that
    +# disagree with Ürümqi or Shanghai are not recorded here.
     # The Gansu counties Aksay, Anxi, Dunhuang, Subei; west Qinghai;
     # the Guangdong counties  Xuwen, Haikang, Suixi, Lianjiang,
     # Zhanjiang, Wuchuan, Huazhou, Gaozhou, Maoming, Dianbai, and Xinyi;
    @@ -445,7 +437,7 @@ Rule	PRC	1987	1991	-	Apr	Sun>=10	0:00	1:00	D
     # Fukang, Kuitun, Kumukuli, Miquan, Qitai, and Turfan.
     #
     # Kunlun Time UT +05:30
    -# Asia/Kashgar (currently a link to Asia/Urumqi)
    +# This region is now in the same status as Xin-zang Time (see above).
     # West Tibet, including Pulan, Aheqi, Shufu, Shule;
     # West Xinjiang, including Aksu, Atushi, Yining, Hetian, Cele, Luopu, Nileke,
     # Zhaosu, Tekesi, Gongliu, Chabuchaer, Huocheng, Bole, Pishan, Suiding,
    @@ -546,7 +538,7 @@ Zone	Asia/Shanghai	8:05:43	-	LMT	1901
     # Xinjiang time, used by many in western China; represented by Ürümqi / Ürümchi
     # / Wulumuqi.  (Please use Asia/Shanghai if you prefer Beijing time.)
     Zone	Asia/Urumqi	5:50:20	-	LMT	1928
    -			6:00	-	XJT
    +			6:00	-	+06
     
     
     # Hong Kong (Xianggang)
    @@ -765,30 +757,29 @@ Rule	Taiwan	1979	only	-	Oct	1	0:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     # Taipei or Taibei or T'ai-pei
     Zone	Asia/Taipei	8:06:00 -	LMT	1896 Jan  1
    -			8:00	-	JWST	1937 Oct  1
    +			8:00	-	CST	1937 Oct  1
     			9:00	-	JST	1945 Sep 21  1:00
     			8:00	Taiwan	C%sT
     
     # Macau (Macao, Aomen)
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    -Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	S
    -Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	-
    -Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	S
    -Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	S
    -Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	S
    -Rule	Macau	1965	only	-	Oct	31	0:00	0	-
    -Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	S
    -Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	-
    -Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	S
    -Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	-
    -Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	-
    -Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	S
    -Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	S
    -Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	-
    +Rule	Macau	1961	1962	-	Mar	Sun>=16	3:30	1:00	D
    +Rule	Macau	1961	1964	-	Nov	Sun>=1	3:30	0	S
    +Rule	Macau	1963	only	-	Mar	Sun>=16	0:00	1:00	D
    +Rule	Macau	1964	only	-	Mar	Sun>=16	3:30	1:00	D
    +Rule	Macau	1965	only	-	Mar	Sun>=16	0:00	1:00	D
    +Rule	Macau	1965	only	-	Oct	31	0:00	0	S
    +Rule	Macau	1966	1971	-	Apr	Sun>=16	3:30	1:00	D
    +Rule	Macau	1966	1971	-	Oct	Sun>=16	3:30	0	S
    +Rule	Macau	1972	1974	-	Apr	Sun>=15	0:00	1:00	D
    +Rule	Macau	1972	1973	-	Oct	Sun>=15	0:00	0	S
    +Rule	Macau	1974	1977	-	Oct	Sun>=15	3:30	0	S
    +Rule	Macau	1975	1977	-	Apr	Sun>=15	3:30	1:00	D
    +Rule	Macau	1978	1980	-	Apr	Sun>=15	0:00	1:00	D
    +Rule	Macau	1978	1980	-	Oct	Sun>=15	0:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Macau	7:34:20 -	LMT	1912 Jan  1
    -			8:00	Macau	MO%sT	1999 Dec 20 # return to China
    -			8:00	PRC	C%sT
    +			8:00	Macau	C%sT
     
     
     ###############################################################################
    @@ -904,11 +895,10 @@ Zone	Asia/Tbilisi	2:59:11 -	LMT	1880
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Dili	8:22:20 -	LMT	1912 Jan  1
    -			8:00	-	TLT	1942 Feb 21 23:00 # E Timor Time
    -			9:00	-	JST	1945 Sep 23
    -			9:00	-	TLT	1976 May  3
    -			8:00	-	WITA	2000 Sep 17  0:00
    -			9:00	-	TLT
    +			8:00	-	+08	1942 Feb 21 23:00
    +			9:00	-	+09	1976 May  3
    +			8:00	-	+08	2000 Sep 17  0:00
    +			9:00	-	+09
     
     # India
     
    @@ -923,9 +913,9 @@ Zone	Asia/Dili	8:22:20 -	LMT	1912 Jan  1
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Kolkata	5:53:28 -	LMT	1880        # Kolkata
     			5:53:20	-	HMT	1941 Oct    # Howrah Mean Time?
    -			6:30	-	BURT	1942 May 15 # Burma Time
    +			6:30	-	+0630	1942 May 15
     			5:30	-	IST	1942 Sep
    -			5:30	1:00	IST	1945 Oct 15
    +			5:30	1:00	+0630	1945 Oct 15
     			5:30	-	IST
     # The following are like Asia/Kolkata:
     #	Andaman Is
    @@ -976,33 +966,33 @@ Zone Asia/Jakarta	7:07:12 -	LMT	1867 Aug 10
     # Shanks & Pottenger say the next transition was at 1924 Jan 1 0:13,
     # but this must be a typo.
     			7:07:12	-	BMT	1923 Dec 31 23:47:12 # Batavia
    -			7:20	-	JAVT	1932 Nov    # Java Time
    -			7:30	-	WIB	1942 Mar 23
    -			9:00	-	JST	1945 Sep 23
    -			7:30	-	WIB	1948 May
    -			8:00	-	WIB	1950 May
    -			7:30	-	WIB	1964
    +			7:20	-	+0720	1932 Nov
    +			7:30	-	+0730	1942 Mar 23
    +			9:00	-	+09	1945 Sep 23
    +			7:30	-	+0730	1948 May
    +			8:00	-	+08	1950 May
    +			7:30	-	+0730	1964
     			7:00	-	WIB
     # west and central Borneo
     Zone Asia/Pontianak	7:17:20	-	LMT	1908 May
     			7:17:20	-	PMT	1932 Nov    # Pontianak MT
    -			7:30	-	WIB	1942 Jan 29
    -			9:00	-	JST	1945 Sep 23
    -			7:30	-	WIB	1948 May
    -			8:00	-	WIB	1950 May
    -			7:30	-	WIB	1964
    +			7:30	-	+0730	1942 Jan 29
    +			9:00	-	+09	1945 Sep 23
    +			7:30	-	+0730	1948 May
    +			8:00	-	+08	1950 May
    +			7:30	-	+0730	1964
     			8:00	-	WITA	1988 Jan  1
     			7:00	-	WIB
     # Sulawesi, Lesser Sundas, east and south Borneo
     Zone Asia/Makassar	7:57:36 -	LMT	1920
     			7:57:36	-	MMT	1932 Nov    # Macassar MT
    -			8:00	-	WITA	1942 Feb  9
    -			9:00	-	JST	1945 Sep 23
    +			8:00	-	+08	1942 Feb  9
    +			9:00	-	+09	1945 Sep 23
     			8:00	-	WITA
     # Maluku Islands, West Papua, Papua
     Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
    -			9:00	-	WIT	1944 Sep  1
    -			9:30	-	ACST	1964
    +			9:00	-	+09	1944 Sep  1
    +			9:30	-	+0930	1964
     			9:00	-	WIT
     
     # Iran
    @@ -1034,8 +1024,6 @@ Zone Asia/Jayapura	9:22:48 -	LMT	1932 Nov
     # for at least the last 5 years.  Before that, for a few years, the
     # date used was the first Thursday night of Farvardin and the last
     # Thursday night of Shahrivar, but I can't give exact dates....
    -# I have also changed the abbreviations to what is considered correct
    -# here in Iran, IRST for regular time and IRDT for daylight saving time.
     #
     # From Roozbeh Pournader (2005-04-05):
     # The text of the Iranian law, in effect since 1925, clearly mentions
    @@ -1142,9 +1130,9 @@ Rule	Iran	2036	max	-	Sep	21	0:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Tehran	3:25:44	-	LMT	1916
     			3:25:44	-	TMT	1946     # Tehran Mean Time
    -			3:30	-	IRST	1977 Nov
    -			4:00	Iran	IR%sT	1979
    -			3:30	Iran	IR%sT
    +			3:30	-	+0330	1977 Nov
    +			4:00	Iran	+04/+05	1979
    +			3:30	Iran	+0330/+0430
     
     
     # Iraq
    @@ -1187,8 +1175,8 @@ Rule	Iraq	1991	2007	-	Oct	 1	3:00s	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Baghdad	2:57:40	-	LMT	1890
     			2:57:36	-	BMT	1918     # Baghdad Mean Time?
    -			3:00	-	AST	1982 May
    -			3:00	Iraq	A%sT
    +			3:00	-	+03	1982 May
    +			3:00	Iraq	+03/+04
     
     
     ###############################################################################
    @@ -1487,8 +1475,6 @@ Rule	Japan	1950	1951	-	May	Sun>=1	2:00	1:00	D
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Tokyo	9:18:59	-	LMT	1887 Dec 31 15:00u
    -			9:00	-	JST	1896 Jan  1
    -			9:00	-	JCST	1937 Oct  1
     			9:00	Japan	J%sT
     # Since 1938, all Japanese possessions have been like Asia/Tokyo.
     
    @@ -1764,7 +1750,23 @@ Zone	Asia/Amman	2:23:44 -	LMT	1931
     # Kazakh 1992-01-13 act appears to provide the same rules and 1992-03-27
     # act was to be enacted on the last Sunday of March 1992.
     
    -# From Paul Eggert (2016-11-07):
    +# From Stepan Golosunov (2016-11-08):
    +# Turgai reorganization should affect only southern part of Qostanay
    +# oblast.  Which should probably be separated into Asia/Arkalyk zone.
    +# (There were also 1970, 1988 and 1990 Turgai oblast reorganizations
    +# according to wikipedia.)
    +#
    +# [For Qostanay] http://www.ng.kz/gazeta/195/hranit/
    +# suggests that clocks were to be moved 40 minutes backwards on
    +# 1920-01-01 to the fourth time belt.  But I do not understand
    +# how that could happen....
    +#
    +# [For Atyrau and Oral] 1919 decree
    +# (http://www.worldtimezone.com/dst_news/dst_news_russia-1919-02-08.html
    +# and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in
    +# the third time belt (before 1930 this means +03).
    +
    +# From Paul Eggert (2016-12-06):
     # The tables below reflect Golosunov's remarks, with exceptions as noted.
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -1794,7 +1796,7 @@ Zone	Asia/Qyzylorda	4:21:52 -	LMT	1924 May  2
     			6:00	-	+06
     # The following zone is like Asia/Qyzylorda except for being one
     # hour earlier from 1991-09-29 to 1992-03-29.  The 1991/2 rules for
    -# Qostenay are unclear partly because of the 1997 Turgai
    +# Qostanay are unclear partly because of the 1997 Turgai
     # reorganization, so this zone is commented out for now.
     #Zone	Asia/Qostanay	4:14:20 -	LMT	1924 May  2
     #			4:00	-	+04	1930 Jun 21
    @@ -1831,7 +1833,7 @@ Zone	Asia/Aqtau	3:21:04	-	LMT	1924 May  2
     # Atyraū (KZ-ATY) is like Mangghystaū except it switched from
     # +04/+05 to +05/+06 in spring 1999, not fall 1994.
     Zone	Asia/Atyrau	3:27:44	-	LMT	1924 May  2
    -			4:00	-	+04	1930 Jun 21
    +			3:00	-	+03	1930 Jun 21
     			5:00	-	+05	1981 Oct  1
     			6:00	-	+06	1982 Apr  1
     			5:00 RussiaAsia	+05/+06	1991 Mar 31  2:00s
    @@ -1843,7 +1845,7 @@ Zone	Asia/Atyrau	3:27:44	-	LMT	1924 May  2
     # From Paul Eggert (2016-03-18):
     # The 1989 transition is from USSR act No. 227 (1989-03-14).
     Zone	Asia/Oral	3:25:24	-	LMT	1924 May  2 # or Ural'sk
    -			4:00	-	+04	1930 Jun 21
    +			3:00	-	+03	1930 Jun 21
     			5:00	-	+05	1981 Apr  1
     			5:00	1:00	+06	1981 Oct  1
     			6:00	-	+06	1982 Apr  1
    @@ -1949,14 +1951,12 @@ Rule	ROK	1987	1988	-	Oct	Sun>=8	3:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Seoul	8:27:52	-	LMT	1908 Apr  1
     			8:30	-	KST	1912 Jan  1
    -			9:00	-	JCST	1937 Oct  1
     			9:00	-	JST	1945 Sep  8
     			9:00	-	KST	1954 Mar 21
     			8:30	ROK	K%sT	1961 Aug 10
     			9:00	ROK	K%sT
     Zone	Asia/Pyongyang	8:23:00 -	LMT	1908 Apr  1
     			8:30	-	KST	1912 Jan  1
    -			9:00	-	JCST	1937 Oct  1
     			9:00	-	JST	1945 Aug 24
     			9:00	-	KST	2015 Aug 15 00:00
     			8:30	-	KST
    @@ -2011,30 +2011,29 @@ Rule	NBorneo	1935	1941	-	Dec	14	0:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Asia/Kuala_Lumpur	6:46:46 -	LMT	1901 Jan  1
     			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
    -			7:00	-	MALT	1933 Jan  1 # Malaya Time
    -			7:00	0:20	MALST	1936 Jan  1
    -			7:20	-	MALT	1941 Sep  1
    -			7:30	-	MALT	1942 Feb 16
    -			9:00	-	JST	1945 Sep 12
    -			7:30	-	MALT	1982 Jan  1
    -			8:00	-	MYT	# Malaysia Time
    +			7:00	-	+07	1933 Jan  1
    +			7:00	0:20	+0720	1936 Jan  1
    +			7:20	-	+0720	1941 Sep  1
    +			7:30	-	+0730	1942 Feb 16
    +			9:00	-	+09	1945 Sep 12
    +			7:30	-	+0730	1982 Jan  1
    +			8:00	-	+08
     # Sabah & Sarawak
     # From Paul Eggert (2014-08-12):
     # The data entries here are mostly from Shanks & Pottenger, but the 1942, 1945
     # and 1982 transition dates are from Mok Ly Yng.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Asia/Kuching	7:21:20	-	LMT	1926 Mar
    -			7:30	-	BORT	1933        # Borneo Time
    -			8:00	NBorneo	BOR%sT	1942 Feb 16
    -			9:00	-	JST	1945 Sep 12
    -			8:00	-	BORT	1982 Jan  1
    -			8:00	-	MYT
    +			7:30	-	+0730	1933
    +			8:00 NBorneo  +08/+0820	1942 Feb 16
    +			9:00	-	+09	1945 Sep 12
    +			8:00	-	+08
     
     # Maldives
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Indian/Maldives	4:54:00 -	LMT	1880 # Male
     			4:54:00	-	MMT	1960 # Male Mean Time
    -			5:00	-	MVT	# Maldives Time
    +			5:00	-	+05
     
     # Mongolia
     
    @@ -2161,37 +2160,41 @@ Rule	Mongol	1983	only	-	Oct	1	0:00	0	-
     # correction of 02:00 (in the previous edition) not being done correctly
     # in the latest edition; so ignore it for now.
     
    +# From Ganbold Tsagaankhuu (2017-02-09):
    +# Mongolian Government meeting has concluded today to cancel daylight
    +# saving time adoption in Mongolia.  Source: http://zasag.mn/news/view/16192
    +
     Rule	Mongol	1985	1998	-	Mar	lastSun	0:00	1:00	S
     Rule	Mongol	1984	1998	-	Sep	lastSun	0:00	0	-
     # IATA SSIM (1999-09) says Mongolia no longer observes DST.
     Rule	Mongol	2001	only	-	Apr	lastSat	2:00	1:00	S
     Rule	Mongol	2001	2006	-	Sep	lastSat	2:00	0	-
     Rule	Mongol	2002	2006	-	Mar	lastSat	2:00	1:00	S
    -Rule	Mongol	2015	max	-	Mar	lastSat	2:00	1:00	S
    -Rule	Mongol	2015	max	-	Sep	lastSat	0:00	0	-
    +Rule	Mongol	2015	2016	-	Mar	lastSat	2:00	1:00	S
    +Rule	Mongol	2015	2016	-	Sep	lastSat	0:00	0	-
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     # Hovd, a.k.a. Chovd, Dund-Us, Dzhargalant, Khovd, Jirgalanta
     Zone	Asia/Hovd	6:06:36 -	LMT	1905 Aug
    -			6:00	-	HOVT	1978     # Hovd Time
    -			7:00	Mongol	HOV%sT
    +			6:00	-	+06	1978
    +			7:00	Mongol	+07/+08
     # Ulaanbaatar, a.k.a. Ulan Bataar, Ulan Bator, Urga
     Zone	Asia/Ulaanbaatar 7:07:32 -	LMT	1905 Aug
    -			7:00	-	ULAT	1978     # Ulaanbaatar Time
    -			8:00	Mongol	ULA%sT
    +			7:00	-	+07	1978
    +			8:00	Mongol	+08/+09
     # Choibalsan, a.k.a. Bajan Tümen, Bajan Tumen, Chojbalsan,
     # Choybalsan, Sanbejse, Tchoibalsan
     Zone	Asia/Choibalsan	7:38:00 -	LMT	1905 Aug
    -			7:00	-	ULAT	1978
    -			8:00	-	ULAT	1983 Apr
    -			9:00	Mongol	CHO%sT	2008 Mar 31 # Choibalsan Time
    -			8:00	Mongol	CHO%sT
    +			7:00	-	+07	1978
    +			8:00	-	+08	1983 Apr
    +			9:00	Mongol	+09/+10	2008 Mar 31
    +			8:00	Mongol	+08/+09
     
     # Nepal
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Kathmandu	5:41:16 -	LMT	1920
    -			5:30	-	IST	1986
    -			5:45	-	NPT	# Nepal Time
    +			5:30	-	+0530	1986
    +			5:45	-	+0545
     
     # Oman
     # See Asia/Dubai.
    @@ -2340,10 +2343,10 @@ Rule Pakistan	2009	only	-	Apr	15	0:00	1:00	S
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Karachi	4:28:12 -	LMT	1907
    -			5:30	-	IST	1942 Sep
    -			5:30	1:00	IST	1945 Oct 15
    -			5:30	-	IST	1951 Sep 30
    -			5:00	-	KART	1971 Mar 26 # Karachi Time
    +			5:30	-	+0530	1942 Sep
    +			5:30	1:00	+0630	1945 Oct 15
    +			5:30	-	+0530	1951 Sep 30
    +			5:00	-	+05	1971 Mar 26
     			5:00 Pakistan	PK%sT	# Pakistan Time
     
     # Palestine
    @@ -2708,15 +2711,15 @@ Rule	Phil	1978	only	-	Sep	21	0:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Manila	-15:56:00 -	LMT	1844 Dec 31
     			8:04:00 -	LMT	1899 May 11
    -			8:00	Phil	PH%sT	1942 May
    -			9:00	-	JST	1944 Nov
    -			8:00	Phil	PH%sT
    +			8:00	Phil	+08/+09	1942 May
    +			9:00	-	+09	1944 Nov
    +			8:00	Phil	+08/+09
     
     # Qatar
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Qatar	3:26:08 -	LMT	1920     # Al Dawhah / Doha
    -			4:00	-	GST	1972 Jun
    -			3:00	-	AST
    +			4:00	-	+04	1972 Jun
    +			3:00	-	+03
     Link Asia/Qatar Asia/Bahrain
     
     # Saudi Arabia
    @@ -2743,7 +2746,7 @@ Link Asia/Qatar Asia/Bahrain
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Riyadh	3:06:52 -	LMT	1947 Mar 14
    -			3:00	-	AST
    +			3:00	-	+03
     Link Asia/Riyadh Asia/Aden	# Yemen
     Link Asia/Riyadh Asia/Kuwait
     
    @@ -2753,14 +2756,13 @@ Link Asia/Riyadh Asia/Kuwait
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Singapore	6:55:25 -	LMT	1901 Jan  1
     			6:55:25	-	SMT	1905 Jun  1 # Singapore M.T.
    -			7:00	-	MALT	1933 Jan  1 # Malaya Time
    -			7:00	0:20	MALST	1936 Jan  1
    -			7:20	-	MALT	1941 Sep  1
    -			7:30	-	MALT	1942 Feb 16
    -			9:00	-	JST	1945 Sep 12
    -			7:30	-	MALT	1965 Aug  9 # independence
    -			7:30	-	SGT	1982 Jan  1 # Singapore Time
    -			8:00	-	SGT
    +			7:00	-	+07	1933 Jan  1
    +			7:00	0:20	+0720	1936 Jan  1
    +			7:20	-	+0720	1941 Sep  1
    +			7:30	-	+0730	1942 Feb 16
    +			9:00	-	+09	1945 Sep 12
    +			7:30	-	+0730	1982 Jan  1
    +			8:00	-	+08
     
     # Spratly Is
     # no information
    @@ -2819,8 +2821,8 @@ Zone	Asia/Singapore	6:55:25 -	LMT	1901 Jan  1
     Zone	Asia/Colombo	5:19:24 -	LMT	1880
     			5:19:32	-	MMT	1906        # Moratuwa Mean Time
     			5:30	-	+0530	1942 Jan  5
    -			5:30	0:30	+0530/+06 1942 Sep
    -			5:30	1:00	+0530/+0630 1945 Oct 16  2:00
    +			5:30	0:30	+06	1942 Sep
    +			5:30	1:00	+0630	1945 Oct 16  2:00
     			5:30	-	+0530	1996 May 25  0:00
     			6:30	-	+0630	1996 Oct 26  0:30
     			6:00	-	+06	2006 Apr 15  0:30
    @@ -3002,7 +3004,7 @@ Zone	Asia/Dushanbe	4:35:12 -	LMT	1924 May  2
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Bangkok	6:42:04	-	LMT	1880
     			6:42:04	-	BMT	1920 Apr # Bangkok Mean Time
    -			7:00	-	ICT
    +			7:00	-	+07
     Link Asia/Bangkok Asia/Phnom_Penh	# Cambodia
     Link Asia/Bangkok Asia/Vientiane	# Laos
     
    @@ -3018,7 +3020,7 @@ Zone	Asia/Ashgabat	3:53:32 -	LMT	1924 May  2 # or Ashkhabad
     # United Arab Emirates
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Asia/Dubai	3:41:12 -	LMT	1920
    -			4:00	-	GST
    +			4:00	-	+04
     Link Asia/Dubai Asia/Muscat	# Oman
     
     # Uzbekistan
    @@ -3091,15 +3093,15 @@ Zone	Asia/Tashkent	4:37:11 -	LMT	1924 May  2
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Asia/Ho_Chi_Minh	7:06:40 -	LMT	1906 Jul  1
    -			7:06:30	-	PLMT	1911 May  1
    -			7:00	-	ICT	1942 Dec 31 23:00
    -			8:00	-	IDT	1945 Mar 14 23:00
    -			9:00	-	JST	1945 Sep  2
    -			7:00	-	ICT	1947 Apr  1
    -			8:00	-	IDT	1955 Jul  1
    -			7:00	-	ICT	1959 Dec 31 23:00
    -			8:00	-	IDT	1975 Jun 13
    -			7:00	-	ICT
    +			7:06:30	-	PLMT	1911 May  1 # Phù Liễn MT
    +			7:00	-	+07	1942 Dec 31 23:00
    +			8:00	-	+08	1945 Mar 14 23:00
    +			9:00	-	+09	1945 Sep  2
    +			7:00	-	+07	1947 Apr  1
    +			8:00	-	+08	1955 Jul  1
    +			7:00	-	+07	1959 Dec 31 23:00
    +			8:00	-	+08	1975 Jun 13
    +			7:00	-	+07
     
     # Yemen
     # See Asia/Riyadh.
    diff --git a/jdk/make/data/tzdata/australasia b/jdk/make/data/tzdata/australasia
    index 81ef5215942..db7e7f7bcb2 100644
    --- a/jdk/make/data/tzdata/australasia
    +++ b/jdk/make/data/tzdata/australasia
    @@ -67,8 +67,8 @@ Zone Australia/Perth	 7:43:24 -	LMT	1895 Dec
     			 8:00	Aus	AW%sT	1943 Jul
     			 8:00	AW	AW%sT
     Zone Australia/Eucla	 8:35:28 -	LMT	1895 Dec
    -			 8:45	Aus	ACW%sT	1943 Jul
    -			 8:45	AW	ACW%sT
    +			 8:45	Aus +0845/+0945	1943 Jul
    +			 8:45	AW  +0845/+0945
     
     # Queensland
     #
    @@ -235,7 +235,8 @@ Rule	LH	2008	max	-	Apr	Sun>=1	2:00	0	S
     Rule	LH	2008	max	-	Oct	Sun>=1	2:00	0:30	D
     Zone Australia/Lord_Howe 10:36:20 -	LMT	1895 Feb
     			10:00	-	AEST	1981 Mar
    -			10:30	LH	LH%sT
    +			10:30	LH	+1030/+1130 1985 Jul
    +			10:30	LH	+1030/+11
     
     # Australian miscellany
     #
    @@ -273,19 +274,19 @@ Zone Antarctica/Macquarie 0	-	-00	1899 Nov
     			0	-	-00	1948 Mar 25
     			10:00	Aus	AE%sT	1967
     			10:00	AT	AE%sT	2010 Apr  4  3:00
    -			11:00	-	MIST	# Macquarie I Standard Time
    +			11:00	-	+11
     
     # Christmas
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
    -			7:00	-	CXT	# Christmas Island Time
    +			7:00	-	+07
     
     # Cocos (Keeling) Is
     # These islands were ruled by the Ross family from about 1830 to 1978.
     # We don't know when standard time was introduced; for now, we guess 1900.
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Indian/Cocos	6:27:40	-	LMT	1900
    -			6:30	-	CCT	# Cocos Islands Time
    +			6:30	-	+0630
     
     
     # Fiji
    @@ -398,16 +399,16 @@ Rule	Fiji	2014	max	-	Nov	Sun>=1	2:00	1:00	S
     Rule	Fiji	2015	max	-	Jan	Sun>=15	3:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Fiji	11:55:44 -	LMT	1915 Oct 26 # Suva
    -			12:00	Fiji	FJ%sT	# Fiji Time
    +			12:00	Fiji	+12/+13
     
     # French Polynesia
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Gambier	 -8:59:48 -	LMT	1912 Oct # Rikitea
    -			 -9:00	-	GAMT	# Gambier Time
    +			 -9:00	-	-09
     Zone	Pacific/Marquesas -9:18:00 -	LMT	1912 Oct
    -			 -9:30	-	MART	# Marquesas Time
    +			 -9:30	-	-0930
     Zone	Pacific/Tahiti	 -9:58:16 -	LMT	1912 Oct # Papeete
    -			-10:00	-	TAHT	# Tahiti Time
    +			-10:00	-	-10
     # Clipperton (near North America) is administered from French Polynesia;
     # it is uninhabited.
     
    @@ -422,15 +423,15 @@ Link Pacific/Guam Pacific/Saipan # N Mariana Is
     # Kiribati
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Tarawa	 11:32:04 -	LMT	1901 # Bairiki
    -			 12:00	-	GILT	# Gilbert Is Time
    +			 12:00	-	+12
     Zone Pacific/Enderbury	-11:24:20 -	LMT	1901
    -			-12:00	-	PHOT	1979 Oct # Phoenix Is Time
    -			-11:00	-	PHOT	1995
    -			 13:00	-	PHOT
    +			-12:00	-	-12	1979 Oct
    +			-11:00	-	-11	1995
    +			 13:00	-	+13
     Zone Pacific/Kiritimati	-10:29:20 -	LMT	1901
    -			-10:40	-	LINT	1979 Oct # Line Is Time
    -			-10:00	-	LINT	1995
    -			 14:00	-	LINT
    +			-10:40	-	-1040	1979 Oct
    +			-10:00	-	-10	1995
    +			 14:00	-	+14
     
     # N Mariana Is
     # See Pacific/Guam.
    @@ -438,31 +439,31 @@ Zone Pacific/Kiritimati	-10:29:20 -	LMT	1901
     # Marshall Is
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Majuro	11:24:48 -	LMT	1901
    -			11:00	-	MHT	1969 Oct # Marshall Islands Time
    -			12:00	-	MHT
    +			11:00	-	+11	1969 Oct
    +			12:00	-	+12
     Zone Pacific/Kwajalein	11:09:20 -	LMT	1901
    -			11:00	-	MHT	1969 Oct
    -			-12:00	-	KWAT	1993 Aug 20 # Kwajalein Time
    -			12:00	-	MHT
    +			11:00	-	+11	1969 Oct
    +			-12:00	-	-12	1993 Aug 20
    +			12:00	-	+12
     
     # Micronesia
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Chuuk	10:07:08 -	LMT	1901
    -			10:00	-	CHUT	# Chuuk Time
    +			10:00	-	+10
     Zone Pacific/Pohnpei	10:32:52 -	LMT	1901 # Kolonia
    -			11:00	-	PONT	# Pohnpei Time
    +			11:00	-	+11
     Zone Pacific/Kosrae	10:51:56 -	LMT	1901
    -			11:00	-	KOST	1969 Oct # Kosrae Time
    -			12:00	-	KOST	1999
    -			11:00	-	KOST
    +			11:00	-	+11	1969 Oct
    +			12:00	-	+12	1999
    +			11:00	-	+11
     
     # Nauru
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Nauru	11:07:40 -	LMT	1921 Jan 15 # Uaobe
    -			11:30	-	NRT	1942 Mar 15 # Nauru Time
    -			9:00	-	JST	1944 Aug 15
    -			11:30	-	NRT	1979 May
    -			12:00	-	NRT
    +			11:30	-	+1130	1942 Mar 15
    +			9:00	-	+09	1944 Aug 15
    +			11:30	-	+1130	1979 May
    +			12:00	-	+12
     
     # New Caledonia
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    @@ -473,7 +474,7 @@ Rule	NC	1996	only	-	Dec	 1	2:00s	1:00	S
     Rule	NC	1997	only	-	Mar	 2	2:00s	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Noumea	11:05:48 -	LMT	1912 Jan 13 # Nouméa
    -			11:00	NC	NC%sT
    +			11:00	NC	+11/+12
     
     
     ###############################################################################
    @@ -514,8 +515,8 @@ Zone Pacific/Auckland	11:39:04 -	LMT	1868 Nov  2
     			11:30	NZ	NZ%sT	1946 Jan  1
     			12:00	NZ	NZ%sT
     Zone Pacific/Chatham	12:13:48 -	LMT	1868 Nov  2
    -			12:15	-	CHAST	1946 Jan  1
    -			12:45	Chatham	CHA%sT
    +			12:15	-	+1215	1946 Jan  1
    +			12:45	Chatham	+1245/+1345
     
     Link Pacific/Auckland Antarctica/McMurdo
     
    @@ -537,8 +538,8 @@ Rule	Cook	1979	1991	-	Mar	Sun>=1	0:00	0	-
     Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901        # Avarua
    -			-10:30	-	CKT	1978 Nov 12 # Cook Is Time
    -			-10:00	Cook	CK%sT
    +			-10:30	-	-1030	1978 Nov 12
    +			-10:00	Cook	-10/-0930
     
     ###############################################################################
     
    @@ -546,29 +547,29 @@ Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901        # Avarua
     # Niue
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Niue	-11:19:40 -	LMT	1901        # Alofi
    -			-11:20	-	NUT	1951        # Niue Time
    -			-11:30	-	NUT	1978 Oct  1
    -			-11:00	-	NUT
    +			-11:20	-	-1120	1951
    +			-11:30	-	-1130	1978 Oct  1
    +			-11:00	-	-11
     
     # Norfolk
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Norfolk	11:11:52 -	LMT	1901 # Kingston
    -			11:12	-	NMT	1951 # Norfolk Mean Time
    -			11:30	-	NFT	1974 Oct 27 02:00 # Norfolk T.
    -			11:30	1:00	NFST	1975 Mar  2 02:00
    -			11:30	-	NFT	2015 Oct  4 02:00
    -			11:00	-	NFT
    +			11:12	-	+1112	1951
    +			11:30	-	+1130	1974 Oct 27 02:00
    +			11:30	1:00	+1230	1975 Mar  2 02:00
    +			11:30	-	+1130	2015 Oct  4 02:00
    +			11:00	-	+11
     
     # Palau (Belau)
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Palau	8:57:56 -	LMT	1901 # Koror
    -			9:00	-	PWT	# Palau Time
    +			9:00	-	+09
     
     # Papua New Guinea
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Port_Moresby 9:48:40 -	LMT	1880
     			9:48:32	-	PMMT	1895 # Port Moresby Mean Time
    -			10:00	-	PGT	# Papua New Guinea Time
    +			10:00	-	+10
     #
     # From Paul Eggert (2014-10-13):
     # Base the Bougainville entry on the Arawa-Kieta region, which appears to have
    @@ -583,28 +584,26 @@ Zone Pacific/Port_Moresby 9:48:40 -	LMT	1880
     # and seem to have controlled it until their 1945-08-21 surrender.
     #
     # The Autonomous Region of Bougainville switched from UT +10 to +11
    -# on 2014-12-28 at 02:00.  They call +11 "Bougainville Standard Time";
    -# abbreviate this as BST.  See:
    +# on 2014-12-28 at 02:00.  They call +11 "Bougainville Standard Time".
    +# See:
     # http://www.bougainville24.com/bougainville-issues/bougainville-gets-own-timezone/
     #
     Zone Pacific/Bougainville 10:22:16 -	LMT	1880
     			 9:48:32 -	PMMT	1895
    -			10:00	-	PGT	1942 Jul
    -			 9:00	-	JST	1945 Aug 21
    -			10:00	-	PGT	2014 Dec 28  2:00
    -			11:00	-	BST
    +			10:00	-	+10	1942 Jul
    +			 9:00	-	+09	1945 Aug 21
    +			10:00	-	+10	2014 Dec 28  2:00
    +			11:00	-	+11
     
     # Pitcairn
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Pitcairn	-8:40:20 -	LMT	1901        # Adamstown
    -			-8:30	-	PNT	1998 Apr 27  0:00
    -			-8:00	-	PST	# Pitcairn Standard Time
    +			-8:30	-	-0830	1998 Apr 27  0:00
    +			-8:00	-	-08
     
     # American Samoa
     Zone Pacific/Pago_Pago	 12:37:12 -	LMT	1879 Jul  5
     			-11:22:48 -	LMT	1911
    -			-11:00	-	NST	1967 Apr    # N=Nome
    -			-11:00	-	BST	1983 Nov 30 # B=Bering
     			-11:00	-	SST	            # S=Samoa
     Link Pacific/Pago_Pago Pacific/Midway # in US minor outlying islands
     
    @@ -685,17 +684,17 @@ Rule	WS	2012	max	-	Sep	lastSun	3:00	1	D
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Apia	 12:33:04 -	LMT	1879 Jul  5
     			-11:26:56 -	LMT	1911
    -			-11:30	-	WSST	1950
    -			-11:00	WS	S%sT	2011 Dec 29 24:00 # S=Samoa
    -			 13:00	WS	WS%sT
    +			-11:30	-	-1130	1950
    +			-11:00	WS	-11/-10	2011 Dec 29 24:00
    +			 13:00	WS	+13/+14
     
     # Solomon Is
     # excludes Bougainville, for which see Papua New Guinea
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Guadalcanal 10:39:48 -	LMT	1912 Oct # Honiara
    -			11:00	-	SBT	# Solomon Is Time
    +			11:00	-	+11
     
    -# Tokelau Is
    +# Tokelau
     #
     # From Gwillim Law (2011-12-29)
     # A correspondent informed me that Tokelau, like Samoa, will be skipping
    @@ -716,8 +715,8 @@ Zone Pacific/Guadalcanal 10:39:48 -	LMT	1912 Oct # Honiara
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Fakaofo	-11:24:56 -	LMT	1901
    -			-11:00	-	TKT	2011 Dec 30 # Tokelau Time
    -			13:00	-	TKT
    +			-11:00	-	-11	2011 Dec 30
    +			13:00	-	+13
     
     # Tonga
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    @@ -736,7 +735,7 @@ Zone Pacific/Tongatapu	12:19:20 -	LMT	1901
     # Tuvalu
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Pacific/Funafuti	11:56:52 -	LMT	1901
    -			12:00	-	TVT	# Tuvalu Time
    +			12:00	-	+12
     
     
     # US minor outlying islands
    @@ -760,10 +759,11 @@ Zone Pacific/Funafuti	11:56:52 -	LMT	1901
     
     # Johnston
     #
    -# From Paul Eggert (2014-03-11):
    +# From Paul Eggert (2017-02-10):
     # Sometimes Johnston kept Hawaii time, and sometimes it was an hour behind.
     # Details are uncertain.  We have no data for Johnston after 1970, so
    -# treat it like Hawaii for now.
    +# treat it like Hawaii for now.  Since Johnston is now uninhabited,
    +# its link to Pacific/Honolulu is in the 'backward' file.
     #
     # In his memoirs of June 6th to October 4, 1945
     #  (2005), Herbert C. Bach writes,
    @@ -783,8 +783,6 @@ Zone Pacific/Funafuti	11:56:52 -	LMT	1901
     # See the table on page 4 where he lists GMT and local times for the tests; a
     # footnote for the JI tests reads that local time is "JI time = Hawaii Time
     # Minus One Hour".
    -#
    -# See 'northamerica' for Pacific/Johnston.
     
     # Kingman
     # uninhabited
    @@ -798,7 +796,7 @@ Zone Pacific/Funafuti	11:56:52 -	LMT	1901
     # Wake
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Wake	11:06:28 -	LMT	1901
    -			12:00	-	WAKT	# Wake Time
    +			12:00	-	+12
     
     
     # Vanuatu
    @@ -811,12 +809,12 @@ Rule	Vanuatu	1992	1993	-	Jan	Sun>=23	0:00	0	-
     Rule	Vanuatu	1992	only	-	Oct	Sun>=23	0:00	1:00	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Efate	11:13:16 -	LMT	1912 Jan 13 # Vila
    -			11:00	Vanuatu	VU%sT	# Vanuatu Time
    +			11:00	Vanuatu	+11/+12
     
     # Wallis and Futuna
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Pacific/Wallis	12:15:20 -	LMT	1901
    -			12:00	-	WFT	# Wallis & Futuna Time
    +			12:00	-	+12
     
     ###############################################################################
     
    @@ -827,15 +825,15 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
     # tz@iana.org for general use in the future).  For more, please see
     # the file CONTRIBUTING in the tz distribution.
     
    -# From Paul Eggert (2014-10-31):
    +# From Paul Eggert (2017-02-10):
     #
     # Unless otherwise specified, the source for data through 1990 is:
     # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
     # San Diego: ACS Publications, Inc. (2003).
     # Unfortunately this book contains many errors and cites no sources.
     #
    -# Gwillim Law writes that a good source
    -# for recent time zone data is the International Air Transport
    +# Many years ago Gwillim Law wrote that a good source
    +# for time zone data was the International Air Transport
     # Association's Standard Schedules Information Manual (IATA SSIM),
     # published semiannually.  Law sent in several helpful summaries
     # of the IATA's data after 1990.  Except where otherwise noted,
    @@ -852,28 +850,19 @@ Zone	Pacific/Wallis	12:15:20 -	LMT	1901
     # A reliable and entertaining source about time zones is
     # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997).
     #
    -# I invented the abbreviations marked '*' in the following table;
    -# the rest are from earlier versions of this file, or from other sources.
    +# The following abbreviations are from other sources.
     # Corrections are welcome!
     #		std	dst
     #		LMT		Local Mean Time
     #	  8:00	AWST	AWDT	Western Australia
    -#	  8:45	ACWST	ACWDT	Central Western Australia*
    -#	  9:00	JST		Japan
     #	  9:30	ACST	ACDT	Central Australia
     #	 10:00	AEST	AEDT	Eastern Australia
    +#	 10:00	GST		Guam through 2000
     #	 10:00	ChST		Chamorro
    -#	 10:30	LHST	LHDT	Lord Howe*
    -#	 11:00	BST		Bougainville*
     #	 11:30	NZMT	NZST	New Zealand through 1945
     #	 12:00	NZST	NZDT	New Zealand 1946-present
    -#	 12:15	CHAST		Chatham through 1945*
    -#	 12:45	CHAST	CHADT	Chatham 1946-present*
    -#	 13:00	WSST	WSDT	(western) Samoa 2011-present*
    -#	-11:30	WSST		Western Samoa through 1950*
     #	-11:00	SST		Samoa
     #	-10:00	HST		Hawaii
    -#	- 8:00	PST		Pitcairn*
     #
     # See the 'northamerica' file for Hawaii.
     # See the 'southamerica' file for Easter I and the Galápagos Is.
    diff --git a/jdk/make/data/tzdata/backward b/jdk/make/data/tzdata/backward
    index ec96c7e39f6..b4cf3be2d34 100644
    --- a/jdk/make/data/tzdata/backward
    +++ b/jdk/make/data/tzdata/backward
    @@ -119,6 +119,7 @@ Link	Pacific/Auckland	NZ
     Link	Pacific/Chatham		NZ-CHAT
     Link	America/Denver		Navajo
     Link	Asia/Shanghai		PRC
    +Link	Pacific/Honolulu	Pacific/Johnston
     Link	Pacific/Pohnpei		Pacific/Ponape
     Link	Pacific/Pago_Pago	Pacific/Samoa
     Link	Pacific/Chuuk		Pacific/Truk
    diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe
    index 9cede59acda..0d8a40e4f37 100644
    --- a/jdk/make/data/tzdata/europe
    +++ b/jdk/make/data/tzdata/europe
    @@ -29,15 +29,15 @@
     # tz@iana.org for general use in the future).  For more, please see
     # the file CONTRIBUTING in the tz distribution.
     
    -# From Paul Eggert (2014-10-31):
    +# From Paul Eggert (2017-02-10):
     #
     # Unless otherwise specified, the source for data through 1990 is:
     # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
     # San Diego: ACS Publications, Inc. (2003).
     # Unfortunately this book contains many errors and cites no sources.
     #
    -# Gwillim Law writes that a good source
    -# for recent time zone data is the International Air Transport
    +# Many years ago Gwillim Law wrote that a good source
    +# for time zone data was the International Air Transport
     # Association's Standard Schedules Information Manual (IATA SSIM),
     # published semiannually.  Law sent in several helpful summaries
     # of the IATA's data after 1990.  Except where otherwise noted,
    @@ -79,26 +79,23 @@
     #	History of Summer Time
     #	
     #	(1998-09-21, in Portuguese)
    -
     #
     # I invented the abbreviations marked '*' in the following table;
    -# the rest are from earlier versions of this file, or from other sources.
    -# Corrections are welcome!
    -#                   std dst  2dst
    -#                   LMT           Local Mean Time
    -#       -4:00       AST ADT       Atlantic
    -#       -3:00       WGT WGST      Western Greenland*
    -#       -1:00       EGT EGST      Eastern Greenland*
    -#        0:00       GMT BST  BDST Greenwich, British Summer
    -#        0:00       GMT IST       Greenwich, Irish Summer
    -#        0:00       WET WEST WEMT Western Europe
    -#        0:19:32.13 AMT NST       Amsterdam, Netherlands Summer (1835-1937)*
    -#        0:20       NET NEST      Netherlands (1937-1940)*
    -#        1:00       BST           British Standard (1968-1971)
    -#        1:00       CET CEST CEMT Central Europe
    -#        1:00:14    SET           Swedish (1879-1899)*
    -#        2:00       EET EEST      Eastern Europe
    -#        3:00       MSK MSD       Moscow
    +# the rest are variants of the "xMT" pattern for a city's mean time,
    +# or are from other sources.  Corrections are welcome!
    +#                   std  dst  2dst
    +#                   LMT             Local Mean Time
    +#       -4:00       AST  ADT        Atlantic
    +#        0:00       GMT  BST  BDST  Greenwich, British Summer
    +#        0:00       GMT  IST        Greenwich, Irish Summer
    +#        0:00       WET  WEST WEMT  Western Europe
    +#        0:19:32.13 AMT* NST*       Amsterdam, Netherlands Summer (1835-1937)
    +#        1:00       BST             British Standard (1968-1971)
    +#        1:00       CET  CEST CEMT  Central Europe
    +#        1:00:14    SET             Swedish (1879-1899)
    +#        1:36:34    RMT* LST*       Riga, Latvian Summer (1880-1926)*
    +#        2:00       EET  EEST       Eastern Europe
    +#        3:00       MSK  MSD  MDST* Moscow
     
     # From Peter Ilieve (1994-12-04),
     # The original six [EU members]: Belgium, France, (West) Germany, Italy,
    @@ -498,7 +495,7 @@ Link	Europe/London	Europe/Isle_of_Man
     
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	Europe/Dublin	-0:25:00 -	LMT	1880 Aug  2
    -			-0:25:21 -	DMT	1916 May 21  2:00
    +			-0:25:21 -	DMT	1916 May 21  2:00 # Dublin MT
     			-0:25:21 1:00	IST	1916 Oct  1  2:00s
     			 0:00	GB-Eire	%s	1921 Dec  6 # independence
     			 0:00	GB-Eire	GMT/IST	1940 Feb 25  2:00
    @@ -1087,16 +1084,16 @@ Rule	Thule	2007	max	-	Nov	Sun>=1	2:00	0	S
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Danmarkshavn -1:14:40 -	LMT	1916 Jul 28
    -			-3:00	-	WGT	1980 Apr  6  2:00
    -			-3:00	EU	WG%sT	1996
    +			-3:00	-	-03	1980 Apr  6  2:00
    +			-3:00	EU	-03/-02	1996
     			0:00	-	GMT
     Zone America/Scoresbysund -1:27:52 -	LMT	1916 Jul 28 # Ittoqqortoormiit
    -			-2:00	-	CGT	1980 Apr  6  2:00
    -			-2:00	C-Eur	CG%sT	1981 Mar 29
    -			-1:00	EU	EG%sT
    +			-2:00	-	-02	1980 Apr  6  2:00
    +			-2:00	C-Eur	-02/-01	1981 Mar 29
    +			-1:00	EU	-01/+00
     Zone America/Godthab	-3:26:56 -	LMT	1916 Jul 28 # Nuuk
    -			-3:00	-	WGT	1980 Apr  6  2:00
    -			-3:00	EU	WG%sT
    +			-3:00	-	-03	1980 Apr  6  2:00
    +			-3:00	EU	-03/-02
     Zone America/Thule	-4:35:08 -	LMT	1916 Jul 28 # Pituffik air base
     			-4:00	Thule	A%sT
     
    @@ -1511,7 +1508,7 @@ Rule	Iceland	1950	1966	-	Oct	Sun>=22	 1:00s	0	-
     Rule	Iceland	1967	only	-	Oct	29	 1:00s	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Atlantic/Reykjavik	-1:28	-	LMT	1908
    -			-1:00	Iceland	IS%sT	1968 Apr  7  1:00s
    +			-1:00	Iceland	-01/+00	1968 Apr  7  1:00s
     			 0:00	-	GMT
     
     # Italy
    @@ -1975,7 +1972,7 @@ Rule	Neth	1945	only	-	Sep	16	2:00s	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Europe/Amsterdam	0:19:32 -	LMT	1835
     			0:19:32	Neth	%s	1937 Jul  1
    -			0:20	Neth	NE%sT	1940 May 16  0:00 # Dutch Time
    +			0:20	Neth +0020/+0120 1940 May 16  0:00
     			1:00	C-Eur	CE%sT	1945 Apr  2  2:00
     			1:00	Neth	CE%sT	1977
     			1:00	EU	CE%sT
    @@ -2192,16 +2189,34 @@ Zone	Europe/Lisbon	-0:36:45 -	LMT	1884
     			 0:00	W-Eur	WE%sT	1992 Sep 27  1:00s
     			 1:00	EU	CE%sT	1996 Mar 31  1:00u
     			 0:00	EU	WE%sT
    +# This Zone can be simplified once we assume zic %z.
     Zone Atlantic/Azores	-1:42:40 -	LMT	1884        # Ponta Delgada
     			-1:54:32 -	HMT	1912 Jan  1 # Horta Mean Time
    -			-2:00	Port	AZO%sT	1966 Apr  3  2:00  # Azores Time
    -			-1:00	Port	AZO%sT	1983 Sep 25  1:00s
    -			-1:00	W-Eur	AZO%sT	1992 Sep 27  1:00s
    +			-2:00	Port	-02/-01	1942 Apr 25 22:00s
    +			-2:00	Port	+00	1942 Aug 15 22:00s
    +			-2:00	Port	-02/-01	1943 Apr 17 22:00s
    +			-2:00	Port	+00	1943 Aug 28 22:00s
    +			-2:00	Port	-02/-01	1944 Apr 22 22:00s
    +			-2:00	Port	+00	1944 Aug 26 22:00s
    +			-2:00	Port	-02/-01	1945 Apr 21 22:00s
    +			-2:00	Port	+00	1945 Aug 25 22:00s
    +			-2:00	Port	-02/-01	1966 Apr  3  2:00
    +			-1:00	Port	-01/+00	1983 Sep 25  1:00s
    +			-1:00	W-Eur	-01/+00	1992 Sep 27  1:00s
     			 0:00	EU	WE%sT	1993 Mar 28  1:00u
    -			-1:00	EU	AZO%sT
    +			-1:00	EU	-01/+00
    +# This Zone can be simplified once we assume zic %z.
     Zone Atlantic/Madeira	-1:07:36 -	LMT	1884        # Funchal
     			-1:07:36 -	FMT	1912 Jan  1 # Funchal Mean Time
    -			-1:00	Port	MAD%sT	1966 Apr  3  2:00 # Madeira Time
    +			-1:00	Port	-01/+00	1942 Apr 25 22:00s
    +			-1:00	Port	+01	1942 Aug 15 22:00s
    +			-1:00	Port	-01/+00	1943 Apr 17 22:00s
    +			-1:00	Port	+01	1943 Aug 28 22:00s
    +			-1:00	Port	-01/+00	1944 Apr 22 22:00s
    +			-1:00	Port	+01	1944 Aug 26 22:00s
    +			-1:00	Port	-01/+00	1945 Apr 21 22:00s
    +			-1:00	Port	+01	1945 Aug 25 22:00s
    +			-1:00	Port	-01/+00	1966 Apr  3  2:00
     			 0:00	Port	WE%sT	1983 Sep 25  1:00s
     			 0:00	EU	WE%sT
     
    @@ -2559,10 +2574,8 @@ Zone Europe/Moscow	 2:30:17 -	LMT	1880
     			 3:00	-	MSK
     
     
    -# From Tim Parenti (2014-07-03):
    -# Europe/Simferopol covers...
    -# **	****	Crimea, Republic of
    -# **	****	Sevastopol
    +# From Paul Eggert (2016-12-06):
    +# Europe/Simferopol covers Crimea.
     
     Zone Europe/Simferopol	 2:16:24 -	LMT	1880
     			 2:16	-	SMT	1924 May  2 # Simferopol Mean T
    @@ -3255,46 +3268,77 @@ Link Europe/Prague Europe/Bratislava
     # See Europe/Belgrade.
     
     # Spain
    +#
    +# From Paul Eggert (2016-12-14):
    +#
    +# The source for Europe/Madrid before 2013 is:
    +# Planesas P. La hora oficial en España y sus cambios.
    +# Anuario del Observatorio Astronómico de Madrid (2013, in Spanish).
    +# http://astronomia.ign.es/rknowsys-theme/images/webAstro/paginas/documentos/Anuario/lahoraoficialenespana.pdf
    +# As this source says that historical time in the Canaries is obscure,
    +# and it does not discuss Ceuta, stick with Shanks for now for that data.
    +#
    +# In the 1918 and 1919 fallback transitions in Spain, the clock for
    +# the hour-longer day officially kept going after midnight, so that
    +# the repeated instances of that day's 00:00 hour were 24 hours apart,
    +# with a fallback transition from the second occurrence of 00:59... to
    +# the next day's 00:00.  Our data format cannot represent this
    +# directly, and instead repeats the first hour of the next day, with a
    +# fallback transition from the next day's 00:59... to 00:00.
    +
    +# From Michael Deckers (2016-12-15):
    +# The Royal Decree of 1900-06-26 quoted by Planesas, online at
    +# https://www.boe.es/datos/pdfs/BOE//1900/209/A00383-00384.pdf
    +# says in its article 5 (my translation):
    +# These dispositions will enter into force beginning with the
    +# instant at which, according to the time indicated in article 1,
    +# the 1st day of January of 1901 will begin.
    +
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    -# For 1917-1919 Whitman gives Apr Sat>=1 - Oct Sat>=1;
    -# go with Shanks & Pottenger.
    -Rule	Spain	1917	only	-	May	 5	23:00s	1:00	S
    -Rule	Spain	1917	1919	-	Oct	 6	23:00s	0	-
    -Rule	Spain	1918	only	-	Apr	15	23:00s	1:00	S
    -Rule	Spain	1919	only	-	Apr	 5	23:00s	1:00	S
    -# Whitman gives 1921 Feb 28 - Oct 14; go with Shanks & Pottenger.
    -Rule	Spain	1924	only	-	Apr	16	23:00s	1:00	S
    -# Whitman gives 1924 Oct 14; go with Shanks & Pottenger.
    -Rule	Spain	1924	only	-	Oct	 4	23:00s	0	-
    -Rule	Spain	1926	only	-	Apr	17	23:00s	1:00	S
    -# Whitman says no DST in 1929; go with Shanks & Pottenger.
    -Rule	Spain	1926	1929	-	Oct	Sat>=1	23:00s	0	-
    -Rule	Spain	1927	only	-	Apr	 9	23:00s	1:00	S
    -Rule	Spain	1928	only	-	Apr	14	23:00s	1:00	S
    -Rule	Spain	1929	only	-	Apr	20	23:00s	1:00	S
    -# Whitman gives 1937 Jun 16, 1938 Apr 16, 1940 Apr 13;
    -# go with Shanks & Pottenger.
    -Rule	Spain	1937	only	-	May	22	23:00s	1:00	S
    -Rule	Spain	1937	1939	-	Oct	Sat>=1	23:00s	0	-
    -Rule	Spain	1938	only	-	Mar	22	23:00s	1:00	S
    -Rule	Spain	1939	only	-	Apr	15	23:00s	1:00	S
    -Rule	Spain	1940	only	-	Mar	16	23:00s	1:00	S
    -# Whitman says no DST 1942-1945; go with Shanks & Pottenger.
    -Rule	Spain	1942	only	-	May	 2	22:00s	2:00	M # Midsummer
    -Rule	Spain	1942	only	-	Sep	 1	22:00s	1:00	S
    -Rule	Spain	1943	1946	-	Apr	Sat>=13	22:00s	2:00	M
    -Rule	Spain	1943	only	-	Oct	 3	22:00s	1:00	S
    -Rule	Spain	1944	only	-	Oct	10	22:00s	1:00	S
    -Rule	Spain	1945	only	-	Sep	30	 1:00	1:00	S
    -Rule	Spain	1946	only	-	Sep	30	 0:00	0	-
    +Rule	Spain	1918	only	-	Apr	15	23:00	1:00	S
    +Rule	Spain	1918	1919	-	Oct	 6	24:00s	0	-
    +Rule	Spain	1919	only	-	Apr	 6	23:00	1:00	S
    +Rule	Spain	1924	only	-	Apr	16	23:00	1:00	S
    +Rule	Spain	1924	only	-	Oct	 4	24:00s	0	-
    +Rule	Spain	1926	only	-	Apr	17	23:00	1:00	S
    +Rule	Spain	1926	1929	-	Oct	Sat>=1	24:00s	0	-
    +Rule	Spain	1927	only	-	Apr	 9	23:00	1:00	S
    +Rule	Spain	1928	only	-	Apr	15	 0:00	1:00	S
    +Rule	Spain	1929	only	-	Apr	20	23:00	1:00	S
    +# Republican Spain during the civil war; it controlled Madrid until 1939-03-28.
    +Rule	Spain	1937	only	-	Jun	16	23:00	1:00	S
    +Rule	Spain	1937	only	-	Oct	 2	24:00s	0	-
    +Rule	Spain	1938	only	-	Apr	 2	23:00	1:00	S
    +Rule	Spain	1938	only	-	Apr	30	23:00	2:00	M
    +Rule	Spain	1938	only	-	Oct	 2	24:00	1:00	S
    +# The following rules are for unified Spain again.
    +#
    +# Planesas does not say what happened in Madrid between its fall on
    +# 1939-03-28 and the Nationalist spring-forward transition on
    +# 1939-04-15.  For lack of better info, assume Madrid's clocks did not
    +# change during that period.
    +#
    +# The first rule is commented out, as it is redundant for Republican Spain.
    +#Rule	Spain	1939	only	-	Apr	15	23:00	1:00	S
    +Rule	Spain	1939	only	-	Oct	 7	24:00s	0	-
    +Rule	Spain	1942	only	-	May	 2	23:00	1:00	S
    +Rule	Spain	1942	only	-	Sep	 1	 1:00	0	-
    +Rule	Spain	1943	1946	-	Apr	Sat>=13	23:00	1:00	S
    +Rule	Spain	1943	1944	-	Oct	Sun>=1	 1:00	0	-
    +Rule	Spain	1945	1946	-	Sep	lastSun	 1:00	0	-
     Rule	Spain	1949	only	-	Apr	30	23:00	1:00	S
    -Rule	Spain	1949	only	-	Sep	30	 1:00	0	-
    -Rule	Spain	1974	1975	-	Apr	Sat>=13	23:00	1:00	S
    +Rule	Spain	1949	only	-	Oct	 2	 1:00	0	-
    +Rule	Spain	1974	1975	-	Apr	Sat>=12	23:00	1:00	S
     Rule	Spain	1974	1975	-	Oct	Sun>=1	 1:00	0	-
     Rule	Spain	1976	only	-	Mar	27	23:00	1:00	S
     Rule	Spain	1976	1977	-	Sep	lastSun	 1:00	0	-
    -Rule	Spain	1977	1978	-	Apr	 2	23:00	1:00	S
    -Rule	Spain	1978	only	-	Oct	 1	 1:00	0	-
    +Rule	Spain	1977	only	-	Apr	 2	23:00	1:00	S
    +Rule	Spain	1978	only	-	Apr	 2	 2:00s	1:00	S
    +Rule	Spain	1978	only	-	Oct	 1	 2:00s	0	-
    +# Nationalist Spain during the civil war
    +#Rule NatSpain	1937	only	-	May	22	23:00	1:00	S
    +#Rule NatSpain	1937	1938	-	Oct	Sat>=1	24:00s	0	-
    +#Rule NatSpain	1938	only	-	Mar	26	23:00	1:00	S
     # The following rules are copied from Morocco from 1967 through 1978.
     Rule SpainAfrica 1967	only	-	Jun	 3	12:00	1:00	S
     Rule SpainAfrica 1967	only	-	Oct	 1	 0:00	0	-
    @@ -3306,11 +3350,11 @@ Rule SpainAfrica 1977	only	-	Sep	28	 0:00	0	-
     Rule SpainAfrica 1978	only	-	Jun	 1	 0:00	1:00	S
     Rule SpainAfrica 1978	only	-	Aug	 4	 0:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    -Zone	Europe/Madrid	-0:14:44 -	LMT	1901 Jan  1  0:00s
    -			 0:00	Spain	WE%sT	1946 Sep 30
    +Zone	Europe/Madrid	-0:14:44 -	LMT	1900 Dec 31 23:45:16
    +			 0:00	Spain	WE%sT	1940 Mar 16 23:00
     			 1:00	Spain	CE%sT	1979
     			 1:00	EU	CE%sT
    -Zone	Africa/Ceuta	-0:21:16 -	LMT	1901
    +Zone	Africa/Ceuta	-0:21:16 -	LMT	1900 Dec 31 23:38:44
     			 0:00	-	WET	1918 May  6 23:00
     			 0:00	1:00	WEST	1918 Oct  7 23:00
     			 0:00	-	WET	1924
    @@ -3319,7 +3363,7 @@ Zone	Africa/Ceuta	-0:21:16 -	LMT	1901
     			 1:00	-	CET	1986
     			 1:00	EU	CE%sT
     Zone	Atlantic/Canary	-1:01:36 -	LMT	1922 Mar # Las Palmas de Gran C.
    -			-1:00	-	CANT	1946 Sep 30  1:00 # Canaries T
    +			-1:00	-	-01	1946 Sep 30  1:00
     			 0:00	-	WET	1980 Apr  6  0:00s
     			 0:00	1:00	WEST	1980 Sep 28  1:00u
     			 0:00	EU	WE%sT
    @@ -3732,7 +3776,7 @@ Zone Europe/Uzhgorod	1:29:12 -	LMT	1890 Oct
     # spelling, except omit the apostrophe as it is not allowed in
     # portable Posix file names.
     Zone Europe/Zaporozhye	2:20:40 -	LMT	1880
    -			2:20	-	CUT	1924 May  2 # Central Ukraine T
    +			2:20	-	+0220	1924 May  2
     			2:00	-	EET	1930 Jun 21
     			3:00	-	MSK	1941 Aug 25
     			1:00	C-Eur	CE%sT	1943 Oct 25
    diff --git a/jdk/make/data/tzdata/iso3166.tab b/jdk/make/data/tzdata/iso3166.tab
    index 004a4a70556..38a3a1ed52b 100644
    --- a/jdk/make/data/tzdata/iso3166.tab
    +++ b/jdk/make/data/tzdata/iso3166.tab
    @@ -32,8 +32,8 @@
     # All text uses UTF-8 encoding.  The columns of the table are as follows:
     #
     # 1.  ISO 3166-1 alpha-2 country code, current as of
    -#     ISO 3166-1 Newsletter VI-16 (2013-07-11).  See: Updates on ISO 3166
    -#   http://www.iso.org/iso/home/standards/country_codes/updates_on_iso_3166.htm
    +#     ISO 3166-1 N905 (2016-11-15).  See: Updates on ISO 3166-1
    +#     http://isotc.iso.org/livelink/livelink/Open/16944257
     # 2.  The usual English name for the coded region,
     #     chosen so that alphabetic sorting of subsets produces helpful lists.
     #     This is not the same as the English name in the ISO 3166 tables.
    diff --git a/jdk/make/data/tzdata/leapseconds b/jdk/make/data/tzdata/leapseconds
    index 71d774d16fa..3823c9abc4c 100644
    --- a/jdk/make/data/tzdata/leapseconds
    +++ b/jdk/make/data/tzdata/leapseconds
    @@ -81,5 +81,5 @@ Leap	2012	Jun	30	23:59:60	+	S
     Leap	2015	Jun	30	23:59:60	+	S
     Leap	2016	Dec	31	23:59:60	+	S
     
    -#	Updated through IERS Bulletin C52
    -#	File expires on:  28 June 2017
    +#	Updated through IERS Bulletin C53
    +#	File expires on:  28 December 2017
    diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica
    index 56b089c8fc5..d59d2705b99 100644
    --- a/jdk/make/data/tzdata/northamerica
    +++ b/jdk/make/data/tzdata/northamerica
    @@ -201,22 +201,6 @@ Zone	CST6CDT		 -6:00	US	C%sT
     Zone	MST7MDT		 -7:00	US	M%sT
     Zone	PST8PDT		 -8:00	US	P%sT
     
    -# From Bob Devine (1988-01-28):
    -# ...Alaska (and Hawaii) had the timezone names changed in 1967.
    -#    old			 new
    -#    Pacific Standard Time(PST)  -same-
    -#    Yukon Standard Time(YST)    -same-
    -#    Central Alaska S.T. (CAT)   Alaska-Hawaii St[an]dard Time (AHST)
    -#    Nome Standard Time (NT)     Bering Standard Time (BST)
    -#
    -# ...Alaska's timezone lines were redrawn in 1983 to give only 2 tz.
    -#    The YST zone now covers nearly all of the state, AHST just part
    -#    of the Aleutian islands.   No DST.
    -
    -# From Paul Eggert (1995-12-19):
    -# The tables below use 'NST', not 'NT', for Nome Standard Time.
    -# I invented 'CAWT' for Central Alaska War Time.
    -
     # From U. S. Naval Observatory (1989-01-19):
     # USA  EASTERN       5 H  BEHIND UTC    NEW YORK, WASHINGTON
     # USA  EASTERN       4 H  BEHIND UTC    APR 3 - OCT 30
    @@ -273,6 +257,21 @@ Zone	PST8PDT		 -8:00	US	P%sT
     #	Samoa standard time
     # The law doesn't give abbreviations.
     #
    +# From Paul Eggert (2016-12-19):
    +# Here are URLs for the 1918 and 1966 legislation:
    +# http://uscode.house.gov/statviewer.htm?volume=40&page=451
    +# http://uscode.house.gov/statviewer.htm?volume=80&page=108
    +# Although the 1918 names were officially "United States Standard
    +# Eastern Time" and similarly for "Central", "Mountain", "Pacific",
    +# and "Alaska", in practice "Standard" was placed just before "Time",
    +# as codified in 1966.  In practice, Alaska time was abbreviated "AST"
    +# before 1968.  Summarizing the 1967 name changes:
    +#	1918 names			1967 names
    +#  -08	Standard Pacific Time (PST)	Pacific standard time (PST)
    +#  -09	(unofficial) Yukon (YST)	Yukon standard time (YST)
    +#  -10	Standard Alaska Time (AST)	Alaska-Hawaii standard time (AHST)
    +#  -11	(unofficial) Nome (NST)		Bering standard time (BST)
    +#
     # From Paul Eggert (2000-01-08), following a heads-up from Rives McDow:
     # Public law 106-564 (2000-12-23) introduced ... "Chamorro Standard Time"
     # for time in Guam and the Northern Marianas.  See the file "australasia".
    @@ -328,6 +327,15 @@ Zone	PST8PDT		 -8:00	US	P%sT
     # Roberts, city administrator in Phenix City. as saying "We are in the Central
     # time zone, but we do go by the Eastern time zone because so many people work
     # in Columbus."
    +#
    +# From Paul Eggert (2017-02-22):
    +# Four cities are involved.  The two not mentioned above are Smiths Station
    +# and Valley.  Barbara Brooks, Valley's assistant treasurer, heard it started
    +# because West Point Pepperell textile mills were in Alabama while the
    +# corporate office was in Georgia, and residents voted to keep Eastern
    +# time even after the mills closed.  See: Kazek K. Did you know which
    +# Alabama towns are in a different time zone?  al.com 2017-02-06.
    +# http://www.al.com/living/index.ssf/2017/02/do_you_know_which_alabama_town.html
     
     # From Paul Eggert (2014-09-06):
     # Monthly Notices of the Royal Astronomical Society 44, 4 (1884-02-08), 208
    @@ -505,7 +513,7 @@ Zone America/Los_Angeles -7:52:58 -	LMT	1883 Nov 18 12:07:02
     			-8:00	US	P%sT
     
     # Alaska
    -# AK%sT is the modern abbreviation for -9:00 per USNO.
    +# AK%sT is the modern abbreviation for -09 per USNO.
     #
     # From Paul Eggert (2001-05-30):
     # Howse writes that Alaska switched from the Julian to the Gregorian calendar,
    @@ -611,10 +619,8 @@ Zone America/Yakutat	 14:41:05 -	LMT	1867 Oct 18
     			 -9:00	US	AK%sT
     Zone America/Anchorage	 14:00:24 -	LMT	1867 Oct 18
     			 -9:59:36 -	LMT	1900 Aug 20 12:00
    -			-10:00	-	CAT	1942
    -			-10:00	US	CAT/CAWT 1945 Aug 14 23:00u
    -			-10:00	US	CAT/CAPT 1946 # Peace
    -			-10:00	-	CAT	1967 Apr
    +			-10:00	-	AST	1942
    +			-10:00	US	A%sT	1967 Apr
     			-10:00	-	AHST	1969
     			-10:00	US	AH%sT	1983 Oct 30  2:00
     			 -9:00	US	Y%sT	1983 Nov 30
    @@ -703,7 +709,6 @@ Zone Pacific/Honolulu	-10:31:26 -	LMT	1896 Jan 13 12:00
     			-10:30	1:00	HDT	1945 Sep 30  2:00
     			-10:30	-	HST	1947 Jun  8  2:00
     			-10:00	-	HST
    -Link Pacific/Honolulu Pacific/Johnston
     
     # Now we turn to US areas that have diverged from the consensus since 1970.
     
    @@ -1091,15 +1096,15 @@ Zone America/Menominee	-5:50:27 -	LMT	1885 Sep 18 12:00
     ################################################################################
     
     
    -# From Paul Eggert (2014-10-31):
    +# From Paul Eggert (2017-02-10):
     #
     # Unless otherwise specified, the source for data through 1990 is:
     # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
     # San Diego: ACS Publications, Inc. (2003).
     # Unfortunately this book contains many errors and cites no sources.
     #
    -# Gwillim Law writes that a good source
    -# for recent time zone data is the International Air Transport
    +# Many years ago Gwillim Law wrote that a good source
    +# for time zone data was the International Air Transport
     # Association's Standard Schedules Information Manual (IATA SSIM),
     # published semiannually.  Law sent in several helpful summaries
     # of the IATA's data after 1990.  Except where otherwise noted,
    @@ -2757,15 +2762,15 @@ Zone America/Barbados	-3:58:29 -	LMT	1924 # Bridgetown
     # Belize
     # Whitman entirely disagrees with Shanks; go with Shanks & Pottenger.
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    -Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	HD
    -Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	S
    -Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	D
    -Rule	Belize	1974	only	-	Feb	 9	0:00	0	S
    -Rule	Belize	1982	only	-	Dec	18	0:00	1:00	D
    -Rule	Belize	1983	only	-	Feb	12	0:00	0	S
    +Rule	Belize	1918	1942	-	Oct	Sun>=2	0:00	0:30	-0530
    +Rule	Belize	1919	1943	-	Feb	Sun>=9	0:00	0	CST
    +Rule	Belize	1973	only	-	Dec	 5	0:00	1:00	CDT
    +Rule	Belize	1974	only	-	Feb	 9	0:00	0	CST
    +Rule	Belize	1982	only	-	Dec	18	0:00	1:00	CDT
    +Rule	Belize	1983	only	-	Feb	12	0:00	0	CST
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Belize	-5:52:48 -	LMT	1912 Apr
    -			-6:00	Belize	C%sT
    +			-6:00	Belize	%s
     
     # Bermuda
     
    @@ -3037,16 +3042,16 @@ Zone	America/Havana	-5:29:28 -	LMT	1890
     
     
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    -Rule	DR	1966	only	-	Oct	30	0:00	1:00	D
    -Rule	DR	1967	only	-	Feb	28	0:00	0	S
    -Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	HD
    -Rule	DR	1970	only	-	Feb	21	0:00	0	S
    -Rule	DR	1971	only	-	Jan	20	0:00	0	S
    -Rule	DR	1972	1974	-	Jan	21	0:00	0	S
    +Rule	DR	1966	only	-	Oct	30	0:00	1:00	EDT
    +Rule	DR	1967	only	-	Feb	28	0:00	0	EST
    +Rule	DR	1969	1973	-	Oct	lastSun	0:00	0:30	-0430
    +Rule	DR	1970	only	-	Feb	21	0:00	0	EST
    +Rule	DR	1971	only	-	Jan	20	0:00	0	EST
    +Rule	DR	1972	1974	-	Jan	21	0:00	0	EST
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Santo_Domingo -4:39:36 -	LMT	1890
     			-4:40	-	SDMT	1933 Apr  1 12:00 # S. Dom. MT
    -			-5:00	DR	E%sT	1974 Oct 27
    +			-5:00	DR	%s	1974 Oct 27
     			-4:00	-	AST	2000 Oct 29  2:00
     			-5:00	US	E%sT	2000 Dec  3  1:00
     			-4:00	-	AST
    @@ -3157,6 +3162,12 @@ Zone America/Guatemala	-6:02:04 -	LMT	1918 Oct 5
     # http://www.vantbefinfo.com/changement-dheure-pas-pour-haiti/
     # http://news.anmwe.com/haiti-lheure-nationale-ne-sera-ni-avancee-ni-reculee-cette-annee/
     
    +# From Steffen Thorsen (2017-03-12):
    +# We have received 4 mails from different people telling that Haiti
    +# has started DST again today, and this source seems to confirm that,
    +# I have not been able to find a more authoritative source:
    +# https://www.haitilibre.com/en/news-20319-haiti-notices-time-change-in-haiti.html
    +
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Haiti	1983	only	-	May	8	0:00	1:00	D
     Rule	Haiti	1984	1987	-	Apr	lastSun	0:00	1:00	D
    @@ -3169,6 +3180,8 @@ Rule	Haiti	2005	2006	-	Apr	Sun>=1	0:00	1:00	D
     Rule	Haiti	2005	2006	-	Oct	lastSun	0:00	0	S
     Rule	Haiti	2012	2015	-	Mar	Sun>=8	2:00	1:00	D
     Rule	Haiti	2012	2015	-	Nov	Sun>=1	2:00	0	S
    +Rule	Haiti	2017	max	-	Mar	Sun>=8	2:00	1:00	D
    +Rule	Haiti	2017	max	-	Nov	Sun>=1	2:00	0	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Port-au-Prince -4:49:20 -	LMT	1890
     			-4:49	-	PPMT	1917 Jan 24 12:00 # P-a-P MT
    @@ -3336,8 +3349,8 @@ Zone America/Puerto_Rico -4:24:25 -	LMT	1899 Mar 28 12:00 # San Juan
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Miquelon	-3:44:40 -	LMT	1911 May 15 # St Pierre
     			-4:00	-	AST	1980 May
    -			-3:00	-	PMST	1987 # Pierre & Miquelon Time
    -			-3:00	Canada	PM%sT
    +			-3:00	-	-03	1987
    +			-3:00	Canada	-03/-02
     
     # St Vincent and the Grenadines
     # See America/Port_of_Spain.
    diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica
    index bbc0a95067a..44dbd957566 100644
    --- a/jdk/make/data/tzdata/southamerica
    +++ b/jdk/make/data/tzdata/southamerica
    @@ -29,15 +29,15 @@
     # tz@iana.org for general use in the future).  For more, please see
     # the file CONTRIBUTING in the tz distribution.
     
    -# From Paul Eggert (2014-10-31):
    +# From Paul Eggert (2016-12-05):
     #
     # Unless otherwise specified, the source for data through 1990 is:
     # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition),
     # San Diego: ACS Publications, Inc. (2003).
     # Unfortunately this book contains many errors and cites no sources.
     #
    -# Gwillim Law writes that a good source
    -# for recent time zone data is the International Air Transport
    +# Many years ago Gwillim Law wrote that a good source
    +# for time zone data was the International Air Transport
     # Association's Standard Schedules Information Manual (IATA SSIM),
     # published semiannually.  Law sent in several helpful summaries
     # of the IATA's data after 1990.  Except where otherwise noted,
    @@ -47,32 +47,10 @@
     # Milne J. Civil time. Geogr J. 1899 Feb;13(2):173-94.
     # http://www.jstor.org/stable/1774359
     #
    -# Earlier editions of these tables used the North American style (e.g. ARST and
    -# ARDT for Argentine Standard and Daylight Time), but the following quote
    -# suggests that it's better to use European style (e.g. ART and ARST).
    -#	I suggest the use of _Summer time_ instead of the more cumbersome
    -#	_daylight-saving time_.  _Summer time_ seems to be in general use
    -#	in Europe and South America.
    -#	-- E O Cutler, _New York Times_ (1937-02-14), quoted in
    -#	H L Mencken, _The American Language: Supplement I_ (1960), p 466
    -#
    -# Earlier editions of these tables also used the North American style
    -# for time zones in Brazil, but this was incorrect, as Brazilians say
    -# "summer time".  Reinaldo Goulart, a São Paulo businessman active in
    -# the railroad sector, writes (1999-07-06):
    -#	The subject of time zones is currently a matter of discussion/debate in
    -#	Brazil.  Let's say that "the Brasília time" is considered the
    -#	"official time" because Brasília is the capital city.
    -#	The other three time zones are called "Brasília time "minus one" or
    -#	"plus one" or "plus two".  As far as I know there is no such
    -#	name/designation as "Eastern Time" or "Central Time".
    -# So I invented the following (English-language) abbreviations for now.
    -# Corrections are welcome!
    -#		std	dst
    -#	-2:00	FNT	FNST	Fernando de Noronha
    -#	-3:00	BRT	BRST	Brasília
    -#	-4:00	AMT	AMST	Amazon
    -#	-5:00	ACT	ACST	Acre
    +# These tables use numeric abbreviations like -03 and -0330 for
    +# integer hour and minute UTC offsets.  Although earlier editions used
    +# alphabetic time zone abbreviations, these abbreviations were
    +# invented and did not reflect common practice.
     
     ###############################################################################
     
    @@ -407,12 +385,6 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
     #
     # So I guess a new set of rules, besides "Arg", must be made and the last
     # America/Argentina/San_Luis entries should change to use these...
    -#
    -# I'm enclosing a patch that does what I say... regretfully, the San Luis
    -# timezone must be called "WART/WARST" even when most of the time (like,
    -# right now) WARST == ART... that is, since last Sunday, all the country
    -# is using UTC-3, but in my patch, San Luis calls it "WARST" and the rest
    -# of the country calls it "ART".
     # ...
     
     # From Alexander Krivenyshev (2010-04-09):
    @@ -451,11 +423,11 @@ Rule	Arg	2008	only	-	Oct	Sun>=15	0:00	1:00	S
     # Buenos Aires (BA), Capital Federal (CF),
     Zone America/Argentina/Buenos_Aires -3:53:48 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	Arg	AR%sT
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	Arg	-03/-02
     #
     # Córdoba (CB), Santa Fe (SF), Entre Ríos (ER), Corrientes (CN), Misiones (MN),
     # Chaco (CC), Formosa (FM), Santiago del Estero (SE)
    @@ -469,113 +441,113 @@ Zone America/Argentina/Buenos_Aires -3:53:48 - LMT	1894 Oct 31
     #
     Zone America/Argentina/Cordoba -4:16:48 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1991 Mar  3
    -			-4:00	-	WART	1991 Oct 20
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	Arg	AR%sT
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1991 Mar  3
    +			-4:00	-	-04	1991 Oct 20
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	Arg	-03/-02
     #
     # Salta (SA), La Pampa (LP), Neuquén (NQ), Rio Negro (RN)
     Zone America/Argentina/Salta -4:21:40 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1991 Mar  3
    -			-4:00	-	WART	1991 Oct 20
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1991 Mar  3
    +			-4:00	-	-04	1991 Oct 20
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # Tucumán (TM)
     Zone America/Argentina/Tucuman -4:20:52 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1991 Mar  3
    -			-4:00	-	WART	1991 Oct 20
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 Jun  1
    -			-4:00	-	WART	2004 Jun 13
    -			-3:00	Arg	AR%sT
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1991 Mar  3
    +			-4:00	-	-04	1991 Oct 20
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 Jun  1
    +			-4:00	-	-04	2004 Jun 13
    +			-3:00	Arg	-03/-02
     #
     # La Rioja (LR)
     Zone America/Argentina/La_Rioja -4:27:24 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1991 Mar  1
    -			-4:00	-	WART	1991 May  7
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 Jun  1
    -			-4:00	-	WART	2004 Jun 20
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1991 Mar  1
    +			-4:00	-	-04	1991 May  7
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 Jun  1
    +			-4:00	-	-04	2004 Jun 20
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # San Juan (SJ)
     Zone America/Argentina/San_Juan -4:34:04 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1991 Mar  1
    -			-4:00	-	WART	1991 May  7
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 May 31
    -			-4:00	-	WART	2004 Jul 25
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1991 Mar  1
    +			-4:00	-	-04	1991 May  7
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 May 31
    +			-4:00	-	-04	2004 Jul 25
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # Jujuy (JY)
     Zone America/Argentina/Jujuy -4:21:12 -	LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1990 Mar  4
    -			-4:00	-	WART	1990 Oct 28
    -			-4:00	1:00	WARST	1991 Mar 17
    -			-4:00	-	WART	1991 Oct  6
    -			-3:00	1:00	ARST	1992
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1990 Mar  4
    +			-4:00	-	-04	1990 Oct 28
    +			-4:00	1:00	-03	1991 Mar 17
    +			-4:00	-	-04	1991 Oct  6
    +			-3:00	1:00	-02	1992
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # Catamarca (CT), Chubut (CH)
     Zone America/Argentina/Catamarca -4:23:08 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1991 Mar  3
    -			-4:00	-	WART	1991 Oct 20
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 Jun  1
    -			-4:00	-	WART	2004 Jun 20
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1991 Mar  3
    +			-4:00	-	-04	1991 Oct 20
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 Jun  1
    +			-4:00	-	-04	2004 Jun 20
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # Mendoza (MZ)
     Zone America/Argentina/Mendoza -4:35:16 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1990 Mar  4
    -			-4:00	-	WART	1990 Oct 15
    -			-4:00	1:00	WARST	1991 Mar  1
    -			-4:00	-	WART	1991 Oct 15
    -			-4:00	1:00	WARST	1992 Mar  1
    -			-4:00	-	WART	1992 Oct 18
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 May 23
    -			-4:00	-	WART	2004 Sep 26
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1990 Mar  4
    +			-4:00	-	-04	1990 Oct 15
    +			-4:00	1:00	-03	1991 Mar  1
    +			-4:00	-	-04	1991 Oct 15
    +			-4:00	1:00	-03	1992 Mar  1
    +			-4:00	-	-04	1992 Oct 18
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 May 23
    +			-4:00	-	-04	2004 Sep 26
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # San Luis (SL)
     
    @@ -584,44 +556,44 @@ Rule	SanLuis	2007	2008	-	Oct	Sun>=8	0:00	1:00	S
     
     Zone America/Argentina/San_Luis -4:25:24 - LMT	1894 Oct 31
     			-4:16:48 -	CMT	1920 May
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1990
    -			-3:00	1:00	ARST	1990 Mar 14
    -			-4:00	-	WART	1990 Oct 15
    -			-4:00	1:00	WARST	1991 Mar  1
    -			-4:00	-	WART	1991 Jun  1
    -			-3:00	-	ART	1999 Oct  3
    -			-4:00	1:00	WARST	2000 Mar  3
    -			-3:00	-	ART	2004 May 31
    -			-4:00	-	WART	2004 Jul 25
    -			-3:00	Arg	AR%sT	2008 Jan 21
    -			-4:00	SanLuis	WAR%sT	2009 Oct 11
    -			-3:00	-	ART
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1990
    +			-3:00	1:00	-02	1990 Mar 14
    +			-4:00	-	-04	1990 Oct 15
    +			-4:00	1:00	-03	1991 Mar  1
    +			-4:00	-	-04	1991 Jun  1
    +			-3:00	-	-03	1999 Oct  3
    +			-4:00	1:00	-03	2000 Mar  3
    +			-3:00	-	-03	2004 May 31
    +			-4:00	-	-04	2004 Jul 25
    +			-3:00	Arg	-03/-02	2008 Jan 21
    +			-4:00	SanLuis	-04/-03	2009 Oct 11
    +			-3:00	-	-03
     #
     # Santa Cruz (SC)
     Zone America/Argentina/Rio_Gallegos -4:36:52 - LMT	1894 Oct 31
    -			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 Jun  1
    -			-4:00	-	WART	2004 Jun 20
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:16:48 -	CMT	1920 May
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 Jun  1
    +			-4:00	-	-04	2004 Jun 20
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     #
     # Tierra del Fuego, Antártida e Islas del Atlántico Sur (TF)
     Zone America/Argentina/Ushuaia -4:33:12 - LMT	1894 Oct 31
    -			-4:16:48 -	CMT	1920 May    # Córdoba Mean Time
    -			-4:00	-	ART	1930 Dec
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1999 Oct  3
    -			-4:00	Arg	AR%sT	2000 Mar  3
    -			-3:00	-	ART	2004 May 30
    -			-4:00	-	WART	2004 Jun 20
    -			-3:00	Arg	AR%sT	2008 Oct 18
    -			-3:00	-	ART
    +			-4:16:48 -	CMT	1920 May
    +			-4:00	-	-04	1930 Dec
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1999 Oct  3
    +			-4:00	Arg	-04/-03	2000 Mar  3
    +			-3:00	-	-03	2004 May 30
    +			-4:00	-	-04	2004 Jun 20
    +			-3:00	Arg	-03/-02	2008 Oct 18
    +			-3:00	-	-03
     
     # Aruba
     Link America/Curacao America/Aruba
    @@ -631,7 +603,7 @@ Link America/Curacao America/Aruba
     Zone	America/La_Paz	-4:32:36 -	LMT	1890
     			-4:32:36 -	CMT	1931 Oct 15 # Calamarca MT
     			-4:32:36 1:00	BOST	1932 Mar 21 # Bolivia ST
    -			-4:00	-	BOT	# Bolivia Time
    +			-4:00	-	-04
     
     # Brazil
     
    @@ -983,12 +955,12 @@ Rule	Brazil	2038	max	-	Feb	Sun>=15	0:00	0	-
     #
     # Fernando de Noronha (administratively part of PE)
     Zone America/Noronha	-2:09:40 -	LMT	1914
    -			-2:00	Brazil	FN%sT	1990 Sep 17
    -			-2:00	-	FNT	1999 Sep 30
    -			-2:00	Brazil	FN%sT	2000 Oct 15
    -			-2:00	-	FNT	2001 Sep 13
    -			-2:00	Brazil	FN%sT	2002 Oct  1
    -			-2:00	-	FNT
    +			-2:00	Brazil	-02/-01	1990 Sep 17
    +			-2:00	-	-02	1999 Sep 30
    +			-2:00	Brazil	-02/-01	2000 Oct 15
    +			-2:00	-	-02	2001 Sep 13
    +			-2:00	Brazil	-02/-01	2002 Oct  1
    +			-2:00	-	-02
     # Other Atlantic islands have no permanent settlement.
     # These include Trindade and Martim Vaz (administratively part of ES),
     # Rocas Atoll (RN), and the St Peter and St Paul Archipelago (PE).
    @@ -1001,119 +973,119 @@ Zone America/Noronha	-2:09:40 -	LMT	1914
     # In the north a very small part from the river Javary (now Jari I guess,
     # the border with Amapá) to the Amazon, then to the Xingu.
     Zone America/Belem	-3:13:56 -	LMT	1914
    -			-3:00	Brazil	BR%sT	1988 Sep 12
    -			-3:00	-	BRT
    +			-3:00	Brazil	-03/-02	1988 Sep 12
    +			-3:00	-	-03
     #
     # west Pará (PA)
     # West Pará includes Altamira, Óbidos, Prainha, Oriximiná, and Santarém.
     Zone America/Santarem	-3:38:48 -	LMT	1914
    -			-4:00	Brazil	AM%sT	1988 Sep 12
    -			-4:00	-	AMT	2008 Jun 24  0:00
    -			-3:00	-	BRT
    +			-4:00	Brazil	-04/-03	1988 Sep 12
    +			-4:00	-	-04	2008 Jun 24  0:00
    +			-3:00	-	-03
     #
     # Maranhão (MA), Piauí (PI), Ceará (CE), Rio Grande do Norte (RN),
     # Paraíba (PB)
     Zone America/Fortaleza	-2:34:00 -	LMT	1914
    -			-3:00	Brazil	BR%sT	1990 Sep 17
    -			-3:00	-	BRT	1999 Sep 30
    -			-3:00	Brazil	BR%sT	2000 Oct 22
    -			-3:00	-	BRT	2001 Sep 13
    -			-3:00	Brazil	BR%sT	2002 Oct  1
    -			-3:00	-	BRT
    +			-3:00	Brazil	-03/-02	1990 Sep 17
    +			-3:00	-	-03	1999 Sep 30
    +			-3:00	Brazil	-03/-02	2000 Oct 22
    +			-3:00	-	-03	2001 Sep 13
    +			-3:00	Brazil	-03/-02	2002 Oct  1
    +			-3:00	-	-03
     #
     # Pernambuco (PE) (except Atlantic islands)
     Zone America/Recife	-2:19:36 -	LMT	1914
    -			-3:00	Brazil	BR%sT	1990 Sep 17
    -			-3:00	-	BRT	1999 Sep 30
    -			-3:00	Brazil	BR%sT	2000 Oct 15
    -			-3:00	-	BRT	2001 Sep 13
    -			-3:00	Brazil	BR%sT	2002 Oct  1
    -			-3:00	-	BRT
    +			-3:00	Brazil	-03/-02	1990 Sep 17
    +			-3:00	-	-03	1999 Sep 30
    +			-3:00	Brazil	-03/-02	2000 Oct 15
    +			-3:00	-	-03	2001 Sep 13
    +			-3:00	Brazil	-03/-02	2002 Oct  1
    +			-3:00	-	-03
     #
     # Tocantins (TO)
     Zone America/Araguaina	-3:12:48 -	LMT	1914
    -			-3:00	Brazil	BR%sT	1990 Sep 17
    -			-3:00	-	BRT	1995 Sep 14
    -			-3:00	Brazil	BR%sT	2003 Sep 24
    -			-3:00	-	BRT	2012 Oct 21
    -			-3:00	Brazil	BR%sT	2013 Sep
    -			-3:00	-	BRT
    +			-3:00	Brazil	-03/-02	1990 Sep 17
    +			-3:00	-	-03	1995 Sep 14
    +			-3:00	Brazil	-03/-02	2003 Sep 24
    +			-3:00	-	-03	2012 Oct 21
    +			-3:00	Brazil	-03/-02	2013 Sep
    +			-3:00	-	-03
     #
     # Alagoas (AL), Sergipe (SE)
     Zone America/Maceio	-2:22:52 -	LMT	1914
    -			-3:00	Brazil	BR%sT	1990 Sep 17
    -			-3:00	-	BRT	1995 Oct 13
    -			-3:00	Brazil	BR%sT	1996 Sep  4
    -			-3:00	-	BRT	1999 Sep 30
    -			-3:00	Brazil	BR%sT	2000 Oct 22
    -			-3:00	-	BRT	2001 Sep 13
    -			-3:00	Brazil	BR%sT	2002 Oct  1
    -			-3:00	-	BRT
    +			-3:00	Brazil	-03/-02	1990 Sep 17
    +			-3:00	-	-03	1995 Oct 13
    +			-3:00	Brazil	-03/-02	1996 Sep  4
    +			-3:00	-	-03	1999 Sep 30
    +			-3:00	Brazil	-03/-02	2000 Oct 22
    +			-3:00	-	-03	2001 Sep 13
    +			-3:00	Brazil	-03/-02	2002 Oct  1
    +			-3:00	-	-03
     #
     # Bahia (BA)
     # There are too many Salvadors elsewhere, so use America/Bahia instead
     # of America/Salvador.
     Zone America/Bahia	-2:34:04 -	LMT	1914
    -			-3:00	Brazil	BR%sT	2003 Sep 24
    -			-3:00	-	BRT	2011 Oct 16
    -			-3:00	Brazil	BR%sT	2012 Oct 21
    -			-3:00	-	BRT
    +			-3:00	Brazil	-03/-02	2003 Sep 24
    +			-3:00	-	-03	2011 Oct 16
    +			-3:00	Brazil	-03/-02	2012 Oct 21
    +			-3:00	-	-03
     #
     # Goiás (GO), Distrito Federal (DF), Minas Gerais (MG),
     # Espírito Santo (ES), Rio de Janeiro (RJ), São Paulo (SP), Paraná (PR),
     # Santa Catarina (SC), Rio Grande do Sul (RS)
     Zone America/Sao_Paulo	-3:06:28 -	LMT	1914
    -			-3:00	Brazil	BR%sT	1963 Oct 23  0:00
    -			-3:00	1:00	BRST	1964
    -			-3:00	Brazil	BR%sT
    +			-3:00	Brazil	-03/-02	1963 Oct 23  0:00
    +			-3:00	1:00	-02	1964
    +			-3:00	Brazil	-03/-02
     #
     # Mato Grosso do Sul (MS)
     Zone America/Campo_Grande -3:38:28 -	LMT	1914
    -			-4:00	Brazil	AM%sT
    +			-4:00	Brazil	-04/-03
     #
     # Mato Grosso (MT)
     Zone America/Cuiaba	-3:44:20 -	LMT	1914
    -			-4:00	Brazil	AM%sT	2003 Sep 24
    -			-4:00	-	AMT	2004 Oct  1
    -			-4:00	Brazil	AM%sT
    +			-4:00	Brazil	-04/-03	2003 Sep 24
    +			-4:00	-	-04	2004 Oct  1
    +			-4:00	Brazil	-04/-03
     #
     # Rondônia (RO)
     Zone America/Porto_Velho -4:15:36 -	LMT	1914
    -			-4:00	Brazil	AM%sT	1988 Sep 12
    -			-4:00	-	AMT
    +			-4:00	Brazil	-04/-03	1988 Sep 12
    +			-4:00	-	-04
     #
     # Roraima (RR)
     Zone America/Boa_Vista	-4:02:40 -	LMT	1914
    -			-4:00	Brazil	AM%sT	1988 Sep 12
    -			-4:00	-	AMT	1999 Sep 30
    -			-4:00	Brazil	AM%sT	2000 Oct 15
    -			-4:00	-	AMT
    +			-4:00	Brazil	-04/-03	1988 Sep 12
    +			-4:00	-	-04	1999 Sep 30
    +			-4:00	Brazil	-04/-03	2000 Oct 15
    +			-4:00	-	-04
     #
     # east Amazonas (AM): Boca do Acre, Jutaí, Manaus, Floriano Peixoto
     # The great circle line from Tabatinga to Porto Acre divides
     # east from west Amazonas.
     Zone America/Manaus	-4:00:04 -	LMT	1914
    -			-4:00	Brazil	AM%sT	1988 Sep 12
    -			-4:00	-	AMT	1993 Sep 28
    -			-4:00	Brazil	AM%sT	1994 Sep 22
    -			-4:00	-	AMT
    +			-4:00	Brazil	-04/-03	1988 Sep 12
    +			-4:00	-	-04	1993 Sep 28
    +			-4:00	Brazil	-04/-03	1994 Sep 22
    +			-4:00	-	-04
     #
     # west Amazonas (AM): Atalaia do Norte, Boca do Maoco, Benjamin Constant,
     #	Eirunepé, Envira, Ipixuna
     Zone America/Eirunepe	-4:39:28 -	LMT	1914
    -			-5:00	Brazil	AC%sT	1988 Sep 12
    -			-5:00	-	ACT	1993 Sep 28
    -			-5:00	Brazil	AC%sT	1994 Sep 22
    -			-5:00	-	ACT	2008 Jun 24  0:00
    -			-4:00	-	AMT	2013 Nov 10
    -			-5:00	-	ACT
    +			-5:00	Brazil	-05/-04	1988 Sep 12
    +			-5:00	-	-05	1993 Sep 28
    +			-5:00	Brazil	-05/-04	1994 Sep 22
    +			-5:00	-	-05	2008 Jun 24  0:00
    +			-4:00	-	-04	2013 Nov 10
    +			-5:00	-	-05
     #
     # Acre (AC)
     Zone America/Rio_Branco	-4:31:12 -	LMT	1914
    -			-5:00	Brazil	AC%sT	1988 Sep 12
    -			-5:00	-	ACT	2008 Jun 24  0:00
    -			-4:00	-	AMT	2013 Nov 10
    -			-5:00	-	ACT
    +			-5:00	Brazil	-05/-04	1988 Sep 12
    +			-5:00	-	-05	2008 Jun 24  0:00
    +			-4:00	-	-04	2013 Nov 10
    +			-5:00	-	-05
     
     # Chile
     
    @@ -1258,6 +1230,18 @@ Zone America/Rio_Branco	-4:31:12 -	LMT	1914
     # to mean 24:00 mainland time, not 24:00 local time, so that Easter
     # Island is always two hours behind the mainland.
     
    +# From Juan Correa (2016-12-04):
    +# Magallanes region ... will keep DST (UTC -3) all year round....
    +# http://www.soychile.cl/Santiago/Sociedad/2016/12/04/433428/Bachelet-firmo-el-decreto-para-establecer-un-horario-unico-para-la-Region-de-Magallanes.aspx
    +#
    +# From Deborah Goldsmith (2017-01-19):
    +# http://www.diariooficial.interior.gob.cl/publicaciones/2017/01/17/41660/01/1169626.pdf
    +# From Paul Eggert (2017-01-19):
    +# The above says the Magallanes change expires 2019-05-11 at 24:00,
    +# so in theory, they will revert to -04/-03 after that, which means
    +# they will switch from -03 to -04 one hour after Santiago does that day.
    +# For now, assume that they will not revert.
    +
     # Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
     Rule	Chile	1927	1931	-	Sep	 1	0:00	1:00	S
     Rule	Chile	1928	1932	-	Apr	 1	0:00	0	-
    @@ -1298,22 +1282,35 @@ Rule	Chile	2016	max	-	Aug	Sun>=9	4:00u	1:00	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Santiago	-4:42:46 -	LMT	1890
     			-4:42:46 -	SMT	1910 Jan 10 # Santiago Mean Time
    -			-5:00	-	CLT	1916 Jul  1 # Chile Time
    +			-5:00	-	-05	1916 Jul  1
     			-4:42:46 -	SMT	1918 Sep 10
    -			-4:00	-	CLT	1919 Jul  1
    +			-4:00	-	-04	1919 Jul  1
     			-4:42:46 -	SMT	1927 Sep  1
    -			-5:00	Chile	CL%sT	1932 Sep  1
    -			-4:00	-	CLT	1942 Jun  1
    -			-5:00	-	CLT	1942 Aug  1
    -			-4:00	-	CLT	1946 Jul 15
    -			-4:00	1:00	CLST	1946 Sep  1 # central Chile
    -			-4:00	-	CLT	1947 Apr  1
    -			-5:00	-	CLT	1947 May 21 23:00
    -			-4:00	Chile	CL%sT
    +			-5:00	Chile	-05/-04	1932 Sep  1
    +			-4:00	-	-04	1942 Jun  1
    +			-5:00	-	-05	1942 Aug  1
    +			-4:00	-	-04	1946 Jul 15
    +			-4:00	1:00	-03	1946 Sep  1 # central Chile
    +			-4:00	-	-04	1947 Apr  1
    +			-5:00	-	-05	1947 May 21 23:00
    +			-4:00	Chile	-04/-03
    +Zone America/Punta_Arenas -4:43:40 -	LMT	1890
    +			-4:42:46 -	SMT	1910 Jan 10
    +			-5:00	-	-05	1916 Jul  1
    +			-4:42:46 -	SMT	1918 Sep 10
    +			-4:00	-	-04	1919 Jul  1
    +			-4:42:46 -	SMT	1927 Sep  1
    +			-5:00	Chile	-05/-04	1932 Sep  1
    +			-4:00	-	-04	1942 Jun  1
    +			-5:00	-	-05	1942 Aug  1
    +			-4:00	-	-04	1947 Apr  1
    +			-5:00	-	-05	1947 May 21 23:00
    +			-4:00	Chile	-04/-03	2016 Dec  4
    +			-3:00	-	-03
     Zone Pacific/Easter	-7:17:28 -	LMT	1890
     			-7:17:28 -	EMT	1932 Sep    # Easter Mean Time
    -			-7:00	Chile	EAS%sT	1982 Mar 14 3:00u # Easter Time
    -			-6:00	Chile	EAS%sT
    +			-7:00	Chile	-07/-06	1982 Mar 14 3:00u # Easter Time
    +			-6:00	Chile	-06/-05
     #
     # Salas y Gómez Island is uninhabited.
     # Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
    @@ -1333,9 +1330,10 @@ Zone Pacific/Easter	-7:17:28 -	LMT	1890
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Antarctica/Palmer	0	-	-00	1965
    -			-4:00	Arg	AR%sT	1969 Oct  5
    -			-3:00	Arg	AR%sT	1982 May
    -			-4:00	Chile	CL%sT
    +			-4:00	Arg	-04/-03	1969 Oct  5
    +			-3:00	Arg	-03/-02	1982 May
    +			-4:00	Chile	-04/-03	2016 Dec  4
    +			-3:00	-	-03
     
     # Colombia
     
    @@ -1348,7 +1346,7 @@ Rule	CO	1993	only	-	Apr	 4	0:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Bogota	-4:56:16 -	LMT	1884 Mar 13
     			-4:56:16 -	BMT	1914 Nov 23 # Bogotá Mean Time
    -			-5:00	CO	CO%sT	# Colombia Time
    +			-5:00	CO	-05/-04
     # Malpelo, Providencia, San Andres
     # no information; probably like America/Bogota
     
    @@ -1372,7 +1370,7 @@ Zone	America/Bogota	-4:56:16 -	LMT	1884 Mar 13
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Curacao	-4:35:47 -	LMT	1912 Feb 12 # Willemstad
    -			-4:30	-	ANT	1965 # Netherlands Antilles Time
    +			-4:30	-	-0430	1965
     			-4:00	-	AST
     
     # From Arthur David Olson (2011-06-15):
    @@ -1387,19 +1385,32 @@ Link	America/Curacao	America/Kralendijk	# Caribbean Netherlands
     #
     # Milne says the Central and South American Telegraph Company used -5:24:15.
     #
    -# From Paul Eggert (2007-03-04):
    -# Apparently Ecuador had a failed experiment with DST in 1992.
    -#  (2007-02-27) and
    -#  (2006-11-06) both
    -# talk about "hora Sixto".  Leave this alone for now, as we have no data.
    +# From Alois Treindl (2016-12-15):
    +# http://www.elcomercio.com/actualidad/hora-sixto-1993.html
    +# ... Whether the law applied also to Galápagos, I do not know.
    +# From Paul Eggert (2016-12-15):
    +# http://www.elcomercio.com/afull/modificacion-husohorario-ecuador-presidentes-decreto.html
    +# This says President Sixto Durán Ballén signed decree No. 285, which
    +# established DST from 1992-11-28 to 1993-02-05; it does not give transition
    +# times.  The people called it "hora de Sixto" ("Sixto hour").  The change did
    +# not go over well; a popular song "Qué hora es" by Jaime Guevara had lyrics
    +# that included "Amanecía en mitad de la noche, los guaguas iban a clase sin
    +# sol" ("It was dawning in the middle of the night, the buses went to class
    +# without sun").  Although Ballén's campaign slogan was "Ni un paso atrás"
    +# (Not one step back), the clocks went back in 1993 and the experiment was not
    +# repeated.  For now, assume transitions were at 00:00 local time country-wide.
    +#
    +# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
    +Rule	Ecuador	1992	only	-	Nov	28	0:00	1:00	S
    +Rule	Ecuador	1993	only	-	Feb	 5	0:00	0	-
     #
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Guayaquil	-5:19:20 -	LMT	1890
     			-5:14:00 -	QMT	1931 # Quito Mean Time
    -			-5:00	-	ECT	# Ecuador Time
    +			-5:00	Ecuador	-05/-04
     Zone Pacific/Galapagos	-5:58:24 -	LMT	1931 # Puerto Baquerizo Moreno
    -			-5:00	-	ECT	1986
    -			-6:00	-	GALT	# Galápagos Time
    +			-5:00	-	-05	1986
    +			-6:00	Ecuador	-06/-05
     
     # Falklands
     
    @@ -1499,25 +1510,24 @@ Rule	Falk	2001	2010	-	Sep	Sun>=1	2:00	1:00	S
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Atlantic/Stanley	-3:51:24 -	LMT	1890
     			-3:51:24 -	SMT	1912 Mar 12 # Stanley Mean Time
    -			-4:00	Falk	FK%sT	1983 May    # Falkland Is Time
    -			-3:00	Falk	FK%sT	1985 Sep 15
    -			-4:00	Falk	FK%sT	2010 Sep  5  2:00
    -			-3:00	-	FKST
    +			-4:00	Falk	-04/-03	1983 May
    +			-3:00	Falk	-03/-02	1985 Sep 15
    +			-4:00	Falk	-04/-03	2010 Sep  5  2:00
    +			-3:00	-	-03
     
     # French Guiana
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Cayenne	-3:29:20 -	LMT	1911 Jul
    -			-4:00	-	GFT	1967 Oct # French Guiana Time
    -			-3:00	-	GFT
    +			-4:00	-	-04	1967 Oct
    +			-3:00	-	-03
     
     # Guyana
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Guyana	-3:52:40 -	LMT	1915 Mar    # Georgetown
    -			-3:45	-	GBGT	1966 May 26 # Br Guiana Time
    -			-3:45	-	GYT	1975 Jul 31 # Guyana Time
    -			-3:00	-	GYT	1991
    +			-3:45	-	-0345	1975 Jul 31
    +			-3:00	-	-03	1991
     # IATA SSIM (1996-06) says -4:00.  Assume a 1991 switch.
    -			-4:00	-	GYT
    +			-4:00	-	-04
     
     # Paraguay
     #
    @@ -1609,9 +1619,9 @@ Rule	Para	2013	max	-	Mar	Sun>=22	0:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone America/Asuncion	-3:50:40 -	LMT	1890
     			-3:50:40 -	AMT	1931 Oct 10 # Asunción Mean Time
    -			-4:00	-	PYT	1972 Oct    # Paraguay Time
    -			-3:00	-	PYT	1974 Apr
    -			-4:00	Para	PY%sT
    +			-4:00	-	-04	1972 Oct
    +			-3:00	-	-03	1974 Apr
    +			-4:00	Para	-04/-03
     
     # Peru
     #
    @@ -1638,12 +1648,12 @@ Rule	Peru	1994	only	-	Apr	 1	0:00	0	-
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Lima	-5:08:12 -	LMT	1890
     			-5:08:36 -	LMT	1908 Jul 28 # Lima Mean Time?
    -			-5:00	Peru	PE%sT	# Peru Time
    +			-5:00	Peru	-05/-04
     
     # South Georgia
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone Atlantic/South_Georgia -2:26:08 -	LMT	1890 # Grytviken
    -			-2:00	-	GST	# South Georgia Time
    +			-2:00	-	-02
     
     # South Sandwich Is
     # uninhabited; scientific personnel have wintered
    @@ -1653,9 +1663,8 @@ Zone Atlantic/South_Georgia -2:26:08 -	LMT	1890 # Grytviken
     Zone America/Paramaribo	-3:40:40 -	LMT	1911
     			-3:40:52 -	PMT	1935     # Paramaribo Mean Time
     			-3:40:36 -	PMT	1945 Oct    # The capital moved?
    -			-3:30	-	NEGT	1975 Nov 20 # Dutch Guiana Time
    -			-3:30	-	SRT	1984 Oct    # Suriname Time
    -			-3:00	-	SRT
    +			-3:30	-	-0330	1984 Oct
    +			-3:00	-	-03
     
     # Trinidad and Tobago
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    @@ -1758,11 +1767,16 @@ Rule	Uruguay	2006	only	-	Mar	12	 2:00	0	-
     # [dated 2015-06-29; repeals Decree 311/006 dated 2006-09-04]
     Rule	Uruguay	2006	2014	-	Oct	Sun>=1	 2:00	1:00	S
     Rule	Uruguay	2007	2015	-	Mar	Sun>=8	 2:00	0	-
    -# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
    +
    +# This Zone can be simplified once we assume zic %z.
     Zone America/Montevideo	-3:44:44 -	LMT	1898 Jun 28
     			-3:44:44 -	MMT	1920 May  1 # Montevideo MT
    -			-3:30	Uruguay	UY%sT	1942 Dec 14 # Uruguay Time
    -			-3:00	Uruguay	UY%sT
    +			-3:30	Uruguay	-0330/-03 1942 Dec 14
    +			-3:00	Uruguay	-03/-02	1968
    +			-3:00	Uruguay	-03/-0230 1971
    +			-3:00	Uruguay	-03/-02	1974
    +			-3:00	Uruguay	-03/-0230 1974 Dec 22
    +			-3:00	Uruguay	-03/-02
     
     # Venezuela
     #
    @@ -1796,7 +1810,7 @@ Zone America/Montevideo	-3:44:44 -	LMT	1898 Jun 28
     # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
     Zone	America/Caracas	-4:27:44 -	LMT	1890
     			-4:27:40 -	CMT	1912 Feb 12 # Caracas Mean Time?
    -			-4:30	-	VET	1965 Jan  1  0:00 # Venezuela T.
    -			-4:00	-	VET	2007 Dec  9  3:00
    -			-4:30	-	VET	2016 May  1  2:30
    -			-4:00	-	VET
    +			-4:30	-	-0430	1965 Jan  1  0:00
    +			-4:00	-	-04	2007 Dec  9  3:00
    +			-4:30	-	-0430	2016 May  1  2:30
    +			-4:00	-	-04
    diff --git a/jdk/make/data/tzdata/zone.tab b/jdk/make/data/tzdata/zone.tab
    index 7255ea5bfb4..8d6247d21a7 100644
    --- a/jdk/make/data/tzdata/zone.tab
    +++ b/jdk/make/data/tzdata/zone.tab
    @@ -165,6 +165,7 @@ CH	+4723+00832	Europe/Zurich
     CI	+0519-00402	Africa/Abidjan
     CK	-2114-15946	Pacific/Rarotonga
     CL	-3327-07040	America/Santiago	Chile (most areas)
    +CL	-5309-07055	America/Punta_Arenas	Region of Magallanes
     CL	-2709-10926	Pacific/Easter	Easter Island
     CM	+0403+00942	Africa/Douala
     CN	+3114+12128	Asia/Shanghai	Beijing Time
    @@ -420,7 +421,6 @@ UA	+5026+03031	Europe/Kiev	Ukraine (most areas)
     UA	+4837+02218	Europe/Uzhgorod	Ruthenia
     UA	+4750+03510	Europe/Zaporozhye	Zaporozh'ye/Zaporizhia; Lugansk/Luhansk (east)
     UG	+0019+03225	Africa/Kampala
    -UM	+1645-16931	Pacific/Johnston	Johnston Atoll
     UM	+2813-17722	Pacific/Midway	Midway Islands
     UM	+1917+16637	Pacific/Wake	Wake Island
     US	+404251-0740023	America/New_York	Eastern (most areas)
    diff --git a/jdk/make/gensrc/GensrcCharsetCoder.gmk b/jdk/make/gensrc/GensrcCharsetCoder.gmk
    index e992b19a3fa..47dab1cfbc0 100644
    --- a/jdk/make/gensrc/GensrcCharsetCoder.gmk
    +++ b/jdk/make/gensrc/GensrcCharsetCoder.gmk
    @@ -54,7 +54,7 @@ $(GENSRC_CHARSETCODER_DST)/CharsetDecoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
     	    -DOtherCoder='Encoder' \
     	    -DreplTypeName='string' \
     	    -DdefaultRepl='"\\uFFFD"' \
    -	    -DdefaultReplName='"\\uFFFD"<\/tt>' \
    +	    -DdefaultReplName='"\\uFFFD"<\/code>' \
     	    -DreplType='String' \
     	    -DreplFQType='java.lang.String' \
     	    -DreplLength='length()' \
    @@ -89,7 +89,7 @@ $(GENSRC_CHARSETCODER_DST)/CharsetEncoder.java: $(GENSRC_CHARSETCODER_TEMPLATE)
     	    -DOtherCoder='Decoder' \
     	    -DreplTypeName='byte array' \
     	    -DdefaultRepl='new byte[] { (byte)'"'"\\?"'"' }' \
    -	    -DdefaultReplName='{<\/tt>\ (byte)'"'"\\?"'"'<\/tt>\ }<\/tt>' \
    +	    -DdefaultReplName='{<\/code>\ (byte)'"'"\\?"'"'<\/code>\ }<\/code>' \
     	    -DreplType='byte[]' \
     	    -DreplFQType='byte[]' \
     	    -DreplLength='length' \
    diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk
    index 6b5dcf9e6b6..9a03f118b82 100644
    --- a/jdk/make/gensrc/GensrcMisc.gmk
    +++ b/jdk/make/gensrc/GensrcMisc.gmk
    @@ -116,11 +116,13 @@ else
         JCE_DEFAULT_POLICY = limited
     endif
     
    -$(eval $(call SetupTextFileProcessing, BUILD_JCESECURITY_JAVA, \
    -    SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template, \
    -    OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/javax/crypto/JceSecurity.java, \
    -    REPLACEMENTS := \
    +ifneq ($(wildcard $(JDK_TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template), )
    +  $(eval $(call SetupTextFileProcessing, BUILD_JCESECURITY_JAVA, \
    +      SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/javax/crypto/JceSecurity.java.template, \
    +      OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/javax/crypto/JceSecurity.java, \
    +      REPLACEMENTS := \
             @@JCE_DEFAULT_POLICY@@ => $(JCE_DEFAULT_POLICY), \
    -))
    +  ))
     
    -GENSRC_JAVA_BASE += $(BUILD_JCESECURITY_JAVA)
    +  GENSRC_JAVA_BASE += $(BUILD_JCESECURITY_JAVA)
    +endif
    diff --git a/jdk/make/launcher/Launcher-java.base.gmk b/jdk/make/launcher/Launcher-java.base.gmk
    index f70d90029a6..06ccec771ea 100644
    --- a/jdk/make/launcher/Launcher-java.base.gmk
    +++ b/jdk/make/launcher/Launcher-java.base.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
     # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     #
     # This code is free software; you can redistribute it and/or modify it
    @@ -71,102 +71,37 @@ $(eval $(call SetupBuildLauncher, keytool, \
     
     ################################################################################
     
    -BUILD_JEXEC :=
    -BUILD_JEXEC_SRC :=
    -BUILD_JEXEC_INC :=
    -BUILD_JEXEC_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
    -
    -#
    -# UNHANDLED:
    -# - COMPILE_APPROACH = normal
    -#
    -
    -#
    -# jdk/make/java/Makefile
    -#
    -ifeq ($(OPENJDK_TARGET_OS), solaris)
    -  ifeq ($(OPENJDK_TARGET_CPU_BITS), 32)
    -    BUILD_JEXEC := 1
    -  endif
    -endif
    -
     ifeq ($(OPENJDK_TARGET_OS), linux)
    -  BUILD_JEXEC := 1
    -endif # OPENJDK_TARGET_OS
    -
    -#
    -# jdk/make/java/jexec/Makefile
    -#
    -ifeq ($(BUILD_JEXEC), 1)
    -
    -  ifeq ($(OPENJDK_TARGET_OS), windows)
    -  else ifeq ($(OPENJDK_TARGET_OS), macosx)
    -    BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/java.base/macosx/native/launcher
    -  else
    -    BUILD_JEXEC_SRC := $(JDK_TOPDIR)/src/java.base/unix/native/launcher
    -  endif
    -
    -  ifeq ($(OPENJDK_TARGET_OS), linux)
    -    BUILD_JEXEC_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
    -    BUILD_JEXEC_INC += -I$(JDK_TOPDIR)/src/java.base/share/native/libjli
    -  endif
    -endif
    -
    -#
    -# Note that the two Makefile's seems to contradict each other,
    -# and that src/macosx/bin/jexec.c seems unused
    -#
    -ifneq ($(BUILD_JEXEC_SRC), )
    -  $(eval $(call SetupNativeCompilation,BUILD_JEXEC, \
    -      SRC := $(BUILD_JEXEC_SRC), \
    +  $(eval $(call SetupNativeCompilation, BUILD_JEXEC, \
    +      SRC := $(JDK_TOPDIR)/src/$(MODULE)/unix/native/launcher, \
           INCLUDE_FILES := jexec.c, \
           OPTIMIZATION := LOW, \
           CFLAGS := $(CFLAGS_JDKEXE) \
    -          $(BUILD_JEXEC_INC), \
    +          -I$(JDK_TOPDIR)/src/$(MODULE)/share/native/libjli, \
           CFLAGS_linux := -fPIC, \
           CFLAGS_solaris := -KPIC, \
           LDFLAGS := $(LDFLAGS_JDKEXE), \
           OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
    -      OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \
    -      PROGRAM := jexec))
    +      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
    +      PROGRAM := jexec, \
    +  ))
     
       TARGETS += $(BUILD_JEXEC)
     endif
     
     ################################################################################
     
    -BUILD_JSPAWNHELPER :=
    -BUILD_JSPAWNHELPER_SRC := $(JDK_TOPDIR)/src/java.base/unix/native/jspawnhelper
    -JSPAWNHELPER_CFLAGS := -I$(JDK_TOPDIR)/src/java.base/unix/native/libjava
    -BUILD_JSPAWNHELPER_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
    -LINK_JSPAWNHELPER_OBJECTS := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o
    -BUILD_JSPAWNHELPER_LDFLAGS :=
    -
     ifneq ($(findstring $(OPENJDK_TARGET_OS), macosx solaris aix), )
    -  BUILD_JSPAWNHELPER := 1
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_OS), macosx)
    -  BUILD_JSPAWNHELPER_DST_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/java.base
    -endif
    -
    -ifeq ($(OPENJDK_TARGET_CPU_BITS), 64)
    -  BUILD_JSPAWNHELPER_LDFLAGS += $(COMPILER_TARGET_BITS_FLAG)64
    -endif
    -
    -ifeq ($(BUILD_JSPAWNHELPER), 1)
    -  $(eval $(call SetupNativeCompilation,BUILD_JSPAWNHELPER, \
    -      SRC := $(BUILD_JSPAWNHELPER_SRC), \
    -      INCLUDE_FILES := jspawnhelper.c, \
    +  $(eval $(call SetupNativeCompilation, BUILD_JSPAWNHELPER, \
    +      SRC := $(JDK_TOPDIR)/src/$(MODULE)/unix/native/jspawnhelper, \
           OPTIMIZATION := LOW, \
    -      CFLAGS := $(CFLAGS_JDKEXE) $(JSPAWNHELPER_CFLAGS), \
    -      LDFLAGS := $(LDFLAGS_JDKEXE) $(BUILD_JSPAWNHELPER_LDFLAGS), \
    -      LIBS := $(LINK_JSPAWNHELPER_OBJECTS), \
    +      CFLAGS := $(CFLAGS_JDKEXE) -I$(JDK_TOPDIR)/src/$(MODULE)/unix/native/libjava, \
    +      EXTRA_OBJECT_FILES := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjava/childproc.o, \
    +      LDFLAGS := $(LDFLAGS_JDKEXE), \
           OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jspawnhelper, \
    -      OUTPUT_DIR := $(BUILD_JSPAWNHELPER_DST_DIR), \
    -      PROGRAM := jspawnhelper))
    -
    -  $(BUILD_JSPAWNHELPER): $(LINK_JSPAWNHELPER_OBJECTS)
    +      OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_libs/$(MODULE), \
    +      PROGRAM := jspawnhelper, \
    +  ))
     
       TARGETS += $(BUILD_JSPAWNHELPER)
     endif
    diff --git a/jdk/make/launcher/Launcher-jdk.aot.gmk b/jdk/make/launcher/Launcher-jdk.aot.gmk
    index a827a66bc35..9aea620ac9e 100644
    --- a/jdk/make/launcher/Launcher-jdk.aot.gmk
    +++ b/jdk/make/launcher/Launcher-jdk.aot.gmk
    @@ -25,9 +25,25 @@
     
     include LauncherCommon.gmk
     
    +# The JVMCI exports are needed since JVMCI is normally dynamically exported
    +# (see jdk.vm.ci.services.internal.ReflectionAccessJDK::openJVMCITo).
    +
     $(eval $(call SetupBuildLauncher, jaotc, \
         MAIN_CLASS := jdk.tools.jaotc.Main, \
         JAVA_ARGS := -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.aarch64=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.amd64=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.site=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.code.stack=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.common=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.aarch64=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.amd64=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.hotspot.sparc=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.meta=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.runtime=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
    +        --add-exports=jdk.internal.vm.ci/jdk.vm.ci.sparc=$(call CommaList, jdk.internal.vm.compiler  jdk.aot) \
             -XX:+UseAOT \
             -Djvmci.UseProfilingInformation=false \
             -Dgraal.UseExceptionProbability=false \
    diff --git a/jdk/make/launcher/Launcher-jdk.pack.gmk b/jdk/make/launcher/Launcher-jdk.pack.gmk
    index 2ee08c767bf..4fe0fdf411f 100644
    --- a/jdk/make/launcher/Launcher-jdk.pack.gmk
    +++ b/jdk/make/launcher/Launcher-jdk.pack.gmk
    @@ -44,7 +44,7 @@ ifeq ($(USE_EXTERNAL_LIBZ), true)
       UNPACKEXE_CFLAGS += -DSYSTEM_ZLIB
       UNPACKEXE_LIBS := -lz
     else
    -  UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
    +  UNPACKEXE_CFLAGS += -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib
       UNPACKEXE_ZIPOBJS := $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/zcrc32$(OBJ_SUFFIX) \
           $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/deflate$(OBJ_SUFFIX) \
           $(SUPPORT_OUTPUTDIR)/native/java.base/libzip/trees$(OBJ_SUFFIX) \
    diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
    index 743422b0afe..9407f91b329 100644
    --- a/jdk/make/lib/Awt2dLibraries.gmk
    +++ b/jdk/make/lib/Awt2dLibraries.gmk
    @@ -889,7 +889,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
       LIBSPLASHSCREEN_LIBS :=
     
       ifneq ($(USE_EXTERNAL_LIBZ), true)
    -    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
    +    LIBSPLASHSCREEN_DIRS += $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib
         LIBSPLASHSCREEN_CFLAGS += $(ZLIB_CPPFLAGS)
       endif
     
    diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk
    index 3ec50824202..5bb93942087 100644
    --- a/jdk/make/lib/CoreLibraries.gmk
    +++ b/jdk/make/lib/CoreLibraries.gmk
    @@ -202,7 +202,7 @@ $(BUILD_LIBJAVA): $(BUILD_LIBFDLIBM)
     
     BUILD_LIBZIP_EXCLUDES :=
     ifeq ($(USE_EXTERNAL_LIBZ), true)
    -  LIBZIP_EXCLUDES += zlib-1.2.8
    +  LIBZIP_EXCLUDES += zlib
     endif
     
     BUILD_LIBZIP_REORDER :=
    @@ -343,7 +343,7 @@ LIBJLI_CFLAGS += $(addprefix -I, $(LIBJLI_SRC_DIRS))
     ifneq ($(USE_EXTERNAL_LIBZ), true)
       LIBJLI_CFLAGS += $(ZLIB_CPPFLAGS)
       LIBJLI_EXTRA_FILES += \
    -      $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8/, \
    +      $(addprefix $(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib/, \
               inflate.c \
               inftrees.c \
               inffast.c \
    diff --git a/jdk/make/lib/LibCommon.gmk b/jdk/make/lib/LibCommon.gmk
    index f326842d0d9..4e1cab991aa 100644
    --- a/jdk/make/lib/LibCommon.gmk
    +++ b/jdk/make/lib/LibCommon.gmk
    @@ -73,7 +73,7 @@ INSTALL_LIBRARIES_HERE := $(call FindLibDirForModule, $(MODULE))
     ifeq ($(USE_EXTERNAL_LIBZ), true)
       LIBZ := -lz
     else
    -  ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib-1.2.8
    +  ZLIB_CPPFLAGS := -I$(JDK_TOPDIR)/src/java.base/share/native/libzip/zlib
     endif
     
     ###############################################################################
    diff --git a/jdk/make/mapfiles/libjava/mapfile-vers b/jdk/make/mapfiles/libjava/mapfile-vers
    index c08bc2c12f0..31395f7ee23 100644
    --- a/jdk/make/mapfiles/libjava/mapfile-vers
    +++ b/jdk/make/mapfiles/libjava/mapfile-vers
    @@ -128,7 +128,6 @@ SUNWprivate_1.1 {
     		Java_java_lang_Class_isInstance;
     		Java_java_lang_Class_registerNatives;
     		Java_java_lang_ClassLoader_findBootstrapClass;
    -		Java_java_lang_ClassLoader_defineClass0;
     		Java_java_lang_ClassLoader_defineClass1;
     		Java_java_lang_ClassLoader_defineClass2;
     		Java_java_lang_ClassLoader_findBuiltinLib;
    @@ -274,12 +273,12 @@ SUNWprivate_1.1 {
                     Java_jdk_internal_misc_VM_getRuntimeArguments;
                     Java_jdk_internal_misc_VM_initialize;
     
    -                Java_java_lang_reflect_Module_defineModule0;
    -                Java_java_lang_reflect_Module_addReads0;
    -                Java_java_lang_reflect_Module_addExports0;
    -                Java_java_lang_reflect_Module_addExportsToAll0;
    -                Java_java_lang_reflect_Module_addExportsToAllUnnamed0;
    -                Java_java_lang_reflect_Module_addPackage0;
    +                Java_java_lang_Module_defineModule0;
    +                Java_java_lang_Module_addReads0;
    +                Java_java_lang_Module_addExports0;
    +                Java_java_lang_Module_addExportsToAll0;
    +                Java_java_lang_Module_addExportsToAllUnnamed0;
    +                Java_java_lang_Module_addPackage0;
     
     		Java_jdk_internal_loader_BootLoader_getSystemPackageLocation;
     		Java_jdk_internal_loader_BootLoader_getSystemPackageNames;
    diff --git a/jdk/make/rmic/RmicCommon.gmk b/jdk/make/rmic/RmicCommon.gmk
    index bfc5b859b54..2eedfda9139 100644
    --- a/jdk/make/rmic/RmicCommon.gmk
    +++ b/jdk/make/rmic/RmicCommon.gmk
    @@ -1,5 +1,5 @@
     #
    -# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
    +# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
     # 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,7 @@ include $(SPEC)
     include MakeBase.gmk
     include RMICompilation.gmk
     
    -##########################################################################################
    +################################################################################
     
     ifeq ($(BOOT_JDK_MODULAR), true)
       RMIC_MAIN_CLASS := -m jdk.rmic/sun.rmi.rmic.Main
    @@ -37,12 +37,13 @@ else
       RMIC_MAIN_CLASS := sun.rmi.rmic.Main
     endif
     
    -RMIC := $(JAVA_SMALL) $(INTERIM_OVERRIDE_MODULES_ARGS) $(RMIC_MAIN_CLASS)
    +RMIC := $(JAVA_SMALL) $(INTERIM_RMIC_OVERRIDE_MODULES_ARGS) $(RMIC_MAIN_CLASS)
     
     CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
    -# NOTE: If the smart javac dependency management is reintroduced, these classes risk
    -# interfering with the dependency checking. In that case they will need to be kept separate.
    +# NOTE: If the smart javac dependency management is reintroduced, these classes
    +# risk interfering with the dependency checking. In that case they will need to
    +# be kept separate.
     STUB_CLASSES_DIR := $(JDK_OUTPUTDIR)/modules
     RMIC_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/rmic
     
    -##########################################################################################
    +################################################################################
    diff --git a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
    index 4de7b5c719a..8301929ebd1 100644
    --- a/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
    +++ b/jdk/make/src/classes/build/tools/jigsaw/GenGraphs.java
    @@ -25,29 +25,25 @@
     
     package build.tools.jigsaw;
     
    +import com.sun.tools.jdeps.ModuleDotGraph;
    +
     import java.io.IOException;
    -import java.io.OutputStream;
    -import java.io.PrintStream;
     import java.lang.module.Configuration;
     import java.lang.module.ModuleDescriptor;
     import java.lang.module.ModuleFinder;
     import java.lang.module.ModuleReference;
    -import java.lang.module.ResolvedModule;
     import java.nio.file.Files;
     import java.nio.file.Path;
     import java.nio.file.Paths;
     import java.util.ArrayList;
    -import java.util.Collections;
     import java.util.HashMap;
     import java.util.HashSet;
     import java.util.List;
     import java.util.Map;
    +import java.util.Properties;
     import java.util.Set;
    -import java.util.TreeSet;
     import java.util.function.Function;
    -
    -import static java.util.stream.Collectors.*;
    -import static java.lang.module.ModuleDescriptor.Requires.Modifier.TRANSITIVE;
    +import java.util.stream.Collectors;
     
     /**
      * Generate the DOT file for a module graph for each module in the JDK
    @@ -56,238 +52,209 @@ import static java.lang.module.ModuleDescriptor.Requires.Modifier.TRANSITIVE;
     public class GenGraphs {
     
         public static void main(String[] args) throws Exception {
    +        Path dir = null;
    +        boolean spec = false;
    +        Properties props = null;
    +        for (int i=0; i < args.length; i++) {
    +            String arg = args[i];
    +            if (arg.equals("--spec")) {
    +                spec = true;
    +            } else if (arg.equals("--dot-attributes")) {
    +                if (i++ == args.length) {
    +                    throw new IllegalArgumentException("Missing argument: --dot-attributes option");
    +                }
    +                props = new Properties();
    +                props.load(Files.newInputStream(Paths.get(args[i])));
    +            } else if (arg.equals("--output")) {
    +                dir = ++i < args.length ? Paths.get(args[i]) : null;
    +            } else if (arg.startsWith("-")) {
    +                throw new IllegalArgumentException("Invalid option: " + arg);
    +            }
    +        }
     
    -        if (args.length != 1) {
    -            System.err.println("ERROR: specify the output directory");
    +        if (dir == null) {
    +            System.err.println("ERROR: must specify --output argument");
                 System.exit(1);
             }
    -        Path dir = Paths.get(args[0]);
    +
             Files.createDirectories(dir);
    +        ModuleGraphAttributes attributes;
    +        if (props != null) {
    +            attributes = new ModuleGraphAttributes(props);
    +        } else {
    +            attributes = new ModuleGraphAttributes();
    +        }
    +        GenGraphs genGraphs = new GenGraphs(dir, spec, attributes);
     
    +        // print dot file for each module
    +        Map configurations = new HashMap<>();
    +        Set modules = new HashSet<>();
             ModuleFinder finder = ModuleFinder.ofSystem();
    -
    -        Set javaSEModules
    -            = new TreeSet<>(finder.findAll().stream()
    -                                  .map(ModuleReference::descriptor)
    -                                  .filter(m -> (m.name().startsWith("java.") &&
    -                                               !m.name().equals("java.smartcardio")))
    -                                  .collect(toSet()));
    -        Set jdkModules
    -            = new TreeSet<>(finder.findAll().stream()
    -                                  .map(ModuleReference::descriptor)
    -                                  .filter(m -> !javaSEModules.contains(m))
    -                                  .collect(toSet()));
    -
    -        GenGraphs genGraphs = new GenGraphs(dir, javaSEModules, jdkModules);
    -        Set mods = new HashSet<>();
    -        for (ModuleReference mref: finder.findAll()) {
    -            mods.add(mref.descriptor().name());
    -            genGraphs.genDotFile(mref);
    +        for (ModuleReference mref : finder.findAll()) {
    +            String name = (mref.descriptor().name());
    +            modules.add(name);
    +            if (genGraphs.accept(name, mref.descriptor())) {
    +                configurations.put(name, Configuration.empty()
    +                                                      .resolve(finder,
    +                                                               ModuleFinder.of(),
    +                                                               Set.of(name)));
    +            }
             }
     
    -        // all modules
    -        genGraphs.genDotFile("jdk", mods);
    +        if (genGraphs.accept("jdk", null)) {
    +            // print a graph of all JDK modules
    +            configurations.put("jdk", Configuration.empty()
    +                                                   .resolve(finder,
    +                                                            ModuleFinder.of(),
    +                                                            modules));
    +        }
     
    +        genGraphs.genDotFiles(configurations);
         }
     
    -    private static final String ORANGE = "#e76f00";
    -    private static final String BLUE = "#437291";
    -    private static final String GRAY = "#dddddd";
    +    /**
    +     * Custom dot file attributes.
    +     */
    +    static class ModuleGraphAttributes implements ModuleDotGraph.Attributes {
    +        static Map DEFAULT_ATTRIBUTES = Map.of(
    +            "ranksep", "0.6",
    +            "fontsize", "12",
    +            "fontcolor", BLACK,
    +            "fontname", "DejaVuSans",
    +            "arrowsize", "1",
    +            "arrowwidth", "2",
    +            "arrowcolor", DARK_GRAY,
    +            // custom
    +            "requiresMandatedColor", LIGHT_GRAY,
    +            "javaSubgraphColor", ORANGE,
    +            "jdkSubgraphColor", BLUE
    +        );
     
    -    private static final String REEXPORTS = "";
    -    private static final String REQUIRES = "style=\"dashed\"";
    -    private static final String REQUIRES_BASE = "color=\"" + GRAY + "\"";
    +        final Map weights = new HashMap<>();
    +        final List> ranks = new ArrayList<>();
    +        final Map attrs;
    +        ModuleGraphAttributes(Map attrs) {
    +            int h = 1000;
    +            weight("java.se", "java.sql.rowset", h * 10);
    +            weight("java.sql.rowset", "java.sql", h * 10);
    +            weight("java.sql", "java.xml", h * 10);
    +            weight("java.xml", "java.base", h * 10);
     
    -    private static final Map weights = new HashMap<>();
    -    private static final List> ranks = new ArrayList<>();
    +            ranks.add(Set.of("java.logging", "java.scripting", "java.xml"));
    +            ranks.add(Set.of("java.sql"));
    +            ranks.add(Set.of("java.compiler", "java.instrument"));
    +            ranks.add(Set.of("java.desktop", "java.management"));
    +            ranks.add(Set.of("java.corba", "java.xml.ws"));
    +            ranks.add(Set.of("java.xml.bind", "java.xml.ws.annotation"));
     
    -    private static void weight(String s, String t, int w) {
    -        weights.put(s + ":" + t, w);
    -    }
    +            this.attrs = attrs;
    +        }
     
    -    private static int weightOf(String s, String t) {
    -        int w = weights.getOrDefault(s + ":" + t, 1);
    -        if (w != 1)
    -            return w;
    -        if (s.startsWith("java.") && t.startsWith("java."))
    -            return 10;
    -        return 1;
    -    }
    +        ModuleGraphAttributes() {
    +            this(DEFAULT_ATTRIBUTES);
    +        }
    +        ModuleGraphAttributes(Properties props) {
    +            this(toAttributes(props));
    +        }
     
    -    static {
    -        int h = 1000;
    -        weight("java.se", "java.sql.rowset", h * 10);
    -        weight("java.sql.rowset", "java.sql", h * 10);
    -        weight("java.sql", "java.xml", h * 10);
    -        weight("java.xml", "java.base", h * 10);
    +        @Override
    +        public double rankSep() {
    +            return Double.valueOf(attrs.get("ranksep"));
    +        }
     
    -        ranks.add(Set.of("java.logging", "java.scripting", "java.xml"));
    -        ranks.add(Set.of("java.sql"));
    -        ranks.add(Set.of("java.compiler", "java.instrument"));
    -        ranks.add(Set.of("java.desktop", "java.management"));
    -        ranks.add(Set.of("java.corba", "java.xml.ws"));
    -        ranks.add(Set.of("java.xml.bind", "java.xml.ws.annotation"));
    +        @Override
    +        public int fontSize() {
    +            return Integer.valueOf(attrs.get("fontsize"));
    +        }
     
    +        @Override
    +        public String fontName() {
    +            return attrs.get("fontname");
    +        }
    +
    +        @Override
    +        public String fontColor() {
    +            return attrs.get("fontcolor");
    +        }
    +
    +        @Override
    +        public int arrowSize() {
    +            return Integer.valueOf(attrs.get("arrowsize"));
    +        }
    +
    +        @Override
    +        public int arrowWidth() {
    +            return Integer.valueOf(attrs.get("arrowwidth"));
    +        }
    +
    +        @Override
    +        public String arrowColor() {
    +            return attrs.get("arrowcolor");
    +        }
    +
    +        @Override
    +        public List> ranks() {
    +            return ranks;
    +        }
    +
    +        @Override
    +        public String requiresMandatedColor() {
    +            return attrs.get("requiresMandatedColor");
    +        }
    +
    +        @Override
    +        public String javaSubgraphColor() {
    +            return attrs.get("javaSubgraphColor");
    +        }
    +
    +        @Override
    +        public String jdkSubgraphColor() {
    +            return attrs.get("jdkSubgraphColor");
    +        }
    +
    +        @Override
    +        public int weightOf(String s, String t) {
    +            int w = weights.getOrDefault(s + ":" + t, 1);
    +            if (w != 1)
    +                return w;
    +            if (s.startsWith("java.") && t.startsWith("java."))
    +                return 10;
    +            return 1;
    +        }
    +
    +        public void weight(String s, String t, int w) {
    +            weights.put(s + ":" + t, w);
    +        }
    +
    +        static Map toAttributes(Properties props) {
    +            return DEFAULT_ATTRIBUTES.keySet().stream()
    +                .collect(Collectors.toMap(Function.identity(),
    +                    k -> props.getProperty(k, DEFAULT_ATTRIBUTES.get(k))));
    +        }
         }
     
         private final Path dir;
    -    private final Set javaGroup;
    -    private final Set jdkGroup;
    -
    -    GenGraphs(Path dir, Set javaGroup, Set jdkGroup) {
    +    private final boolean spec;
    +    private final ModuleGraphAttributes attributes;
    +    GenGraphs(Path dir, boolean spec, ModuleGraphAttributes attributes) {
             this.dir = dir;
    -        this.javaGroup = Collections.unmodifiableSet(javaGroup);
    -        this.jdkGroup = Collections.unmodifiableSet(jdkGroup);
    +        this.spec = spec;
    +        this.attributes = attributes;
    +    }
    +
    +    void genDotFiles(Map configurations) throws IOException {
    +        ModuleDotGraph dotGraph = new ModuleDotGraph(configurations, spec);
    +        dotGraph.genDotFiles(dir, attributes);
         }
     
         /**
    -     * Generates a dot file for the given module reference as the root.
    +     * Returns true for any name if generating graph for non-spec;
    +     * otherwise, returns true except "jdk" and name with "jdk.internal." prefix
          */
    -    void genDotFile(ModuleReference mref) throws IOException {
    -        String name = mref.descriptor().name();
    -        genDotFile(name, Set.of(name));
    -    }
    +    boolean accept(String name, ModuleDescriptor descriptor) {
    +        if (!spec)
    +            return true;
     
    -    /**
    -     * Generates a dot file for the given set of root modules.
    -     */
    -    void genDotFile(String name, Set roots) throws IOException {
    -        Configuration cf =
    -            Configuration.empty().resolveRequires(ModuleFinder.ofSystem(),
    -                                                  ModuleFinder.of(),
    -                                                  roots);
    -
    -        Set mds = cf.modules().stream()
    -                .map(ResolvedModule::reference)
    -                .map(ModuleReference::descriptor)
    -                .collect(toSet());
    -
    -        // generate a dot file for the resolved graph
    -        try (OutputStream os = Files.newOutputStream(dir.resolve(name + ".dot"));
    -             PrintStream out = new PrintStream(os)) {
    -            printGraph(out, name, gengraph(cf),
    -                       mds.stream()
    -                          .collect(toMap(ModuleDescriptor::name, Function.identity()))
    -            );
    -        }
    -
    -        if (name.equals("java.se") || name.equals("java.se.ee")) {
    -            // generate a dot file for Java SE module graph
    -            try (OutputStream os = Files.newOutputStream(dir.resolve(name + "-spec.dot"));
    -                 PrintStream out = new PrintStream(os)) {
    -                // transitive reduction on the graph of `requires transitive` edges
    -                // filter out jdk.* modules which are implementation dependences
    -                Graph graph = requiresTransitiveGraph(cf, true);
    -                printGraph(out, name, graph,
    -                           mds.stream()
    -                              .filter(md -> !md.name().startsWith("jdk.") &&
    -                                                graph.nodes().contains(md.name()))
    -                              .collect(toMap(ModuleDescriptor::name, Function.identity()))
    -                );
    -            }
    -        }
    -    }
    -
    -    private void printGraph(PrintStream out,
    -                            String name,
    -                            Graph graph,
    -                            Map nameToModule)
    -        throws IOException
    -    {
    -            Set descriptors = new TreeSet<>(nameToModule.values());
    -
    -            out.format("digraph \"%s\" {%n", name);
    -            out.format("size=\"25,25\";");
    -            out.format("nodesep=.5;%n");
    -            out.format("ranksep=1.5;%n");
    -            out.format("pencolor=transparent;%n");
    -            out.format("node [shape=plaintext, fontname=\"DejaVuSans\", fontsize=36, margin=\".2,.2\"];%n");
    -            out.format("edge [penwidth=4, color=\"#999999\", arrowhead=open, arrowsize=2];%n");
    -
    -            out.format("subgraph %sse {%n", name.equals("jdk") ? "cluster_" : "");
    -            descriptors.stream()
    -                .filter(javaGroup::contains)
    -                .map(ModuleDescriptor::name)
    -                .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
    -                                          mn, ORANGE, "java"));
    -            out.format("}%n");
    -
    -            // same ranks
    -            ranks.stream()
    -                .map(group -> descriptors.stream()
    -                                         .map(ModuleDescriptor::name)
    -                                         .filter(group::contains)
    -                                         .map(mn -> "\"" + mn + "\"")
    -                                         .collect(joining(",")))
    -                .filter(group -> group.length() > 0)
    -                .forEach(group -> out.format("{rank=same %s}%n", group));
    -
    -            descriptors.stream()
    -                .filter(jdkGroup::contains)
    -                .map(ModuleDescriptor::name)
    -                .forEach(mn -> out.format("  \"%s\" [fontcolor=\"%s\", group=%s];%n",
    -                                          mn, BLUE, "jdk"));
    -
    -            descriptors.stream()
    -                .forEach(md -> {
    -                    String mn = md.name();
    -                    Set requiresTransitive = md.requires().stream()
    -                            .filter(d -> d.modifiers().contains(TRANSITIVE))
    -                            .map(d -> d.name())
    -                            .collect(toSet());
    -
    -                    graph.adjacentNodes(mn)
    -                         .stream()
    -                         .filter(nameToModule::containsKey)
    -                         .forEach(dn -> {
    -                             String attr = dn.equals("java.base") ? REQUIRES_BASE
    -                                    : (requiresTransitive.contains(dn) ? REEXPORTS : REQUIRES);
    -                             int w = weightOf(mn, dn);
    -                             if (w > 1)
    -                                 attr += "weight=" + w;
    -                             out.format("  \"%s\" -> \"%s\" [%s];%n", mn, dn, attr);
    -                         });
    -                });
    -
    -            out.println("}");
    -    }
    -
    -    /**
    -     * Returns a Graph of the given Configuration after transitive reduction.
    -     *
    -     * Transitive reduction of requires transitive edge and requires edge have
    -     * to be applied separately to prevent the requires transitive edges
    -     * (e.g. U -> V) from being reduced by a path (U -> X -> Y -> V)
    -     * in which  V would not be re-exported from U.
    -     */
    -    private Graph gengraph(Configuration cf) {
    -        Graph.Builder builder = new Graph.Builder<>();
    -        for (ResolvedModule resolvedModule : cf.modules()) {
    -            String mn = resolvedModule.reference().descriptor().name();
    -            builder.addNode(mn);
    -            resolvedModule.reads().stream()
    -                    .map(ResolvedModule::name)
    -                    .forEach(target -> builder.addEdge(mn, target));
    -        }
    -        Graph rpg = requiresTransitiveGraph(cf, false);
    -        return builder.build().reduce(rpg);
    -    }
    -
    -    /**
    -     * Returns a Graph containing only requires transitive edges
    -     * with transitive reduction.
    -     */
    -    private Graph requiresTransitiveGraph(Configuration cf, boolean includeBase) {
    -        Graph.Builder builder = new Graph.Builder<>();
    -        for (ResolvedModule resolvedModule : cf.modules()) {
    -            ModuleDescriptor descriptor = resolvedModule.reference().descriptor();
    -            String mn = descriptor.name();
    -            descriptor.requires().stream()
    -                    .filter(d -> d.modifiers().contains(TRANSITIVE)
    -                                    || (includeBase && d.name().equals("java.base")))
    -                    .map(d -> d.name())
    -                    .forEach(d -> builder.addEdge(mn, d));
    -        }
    -        return builder.build().reduce();
    +        return !name.equals("jdk") && !name.startsWith("jdk.internal.");
         }
     }
    diff --git a/jdk/make/src/classes/build/tools/jigsaw/Graph.java b/jdk/make/src/classes/build/tools/jigsaw/Graph.java
    deleted file mode 100644
    index a835da1ad93..00000000000
    --- a/jdk/make/src/classes/build/tools/jigsaw/Graph.java
    +++ /dev/null
    @@ -1,171 +0,0 @@
    -/*
    - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
    - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    - *
    - * This code is free software; you can redistribute 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 build.tools.jigsaw;
    -
    -import java.io.PrintStream;
    -import java.util.Deque;
    -import java.util.HashMap;
    -import java.util.HashSet;
    -import java.util.LinkedList;
    -import java.util.Map;
    -import java.util.Set;
    -
    -public class Graph {
    -    private static boolean traceOn = Boolean.getBoolean("build.tools.module.trace");
    -    private final Set nodes;
    -    private final Map> edges;
    -    private Graph(Set nodes, Map> edges) {
    -        this.nodes = nodes;
    -        this.edges = edges;
    -    }
    -
    -    public Set nodes() {
    -        return nodes;
    -    }
    -
    -    public Map> edges() {
    -        return edges;
    -    }
    -
    -    public Set adjacentNodes(T u) {
    -        return edges.get(u);
    -    }
    -
    -    /**
    -     * Returns a new Graph after transitive reduction
    -     */
    -    public Graph reduce() {
    -        Graph.Builder builder = new Builder<>();
    -        nodes.stream()
    -             .forEach(u -> {
    -                 builder.addNode(u);
    -                 edges.get(u).stream()
    -                         .filter(v -> !pathExists(u, v, false))
    -                         .forEach(v -> builder.addEdge(u, v));
    -             });
    -        return builder.build();
    -    }
    -
    -    /**
    -     * Returns a new Graph after transitive reduction.  All edges in
    -     * the given g takes precedence over this graph.
    -     *
    -     * @throw IllegalArgumentException g must be a subgraph this graph
    -     */
    -    public Graph reduce(Graph g) {
    -        boolean subgraph = nodes.containsAll(g.nodes) && g.edges.keySet().stream()
    -               .allMatch(u -> adjacentNodes(u).containsAll(g.adjacentNodes(u)));
    -        if (!subgraph) {
    -            throw new IllegalArgumentException("the given argument is not a subgraph of this graph");
    -        }
    -
    -        Graph.Builder builder = new Builder<>();
    -        nodes.stream()
    -             .forEach(u -> {
    -                 builder.addNode(u);
    -                 // filter the edge if there exists a path from u to v in the given g
    -                 // or there exists another path from u to v in this graph
    -                 edges.get(u).stream()
    -                      .filter(v -> !g.pathExists(u, v) && !pathExists(u, v, false))
    -                      .forEach(v -> builder.addEdge(u, v));
    -             });
    -
    -        // add the overlapped edges from this graph and the given g
    -        g.edges().keySet().stream()
    -                 .forEach(u -> g.adjacentNodes(u).stream()
    -                         .filter(v -> isAdjacent(u, v))
    -                         .forEach(v -> builder.addEdge(u, v)));
    -        return builder.build();
    -    }
    -
    -    private boolean isAdjacent(T u, T v) {
    -        return edges.containsKey(u) && edges.get(u).contains(v);
    -    }
    -
    -    private boolean pathExists(T u, T v) {
    -        return pathExists(u, v, true);
    -    }
    -
    -    /**
    -     * Returns true if there exists a path from u to v in this graph.
    -     * If includeAdjacent is false, it returns true if there exists
    -     * another path from u to v of distance > 1
    -     */
    -    private boolean pathExists(T u, T v, boolean includeAdjacent) {
    -        if (!nodes.contains(u) || !nodes.contains(v)) {
    -            return false;
    -        }
    -        if (includeAdjacent && isAdjacent(u, v)) {
    -            return true;
    -        }
    -        Deque stack = new LinkedList<>();
    -        Set visited = new HashSet<>();
    -        stack.push(u);
    -        while (!stack.isEmpty()) {
    -            T node = stack.pop();
    -            if (node.equals(v)) {
    -                if (traceOn) {
    -                    System.out.format("Edge %s -> %s removed%n", u, v);
    -                }
    -                return true;
    -            }
    -            if (!visited.contains(node)) {
    -                visited.add(node);
    -                edges.get(node).stream()
    -                     .filter(e -> includeAdjacent || !node.equals(u) || !e.equals(v))
    -                     .forEach(e -> stack.push(e));
    -            }
    -        }
    -        assert !visited.contains(v);
    -        return false;
    -    }
    -
    -    void printGraph(PrintStream out) {
    -        nodes.stream()
    -             .forEach(u -> adjacentNodes(u).stream()
    -                     .forEach(v -> out.format("%s -> %s%n", u, v)));
    -    }
    -
    -    public static class Builder {
    -        final Set nodes = new HashSet<>();
    -        final Map> edges = new HashMap<>();
    -        public void addNode(T node) {
    -            if (nodes.contains(node)) {
    -                return;
    -            }
    -            nodes.add(node);
    -            edges.computeIfAbsent(node, _e -> new HashSet<>());
    -        }
    -        public void addEdge(T u, T v) {
    -            addNode(u);
    -            addNode(v);
    -            edges.get(u).add(v);
    -        }
    -        public Graph build() {
    -            return new Graph<>(nodes, edges);
    -        }
    -    }
    -}
    diff --git a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
    index e55a1c04855..520fb1b96b0 100644
    --- a/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
    +++ b/jdk/make/src/classes/build/tools/jigsaw/ModuleSummary.java
    @@ -291,9 +291,9 @@ public class ModuleSummary {
     
         static Configuration resolve(Set roots) {
             return Configuration.empty()
    -            .resolveRequires(ModuleFinder.ofSystem(),
    -                             ModuleFinder.of(),
    -                             roots);
    +            .resolve(ModuleFinder.ofSystem(),
    +                     ModuleFinder.of(),
    +                     roots);
         }
     
         static class HtmlDocument {
    diff --git a/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties b/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
    new file mode 100644
    index 00000000000..75348c3f7be
    --- /dev/null
    +++ b/jdk/make/src/classes/build/tools/jigsaw/javadoc-graphs.properties
    @@ -0,0 +1,2 @@
    +arrowcolor=#999999
    +requiresMandatedColor=#999999
    diff --git a/jdk/make/src/classes/build/tools/taglet/ExtLink.java b/jdk/make/src/classes/build/tools/taglet/ExtLink.java
    new file mode 100644
    index 00000000000..ad042160756
    --- /dev/null
    +++ b/jdk/make/src/classes/build/tools/taglet/ExtLink.java
    @@ -0,0 +1,109 @@
    +/*
    + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
    + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
    + *
    + * This code is free software; you can redistribute 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 build.tools.taglet;
    +
    +import java.util.EnumSet;
    +import java.util.List;
    +import java.util.Set;
    +import java.util.regex.Matcher;
    +import java.util.regex.Pattern;
    +import javax.lang.model.element.Element;
    +
    +import com.sun.source.doctree.DocTree;
    +import com.sun.source.doctree.UnknownInlineTagTree;
    +import jdk.javadoc.doclet.Taglet;
    +
    +import static com.sun.source.doctree.DocTree.Kind.*;
    +import static jdk.javadoc.doclet.Taglet.Location.*;
    +
    +/**
    + * An inline tag to conveniently insert an external link.
    + * The tag can be used as follows:
    + * {@extLink name description}, for example
    + * 

    + * {@code Please see {@extLink Borealis a spectacular} sight.} + *

    + * will produce the following html + *

    + * {@code + * Please see a spectacular sight. + * } + */ +public class ExtLink implements Taglet { + + static final String TAG_NAME = "extLink"; + + static final String URL = "https://www.oracle.com/pls/topic/lookup?ctx=javase9&id="; + + static final Pattern TAG_PATTERN = Pattern.compile("(\\s*)(?\\w+)(\\s+)(?.*)"); + + /** + * Returns the set of locations in which the tag may be used. + */ + @Override + public Set getAllowedLocations() { + return EnumSet.allOf(jdk.javadoc.doclet.Taglet.Location.class); + } + + @Override + public boolean isInlineTag() { + return true; + } + + @Override + public String getName() { + return TAG_NAME; + } + + @Override + public String toString(List tags, Element elem) { + + if (tags.isEmpty()) + return ""; + + DocTree tag = tags.get(0); + if (tag.getKind() != UNKNOWN_INLINE_TAG) + return ""; + + UnknownInlineTagTree uitree = (UnknownInlineTagTree) tag; + if (uitree.getContent().isEmpty()) + return ""; + + String tagText = uitree.getContent().get(0).toString(); + Matcher m = TAG_PATTERN.matcher(tagText); + if (!m.find()) + return ""; + + StringBuilder sb = new StringBuilder("") + .append(m.group("desc")) + .append(""); + + return sb.toString(); + } +} diff --git a/jdk/make/src/classes/build/tools/taglet/Incubating.java b/jdk/make/src/classes/build/tools/taglet/Incubating.java index 826fadd4ddf..0670a9630ce 100644 --- a/jdk/make/src/classes/build/tools/taglet/Incubating.java +++ b/jdk/make/src/classes/build/tools/taglet/Incubating.java @@ -28,9 +28,10 @@ package build.tools.taglet; import java.util.EnumSet; import java.util.List; import java.util.Set; +import javax.lang.model.element.Element; import com.sun.source.doctree.DocTree; -import jdk.javadoc.doclet.taglet.Taglet; -import static jdk.javadoc.doclet.taglet.Taglet.Location.*; +import jdk.javadoc.doclet.Taglet; +import static jdk.javadoc.doclet.Taglet.Location.*; /** * An inline tag to conveniently insert a standard Incubating warning. For @@ -59,12 +60,7 @@ public class Incubating implements Taglet { + " Will be removed in a future release."; @Override - public String toString(DocTree tag) { - return MESSAGE; - } - - @Override - public String toString(List tags) { + public String toString(List tags, Element elem) { return MESSAGE; } } diff --git a/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java new file mode 100644 index 00000000000..6983eaa64d2 --- /dev/null +++ b/jdk/make/src/classes/build/tools/taglet/ModuleGraph.java @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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 build.tools.taglet; + +import java.util.EnumSet; +import java.util.List; +import java.util.Set; +import javax.lang.model.element.Element; +import com.sun.source.doctree.DocTree; +import jdk.javadoc.doclet.Taglet; +import static jdk.javadoc.doclet.Taglet.Location.*; + +/** + * A block tag to optionally insert a reference to a module graph. + */ +public class ModuleGraph implements Taglet { + private static final boolean enableModuleGraph = + Boolean.getBoolean("enableModuleGraph"); + + /** Returns the set of locations in which a taglet may be used. */ + @Override + public Set getAllowedLocations() { + return EnumSet.of(MODULE); + } + + @Override + public boolean isInlineTag() { + return false; + } + + @Override + public String getName() { + return "moduleGraph"; + } + + @Override + public String toString(List tags, Element element) { + if (!enableModuleGraph) { + return ""; + } + + String moduleName = element.getSimpleName().toString(); + String imageFile = moduleName + "-graph.png"; + int thumbnailHeight = -1; + String hoverImage = ""; + if (!moduleName.equals("java.base")) { + thumbnailHeight = 100; // also appears in the stylesheet + hoverImage = "" + + getImage(moduleName, imageFile, -1, true) + + ""; + } + return "

    " + + "Module Graph:\n" + + "
    " + + "
    " + + "" + + getImage(moduleName, imageFile, thumbnailHeight, false) + + hoverImage + + "" + + "
    "; + } + + private static final String VERTICAL_ALIGN = "vertical-align:top"; + private static final String BORDER = "border: solid lightgray 1px;"; + + private String getImage(String moduleName, String file, int height, boolean useBorder) { + return String.format("\"Module", + useBorder ? BORDER + " " + VERTICAL_ALIGN : VERTICAL_ALIGN, + moduleName, + file, + (height <= 0 ? "" : " height=\"" + height + "\"")); + } +} diff --git a/jdk/src/demo/share/README b/jdk/src/demo/share/README index e70be01a0a2..7936fb3893e 100644 --- a/jdk/src/demo/share/README +++ b/jdk/src/demo/share/README @@ -1,4 +1,4 @@ -The source code provided with samples and demos for the JDK is meant +The source code provided with demos for the JDK is meant to illustrate the usage of a given feature or technique and has been deliberately simplified. Additional steps required for a production-quality application, such as security checks, input diff --git a/jdk/src/demo/share/jvmti/agent_util/README.txt b/jdk/src/demo/share/jvmti/agent_util/README.txt deleted file mode 100644 index 88638b01e9a..00000000000 --- a/jdk/src/demo/share/jvmti/agent_util/README.txt +++ /dev/null @@ -1,35 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -agent_util sources - -Just some shared generic source used by several of the demos. - diff --git a/jdk/src/demo/share/jvmti/agent_util/agent_util.c b/jdk/src/demo/share/jvmti/agent_util/agent_util.c deleted file mode 100644 index 6678ef7d966..00000000000 --- a/jdk/src/demo/share/jvmti/agent_util/agent_util.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include - -/* ------------------------------------------------------------------- */ -/* Generic C utility functions */ - -/* Send message to stdout or whatever the data output location is */ -void -stdout_message(const char * format, ...) -{ - va_list ap; - - va_start(ap, format); - (void)vfprintf(stdout, format, ap); - va_end(ap); -} - -/* Send message to stderr or whatever the error output location is and exit */ -void -fatal_error(const char * format, ...) -{ - va_list ap; - - va_start(ap, format); - (void)vfprintf(stderr, format, ap); - (void)fflush(stderr); - va_end(ap); - exit(3); -} - -/* Get a token from a string (strtok is not MT-safe) - * str String to scan - * seps Separation characters - * buf Place to put results - * max Size of buf - * Returns NULL if no token available or can't do the scan. - */ -char * -get_token(char *str, char *seps, char *buf, int max) -{ - int len; - - buf[0] = 0; - if ( str==NULL || str[0]==0 ) { - return NULL; - } - str += strspn(str, seps); - if ( str[0]==0 ) { - return NULL; - } - len = (int)strcspn(str, seps); - if ( len >= max ) { - return NULL; - } - (void)strncpy(buf, str, len); - buf[len] = 0; - return str+len; -} - -/* Determines if a class/method is specified by a list item - * item String that represents a pattern to match - * If it starts with a '*', then any class is allowed - * If it ends with a '*', then any method is allowed - * cname Class name, e.g. "java.lang.Object" - * mname Method name, e.g. "" - * Returns 1(true) or 0(false). - */ -static int -covered_by_list_item(char *item, char *cname, char *mname) -{ - int len; - - len = (int)strlen(item); - if ( item[0]=='*' ) { - if ( strncmp(mname, item+1, len-1)==0 ) { - return 1; - } - } else if ( item[len-1]=='*' ) { - if ( strncmp(cname, item, len-1)==0 ) { - return 1; - } - } else { - int cname_len; - - cname_len = (int)strlen(cname); - if ( strncmp(cname, item, (len>cname_len?cname_len:len))==0 ) { - if ( cname_len >= len ) { - /* No method name supplied in item, we must have matched */ - return 1; - } else { - int mname_len; - - mname_len = (int)strlen(mname); - item += cname_len+1; - len -= cname_len+1; - if ( strncmp(mname, item, (len>mname_len?mname_len:len))==0 ) { - return 1; - } - } - } - } - return 0; -} - -/* Determines if a class/method is specified by this list - * list String of comma separated pattern items - * cname Class name, e.g. "java.lang.Object" - * mname Method name, e.g. "" - * Returns 1(true) or 0(false). - */ -static int -covered_by_list(char *list, char *cname, char *mname) -{ - char token[1024]; - char *next; - - if ( list[0] == 0 ) { - return 0; - } - - next = get_token(list, ",", token, sizeof(token)); - while ( next != NULL ) { - if ( covered_by_list_item(token, cname, mname) ) { - return 1; - } - next = get_token(next, ",", token, sizeof(token)); - } - return 0; -} - -/* Determines which class and methods we are interested in - * cname Class name, e.g. "java.lang.Object" - * mname Method name, e.g. "" - * include_list Empty or an explicit list for inclusion - * exclude_list Empty or an explicit list for exclusion - * Returns 1(true) or 0(false). - */ -int -interested(char *cname, char *mname, char *include_list, char *exclude_list) -{ - if ( exclude_list!=NULL && exclude_list[0]!=0 && - covered_by_list(exclude_list, cname, mname) ) { - return 0; - } - if ( include_list!=NULL && include_list[0]!=0 && - !covered_by_list(include_list, cname, mname) ) { - return 0; - } - return 1; -} - -/* ------------------------------------------------------------------- */ -/* Generic JVMTI utility functions */ - -/* Every JVMTI interface returns an error code, which should be checked - * to avoid any cascading errors down the line. - * The interface GetErrorName() returns the actual enumeration constant - * name, making the error messages much easier to understand. - */ -void -check_jvmti_error(jvmtiEnv *jvmti, jvmtiError errnum, const char *str) -{ - if ( errnum != JVMTI_ERROR_NONE ) { - char *errnum_str; - - errnum_str = NULL; - (void)(*jvmti)->GetErrorName(jvmti, errnum, &errnum_str); - - fatal_error("ERROR: JVMTI: %d(%s): %s\n", errnum, - (errnum_str==NULL?"Unknown":errnum_str), - (str==NULL?"":str)); - } -} - -/* All memory allocated by JVMTI must be freed by the JVMTI Deallocate - * interface. - */ -void -deallocate(jvmtiEnv *jvmti, void *ptr) -{ - jvmtiError error; - - error = (*jvmti)->Deallocate(jvmti, ptr); - check_jvmti_error(jvmti, error, "Cannot deallocate memory"); -} - -/* Allocation of JVMTI managed memory */ -void * -allocate(jvmtiEnv *jvmti, jint len) -{ - jvmtiError error; - void *ptr; - - error = (*jvmti)->Allocate(jvmti, len, (unsigned char **)&ptr); - check_jvmti_error(jvmti, error, "Cannot allocate memory"); - return ptr; -} - -/* Add demo jar file to boot class path (the BCI Tracker class must be - * in the boot classpath) - * - * WARNING: This code assumes that the jar file can be found at one of: - * ${JAVA_HOME}/demo/jvmti/${DEMO_NAME}/${DEMO_NAME}.jar - * ${JAVA_HOME}/../demo/jvmti/${DEMO_NAME}/${DEMO_NAME}.jar - * where JAVA_HOME may refer to the jre directory. - * Both these values are added to the boot classpath. - * These locations are only true for these demos, installed - * in the JDK area. Platform specific code could be used to - * find the location of the DLL or .so library, and construct a - * path name to the jar file, relative to the library location. - */ -void -add_demo_jar_to_bootclasspath(jvmtiEnv *jvmti, char *demo_name) -{ - jvmtiError error; - char *file_sep; - int max_len; - char *java_home; - char jar_path[FILENAME_MAX+1]; - - java_home = NULL; - error = (*jvmti)->GetSystemProperty(jvmti, "java.home", &java_home); - check_jvmti_error(jvmti, error, "Cannot get java.home property value"); - if ( java_home == NULL || java_home[0] == 0 ) { - fatal_error("ERROR: Java home not found\n"); - } - -#ifdef WIN32 - file_sep = "\\"; -#else - file_sep = "/"; -#endif - - max_len = (int)(strlen(java_home) + strlen(demo_name)*2 + - strlen(file_sep)*5 + - 16 /* ".." "demo" "jvmti" ".jar" NULL */ ); - if ( max_len > (int)sizeof(jar_path) ) { - fatal_error("ERROR: Path to jar file too long\n"); - } - (void)strcpy(jar_path, java_home); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, "demo"); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, "jvmti"); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, demo_name); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, demo_name); - (void)strcat(jar_path, ".jar"); - error = (*jvmti)->AddToBootstrapClassLoaderSearch(jvmti, (const char*)jar_path); - check_jvmti_error(jvmti, error, "Cannot add to boot classpath"); - - (void)strcpy(jar_path, java_home); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, ".."); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, "demo"); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, "jvmti"); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, demo_name); - (void)strcat(jar_path, file_sep); - (void)strcat(jar_path, demo_name); - (void)strcat(jar_path, ".jar"); - - error = (*jvmti)->AddToBootstrapClassLoaderSearch(jvmti, (const char*)jar_path); - check_jvmti_error(jvmti, error, "Cannot add to boot classpath"); -} - -/* ------------------------------------------------------------------- */ diff --git a/jdk/src/demo/share/jvmti/agent_util/agent_util.h b/jdk/src/demo/share/jvmti/agent_util/agent_util.h deleted file mode 100644 index 2237097ab30..00000000000 --- a/jdk/src/demo/share/jvmti/agent_util/agent_util.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#ifndef AGENT_UTIL_H -#define AGENT_UTIL_H - -#include -#include -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#ifdef __cplusplus -extern "C" { -#endif - -void stdout_message(const char * format, ...); -void fatal_error(const char * format, ...); -char *get_token(char *str, char *seps, char *buf, int max); -int interested(char *cname, char *mname, - char *include_list, char *exclude_list); - -void check_jvmti_error(jvmtiEnv *jvmti, jvmtiError errnum, const char *str); -void deallocate(jvmtiEnv *jvmti, void *ptr); -void *allocate(jvmtiEnv *jvmti, jint len); -void add_demo_jar_to_bootclasspath(jvmtiEnv *jvmti, char *demo_name); - -#ifdef STATIC_BUILD -/* Macros for handling declaration of static/dynamic - * Agent library Load/Attach/Unload functions - * - * DEF_Agent_OnLoad, DEF_Agent_OnAttach or DEF_Agent_OnUnload - * generate the appropriate entrypoint names based on static - * versus dynamic builds. - * - * STATIC_BUILD must be defined to build static versions of these libraries. - * LIBRARY_NAME must be set to the name of the library for static builds. - */ -#define ADD_LIB_NAME3(name, lib) name ## lib -#define ADD_LIB_NAME2(name, lib) ADD_LIB_NAME3(name, lib) -#define ADD_LIB_NAME(entry) ADD_LIB_NAME2(entry, LIBRARY_NAME) - -#define DEF_Agent_OnLoad \ -ADD_LIB_NAME(Agent_OnLoad_)(JavaVM *vm, char *options, void *reserved) \ -{ \ - jint JNICALL ADD_LIB_NAME(Agent_OnLoad_dynamic_)(JavaVM *vm, char *options, void *reserved); \ - return ADD_LIB_NAME(Agent_OnLoad_dynamic_)(vm, options, reserved); \ -} \ -jint JNICALL ADD_LIB_NAME(Agent_OnLoad_dynamic_) - -#define DEF_Agent_OnAttach \ -ADD_LIB_NAME(Agent_OnAttach_)(JavaVM *vm, char *options, void *reserved) \ -{ \ - jint JNICALL ADD_LIB_NAME(Agent_OnAttach_dynamic_)(JavaVM *vm, char *options, void *reserved); \ - return ADD_LIB_NAME(Agent_OnAttach_dynamic_)(vm, options, reserved); \ -} \ -jint JNICALL ADD_LIB_NAME(Agent_OnAttach_dynamic_) - -#define DEF_Agent_OnUnload \ -ADD_LIB_NAME(Agent_OnUnload_)(JavaVM *vm) \ -{ \ - void JNICALL ADD_LIB_NAME(Agent_OnUnload_dynamic_)(JavaVM *vm); \ - ADD_LIB_NAME(Agent_OnUnload_dynamic_)(vm); \ -} \ -void JNICALL ADD_LIB_NAME(Agent_OnUnload_dynamic_) - -#else -#define DEF_Agent_OnLoad Agent_OnLoad -#define DEF_Agent_OnAttach Agent_OnAttach -#define DEF_Agent_OnUnload Agent_OnUnload -#endif - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif diff --git a/jdk/src/demo/share/jvmti/compiledMethodLoad/README.txt b/jdk/src/demo/share/jvmti/compiledMethodLoad/README.txt deleted file mode 100644 index 3898d29afbc..00000000000 --- a/jdk/src/demo/share/jvmti/compiledMethodLoad/README.txt +++ /dev/null @@ -1,42 +0,0 @@ -# -# 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. -# - -compiledMethodLoad - -This agent library traces CompiledMethodLoad events along -with the HotSpot specific compile_info parameter. - -You can use this agent library as follows: - - java -agentlib:compiledMethodLoad ... - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c b/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c deleted file mode 100644 index 92d123ea3ce..00000000000 --- a/jdk/src/demo/share/jvmti/compiledMethodLoad/compiledMethodLoad.c +++ /dev/null @@ -1,277 +0,0 @@ -/* - * Copyright (c) 2010, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" -#include "jvmticmlr.h" - -#include "agent_util.h" - -/* Global static data */ -static char OUTPUT_FILE[] = "compiledMethodLoad.txt"; -static FILE *fp; -static jvmtiEnv *jvmti; -static jrawMonitorID lock; - -/* print a jvmtiCompiledMethodLoadDummyRecord */ -void -print_dummy_record(jvmtiCompiledMethodLoadDummyRecord* record, - jvmtiEnv* jvmti, FILE* fp) { - - if (record != NULL) { - fprintf(fp, "Dummy record detected containing message: %s\n", - (char *)record->message); - } -} - -/* print the specified stack frames */ -void -print_stack_frames(PCStackInfo* record, jvmtiEnv *jvmti, FILE* fp) { - if (record != NULL && record->methods != NULL) { - int i; - - for (i = 0; i < record->numstackframes; i++) { - jvmtiError err; - char* method_name = NULL; - char* class_name = NULL; - char* method_signature = NULL; - char* class_signature = NULL; - char* generic_ptr_method = NULL; - char* generic_ptr_class = NULL; - jmethodID id; - jclass declaringclassptr; - id = record->methods[i]; - - err = (*jvmti)->GetMethodDeclaringClass(jvmti, id, - &declaringclassptr); - check_jvmti_error(jvmti, err, "get method declaring class"); - - err = (*jvmti)->GetClassSignature(jvmti, declaringclassptr, - &class_signature, &generic_ptr_class); - check_jvmti_error(jvmti, err, "get class signature"); - - err = (*jvmti)->GetMethodName(jvmti, id, &method_name, - &method_signature, &generic_ptr_method); - check_jvmti_error(jvmti, err, "get method name"); - - fprintf(fp, "%s::%s %s %s @%d\n", class_signature, method_name, - method_signature, - generic_ptr_method == NULL ? "" : generic_ptr_method, - record->bcis[i]); - - if (method_name != NULL) { - err = (*jvmti)->Deallocate(jvmti, (unsigned char*)method_name); - check_jvmti_error(jvmti, err, "deallocate method_name"); - } - if (method_signature != NULL) { - err = (*jvmti)->Deallocate(jvmti, - (unsigned char*)method_signature); - check_jvmti_error(jvmti, err, "deallocate method_signature"); - } - if (generic_ptr_method != NULL) { - err = (*jvmti)->Deallocate(jvmti, - (unsigned char*)generic_ptr_method); - check_jvmti_error(jvmti, err, "deallocate generic_ptr_method"); - } - if (class_name != NULL) { - err = (*jvmti)->Deallocate(jvmti, (unsigned char*)class_name); - check_jvmti_error(jvmti, err, "deallocate class_name"); - } - if (class_signature != NULL) { - err = (*jvmti)->Deallocate(jvmti, - (unsigned char*)class_signature); - check_jvmti_error(jvmti, err, "deallocate class_signature"); - } - if (generic_ptr_class != NULL) { - err = (*jvmti)->Deallocate(jvmti, - (unsigned char*)generic_ptr_class); - check_jvmti_error(jvmti, err, "deallocate generic_ptr_class"); - } - } - } -} - -/* print a jvmtiCompiledMethodLoadInlineRecord */ -void -print_inline_info_record(jvmtiCompiledMethodLoadInlineRecord* record, - jvmtiEnv *jvmti, FILE* fp) { - - if (record != NULL && record->pcinfo != NULL) { - int numpcs = record->numpcs; - int i; - - for (i = 0; i < numpcs; i++) { - PCStackInfo pcrecord = (record->pcinfo[i]); - fprintf(fp, "PcDescriptor(pc=%p):\n", pcrecord.pc); - print_stack_frames(&pcrecord, jvmti, fp); - } - } -} - -/* decode kind of CompiledMethodLoadRecord and print */ -void -print_records(jvmtiCompiledMethodLoadRecordHeader* list, jvmtiEnv *jvmti, - FILE* fp) -{ - jvmtiCompiledMethodLoadRecordHeader* curr = list; - fprintf(fp, "\nPrinting PC Descriptors\n\n"); - while (curr != NULL) { - switch (curr->kind) { - case JVMTI_CMLR_DUMMY: - print_dummy_record((jvmtiCompiledMethodLoadDummyRecord *)curr, - jvmti, fp); - break; - - case JVMTI_CMLR_INLINE_INFO: - print_inline_info_record( - (jvmtiCompiledMethodLoadInlineRecord *)curr, jvmti, fp); - break; - - default: - fprintf(fp, "Warning: unrecognized record: kind=%d\n", curr->kind); - break; - } - - curr = (jvmtiCompiledMethodLoadRecordHeader *)curr->next; - } -} - -/* Callback for JVMTI_EVENT_COMPILED_METHOD_LOAD */ -void JNICALL -compiled_method_load(jvmtiEnv *jvmti, jmethodID method, jint code_size, - const void* code_addr, jint map_length, const jvmtiAddrLocationMap* map, - const void* compile_info) -{ - jvmtiError err; - char* name = NULL; - char* signature = NULL; - char* generic_ptr = NULL; - jvmtiCompiledMethodLoadRecordHeader* pcs; - - err = (*jvmti)->RawMonitorEnter(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor enter"); - - err = (*jvmti)->GetMethodName(jvmti, method, &name, &signature, - &generic_ptr); - check_jvmti_error(jvmti, err, "get method name"); - - fprintf(fp, "\nCompiled method load event\n"); - fprintf(fp, "Method name %s %s %s\n\n", name, signature, - generic_ptr == NULL ? "" : generic_ptr); - pcs = (jvmtiCompiledMethodLoadRecordHeader *)compile_info; - if (pcs != NULL) { - print_records(pcs, jvmti, fp); - } - - if (name != NULL) { - err = (*jvmti)->Deallocate(jvmti, (unsigned char*)name); - check_jvmti_error(jvmti, err, "deallocate name"); - } - if (signature != NULL) { - err = (*jvmti)->Deallocate(jvmti, (unsigned char*)signature); - check_jvmti_error(jvmti, err, "deallocate signature"); - } - if (generic_ptr != NULL) { - err = (*jvmti)->Deallocate(jvmti, (unsigned char*)generic_ptr); - check_jvmti_error(jvmti, err, "deallocate generic_ptr"); - } - - err = (*jvmti)->RawMonitorExit(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor exit"); -} - -/* Agent_OnLoad() is called first, we prepare for a COMPILED_METHOD_LOAD - * event here. - */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - jint rc; - jvmtiError err; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - - fp = fopen(OUTPUT_FILE, "w"); - if (fp == NULL) { - fatal_error("ERROR: %s: Unable to create output file\n", OUTPUT_FILE); - return -1; - } - - /* Get JVMTI environment */ - rc = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION); - if (rc != JNI_OK) { - fatal_error( - "ERROR: Unable to create jvmtiEnv, GetEnv failed, error=%d\n", rc); - return -1; - } - - /* add JVMTI capabilities */ - memset(&capabilities,0, sizeof(capabilities)); - capabilities.can_generate_compiled_method_load_events = 1; - err = (*jvmti)->AddCapabilities(jvmti, &capabilities); - check_jvmti_error(jvmti, err, "add capabilities"); - - /* set JVMTI callbacks for events */ - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.CompiledMethodLoad = &compiled_method_load; - err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(callbacks)); - check_jvmti_error(jvmti, err, "set event callbacks"); - - /* enable JVMTI events */ - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - - /* create coordination monitor */ - err = (*jvmti)->CreateRawMonitor(jvmti, "agent lock", &lock); - check_jvmti_error(jvmti, err, "create raw monitor"); - - return 0; -} - -/* Agent_OnUnload() is called last */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ -} diff --git a/jdk/src/demo/share/jvmti/compiledMethodLoad/sample.makefile.txt b/jdk/src/demo/share/jvmti/compiledMethodLoad/sample.makefile.txt deleted file mode 100644 index 3da8383d912..00000000000 --- a/jdk/src/demo/share/jvmti/compiledMethodLoad/sample.makefile.txt +++ /dev/null @@ -1,148 +0,0 @@ -# -# Copyright (c) 2010, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo compiledMethodLoad -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=compiledMethodLoad -SOURCES=compiledMethodLoad.c ../agent_util/agent_util.c - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES= -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I../agent_util -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule -all: $(LIBRARY) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Cleanup the built bits -clean: - rm -f $(LIBRARY) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/gctest/README.txt b/jdk/src/demo/share/jvmti/gctest/README.txt deleted file mode 100644 index 1d23b8fa339..00000000000 --- a/jdk/src/demo/share/jvmti/gctest/README.txt +++ /dev/null @@ -1,54 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -gctest - -This agent library can be used to track garbage collection events. - -You can use this agent library as follows: - - java -agentlib:gctest ... - -To get help on the available options try: - - java -agentlib:gctest=help - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - -The Events JVMTI_EVENT_GARBAGE_COLLECTION_START, -JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, and JVMTI_EVENT_OBJECT_FREE -all have limitations as to what can be called directly inside the -agent callback functions (e.g. no JNI calls are allowed, and limited -interface calls can be made). However, by using raw monitors and a separate -watcher thread, this agent demonstrates how these limitations can be -easily avoided, allowing the watcher thread to do just about anything -after the JVMTI_EVENT_GARBAGE_COLLECTION_FINISH event. - diff --git a/jdk/src/demo/share/jvmti/gctest/gctest.c b/jdk/src/demo/share/jvmti/gctest/gctest.c deleted file mode 100644 index 848e7e07c1a..00000000000 --- a/jdk/src/demo/share/jvmti/gctest/gctest.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Example of using JVMTI_EVENT_GARBAGE_COLLECTION_START and - * JVMTI_EVENT_GARBAGE_COLLECTION_FINISH events. - */ - -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -/* For stdout_message(), fatal_error(), and check_jvmti_error() */ -#include "agent_util.h" - -/* Global static data */ -static jvmtiEnv *jvmti; -static int gc_count; -static jrawMonitorID lock; - -/* Worker thread that waits for garbage collections */ -static void JNICALL -worker(jvmtiEnv* jvmti, JNIEnv* jni, void *p) -{ - jvmtiError err; - - stdout_message("GC worker started...\n"); - - for (;;) { - err = (*jvmti)->RawMonitorEnter(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor enter"); - while (gc_count == 0) { - err = (*jvmti)->RawMonitorWait(jvmti, lock, 0); - if (err != JVMTI_ERROR_NONE) { - err = (*jvmti)->RawMonitorExit(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor wait"); - return; - } - } - gc_count = 0; - - err = (*jvmti)->RawMonitorExit(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor exit"); - - /* Perform arbitrary JVMTI/JNI work here to do post-GC cleanup */ - stdout_message("post-GarbageCollectionFinish actions...\n"); - } -} - -/* Creates a new jthread */ -static jthread -alloc_thread(JNIEnv *env) -{ - jclass thrClass; - jmethodID cid; - jthread res; - - thrClass = (*env)->FindClass(env, "java/lang/Thread"); - if ( thrClass == NULL ) { - fatal_error("Cannot find Thread class\n"); - } - cid = (*env)->GetMethodID(env, thrClass, "", "()V"); - if ( cid == NULL ) { - fatal_error("Cannot find Thread constructor method\n"); - } - res = (*env)->NewObject(env, thrClass, cid); - if ( res == NULL ) { - fatal_error("Cannot create new Thread object\n"); - } - return res; -} - -/* Callback for JVMTI_EVENT_VM_INIT */ -static void JNICALL -vm_init(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiError err; - - stdout_message("VMInit...\n"); - - err = (*jvmti)->RunAgentThread(jvmti, alloc_thread(env), &worker, NULL, - JVMTI_THREAD_MAX_PRIORITY); - check_jvmti_error(jvmti, err, "running agent thread"); -} - -/* Callback for JVMTI_EVENT_GARBAGE_COLLECTION_START */ -static void JNICALL -gc_start(jvmtiEnv* jvmti_env) -{ - stdout_message("GarbageCollectionStart...\n"); -} - -/* Callback for JVMTI_EVENT_GARBAGE_COLLECTION_FINISH */ -static void JNICALL -gc_finish(jvmtiEnv* jvmti_env) -{ - jvmtiError err; - - stdout_message("GarbageCollectionFinish...\n"); - - err = (*jvmti)->RawMonitorEnter(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor enter"); - gc_count++; - err = (*jvmti)->RawMonitorNotify(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor notify"); - err = (*jvmti)->RawMonitorExit(jvmti, lock); - check_jvmti_error(jvmti, err, "raw monitor exit"); -} - -/* Agent_OnLoad() is called first, we prepare for a VM_INIT event here. */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - jint rc; - jvmtiError err; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - - /* Get JVMTI environment */ - rc = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION); - if (rc != JNI_OK) { - fatal_error("ERROR: Unable to create jvmtiEnv, rc=%d\n", rc); - return -1; - } - - /* Get/Add JVMTI capabilities */ - (void)memset(&capabilities, 0, sizeof(capabilities)); - capabilities.can_generate_garbage_collection_events = 1; - err = (*jvmti)->AddCapabilities(jvmti, &capabilities); - check_jvmti_error(jvmti, err, "add capabilities"); - - /* Set callbacks and enable event notifications */ - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.VMInit = &vm_init; - callbacks.GarbageCollectionStart = &gc_start; - callbacks.GarbageCollectionFinish = &gc_finish; - err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(callbacks)); - check_jvmti_error(jvmti, err, "set event callbacks"); - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, NULL); - check_jvmti_error(jvmti, err, "set event notification"); - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_GARBAGE_COLLECTION_START, NULL); - check_jvmti_error(jvmti, err, "set event notification"); - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_GARBAGE_COLLECTION_FINISH, NULL); - check_jvmti_error(jvmti, err, "set event notification"); - - /* Create the necessary raw monitor */ - err = (*jvmti)->CreateRawMonitor(jvmti, "lock", &lock); - check_jvmti_error(jvmti, err, "create raw monitor"); - return 0; -} - -/* Agent_OnUnload() is called last */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ -} diff --git a/jdk/src/demo/share/jvmti/gctest/sample.makefile.txt b/jdk/src/demo/share/jvmti/gctest/sample.makefile.txt deleted file mode 100644 index 46afeb498ce..00000000000 --- a/jdk/src/demo/share/jvmti/gctest/sample.makefile.txt +++ /dev/null @@ -1,148 +0,0 @@ -# -# Copyright (c) 2004, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo gctest -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=gctest -SOURCES=gctest.c ../agent_util/agent_util.c - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES= -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I../agent_util -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule -all: $(LIBRARY) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Cleanup the built bits -clean: - rm -f $(LIBRARY) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/heapTracker/HeapTracker.java b/jdk/src/demo/share/jvmti/heapTracker/HeapTracker.java deleted file mode 100644 index a7eb362cd20..00000000000 --- a/jdk/src/demo/share/jvmti/heapTracker/HeapTracker.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - - -/* Java class to hold static methods which will be called in byte code - * injections of all class files. - */ - -public class HeapTracker { - - private static int engaged = 0; - - private static native void _newobj(Object thread, Object o); - public static void newobj(Object o) - { - if ( engaged != 0 ) { - _newobj(Thread.currentThread(), o); - } - } - - private static native void _newarr(Object thread, Object a); - public static void newarr(Object a) - { - if ( engaged != 0 ) { - _newarr(Thread.currentThread(), a); - } - } - -} diff --git a/jdk/src/demo/share/jvmti/heapTracker/README.txt b/jdk/src/demo/share/jvmti/heapTracker/README.txt deleted file mode 100644 index cb7aac359b9..00000000000 --- a/jdk/src/demo/share/jvmti/heapTracker/README.txt +++ /dev/null @@ -1,47 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -heapTracker - -This agent library can be used to track object allocations. -It uses the same java_crw_demo library used by HPROF to do BCI -on all classfiles loaded into the Virtual Machine. - -You can use this agent library as follows: - - java -agentlib:heapTracker ... - -To get help on the available options try: - - java -agentlib:heapTracker=help - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/heapTracker/heapTracker.c b/jdk/src/demo/share/jvmti/heapTracker/heapTracker.c deleted file mode 100644 index 3af21846245..00000000000 --- a/jdk/src/demo/share/jvmti/heapTracker/heapTracker.c +++ /dev/null @@ -1,1016 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include "stdlib.h" - -#include "heapTracker.h" -#include "java_crw_demo.h" - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -/* ------------------------------------------------------------------- - * Some constant names that tie to Java class/method names. - * We assume the Java class whose static methods we will be calling - * looks like: - * - * public class HeapTracker { - * private static int engaged; - * private static native void _newobj(Object thr, Object o); - * public static void newobj(Object o) - * { - * if ( engaged != 0 ) { - * _newobj(Thread.currentThread(), o); - * } - * } - * private static native void _newarr(Object thr, Object a); - * public static void newarr(Object a) - * { - * if ( engaged != 0 ) { - * _newarr(Thread.currentThread(), a); - * } - * } - * } - * - * The engaged field allows us to inject all classes (even system classes) - * and delay the actual calls to the native code until the VM has reached - * a safe time to call native methods (Past the JVMTI VM_START event). - * - */ - -#define HEAP_TRACKER_class HeapTracker /* Name of class we are using */ -#define HEAP_TRACKER_newobj newobj /* Name of java init method */ -#define HEAP_TRACKER_newarr newarr /* Name of java newarray method */ -#define HEAP_TRACKER_native_newobj _newobj /* Name of java newobj native */ -#define HEAP_TRACKER_native_newarr _newarr /* Name of java newarray native */ -#define HEAP_TRACKER_engaged engaged /* Name of static field switch */ - -/* C macros to create strings from tokens */ -#define _STRING(s) #s -#define STRING(s) _STRING(s) - -/* ------------------------------------------------------------------- */ - -/* Flavors of traces (to separate out stack traces) */ - -typedef enum { - TRACE_FIRST = 0, - TRACE_USER = 0, - TRACE_BEFORE_VM_START = 1, - TRACE_BEFORE_VM_INIT = 2, - TRACE_VM_OBJECT = 3, - TRACE_MYSTERY = 4, - TRACE_LAST = 4 -} TraceFlavor; - -static char * flavorDesc[] = { - "", - "before VM_START", - "before VM_INIT", - "VM_OBJECT", - "unknown" -}; - -/* Trace (Stack Trace) */ - -#define MAX_FRAMES 6 -typedef struct Trace { - /* Number of frames (includes HEAP_TRACKER methods) */ - jint nframes; - /* Frames from GetStackTrace() (2 extra for HEAP_TRACKER methods) */ - jvmtiFrameInfo frames[MAX_FRAMES+2]; - /* Used to make some traces unique */ - TraceFlavor flavor; -} Trace; - -/* Trace information (more than one object will have this as a tag) */ - -typedef struct TraceInfo { - /* Trace where this object was allocated from */ - Trace trace; - /* 64 bit hash code that attempts to identify this specific trace */ - jlong hashCode; - /* Total space taken up by objects allocated from this trace */ - jlong totalSpace; - /* Total count of objects ever allocated from this trace */ - int totalCount; - /* Total live objects that were allocated from this trace */ - int useCount; - /* The next TraceInfo in the hash bucket chain */ - struct TraceInfo *next; -} TraceInfo; - -/* Global agent data structure */ - -typedef struct { - /* JVMTI Environment */ - jvmtiEnv *jvmti; - /* State of the VM flags */ - jboolean vmStarted; - jboolean vmInitialized; - jboolean vmDead; - /* Options */ - int maxDump; - /* Data access Lock */ - jrawMonitorID lock; - /* Counter on classes where BCI has been applied */ - jint ccount; - /* Hash table to lookup TraceInfo's via Trace's */ - #define HASH_INDEX_BIT_WIDTH 12 /* 4096 */ - #define HASH_BUCKET_COUNT (1<RawMonitorEnter(jvmti, gdata->lock); - check_jvmti_error(jvmti, error, "Cannot enter with raw monitor"); -} - -/* Exit a critical section by doing a JVMTI Raw Monitor Exit */ -static void -exitCriticalSection(jvmtiEnv *jvmti) -{ - jvmtiError error; - - error = (*jvmti)->RawMonitorExit(jvmti, gdata->lock); - check_jvmti_error(jvmti, error, "Cannot exit with raw monitor"); -} - -/* Update stats on a TraceInfo */ -static TraceInfo * -updateStats(TraceInfo *tinfo) -{ - tinfo->totalCount++; - tinfo->useCount++; - return tinfo; -} - -/* Get TraceInfo for empty stack */ -static TraceInfo * -emptyTrace(TraceFlavor flavor) -{ - return updateStats(gdata->emptyTrace[flavor]); -} - -/* Allocate new TraceInfo */ -static TraceInfo * -newTraceInfo(Trace *trace, jlong hashCode, TraceFlavor flavor) -{ - TraceInfo *tinfo; - - tinfo = (TraceInfo*)calloc(1, sizeof(TraceInfo)); - if ( tinfo == NULL ) { - fatal_error("ERROR: Ran out of malloc() space\n"); - } else { - int hashIndex; - - tinfo->trace = *trace; - tinfo->trace.flavor = flavor; - tinfo->hashCode = hashCode; - gdata->traceInfoCount++; - hashIndex = (int)(hashCode & HASH_INDEX_MASK); - tinfo->next = gdata->hashBuckets[hashIndex]; - gdata->hashBuckets[hashIndex] = tinfo; - } - return tinfo; -} - -/* Create hash code for a Trace */ -static jlong -hashTrace(Trace *trace) -{ - jlong hashCode; - int i; - - hashCode = 0; - for ( i = 0 ; i < trace->nframes ; i++ ) { - hashCode = (hashCode << 3) + - (jlong)(ptrdiff_t)(void*)(trace->frames[i].method); - hashCode = (hashCode << 2) + - (jlong)(trace->frames[i].location); - } - hashCode = (hashCode << 3) + trace->nframes; - hashCode += trace->flavor; - return hashCode; -} - -/* Lookup or create a new TraceInfo */ -static TraceInfo * -lookupOrEnter(jvmtiEnv *jvmti, Trace *trace, TraceFlavor flavor) -{ - TraceInfo *tinfo; - jlong hashCode; - - /* Calculate hash code (outside critical section to lessen contention) */ - hashCode = hashTrace(trace); - - /* Do a lookup in the hash table */ - enterCriticalSection(jvmti); { - TraceInfo *prev; - int hashIndex; - - /* Start with first item in hash buck chain */ - prev = NULL; - hashIndex = (int)(hashCode & HASH_INDEX_MASK); - tinfo = gdata->hashBuckets[hashIndex]; - while ( tinfo != NULL ) { - if ( tinfo->hashCode == hashCode && - memcmp(trace, &(tinfo->trace), sizeof(Trace))==0 ) { - /* We found one that matches, move to head of bucket chain */ - if ( prev != NULL ) { - /* Remove from list and add to head of list */ - prev->next = tinfo->next; - tinfo->next = gdata->hashBuckets[hashIndex]; - gdata->hashBuckets[hashIndex] = tinfo; - } - /* Break out */ - break; - } - prev = tinfo; - tinfo = tinfo->next; - } - - /* If we didn't find anything we need to enter a new entry */ - if ( tinfo == NULL ) { - /* Create new hash table element */ - tinfo = newTraceInfo(trace, hashCode, flavor); - } - - /* Update stats */ - (void)updateStats(tinfo); - - } exitCriticalSection(jvmti); - - return tinfo; -} - -/* Get TraceInfo for this allocation */ -static TraceInfo * -findTraceInfo(jvmtiEnv *jvmti, jthread thread, TraceFlavor flavor) -{ - TraceInfo *tinfo; - jvmtiError error; - - tinfo = NULL; - if ( thread != NULL ) { - static Trace empty; - Trace trace; - - /* Before VM_INIT thread could be NULL, watch out */ - trace = empty; - error = (*jvmti)->GetStackTrace(jvmti, thread, 0, MAX_FRAMES+2, - trace.frames, &(trace.nframes)); - /* If we get a PHASE error, the VM isn't ready, or it died */ - if ( error == JVMTI_ERROR_WRONG_PHASE ) { - /* It is assumed this is before VM_INIT */ - if ( flavor == TRACE_USER ) { - tinfo = emptyTrace(TRACE_BEFORE_VM_INIT); - } else { - tinfo = emptyTrace(flavor); - } - } else { - check_jvmti_error(jvmti, error, "Cannot get stack trace"); - /* Lookup this entry */ - tinfo = lookupOrEnter(jvmti, &trace, flavor); - } - } else { - /* If thread==NULL, it's assumed this is before VM_START */ - if ( flavor == TRACE_USER ) { - tinfo = emptyTrace(TRACE_BEFORE_VM_START); - } else { - tinfo = emptyTrace(flavor); - } - } - return tinfo; -} - -/* Tag an object with a TraceInfo pointer. */ -static void -tagObjectWithTraceInfo(jvmtiEnv *jvmti, jobject object, TraceInfo *tinfo) -{ - jvmtiError error; - jlong tag; - - /* Tag this object with this TraceInfo pointer */ - tag = (jlong)(ptrdiff_t)(void*)tinfo; - error = (*jvmti)->SetTag(jvmti, object, tag); - check_jvmti_error(jvmti, error, "Cannot tag object"); -} - -/* Java Native Method for Object. */ -static void JNICALL -HEAP_TRACKER_native_newobj(JNIEnv *env, jclass klass, jthread thread, jobject o) -{ - TraceInfo *tinfo; - - if ( gdata->vmDead ) { - return; - } - tinfo = findTraceInfo(gdata->jvmti, thread, TRACE_USER); - tagObjectWithTraceInfo(gdata->jvmti, o, tinfo); -} - -/* Java Native Method for newarray */ -static void JNICALL -HEAP_TRACKER_native_newarr(JNIEnv *env, jclass klass, jthread thread, jobject a) -{ - TraceInfo *tinfo; - - if ( gdata->vmDead ) { - return; - } - tinfo = findTraceInfo(gdata->jvmti, thread, TRACE_USER); - tagObjectWithTraceInfo(gdata->jvmti, a, tinfo); -} - -/* Callback for JVMTI_EVENT_VM_START */ -static void JNICALL -cbVMStart(jvmtiEnv *jvmti, JNIEnv *env) -{ - enterCriticalSection(jvmti); { - jclass klass; - jfieldID field; - jint rc; - - /* Java Native Methods for class */ - static JNINativeMethod registry[2] = { - {STRING(HEAP_TRACKER_native_newobj), "(Ljava/lang/Object;Ljava/lang/Object;)V", - (void*)&HEAP_TRACKER_native_newobj}, - {STRING(HEAP_TRACKER_native_newarr), "(Ljava/lang/Object;Ljava/lang/Object;)V", - (void*)&HEAP_TRACKER_native_newarr} - }; - - /* Register Natives for class whose methods we use */ - klass = (*env)->FindClass(env, STRING(HEAP_TRACKER_class)); - if ( klass == NULL ) { - fatal_error("ERROR: JNI: Cannot find %s with FindClass\n", - STRING(HEAP_TRACKER_class)); - } - rc = (*env)->RegisterNatives(env, klass, registry, 2); - if ( rc != 0 ) { - fatal_error("ERROR: JNI: Cannot register natives for class %s\n", - STRING(HEAP_TRACKER_class)); - } - - /* Engage calls. */ - field = (*env)->GetStaticFieldID(env, klass, STRING(HEAP_TRACKER_engaged), "I"); - if ( field == NULL ) { - fatal_error("ERROR: JNI: Cannot get field from %s\n", - STRING(HEAP_TRACKER_class)); - } - (*env)->SetStaticIntField(env, klass, field, 1); - - /* Indicate VM has started */ - gdata->vmStarted = JNI_TRUE; - - } exitCriticalSection(jvmti); -} - -/* Iterate Through Heap callback */ -static jint JNICALL -cbObjectTagger(jlong class_tag, jlong size, jlong* tag_ptr, jint length, - void *user_data) -{ - TraceInfo *tinfo; - - tinfo = emptyTrace(TRACE_BEFORE_VM_INIT); - *tag_ptr = (jlong)(ptrdiff_t)(void*)tinfo; - return JVMTI_VISIT_OBJECTS; -} - -/* Callback for JVMTI_EVENT_VM_INIT */ -static void JNICALL -cbVMInit(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiHeapCallbacks heapCallbacks; - jvmtiError error; - - /* Iterate through heap, find all untagged objects allocated before this */ - (void)memset(&heapCallbacks, 0, sizeof(heapCallbacks)); - heapCallbacks.heap_iteration_callback = &cbObjectTagger; - error = (*jvmti)->IterateThroughHeap(jvmti, JVMTI_HEAP_FILTER_TAGGED, - NULL, &heapCallbacks, NULL); - check_jvmti_error(jvmti, error, "Cannot iterate through heap"); - - enterCriticalSection(jvmti); { - - /* Indicate VM is initialized */ - gdata->vmInitialized = JNI_TRUE; - - } exitCriticalSection(jvmti); -} - -/* Iterate Through Heap callback */ -static jint JNICALL -cbObjectSpaceCounter(jlong class_tag, jlong size, jlong* tag_ptr, jint length, - void *user_data) -{ - TraceInfo *tinfo; - - tinfo = (TraceInfo*)(ptrdiff_t)(*tag_ptr); - if ( tinfo == NULL ) { - tinfo = emptyTrace(TRACE_MYSTERY); - *tag_ptr = (jlong)(ptrdiff_t)(void*)tinfo; - } - tinfo->totalSpace += size; - return JVMTI_VISIT_OBJECTS; -} - -/* Qsort compare function */ -static int -compareInfo(const void *p1, const void *p2) -{ - TraceInfo *tinfo1, *tinfo2; - - tinfo1 = *((TraceInfo**)p1); - tinfo2 = *((TraceInfo**)p2); - return (int)(tinfo2->totalSpace - tinfo1->totalSpace); -} - -/* Frame to text */ -static void -frameToString(jvmtiEnv *jvmti, char *buf, int buflen, jvmtiFrameInfo *finfo) -{ - jvmtiError error; - jclass klass; - char *signature; - char *methodname; - char *methodsig; - jboolean isNative; - char *filename; - int lineCount; - jvmtiLineNumberEntry*lineTable; - int lineNumber; - - /* Initialize defaults */ - buf[0] = 0; - klass = NULL; - signature = NULL; - methodname = NULL; - methodsig = NULL; - isNative = JNI_FALSE; - filename = NULL; - lineCount = 0; - lineTable = NULL; - lineNumber = 0; - - /* Get jclass object for the jmethodID */ - error = (*jvmti)->GetMethodDeclaringClass(jvmti, finfo->method, &klass); - check_jvmti_error(jvmti, error, "Cannot get method's class"); - - /* Get the class signature */ - error = (*jvmti)->GetClassSignature(jvmti, klass, &signature, NULL); - check_jvmti_error(jvmti, error, "Cannot get class signature"); - - /* Skip all this if it's our own Tracker method */ - if ( strcmp(signature, "L" STRING(HEAP_TRACKER_class) ";" ) == 0 ) { - deallocate(jvmti, signature); - return; - } - - /* Get the name and signature for the method */ - error = (*jvmti)->GetMethodName(jvmti, finfo->method, - &methodname, &methodsig, NULL); - check_jvmti_error(jvmti, error, "Cannot method name"); - - /* Check to see if it's a native method, which means no lineNumber */ - error = (*jvmti)->IsMethodNative(jvmti, finfo->method, &isNative); - check_jvmti_error(jvmti, error, "Cannot get method native status"); - - /* Get source file name */ - error = (*jvmti)->GetSourceFileName(jvmti, klass, &filename); - if ( error != JVMTI_ERROR_NONE && error != JVMTI_ERROR_ABSENT_INFORMATION ) { - check_jvmti_error(jvmti, error, "Cannot get source filename"); - } - - /* Get lineNumber if we can */ - if ( !isNative ) { - int i; - - /* Get method line table */ - error = (*jvmti)->GetLineNumberTable(jvmti, finfo->method, &lineCount, &lineTable); - if ( error == JVMTI_ERROR_NONE ) { - /* Search for line */ - lineNumber = lineTable[0].line_number; - for ( i = 1 ; i < lineCount ; i++ ) { - if ( finfo->location < lineTable[i].start_location ) { - break; - } - lineNumber = lineTable[i].line_number; - } - } else if ( error != JVMTI_ERROR_ABSENT_INFORMATION ) { - check_jvmti_error(jvmti, error, "Cannot get method line table"); - } - } - - /* Create string for this frame location. - * NOTE: These char* quantities are mUTF (Modified UTF-8) bytes - * and should actually be converted to the default system - * character encoding. Sending them to things like - * printf() without converting them is actually an I18n - * (Internationalization) error. - */ - (void)sprintf(buf, "%s.%s@%d[%s:%d]", - (signature==NULL?"UnknownClass":signature), - (methodname==NULL?"UnknownMethod":methodname), - (int)finfo->location, - (filename==NULL?"UnknownFile":filename), - lineNumber); - - /* Free up JVMTI space allocated by the above calls */ - deallocate(jvmti, signature); - deallocate(jvmti, methodname); - deallocate(jvmti, methodsig); - deallocate(jvmti, filename); - deallocate(jvmti, lineTable); -} - -/* Print the information */ -static void -printTraceInfo(jvmtiEnv *jvmti, int index, TraceInfo* tinfo) -{ - if ( tinfo == NULL ) { - fatal_error("%d: NULL ENTRY ERROR\n", index); - return; - } - - stdout_message("%2d: %7d bytes %5d objects %5d live %s", - index, (int)tinfo->totalSpace, tinfo->totalCount, - tinfo->useCount, flavorDesc[tinfo->trace.flavor]); - - if ( tinfo->trace.nframes > 0 ) { - int i; - int fcount; - - fcount = 0; - stdout_message(" stack=("); - for ( i = 0 ; i < tinfo->trace.nframes ; i++ ) { - char buf[4096]; - - frameToString(jvmti, buf, (int)sizeof(buf), tinfo->trace.frames+i); - if ( buf[0] == 0 ) { - continue; /* Skip the ones that are from Tracker class */ - } - fcount++; - stdout_message("%s", buf); - if ( i < (tinfo->trace.nframes-1) ) { - stdout_message(","); - } - } - stdout_message(") nframes=%d\n", fcount); - } else { - stdout_message(" stack=\n"); - } -} - -/* Callback for JVMTI_EVENT_VM_DEATH */ -static void JNICALL -cbVMDeath(jvmtiEnv *jvmti, JNIEnv *env) -{ - jvmtiHeapCallbacks heapCallbacks; - jvmtiError error; - - /* These are purposely done outside the critical section */ - - /* Force garbage collection now so we get our ObjectFree calls */ - error = (*jvmti)->ForceGarbageCollection(jvmti); - check_jvmti_error(jvmti, error, "Cannot force garbage collection"); - - /* Iterate through heap and find all objects */ - (void)memset(&heapCallbacks, 0, sizeof(heapCallbacks)); - heapCallbacks.heap_iteration_callback = &cbObjectSpaceCounter; - error = (*jvmti)->IterateThroughHeap(jvmti, 0, NULL, &heapCallbacks, NULL); - check_jvmti_error(jvmti, error, "Cannot iterate through heap"); - - /* Process VM Death */ - enterCriticalSection(jvmti); { - jclass klass; - jfieldID field; - jvmtiEventCallbacks callbacks; - - /* Disengage calls in HEAP_TRACKER_class. */ - klass = (*env)->FindClass(env, STRING(HEAP_TRACKER_class)); - if ( klass == NULL ) { - fatal_error("ERROR: JNI: Cannot find %s with FindClass\n", - STRING(HEAP_TRACKER_class)); - } - field = (*env)->GetStaticFieldID(env, klass, STRING(HEAP_TRACKER_engaged), "I"); - if ( field == NULL ) { - fatal_error("ERROR: JNI: Cannot get field from %s\n", - STRING(HEAP_TRACKER_class)); - } - (*env)->SetStaticIntField(env, klass, field, 0); - - /* The critical section here is important to hold back the VM death - * until all other callbacks have completed. - */ - - /* Clear out all callbacks. */ - (void)memset(&callbacks,0, sizeof(callbacks)); - error = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, - (jint)sizeof(callbacks)); - check_jvmti_error(jvmti, error, "Cannot set jvmti callbacks"); - - /* Since this critical section could be holding up other threads - * in other event callbacks, we need to indicate that the VM is - * dead so that the other callbacks can short circuit their work. - * We don't expect an further events after VmDeath but we do need - * to be careful that existing threads might be in our own agent - * callback code. - */ - gdata->vmDead = JNI_TRUE; - - /* Dump all objects */ - if ( gdata->traceInfoCount > 0 ) { - TraceInfo **list; - int count; - int i; - - stdout_message("Dumping heap trace information\n"); - - /* Create single array of pointers to TraceInfo's, sort, and - * print top gdata->maxDump top space users. - */ - list = (TraceInfo**)calloc(gdata->traceInfoCount, - sizeof(TraceInfo*)); - if ( list == NULL ) { - fatal_error("ERROR: Ran out of malloc() space\n"); - } - count = 0; - for ( i = 0 ; i < HASH_BUCKET_COUNT ; i++ ) { - TraceInfo *tinfo; - - tinfo = gdata->hashBuckets[i]; - while ( tinfo != NULL ) { - if ( count < gdata->traceInfoCount ) { - list[count++] = tinfo; - } - tinfo = tinfo->next; - } - } - if ( count != gdata->traceInfoCount ) { - fatal_error("ERROR: Count found by iterate doesn't match ours:" - " count=%d != traceInfoCount==%d\n", - count, gdata->traceInfoCount); - } - qsort(list, count, sizeof(TraceInfo*), &compareInfo); - for ( i = 0 ; i < count ; i++ ) { - if ( i >= gdata->maxDump ) { - break; - } - printTraceInfo(jvmti, i+1, list[i]); - } - (void)free(list); - } - - } exitCriticalSection(jvmti); - -} - -/* Callback for JVMTI_EVENT_VM_OBJECT_ALLOC */ -static void JNICALL -cbVMObjectAlloc(jvmtiEnv *jvmti, JNIEnv *env, jthread thread, - jobject object, jclass object_klass, jlong size) -{ - TraceInfo *tinfo; - - if ( gdata->vmDead ) { - return; - } - tinfo = findTraceInfo(jvmti, thread, TRACE_VM_OBJECT); - tagObjectWithTraceInfo(jvmti, object, tinfo); -} - -/* Callback for JVMTI_EVENT_OBJECT_FREE */ -static void JNICALL -cbObjectFree(jvmtiEnv *jvmti, jlong tag) -{ - TraceInfo *tinfo; - - if ( gdata->vmDead ) { - return; - } - - /* The object tag is actually a pointer to a TraceInfo structure */ - tinfo = (TraceInfo*)(void*)(ptrdiff_t)tag; - - /* Decrement the use count */ - tinfo->useCount--; -} - -/* Callback for JVMTI_EVENT_CLASS_FILE_LOAD_HOOK */ -static void JNICALL -cbClassFileLoadHook(jvmtiEnv *jvmti, JNIEnv* env, - jclass class_being_redefined, jobject loader, - const char* name, jobject protection_domain, - jint class_data_len, const unsigned char* class_data, - jint* new_class_data_len, unsigned char** new_class_data) -{ - enterCriticalSection(jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vmDead ) { - - const char * classname; - - /* Name can be NULL, make sure we avoid SEGV's */ - if ( name == NULL ) { - classname = java_crw_demo_classname(class_data, class_data_len, - NULL); - if ( classname == NULL ) { - fatal_error("ERROR: No classname in classfile\n"); - } - } else { - classname = strdup(name); - if ( classname == NULL ) { - fatal_error("ERROR: Ran out of malloc() space\n"); - } - } - - *new_class_data_len = 0; - *new_class_data = NULL; - - /* The tracker class itself? */ - if ( strcmp(classname, STRING(HEAP_TRACKER_class)) != 0 ) { - jint cnum; - int systemClass; - unsigned char *newImage; - long newLength; - - /* Get number for every class file image loaded */ - cnum = gdata->ccount++; - - /* Is it a system class? If the class load is before VmStart - * then we will consider it a system class that should - * be treated carefully. (See java_crw_demo) - */ - systemClass = 0; - if ( !gdata->vmStarted ) { - systemClass = 1; - } - - newImage = NULL; - newLength = 0; - - /* Call the class file reader/write demo code */ - java_crw_demo(cnum, - classname, - class_data, - class_data_len, - systemClass, - STRING(HEAP_TRACKER_class), - "L" STRING(HEAP_TRACKER_class) ";", - NULL, NULL, - NULL, NULL, - STRING(HEAP_TRACKER_newobj), "(Ljava/lang/Object;)V", - STRING(HEAP_TRACKER_newarr), "(Ljava/lang/Object;)V", - &newImage, - &newLength, - NULL, - NULL); - - /* If we got back a new class image, return it back as "the" - * new class image. This must be JVMTI Allocate space. - */ - if ( newLength > 0 ) { - unsigned char *jvmti_space; - - jvmti_space = (unsigned char *)allocate(jvmti, (jint)newLength); - (void)memcpy((void*)jvmti_space, (void*)newImage, (int)newLength); - *new_class_data_len = (jint)newLength; - *new_class_data = jvmti_space; /* VM will deallocate */ - } - - /* Always free up the space we get from java_crw_demo() */ - if ( newImage != NULL ) { - (void)free((void*)newImage); /* Free malloc() space with free() */ - } - } - - (void)free((void*)classname); - } - } exitCriticalSection(jvmti); -} - -/* Parse the options for this heapTracker agent */ -static void -parse_agent_options(char *options) -{ - #define MAX_TOKEN_LENGTH 16 - char token[MAX_TOKEN_LENGTH]; - char *next; - - /* Defaults */ - gdata->maxDump = 20; - - /* Parse options and set flags in gdata */ - if ( options==NULL ) { - return; - } - - /* Get the first token from the options string. */ - next = get_token(options, ",=", token, (int)sizeof(token)); - - /* While not at the end of the options string, process this option. */ - while ( next != NULL ) { - if ( strcmp(token,"help")==0 ) { - stdout_message("The heapTracker JVMTI demo agent\n"); - stdout_message("\n"); - stdout_message(" java -agent:heapTracker[=options] ...\n"); - stdout_message("\n"); - stdout_message("The options are comma separated:\n"); - stdout_message("\t help\t\t\t Print help information\n"); - stdout_message("\t maxDump=n\t\t\t How many TraceInfo's to dump\n"); - stdout_message("\n"); - exit(0); - } else if ( strcmp(token,"maxDump")==0 ) { - char number[MAX_TOKEN_LENGTH]; - - next = get_token(next, ",=", number, (int)sizeof(number)); - if ( next == NULL ) { - fatal_error("ERROR: Cannot parse maxDump=number: %s\n", options); - } - gdata->maxDump = atoi(number); - } else if ( token[0]!=0 ) { - /* We got a non-empty token and we don't know what it is. */ - fatal_error("ERROR: Unknown option: %s\n", token); - } - /* Get the next token (returns NULL if there are no more) */ - next = get_token(next, ",=", token, (int)sizeof(token)); - } -} - -/* Agent_OnLoad: This is called immediately after the shared library is - * loaded. This is the first code executed. - */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - static GlobalAgentData data; - jvmtiEnv *jvmti; - jvmtiError error; - jint res; - TraceFlavor flavor; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - static Trace empty; - - /* Setup initial global agent data area - * Use of static/extern data should be handled carefully here. - * We need to make sure that we are able to cleanup after ourselves - * so anything allocated in this library needs to be freed in - * the Agent_OnUnload() function. - */ - (void)memset((void*)&data, 0, sizeof(data)); - gdata = &data; - - /* First thing we need to do is get the jvmtiEnv* or JVMTI environment */ - res = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION_1); - if (res != JNI_OK) { - /* This means that the VM was unable to obtain this version of the - * JVMTI interface, this is a fatal error. - */ - fatal_error("ERROR: Unable to access JVMTI Version 1 (0x%x)," - " is your JDK a 5.0 or newer version?" - " JNIEnv's GetEnv() returned %d\n", - JVMTI_VERSION_1, res); - } - - /* Here we save the jvmtiEnv* for Agent_OnUnload(). */ - gdata->jvmti = jvmti; - - /* Parse any options supplied on java command line */ - parse_agent_options(options); - - /* Immediately after getting the jvmtiEnv* we need to ask for the - * capabilities this agent will need. - */ - (void)memset(&capabilities,0, sizeof(capabilities)); - capabilities.can_generate_all_class_hook_events = 1; - capabilities.can_tag_objects = 1; - capabilities.can_generate_object_free_events = 1; - capabilities.can_get_source_file_name = 1; - capabilities.can_get_line_numbers = 1; - capabilities.can_generate_vm_object_alloc_events = 1; - error = (*jvmti)->AddCapabilities(jvmti, &capabilities); - check_jvmti_error(jvmti, error, "Unable to get necessary JVMTI capabilities."); - - /* Next we need to provide the pointers to the callback functions to - * to this jvmtiEnv* - */ - (void)memset(&callbacks,0, sizeof(callbacks)); - /* JVMTI_EVENT_VM_START */ - callbacks.VMStart = &cbVMStart; - /* JVMTI_EVENT_VM_INIT */ - callbacks.VMInit = &cbVMInit; - /* JVMTI_EVENT_VM_DEATH */ - callbacks.VMDeath = &cbVMDeath; - /* JVMTI_EVENT_OBJECT_FREE */ - callbacks.ObjectFree = &cbObjectFree; - /* JVMTI_EVENT_VM_OBJECT_ALLOC */ - callbacks.VMObjectAlloc = &cbVMObjectAlloc; - /* JVMTI_EVENT_CLASS_FILE_LOAD_HOOK */ - callbacks.ClassFileLoadHook = &cbClassFileLoadHook; - error = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, (jint)sizeof(callbacks)); - check_jvmti_error(jvmti, error, "Cannot set jvmti callbacks"); - - /* At first the only initial events we are interested in are VM - * initialization, VM death, and Class File Loads. - * Once the VM is initialized we will request more events. - */ - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_START, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_DEATH, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_OBJECT_FREE, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_OBJECT_ALLOC, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - - /* Here we create a raw monitor for our use in this agent to - * protect critical sections of code. - */ - error = (*jvmti)->CreateRawMonitor(jvmti, "agent data", &(gdata->lock)); - check_jvmti_error(jvmti, error, "Cannot create raw monitor"); - - /* Create the TraceInfo for various flavors of empty traces */ - for ( flavor = TRACE_FIRST ; flavor <= TRACE_LAST ; flavor++ ) { - gdata->emptyTrace[flavor] = - newTraceInfo(&empty, hashTrace(&empty), flavor); - } - - /* Add jar file to boot classpath */ - add_demo_jar_to_bootclasspath(jvmti, "heapTracker"); - - /* We return JNI_OK to signify success */ - return JNI_OK; -} - -/* Agent_OnUnload: This is called immediately before the shared library is - * unloaded. This is the last code executed. - */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ - /* Skip any cleanup, VM is about to die anyway */ -} diff --git a/jdk/src/demo/share/jvmti/heapTracker/heapTracker.h b/jdk/src/demo/share/jvmti/heapTracker/heapTracker.h deleted file mode 100644 index 8d63f156b71..00000000000 --- a/jdk/src/demo/share/jvmti/heapTracker/heapTracker.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Primary heapTracker #include file, should be included by most if not - * all heapTracker source files. Gives access to the global data structure - * and all global macros. - */ - -#ifndef HEAP_TRACKER_H -#define HEAP_TRACKER_H - -/* Standard C functions used throughout. */ - -#include -#include -#include -#include -#include - -/* General JVM/Java functions, types and macros. */ - -#include -#include "jni.h" -#include "jvmti.h" - -/* Utility functions */ - -#include "agent_util.h" - -#endif diff --git a/jdk/src/demo/share/jvmti/heapTracker/sample.makefile.txt b/jdk/src/demo/share/jvmti/heapTracker/sample.makefile.txt deleted file mode 100644 index e094bc8206f..00000000000 --- a/jdk/src/demo/share/jvmti/heapTracker/sample.makefile.txt +++ /dev/null @@ -1,163 +0,0 @@ -# -# Copyright (c) 2004, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo heapTracker -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=heapTracker -SOURCES=heapTracker.c ../agent_util/agent_util.c -JAVA_SOURCES=HeapTracker.java - -# Name of jar file that needs to be created -JARFILE=heapTracker.jar - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Sources need java_crw_demo - SOURCES += ../java_crw_demo/java_crw_demo.c - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES=$(JDK)/ - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I../agent_util -CFLAGS += -I../java_crw_demo -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule (build both native library and jar file) -all: $(LIBRARY) $(JARFILE) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Build jar file -$(JARFILE): $(JAVA_SOURCES) - rm -f -r classes - mkdir -p classes - $(JDK)/bin/javac -d classes $(JAVA_SOURCES) - (cd classes; $(JDK)/bin/jar cf ../$@ *) - -# Cleanup the built bits -clean: - rm -f -r classes - rm -f $(LIBRARY) $(JARFILE) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=. $(JDK)/bin/java -agentlib:$(LIBNAME) -Xbootclasspath/a:./$(JARFILE) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/heapViewer/README.txt b/jdk/src/demo/share/jvmti/heapViewer/README.txt deleted file mode 100644 index 57c183819f3..00000000000 --- a/jdk/src/demo/share/jvmti/heapViewer/README.txt +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -heapViewer - -This agent library demonstrates how to get an easy view of the -heap in terms of total object count and space used. -It uses GetLoadedClasses(), SetTag(), and IterateThroughHeap() -to count up all the objects of all the current loaded classes. -The heap dump will happen at the event JVMTI_EVENT_VM_DEATH, or the -event JVMTI_EVENT_DATA_DUMP_REQUEST. - -It also demonstrates some more robust agent error handling using -GetErrorName(), - -Using the heap iterate functions, lots of statistics can be generated -without resorting to using Byte Code Instrumentation (BCI). - -You can use this agent library as follows: - - java -agentlib:heapViewer ... - -To get help on the available options try: - - java -agentlib:heapViewer=help - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/heapViewer/heapViewer.c b/jdk/src/demo/share/jvmti/heapViewer/heapViewer.c deleted file mode 100644 index 35ed907b84a..00000000000 --- a/jdk/src/demo/share/jvmti/heapViewer/heapViewer.c +++ /dev/null @@ -1,288 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -/* Global static data */ -typedef struct { - jboolean vmDeathCalled; - jboolean dumpInProgress; - jrawMonitorID lock; -} GlobalData; -static GlobalData globalData, *gdata = &globalData; - -/* Typedef to hold class details */ -typedef struct { - char *signature; - int count; - int space; -} ClassDetails; - -/* Enter agent monitor protected section */ -static void -enterAgentMonitor(jvmtiEnv *jvmti) -{ - jvmtiError err; - - err = (*jvmti)->RawMonitorEnter(jvmti, gdata->lock); - check_jvmti_error(jvmti, err, "raw monitor enter"); -} - -/* Exit agent monitor protected section */ -static void -exitAgentMonitor(jvmtiEnv *jvmti) -{ - jvmtiError err; - - err = (*jvmti)->RawMonitorExit(jvmti, gdata->lock); - check_jvmti_error(jvmti, err, "raw monitor exit"); -} - -/* Heap object callback */ -static jint JNICALL -cbHeapObject(jlong class_tag, jlong size, jlong* tag_ptr, jint length, - void* user_data) -{ - if ( class_tag != (jlong)0 ) { - ClassDetails *d; - - d = (ClassDetails*)(void*)(ptrdiff_t)class_tag; - (*((jint*)(user_data)))++; - d->count++; - d->space += (int)size; - } - return JVMTI_VISIT_OBJECTS; -} - -/* Compare two ClassDetails */ -static int -compareDetails(const void *p1, const void *p2) -{ - return ((ClassDetails*)p2)->space - ((ClassDetails*)p1)->space; -} - -/* Callback for JVMTI_EVENT_DATA_DUMP_REQUEST (Ctrl-\ or at exit) */ -static void JNICALL -dataDumpRequest(jvmtiEnv *jvmti) -{ - enterAgentMonitor(jvmti); { - if ( !gdata->vmDeathCalled && !gdata->dumpInProgress ) { - jvmtiHeapCallbacks heapCallbacks; - ClassDetails *details; - jvmtiError err; - jclass *classes; - jint totalCount; - jint count; - jint i; - - gdata->dumpInProgress = JNI_TRUE; - - /* Get all the loaded classes */ - err = (*jvmti)->GetLoadedClasses(jvmti, &count, &classes); - check_jvmti_error(jvmti, err, "get loaded classes"); - - /* Setup an area to hold details about these classes */ - details = (ClassDetails*)calloc(sizeof(ClassDetails), count); - if ( details == NULL ) { - fatal_error("ERROR: Ran out of malloc space\n"); - } - for ( i = 0 ; i < count ; i++ ) { - char *sig; - - /* Get and save the class signature */ - err = (*jvmti)->GetClassSignature(jvmti, classes[i], &sig, NULL); - check_jvmti_error(jvmti, err, "get class signature"); - if ( sig == NULL ) { - fatal_error("ERROR: No class signature found\n"); - } - details[i].signature = strdup(sig); - deallocate(jvmti, sig); - - /* Tag this jclass */ - err = (*jvmti)->SetTag(jvmti, classes[i], - (jlong)(ptrdiff_t)(void*)(&details[i])); - check_jvmti_error(jvmti, err, "set object tag"); - } - - /* Iterate through the heap and count up uses of jclass */ - (void)memset(&heapCallbacks, 0, sizeof(heapCallbacks)); - heapCallbacks.heap_iteration_callback = &cbHeapObject; - totalCount = 0; - err = (*jvmti)->IterateThroughHeap(jvmti, - JVMTI_HEAP_FILTER_CLASS_UNTAGGED, NULL, - &heapCallbacks, (const void *)&totalCount); - check_jvmti_error(jvmti, err, "iterate through heap"); - - /* Remove tags */ - for ( i = 0 ; i < count ; i++ ) { - /* Un-Tag this jclass */ - err = (*jvmti)->SetTag(jvmti, classes[i], (jlong)0); - check_jvmti_error(jvmti, err, "set object tag"); - } - - /* Sort details by space used */ - qsort(details, count, sizeof(ClassDetails), &compareDetails); - - /* Print out sorted table */ - stdout_message("Heap View, Total of %d objects found.\n\n", - totalCount); - - stdout_message("Space Count Class Signature\n"); - stdout_message("---------- ---------- ----------------------\n"); - - for ( i = 0 ; i < count ; i++ ) { - if ( details[i].space == 0 || i > 20 ) { - break; - } - stdout_message("%10d %10d %s\n", - details[i].space, details[i].count, details[i].signature); - } - stdout_message("---------- ---------- ----------------------\n\n"); - - /* Free up all allocated space */ - deallocate(jvmti, classes); - for ( i = 0 ; i < count ; i++ ) { - if ( details[i].signature != NULL ) { - free(details[i].signature); - } - } - free(details); - - gdata->dumpInProgress = JNI_FALSE; - } - } exitAgentMonitor(jvmti); -} - -/* Callback for JVMTI_EVENT_VM_INIT */ -static void JNICALL -vmInit(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - enterAgentMonitor(jvmti); { - jvmtiError err; - - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_DATA_DUMP_REQUEST, NULL); - check_jvmti_error(jvmti, err, "set event notification"); - } exitAgentMonitor(jvmti); -} - -/* Callback for JVMTI_EVENT_VM_DEATH */ -static void JNICALL -vmDeath(jvmtiEnv *jvmti, JNIEnv *env) -{ - jvmtiError err; - - /* Make sure everything has been garbage collected */ - err = (*jvmti)->ForceGarbageCollection(jvmti); - check_jvmti_error(jvmti, err, "force garbage collection"); - - /* Disable events and dump the heap information */ - enterAgentMonitor(jvmti); { - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_DISABLE, - JVMTI_EVENT_DATA_DUMP_REQUEST, NULL); - check_jvmti_error(jvmti, err, "set event notification"); - - dataDumpRequest(jvmti); - - gdata->vmDeathCalled = JNI_TRUE; - } exitAgentMonitor(jvmti); -} - -/* Agent_OnLoad() is called first, we prepare for a VM_INIT event here. */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - jint rc; - jvmtiError err; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - jvmtiEnv *jvmti; - - /* Get JVMTI environment */ - jvmti = NULL; - rc = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION); - if (rc != JNI_OK) { - fatal_error("ERROR: Unable to create jvmtiEnv, error=%d\n", rc); - return -1; - } - if ( jvmti == NULL ) { - fatal_error("ERROR: No jvmtiEnv* returned from GetEnv\n"); - } - - /* Get/Add JVMTI capabilities */ - (void)memset(&capabilities, 0, sizeof(capabilities)); - capabilities.can_tag_objects = 1; - capabilities.can_generate_garbage_collection_events = 1; - err = (*jvmti)->AddCapabilities(jvmti, &capabilities); - check_jvmti_error(jvmti, err, "add capabilities"); - - /* Create the raw monitor */ - err = (*jvmti)->CreateRawMonitor(jvmti, "agent lock", &(gdata->lock)); - check_jvmti_error(jvmti, err, "create raw monitor"); - - /* Set callbacks and enable event notifications */ - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.VMInit = &vmInit; - callbacks.VMDeath = &vmDeath; - callbacks.DataDumpRequest = &dataDumpRequest; - err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(callbacks)); - check_jvmti_error(jvmti, err, "set event callbacks"); - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, NULL); - check_jvmti_error(jvmti, err, "set event notifications"); - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_DEATH, NULL); - check_jvmti_error(jvmti, err, "set event notifications"); - return 0; -} - -/* Agent_OnUnload() is called last */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ -} diff --git a/jdk/src/demo/share/jvmti/heapViewer/sample.makefile.txt b/jdk/src/demo/share/jvmti/heapViewer/sample.makefile.txt deleted file mode 100644 index 59693c298eb..00000000000 --- a/jdk/src/demo/share/jvmti/heapViewer/sample.makefile.txt +++ /dev/null @@ -1,147 +0,0 @@ -# -# Copyright (c) 2004, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo heapViewer -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=heapViewer -SOURCES=heapViewer.c ../agent_util/agent_util.c - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES= -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule -all: $(LIBRARY) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Cleanup the built bits -clean: - rm -f $(LIBRARY) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/index.html b/jdk/src/demo/share/jvmti/index.html deleted file mode 100644 index 5791b8b046f..00000000000 --- a/jdk/src/demo/share/jvmti/index.html +++ /dev/null @@ -1,430 +0,0 @@ - - JVM TI Demonstration Code - -

    JVM TI Demonstration Code

    - -

    -The -Java™ Virtual Machine Tools Interface (JVM TI) -is a native tool interface provided in JDK 5.0 and newer. -Native libraries that use JVM TI and are loaded into the -Java Virtual Machine -via the -agentlib, -agentpath, or -Xrun (deprecated) interfaces, are -called Agents. -

    -JVM TI -was designed to work with the -Java Native Interface -(JNI), -and eventually displace the -Java Virtual Machine Debugging Interface -(JVMDI) -and the -Java Virtual Machine Profiling Interface -(JVMPI). - -

    -We have created a set of demonstration agents that should -help show many of the features and abilities of the -interface. This list of demonstration agents will change over time. -They are provided as educational tools and as starting -points for Java tool development. - -

    -These agents are built with every JDK build and some basic testing is performed -on a regular basis, but no extensive testbases currently -exist for these agents. -Every JDK installation should include all the pre-built binaries and sources for -all these agents, just look in the demo/jvmti directory of your JDK. - - -

    Using or Running These Agents

    - -

    -Using these agents will require the VM to locate the shared library file -before any actual Java code is run. -The JDK installation should contain all the agent libraries in -the ${JAVA_HOME}/demo/jvmti/agent-name/lib directories. -The Solaris 64bit version would be contained in the sparcv9 or amd64 -subdirectory. -If 'java' complains that it can't find the library, -you may need to add the directory containing the library into the -LD_LIBRARY_PATH environment variable (Unix), or the PATH environment -variable (Windows). -This is system and platform specific. -If you are using 64bit Solaris (e.g. 'java -d64'), -you should use LD_LIBRARY_PATH64. -Some agents such as the jdwp (debugger backend) -are located inside the primary JDK directories and will always be found -in those locations. - -

    -The agents that instrument classfiles -(i.e. BCI, usually through the java_crw_demo library) -such as heapTracker, mtrace, and minst, -also need to have the Java classes they use available in the bootclasspath. -The agents will make attempts at automatically adding their jar file -(e.g. heapTracker.jar, mtrace.jar, or minst.jar) to the bootclasspath -with AddToBootstrapClassLoaderSearch from JVM TI at startup -(see the agent_util code). -This is done by locating this jar file at -${JAVA_HOME}/demo/jvmti/agent-name -where JAVA_HOME is obtained by calling GetSystemProperty from JVM TI -with "java.home". -We recognize that this is not ideal, but felt that as just demonstration -code it was acceptable. -Ideally the agent could find out the actual directory it came from and -locate the jar file relative to that location. -Our demonstration agents currently do not do this. - -

    -If you choose to modify or change these agents, the above information -is important in making everything is found. -It is recommended that you change the name of the agent when you -modify it to avoid conflicts with the existing demo agents. -Or better yet, go to http://jdk.dev.java.net and submit your -changes to the agent as an RFE to the JDK. - - -

    Demonstration Agents Available

    - -
      - -
    • -versionCheck -
      -This is a extremely small agent that does nothing but check the -version string supplied in the jvmti.h file, with the version -number supplied by the VM at runtime. -
    • - -
    • -compiledMethodLoad -
      -This is a small agent that traces CompiledMethodLoad events along -with the HotSpot specific compile_info parameter. -
    • - -
    • -mtrace -
      -This is a small agent that does method tracing. -It uses Bytecode Instrumentation (BCI) via the java_crw_demo library. -
    • - -
    • -minst -
      -This is an even smaller agent that does just method entry tracing. -It also uses Bytecode Instrumentation (BCI) via the java_crw_demo library, -but the instrumentation code is pure Java (no Java native methods used). -NOTE: Be sure to check out java.lang.instrument for a way to avoid -native code agents completely. -
    • - -
    • -gctest -
      -This is a small agent that does garbage collection counting. -
    • - -
    • -heapViewer -
      -This is a small agent that does some basic heap inspections. -
    • - -
    • -heapTracker -
      -This is a small agent that does BCI to capture object creation -and track them. -It uses Bytecode Instrumentation (BCI) via the java_crw_demo library. -
    • - -
    • -waiters -
      -This is a small agent that gets information about threads -waiting on monitors. -
    • - -
    - - - -

    Agent Support

    - -
      - -
    • -java_crw_demo -
      -This is a demo C library that does class file to class file -transformations or BCI (Bytecode Instrumentation). -It is used by several of the above agents. -
    • - - -
    - - - -

    Native Library Build Hints

    - -

    -All libraries loaded into java are assumed to be MT-safe (Multi-thread safe). -This means that multiple threads could be executing the code at the same -time, and static or global data may need to be placed in critical -sections. See the Raw Monitor interfaces for more information. - -

    -All native libraries loaded into the -Java Virtual Machine, -including Agent libraries, -need to be compiled and built in a compatible way. -Certain native compilation options or optimizations should be avoided, -and some are required. -More information on this options is available in the man pages for -the various compilers. - -

    -Some native compiler and linker options can create fatal or -erroneous behavior when native agent libraries are operating -inside the Java Virtual Machine. -It would take too many words to describe all the possible issues with all -the native compiler options, optimizations, and settings. -Here are some recommendations on the basic compiler and linker options -we recommend: - -

      - -

      Solaris

      - -
    • -On Solaris, using the Sun Studio 11 C compiler, -the typical compile and link command lines might look something like: -
      -For 32bit SPARC: -
      -
        -cc -xO2 -mt -xregs=no%appl -xmemalign=4s -xarch=v8 -KPIC -c *.c -
        -cc -mt -xarch=v8 -z defs -ztext -G -o libXXX.so *.o -lc -
      -
      -For 64bit SPARC: -
      -
        -cc -xO2 -mt -xregs=no%appl -xarch=v9 -KPIC -c *.c -
        -cc -mt -xarch=v9 -z defs -ztext -G -o libXXX.so *.o -lc -
      -
      -For X86: -
      -
        -cc -xO2 -mt -xregs=no%frameptr -KPIC -c *.c -
        -cc -mt -z defs -ztext -G -o libXXX.so *.o -lc -
      -
      -For AMD64: -
      -
        -cc -xO2 -mt -xregs=no%frameptr -xarch=amd64 -KPIC -c *.c -
        -cc -mt -xarch=amd64 -z defs -ztext -G -o libXXX.so *.o -lc -
      -
      -
    • - -
    • -Architecture/File Format: -For SPARC 32bit use -xarch=v8, -for SPARC 64bit use -xarch=v9, -for X86 (32-bit) - -leave the option off or use -xarch=generic -, -and for AMD64 (64bit) use -xarch=amd64 -with both C and C++. -
      -This is to be specific as to the architecture and the file format -of the .o files (and ultimately of the .so). -
    • - -
    • -MT-Safe, Position Independent: Use -KPIC -mt -with both C and C++. -
    • - -
    • -Register usage: For SPARC (both 32bit and 64bit) use --xregs=no%appl and for X86 and AMD64 use -xregs=no%frameptr -with both C and C++. -
    • - -
    • -Alignment: For SPARC 32bit use -xmemalign=4s and for SPARC 64bit do NOT use -xmemalign=4 -with both C and C++. -
    • - -
    • -Dependencies: Use ldd -r LibraryName. -
      -After the shared library has been built, the utility -ldd can be used to verify that all dependent libraries -have been satisfied, and all externs can be found. -If ldd says anything is missing, it is very likely that the JVM will also -be unable to load this library. -This usually means that you missed some -lname -options when building the library, or perhaps forgot a -R path -option that tells the library where to look for libraries at runtime. -
    • - -

      Linux

      - -
    • -On Linux, using the gcc version 3.2, -the typical compile and link command lines might look something like: -
      -For X86: -
      -
        -gcc -O2 -fPIC -pthread -DLINUX -c *.c -
        -gcc -z defs -static-libgcc -shared -o libXXX.so *.o -lc -
      -
      -For AMD64: -
      -
        -gcc -O2 -fPIC -pthread -DLINUX -D_LP64=1 -c *.c -
        -gcc -z defs -static-libgcc -shared -o libXXX.so *.o -lc -
      -
      -
    • - -
    • -MT-Safe, Position Independent: -Use -fPIC -pthread. -
    • - -
    • -Agent Demo Code: Needs -DLINUX -
    • - -
    • -Register Usage: Use -fno-omit-frame-pointer. -
      -It is important that these libraries have frame pointer register usage, see the above comments on the Solaris --xregs=no%frameptr -option. -
    • - -
    • -Library: Use -static-libgcc. -
      -When building the shared library (-shared option), this option -allows for maximum portability of the library between different -flavors of Linux. -The problem we have seen with Linux is that we cannot depend -on a compatible shared gcc library existing on all the versions of -Linux we can run on. -By doing this static link, the version script becomes more -important, making sure you don't expose any extern symbols -you didn't intend to. -
    • - -
    • -Dependencies: Use ldd -r LibraryName. -
      -Provides the same checking as Solaris (see above). -
    • - -

      Windows

      - -
    • -On Windows and using the Microsoft C++ Compiler Visual Studio .NET 2003, -the typical compile and link command lines might look something like: -
      -For X86: -
      -
        -cl /O1 /MD /D _STATIC_CPPLIB /c *.c -
        -link /dll /opt:REF /out:XXX.dll *.obj -
      -
      -For AMD64: -
      -
        -cl /O1 /MD /D _STATIC_CPPLIB /c *.c -
        -link /dll /opt:REF /out:XXX.dll *.obj -
      -
      -
    • - -
    • -Library: Use /opt:REF when building the dll. -
    • - -
    • -MS DLL Runtime: Use the /MD /D _STATIC_CPPLIB option. -
      -This causes your dll to become dependent on just MSVCR*.DLL. -The option /D _STATIC_CPPLIB prevents you from becoming dependent on the -C++ library MSVCP*.DLL. -This is what we use in the JDK, but there are probably many combinations -that you could safely use, unfortunately there are many combinations -of runtimes that will not work. -Check the Microsoft site on proper use of runtimes. -
    • - -
    • -Dependencies: Use VC++ dumpbin /exports and the VC++ "Dependency Walker". -
      -Provides dependency information similar to ldd. -
    • - -
    - - -

    For More Information

    - -

    -Remember, the complete source to all these agents is contained in the JDK -installations at demo/jvmti. - -

    -For more detailed information on JVM TI, refer to - -http://java.sun.com/j2se/latest/docs/guide/jvmti. - -

    -More information on using JNI and building native libraries refer to: - -http://java.sun.com/j2se/latest/docs/guide/jni. - -

    -Additional information can also be found by doing a search on "jvmti" at -http://java.sun.com/j2se. -Various technical articles are also available through this website. -And don't forget the -Java Tutorials at -http://docs.oracle.com/javase/tutorial -for getting a quick start on all the various interfaces. - -

    Comments and Feedback

    - -

    -Comments regarding JVM TI or on any of these demonstrations should be -sent through -http://java.sun.com/mail/ - - - - diff --git a/jdk/src/demo/share/jvmti/java_crw_demo/README.txt b/jdk/src/demo/share/jvmti/java_crw_demo/README.txt deleted file mode 100644 index c242793a6a2..00000000000 --- a/jdk/src/demo/share/jvmti/java_crw_demo/README.txt +++ /dev/null @@ -1,77 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -java_crw_demo Library - -The library java_crw_demo is a small C library that is used by HPROF -and other agent libraries to do some very basic bytecode -insertion (BCI) of class files. This is not an agent -library but a general purpose library that can be used to do some -very limited bytecode insertion. - -In the demo sources, look for the use of java_crw_demo.h and -the C function java_crw_demo(). The java_crw_demo library is provided -as part of the JRE. - -The basic BCI that this library does includes: - - * On entry to the java.lang.Object init method (signature "()V"), - a invokestatic call to tclass.obj_init_method(object); is inserted. - - * On any newarray type opcode, immediately following it, the array - object is duplicated on the stack and an invokestatic call to - tclass.newarray_method(object); is inserted. - - * On entry to all methods, a invokestatic call to - tclass.call_method(cnum,mnum); is inserted. The agent can map the - two integers (cnum,mnum) to a method in a class, the cnum is the - number provided to the java_crw_demo library when the classfile was - modified. - - * On return from any method (any return opcode), a invokestatic call to - tclass.return_method(cnum,mnum); is inserted. - -Some methods are not modified at all, init methods and finalize methods -whose length is 1 will not be modified. Classes that are designated -"system" will not have their clinit methods modified. In addition, the -method java.lang.Thread.currentThread() is not modified. - -No methods or fields will be added to any class, however new constant -pool entries will be added at the end of the original constant pool table. -The exception, line, and local variable tables for each method is adjusted -for the modification. The bytecodes are compressed to use smaller offsets -and the fewest 'wide' opcodes. - -All attempts are made to minimize the number of bytecodes at each insertion -site, however, classes with N return opcodes or N newarray opcodes will get -N insertions. And only the necessary modification dictated by the input -arguments to java_crw_demo are actually made. - diff --git a/jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c b/jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c deleted file mode 100644 index eaa271e9e18..00000000000 --- a/jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.c +++ /dev/null @@ -1,2535 +0,0 @@ -/* - * Copyright (c) 2003, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Class reader writer (java_crw_demo) for instrumenting bytecodes */ - -/* - * As long as the callbacks allow for it and the class number is unique, - * this code is completely re-entrant and any number of classfile - * injections can happen at the same time. - * - * The current logic requires a unique number for this class instance - * or (jclass,jobject loader) pair, this is done via the ClassIndex - * in hprof, which is passed in as the 'unsigned cnum' to java_crw_demo(). - * It's up to the user of this interface if it wants to use this - * feature. - * - */ - -#include -#include -#include - -/* Get Java and class file and bytecode information. */ - -#include - -#include "classfile_constants.h" - - -/* Include our own interface for cross check */ - -#include "java_crw_demo.h" - -/* Macros over error functions to capture line numbers */ - -/* Fatal error used in all builds. */ - -/* Use THIS_FILE when it is available. */ -#ifndef THIS_FILE - #define THIS_FILE "java_crw.demo.c" /* Never use __FILE__ */ -#endif - -#define CRW_FATAL(ci, message) fatal_error(ci, message, THIS_FILE, __LINE__) - -#if defined(DEBUG) || !defined(NDEBUG) - - /* This assert macro is only used in the debug builds. */ - #define CRW_ASSERT(ci, cond) \ - ((cond)?(void)0:assert_error(ci, #cond, THIS_FILE, __LINE__)) - -#else - - #define CRW_ASSERT(ci, cond) - -#endif - -#define CRW_ASSERT_MI(mi) CRW_ASSERT((mi)?(mi)->ci:NULL,(mi)!=NULL) - -#define CRW_ASSERT_CI(ci) CRW_ASSERT(ci, ( (ci) != NULL && \ - (ci)->input_position <= (ci)->input_len && \ - (ci)->output_position <= (ci)->output_len) ) - -#define BUFSIZE 256 - -#ifdef _WIN32 -#define snprintf(buffer, count, format, ...) _snprintf_s(buffer, count, _TRUNCATE, format, ##__VA_ARGS__) -#endif - -/* Typedefs for various integral numbers, just for code clarity */ - -typedef unsigned ClassOpcode; /* One opcode */ -typedef unsigned char ByteCode; /* One byte from bytecodes */ -typedef int ByteOffset; /* Byte offset */ -typedef int ClassConstant; /* Constant pool kind */ -typedef long CrwPosition; /* Position in class image */ -typedef unsigned short CrwCpoolIndex; /* Index into constant pool */ - -/* Misc support macros */ - -/* Given the position of an opcode, find the next 4byte boundary position */ -#define NEXT_4BYTE_BOUNDARY(opcode_pos) (((opcode_pos)+4) & (~3)) - -#define LARGEST_INJECTION (12*3) /* 3 injections at same site */ -#define MAXIMUM_NEW_CPOOL_ENTRIES 64 /* don't add more than 32 entries */ - -/* Constant Pool Entry (internal table that mirrors pool in file image) */ - -typedef struct { - const char * ptr; /* Pointer to any string */ - unsigned short len; /* Length of string */ - unsigned int index1; /* 1st 16 bit index or 32bit value. */ - unsigned int index2; /* 2nd 16 bit index or 32bit value. */ - ClassConstant tag; /* Tag or kind of entry. */ -} CrwConstantPoolEntry; - -struct MethodImage; - -/* Class file image storage structure */ - -typedef struct CrwClassImage { - - /* Unique class number for this class */ - unsigned number; - - /* Name of class, given or gotten out of class image */ - const char * name; - - /* Input and Output class images tracking */ - const unsigned char * input; - unsigned char * output; - CrwPosition input_len; - CrwPosition output_len; - CrwPosition input_position; - CrwPosition output_position; - - /* Mirrored constant pool */ - CrwConstantPoolEntry * cpool; - CrwCpoolIndex cpool_max_elements; /* Max count */ - CrwCpoolIndex cpool_count_plus_one; - - /* Input flags about class (e.g. is it a system class) */ - int system_class; - - /* Class access flags gotten from file. */ - unsigned access_flags; - - /* Names of classes and methods. */ - char* tclass_name; /* Name of class that has tracker methods. */ - char* tclass_sig; /* Signature of class */ - char* call_name; /* Method name to call at offset 0 */ - char* call_sig; /* Signature of this method */ - char* return_name; /* Method name to call before any return */ - char* return_sig; /* Signature of this method */ - char* obj_init_name; /* Method name to call in Object */ - char* obj_init_sig; /* Signature of this method */ - char* newarray_name; /* Method name to call after newarray opcodes */ - char* newarray_sig; /* Signature of this method */ - - /* Constant pool index values for new entries */ - CrwCpoolIndex tracker_class_index; - CrwCpoolIndex object_init_tracker_index; - CrwCpoolIndex newarray_tracker_index; - CrwCpoolIndex call_tracker_index; - CrwCpoolIndex return_tracker_index; - CrwCpoolIndex class_number_index; /* Class number in pool */ - - /* Count of injections made into this class */ - int injection_count; - - /* This class must be the java.lang.Object class */ - jboolean is_object_class; - - /* This class must be the java.lang.Thread class */ - jboolean is_thread_class; - - /* Callback functions */ - FatalErrorHandler fatal_error_handler; - MethodNumberRegister mnum_callback; - - /* Table of method names and descr's */ - int method_count; - const char ** method_name; - const char ** method_descr; - struct MethodImage * current_mi; - -} CrwClassImage; - -/* Injection bytecodes (holds injected bytecodes for each code position) */ - -typedef struct { - ByteCode * code; - ByteOffset len; -} Injection; - -/* Method transformation data (allocated/freed as each method is processed) */ - -typedef struct MethodImage { - - /* Back reference to Class image data. */ - CrwClassImage * ci; - - /* Unique method number for this class. */ - unsigned number; - - /* Method name and descr */ - const char * name; - const char * descr; - - /* Map of input bytecode offsets to output bytecode offsets */ - ByteOffset * map; - - /* Bytecode injections for each input bytecode offset */ - Injection * injections; - - /* Widening setting for each input bytecode offset */ - signed char * widening; - - /* Length of original input bytecodes, and new bytecodes. */ - ByteOffset code_len; - ByteOffset new_code_len; - - /* Location in input where bytecodes are located. */ - CrwPosition start_of_input_bytecodes; - - /* Original max_stack and new max stack */ - unsigned max_stack; - unsigned new_max_stack; - - jboolean object_init_method; - jboolean skip_call_return_sites; - - /* Method access flags gotten from file. */ - unsigned access_flags; - -} MethodImage; - -/* ----------------------------------------------------------------- */ -/* General support functions (memory and error handling) */ - -static void -fatal_error(CrwClassImage *ci, const char *message, const char *file, int line) -{ - if ( ci != NULL && ci->fatal_error_handler != NULL ) { - (*ci->fatal_error_handler)(message, file, line); - } else { - /* Normal operation should NEVER reach here */ - /* NO CRW FATAL ERROR HANDLER! */ - (void)fprintf(stderr, "CRW: %s [%s:%d]\n", message, file, line); - } - abort(); -} - -#if defined(DEBUG) || !defined(NDEBUG) -static void -assert_error(CrwClassImage *ci, const char *condition, - const char *file, int line) -{ - char buf[512]; - MethodImage *mi; - ByteOffset byte_code_offset; - - mi = ci->current_mi; - if ( mi != NULL ) { - byte_code_offset = (ByteOffset)(mi->ci->input_position - mi->start_of_input_bytecodes); - } else { - byte_code_offset=-1; - } - - (void)sprintf(buf, - "CRW ASSERTION FAILURE: %s (%s:%s:%d)", - condition, - ci->name==NULL?"?":ci->name, - (mi==NULL||mi->name==NULL)?"?":mi->name, - byte_code_offset); - fatal_error(ci, buf, file, line); -} -#endif - -static void * -allocate(CrwClassImage *ci, int nbytes) -{ - void * ptr; - - if ( nbytes <= 0 ) { - CRW_FATAL(ci, "Cannot allocate <= 0 bytes"); - } - ptr = malloc(nbytes); - if ( ptr == NULL ) { - CRW_FATAL(ci, "Ran out of malloc memory"); - } - return ptr; -} - -static void * -reallocate(CrwClassImage *ci, void *optr, int nbytes) -{ - void * ptr; - - if ( optr == NULL ) { - CRW_FATAL(ci, "Cannot deallocate NULL"); - } - if ( nbytes <= 0 ) { - CRW_FATAL(ci, "Cannot reallocate <= 0 bytes"); - } - ptr = realloc(optr, nbytes); - if ( ptr == NULL ) { - CRW_FATAL(ci, "Ran out of malloc memory"); - } - return ptr; -} - -static void * -allocate_clean(CrwClassImage *ci, int nbytes) -{ - void * ptr; - - if ( nbytes <= 0 ) { - CRW_FATAL(ci, "Cannot allocate <= 0 bytes"); - } - ptr = calloc(nbytes, 1); - if ( ptr == NULL ) { - CRW_FATAL(ci, "Ran out of malloc memory"); - } - return ptr; -} - -static const char * -duplicate(CrwClassImage *ci, const char *str, int len) -{ - char *copy; - - copy = (char*)allocate(ci, len+1); - (void)memcpy(copy, str, len); - copy[len] = 0; - return (const char *)copy; -} - -static void -deallocate(CrwClassImage *ci, void *ptr) -{ - if ( ptr == NULL ) { - CRW_FATAL(ci, "Cannot deallocate NULL"); - } - (void)free(ptr); -} - -/* ----------------------------------------------------------------- */ -/* Functions for reading/writing bytes to/from the class images */ - -static unsigned -readU1(CrwClassImage *ci) -{ - CRW_ASSERT_CI(ci); - return ((unsigned)(ci->input[ci->input_position++])) & 0xFF; -} - -static unsigned -readU2(CrwClassImage *ci) -{ - unsigned res; - - res = readU1(ci); - return (res << 8) + readU1(ci); -} - -static signed short -readS2(CrwClassImage *ci) -{ - unsigned res; - - res = readU1(ci); - return ((res << 8) + readU1(ci)) & 0xFFFF; -} - -static unsigned -readU4(CrwClassImage *ci) -{ - unsigned res; - - res = readU2(ci); - return (res << 16) + readU2(ci); -} - -static void -writeU1(CrwClassImage *ci, unsigned val) /* Only writes out lower 8 bits */ -{ - CRW_ASSERT_CI(ci); - if ( ci->output != NULL ) { - ci->output[ci->output_position++] = val & 0xFF; - } -} - -static void -writeU2(CrwClassImage *ci, unsigned val) -{ - writeU1(ci, val >> 8); - writeU1(ci, val); -} - -static void -writeU4(CrwClassImage *ci, unsigned val) -{ - writeU2(ci, val >> 16); - writeU2(ci, val); -} - -static unsigned -copyU1(CrwClassImage *ci) -{ - unsigned value; - - value = readU1(ci); - writeU1(ci, value); - return value; -} - -static unsigned -copyU2(CrwClassImage *ci) -{ - unsigned value; - - value = readU2(ci); - writeU2(ci, value); - return value; -} - -static unsigned -copyU4(CrwClassImage *ci) -{ - unsigned value; - - value = readU4(ci); - writeU4(ci, value); - return value; -} - -static void -copy(CrwClassImage *ci, unsigned count) -{ - CRW_ASSERT_CI(ci); - if ( ci->output != NULL ) { - (void)memcpy(ci->output+ci->output_position, - ci->input+ci->input_position, count); - ci->output_position += count; - } - ci->input_position += count; - CRW_ASSERT_CI(ci); -} - -static void -skip(CrwClassImage *ci, unsigned count) -{ - CRW_ASSERT_CI(ci); - ci->input_position += count; -} - -static void -read_bytes(CrwClassImage *ci, void *bytes, unsigned count) -{ - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, bytes!=NULL); - (void)memcpy(bytes, ci->input+ci->input_position, count); - ci->input_position += count; -} - -static void -write_bytes(CrwClassImage *ci, void *bytes, unsigned count) -{ - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, bytes!=NULL); - if ( ci->output != NULL ) { - (void)memcpy(ci->output+ci->output_position, bytes, count); - ci->output_position += count; - } -} - -static void -random_writeU2(CrwClassImage *ci, CrwPosition pos, unsigned val) -{ - CrwPosition save_position; - - CRW_ASSERT_CI(ci); - save_position = ci->output_position; - ci->output_position = pos; - writeU2(ci, val); - ci->output_position = save_position; -} - -static void -random_writeU4(CrwClassImage *ci, CrwPosition pos, unsigned val) -{ - CrwPosition save_position; - - CRW_ASSERT_CI(ci); - save_position = ci->output_position; - ci->output_position = pos; - writeU4(ci, val); - ci->output_position = save_position; -} - -/* ----------------------------------------------------------------- */ -/* Constant Pool handling functions. */ - -static void -fillin_cpool_entry(CrwClassImage *ci, CrwCpoolIndex i, - ClassConstant tag, - unsigned int index1, unsigned int index2, - const char *ptr, int len) -{ - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, i > 0 && i < ci->cpool_count_plus_one); - ci->cpool[i].tag = tag; - ci->cpool[i].index1 = index1; - ci->cpool[i].index2 = index2; - ci->cpool[i].ptr = ptr; - ci->cpool[i].len = (unsigned short)len; -} - -static CrwCpoolIndex -add_new_cpool_entry(CrwClassImage *ci, ClassConstant tag, - unsigned int index1, unsigned int index2, - const char *str, int len) -{ - CrwCpoolIndex i; - char *utf8 = NULL; - - CRW_ASSERT_CI(ci); - i = ci->cpool_count_plus_one++; - - /* NOTE: This implementation does not automatically expand the - * constant pool table beyond the expected number needed - * to handle this particular CrwTrackerInterface injections. - * See MAXIMUM_NEW_CPOOL_ENTRIES - */ - CRW_ASSERT(ci, ci->cpool_count_plus_one < ci->cpool_max_elements ); - - writeU1(ci, tag); - switch (tag) { - case JVM_CONSTANT_Class: - writeU2(ci, index1); - break; - case JVM_CONSTANT_String: - writeU2(ci, index1); - break; - case JVM_CONSTANT_Fieldref: - case JVM_CONSTANT_Methodref: - case JVM_CONSTANT_InterfaceMethodref: - case JVM_CONSTANT_Integer: - case JVM_CONSTANT_Float: - case JVM_CONSTANT_NameAndType: - writeU2(ci, index1); - writeU2(ci, index2); - break; - case JVM_CONSTANT_Long: - case JVM_CONSTANT_Double: - writeU4(ci, index1); - writeU4(ci, index2); - ci->cpool_count_plus_one++; - CRW_ASSERT(ci, ci->cpool_count_plus_one < ci->cpool_max_elements ); - break; - case JVM_CONSTANT_Utf8: - CRW_ASSERT(ci, len==(len & 0xFFFF)); - writeU2(ci, len); - write_bytes(ci, (void*)str, len); - utf8 = (char*)duplicate(ci, str, len); - break; - default: - CRW_FATAL(ci, "Unknown constant"); - break; - } - fillin_cpool_entry(ci, i, tag, index1, index2, (const char *)utf8, len); - CRW_ASSERT(ci, i > 0 && i < ci->cpool_count_plus_one); - return i; -} - -static CrwCpoolIndex -add_new_class_cpool_entry(CrwClassImage *ci, const char *class_name) -{ - CrwCpoolIndex name_index; - CrwCpoolIndex class_index; - int len; - - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, class_name!=NULL); - - len = (int)strlen(class_name); - name_index = add_new_cpool_entry(ci, JVM_CONSTANT_Utf8, len, 0, - class_name, len); - class_index = add_new_cpool_entry(ci, JVM_CONSTANT_Class, name_index, 0, - NULL, 0); - return class_index; -} - -static CrwCpoolIndex -add_new_method_cpool_entry(CrwClassImage *ci, CrwCpoolIndex class_index, - const char *name, const char *descr) -{ - CrwCpoolIndex name_index; - CrwCpoolIndex descr_index; - CrwCpoolIndex name_type_index; - int len; - - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, name!=NULL); - CRW_ASSERT(ci, descr!=NULL); - len = (int)strlen(name); - name_index = - add_new_cpool_entry(ci, JVM_CONSTANT_Utf8, len, 0, name, len); - len = (int)strlen(descr); - descr_index = - add_new_cpool_entry(ci, JVM_CONSTANT_Utf8, len, 0, descr, len); - name_type_index = - add_new_cpool_entry(ci, JVM_CONSTANT_NameAndType, - name_index, descr_index, NULL, 0); - return add_new_cpool_entry(ci, JVM_CONSTANT_Methodref, - class_index, name_type_index, NULL, 0); -} - -static CrwConstantPoolEntry -cpool_entry(CrwClassImage *ci, CrwCpoolIndex c_index) -{ - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, c_index > 0 && c_index < ci->cpool_count_plus_one); - return ci->cpool[c_index]; -} - -static void -cpool_setup(CrwClassImage *ci) -{ - CrwCpoolIndex i; - CrwPosition cpool_output_position; - int count_plus_one; - - CRW_ASSERT_CI(ci); - cpool_output_position = ci->output_position; - count_plus_one = copyU2(ci); - CRW_ASSERT(ci, count_plus_one>1); - ci->cpool_max_elements = count_plus_one+MAXIMUM_NEW_CPOOL_ENTRIES; - ci->cpool = (CrwConstantPoolEntry*)allocate_clean(ci, - (int)((ci->cpool_max_elements)*sizeof(CrwConstantPoolEntry))); - ci->cpool_count_plus_one = (CrwCpoolIndex)count_plus_one; - - /* Index zero not in class file */ - for (i = 1; i < count_plus_one; ++i) { - CrwCpoolIndex ipos; - ClassConstant tag; - unsigned int index1; - unsigned int index2; - unsigned len; - char * utf8; - char message[BUFSIZE]; - - ipos = i; - index1 = 0; - index2 = 0; - len = 0; - utf8 = NULL; - - tag = copyU1(ci); - switch (tag) { - case JVM_CONSTANT_Class: - index1 = copyU2(ci); - break; - case JVM_CONSTANT_String: - index1 = copyU2(ci); - break; - case JVM_CONSTANT_Fieldref: - case JVM_CONSTANT_Methodref: - case JVM_CONSTANT_InterfaceMethodref: - case JVM_CONSTANT_Integer: - case JVM_CONSTANT_Float: - case JVM_CONSTANT_NameAndType: - index1 = copyU2(ci); - index2 = copyU2(ci); - break; - case JVM_CONSTANT_Long: - case JVM_CONSTANT_Double: - index1 = copyU4(ci); - index2 = copyU4(ci); - ++i; /* // these take two CP entries - duh! */ - break; - case JVM_CONSTANT_Utf8: - len = copyU2(ci); - index1 = (unsigned short)len; - utf8 = (char*)allocate(ci, len+1); - read_bytes(ci, (void*)utf8, len); - utf8[len] = 0; - write_bytes(ci, (void*)utf8, len); - break; - case JVM_CONSTANT_MethodType: - index1 = copyU2(ci); - break; - case JVM_CONSTANT_MethodHandle: - index1 = copyU1(ci); - index2 = copyU2(ci); - break; - case JVM_CONSTANT_InvokeDynamic: - index1 = copyU2(ci); - index2 = copyU2(ci); - break; - default: - snprintf(message, BUFSIZE, "Unknown tag: %d, at ipos %hu", tag, ipos); - CRW_FATAL(ci, message); - break; - } - fillin_cpool_entry(ci, ipos, tag, index1, index2, (const char *)utf8, len); - } - - if (ci->call_name != NULL || ci->return_name != NULL) { - if ( ci->number != (ci->number & 0x7FFF) ) { - ci->class_number_index = - add_new_cpool_entry(ci, JVM_CONSTANT_Integer, - (ci->number>>16) & 0xFFFF, ci->number & 0xFFFF, NULL, 0); - } - } - - if ( ci->tclass_name != NULL ) { - ci->tracker_class_index = - add_new_class_cpool_entry(ci, ci->tclass_name); - } - if (ci->obj_init_name != NULL) { - ci->object_init_tracker_index = add_new_method_cpool_entry(ci, - ci->tracker_class_index, - ci->obj_init_name, - ci->obj_init_sig); - } - if (ci->newarray_name != NULL) { - ci->newarray_tracker_index = add_new_method_cpool_entry(ci, - ci->tracker_class_index, - ci->newarray_name, - ci->newarray_sig); - } - if (ci->call_name != NULL) { - ci->call_tracker_index = add_new_method_cpool_entry(ci, - ci->tracker_class_index, - ci->call_name, - ci->call_sig); - } - if (ci->return_name != NULL) { - ci->return_tracker_index = add_new_method_cpool_entry(ci, - ci->tracker_class_index, - ci->return_name, - ci->return_sig); - } - - random_writeU2(ci, cpool_output_position, ci->cpool_count_plus_one); -} - -/* ----------------------------------------------------------------- */ -/* Functions that create the bytecodes to inject */ - -static ByteOffset -push_pool_constant_bytecodes(ByteCode *bytecodes, CrwCpoolIndex index) -{ - ByteOffset nbytes = 0; - - if ( index == (index&0x7F) ) { - bytecodes[nbytes++] = (ByteCode)JVM_OPC_ldc; - } else { - bytecodes[nbytes++] = (ByteCode)JVM_OPC_ldc_w; - bytecodes[nbytes++] = (ByteCode)((index >> 8) & 0xFF); - } - bytecodes[nbytes++] = (ByteCode)(index & 0xFF); - return nbytes; -} - -static ByteOffset -push_short_constant_bytecodes(ByteCode *bytecodes, unsigned number) -{ - ByteOffset nbytes = 0; - - if ( number <= 5 ) { - bytecodes[nbytes++] = (ByteCode)(JVM_OPC_iconst_0+number); - } else if ( number == (number&0x7F) ) { - bytecodes[nbytes++] = (ByteCode)JVM_OPC_bipush; - bytecodes[nbytes++] = (ByteCode)(number & 0xFF); - } else { - bytecodes[nbytes++] = (ByteCode)JVM_OPC_sipush; - bytecodes[nbytes++] = (ByteCode)((number >> 8) & 0xFF); - bytecodes[nbytes++] = (ByteCode)(number & 0xFF); - } - return nbytes; -} - -static ByteOffset -injection_template(MethodImage *mi, ByteCode *bytecodes, ByteOffset max_nbytes, - CrwCpoolIndex method_index) -{ - CrwClassImage * ci; - ByteOffset nbytes = 0; - unsigned max_stack; - int add_dup; - int add_aload; - int push_cnum; - int push_mnum; - - ci = mi->ci; - - CRW_ASSERT(ci, bytecodes!=NULL); - - if ( method_index == 0 ) { - return 0; - } - - if ( method_index == ci->newarray_tracker_index) { - max_stack = mi->max_stack + 1; - add_dup = JNI_TRUE; - add_aload = JNI_FALSE; - push_cnum = JNI_FALSE; - push_mnum = JNI_FALSE; - } else if ( method_index == ci->object_init_tracker_index) { - max_stack = mi->max_stack + 1; - add_dup = JNI_FALSE; - add_aload = JNI_TRUE; - push_cnum = JNI_FALSE; - push_mnum = JNI_FALSE; - } else { - max_stack = mi->max_stack + 2; - add_dup = JNI_FALSE; - add_aload = JNI_FALSE; - push_cnum = JNI_TRUE; - push_mnum = JNI_TRUE; - } - - if ( add_dup ) { - bytecodes[nbytes++] = (ByteCode)JVM_OPC_dup; - } - if ( add_aload ) { - bytecodes[nbytes++] = (ByteCode)JVM_OPC_aload_0; - } - if ( push_cnum ) { - if ( ci->number == (ci->number & 0x7FFF) ) { - nbytes += push_short_constant_bytecodes(bytecodes+nbytes, - ci->number); - } else { - CRW_ASSERT(ci, ci->class_number_index!=0); - nbytes += push_pool_constant_bytecodes(bytecodes+nbytes, - ci->class_number_index); - } - } - if ( push_mnum ) { - nbytes += push_short_constant_bytecodes(bytecodes+nbytes, - mi->number); - } - bytecodes[nbytes++] = (ByteCode)JVM_OPC_invokestatic; - bytecodes[nbytes++] = (ByteCode)(method_index >> 8); - bytecodes[nbytes++] = (ByteCode)method_index; - bytecodes[nbytes] = 0; - CRW_ASSERT(ci, nbytes mi->new_max_stack ) { - mi->new_max_stack = max_stack; - } - return nbytes; -} - -/* Called to create injection code at entry to a method */ -static ByteOffset -entry_injection_code(MethodImage *mi, ByteCode *bytecodes, ByteOffset len) -{ - CrwClassImage * ci; - ByteOffset nbytes = 0; - - CRW_ASSERT_MI(mi); - - ci = mi->ci; - - if ( mi->object_init_method ) { - nbytes = injection_template(mi, - bytecodes, len, ci->object_init_tracker_index); - } - if ( !mi->skip_call_return_sites ) { - nbytes += injection_template(mi, - bytecodes+nbytes, len-nbytes, ci->call_tracker_index); - } - return nbytes; -} - -/* Called to create injection code before an opcode */ -static ByteOffset -before_injection_code(MethodImage *mi, ClassOpcode opcode, - ByteCode *bytecodes, ByteOffset len) -{ - ByteOffset nbytes = 0; - - - CRW_ASSERT_MI(mi); - switch ( opcode ) { - case JVM_OPC_return: - case JVM_OPC_ireturn: - case JVM_OPC_lreturn: - case JVM_OPC_freturn: - case JVM_OPC_dreturn: - case JVM_OPC_areturn: - if ( !mi->skip_call_return_sites ) { - nbytes = injection_template(mi, - bytecodes, len, mi->ci->return_tracker_index); - } - break; - default: - break; - } - return nbytes; -} - -/* Called to create injection code after an opcode */ -static ByteOffset -after_injection_code(MethodImage *mi, ClassOpcode opcode, - ByteCode *bytecodes, ByteOffset len) -{ - CrwClassImage* ci; - ByteOffset nbytes; - - ci = mi->ci; - nbytes = 0; - - CRW_ASSERT_MI(mi); - switch ( opcode ) { - case JVM_OPC_new: - /* Can't inject here cannot pass around uninitialized object */ - break; - case JVM_OPC_newarray: - case JVM_OPC_anewarray: - case JVM_OPC_multianewarray: - nbytes = injection_template(mi, - bytecodes, len, ci->newarray_tracker_index); - break; - default: - break; - } - return nbytes; -} - -/* Actually inject the bytecodes */ -static void -inject_bytecodes(MethodImage *mi, ByteOffset at, - ByteCode *bytecodes, ByteOffset len) -{ - Injection injection; - CrwClassImage *ci; - - ci = mi->ci; - CRW_ASSERT_MI(mi); - CRW_ASSERT(ci, at <= mi->code_len); - - injection = mi->injections[at]; - - CRW_ASSERT(ci, len <= LARGEST_INJECTION/2); - CRW_ASSERT(ci, injection.len+len <= LARGEST_INJECTION); - - /* Either start an injection area or concatenate to what is there */ - if ( injection.code == NULL ) { - CRW_ASSERT(ci, injection.len==0); - injection.code = (ByteCode *)allocate_clean(ci, LARGEST_INJECTION+1); - } - - (void)memcpy(injection.code+injection.len, bytecodes, len); - injection.len += len; - injection.code[injection.len] = 0; - mi->injections[at] = injection; - ci->injection_count++; -} - -/* ----------------------------------------------------------------- */ -/* Method handling functions */ - -static MethodImage * -method_init(CrwClassImage *ci, unsigned mnum, ByteOffset code_len) -{ - MethodImage * mi; - ByteOffset i; - - mi = (MethodImage*)allocate_clean(ci, (int)sizeof(MethodImage)); - mi->ci = ci; - mi->name = ci->method_name[mnum]; - mi->descr = ci->method_descr[mnum]; - mi->code_len = code_len; - mi->map = (ByteOffset*)allocate_clean(ci, - (int)((code_len+1)*sizeof(ByteOffset))); - for(i=0; i<=code_len; i++) { - mi->map[i] = i; - } - mi->widening = (signed char*)allocate_clean(ci, code_len+1); - mi->injections = (Injection *)allocate_clean(ci, - (int)((code_len+1)*sizeof(Injection))); - mi->number = mnum; - ci->current_mi = mi; - return mi; -} - -static void -method_term(MethodImage *mi) -{ - CrwClassImage *ci; - - ci = mi->ci; - CRW_ASSERT_MI(mi); - if ( mi->map != NULL ) { - deallocate(ci, (void*)mi->map); - mi->map = NULL; - } - if ( mi->widening != NULL ) { - deallocate(ci, (void*)mi->widening); - mi->widening = NULL; - } - if ( mi->injections != NULL ) { - ByteOffset i; - for(i=0; i<= mi->code_len; i++) { - if ( mi->injections[i].code != NULL ) { - deallocate(ci, (void*)mi->injections[i].code); - mi->injections[i].code = NULL; - } - } - deallocate(ci, (void*)mi->injections); - mi->injections = NULL; - } - ci->current_mi = NULL; - deallocate(ci, (void*)mi); -} - -static ByteOffset -input_code_offset(MethodImage *mi) -{ - CRW_ASSERT_MI(mi); - return (ByteOffset)(mi->ci->input_position - mi->start_of_input_bytecodes); -} - -static void -rewind_to_beginning_of_input_bytecodes(MethodImage *mi) -{ - CRW_ASSERT_MI(mi); - mi->ci->input_position = mi->start_of_input_bytecodes; -} - -/* Starting at original byte position 'at', add 'offset' to it's new - * location. This may be a negative value. - * NOTE: That this map is not the new bytecode location of the opcode - * but the new bytecode location that should be used when - * a goto or jump instruction was targeting the old bytecode - * location. - */ -static void -adjust_map(MethodImage *mi, ByteOffset at, ByteOffset offset) -{ - ByteOffset i; - - CRW_ASSERT_MI(mi); - for (i = at; i <= mi->code_len; ++i) { - mi->map[i] += offset; - } -} - -static void -widen(MethodImage *mi, ByteOffset at, ByteOffset len) -{ - int delta; - - CRW_ASSERT(mi->ci, at <= mi->code_len); - delta = len - mi->widening[at]; - /* Adjust everything from the current input location by delta */ - adjust_map(mi, input_code_offset(mi), delta); - /* Mark at beginning of instruction */ - mi->widening[at] = (signed char)len; -} - -static void -verify_opc_wide(CrwClassImage *ci, ClassOpcode wopcode) -{ - switch (wopcode) { - case JVM_OPC_aload: case JVM_OPC_astore: - case JVM_OPC_fload: case JVM_OPC_fstore: - case JVM_OPC_iload: case JVM_OPC_istore: - case JVM_OPC_lload: case JVM_OPC_lstore: - case JVM_OPC_dload: case JVM_OPC_dstore: - case JVM_OPC_ret: case JVM_OPC_iinc: - break; - default: - CRW_FATAL(ci, "Invalid opcode supplied to wide opcode"); - break; - } -} - -static unsigned -opcode_length(CrwClassImage *ci, ClassOpcode opcode) -{ - /* Define array that holds length of an opcode */ - static unsigned char _opcode_length[JVM_OPC_MAX+1] = - JVM_OPCODE_LENGTH_INITIALIZER; - - if ( opcode > JVM_OPC_MAX ) { - CRW_FATAL(ci, "Invalid opcode supplied to opcode_length()"); - } - return _opcode_length[opcode]; -} - -/* Walk one instruction and inject instrumentation */ -static void -inject_for_opcode(MethodImage *mi) -{ - CrwClassImage * ci; - ClassOpcode opcode; - int pos; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - pos = input_code_offset(mi); - opcode = readU1(ci); - - if (opcode == JVM_OPC_wide) { - ClassOpcode wopcode; - - wopcode = readU1(ci); - /* lvIndex not used */ - (void)readU2(ci); - verify_opc_wide(ci, wopcode); - if ( wopcode==JVM_OPC_iinc ) { - (void)readU1(ci); - (void)readU1(ci); - } - } else { - - ByteCode bytecodes[LARGEST_INJECTION+1]; - int header; - int instr_len; - int low; - int high; - int npairs; - ByteOffset len; - - /* Get bytecodes to inject before this opcode */ - len = before_injection_code(mi, opcode, bytecodes, (int)sizeof(bytecodes)); - if ( len > 0 ) { - inject_bytecodes(mi, pos, bytecodes, len); - /* Adjust map after processing this opcode */ - } - - /* Process this opcode */ - switch (opcode) { - case JVM_OPC_tableswitch: - header = NEXT_4BYTE_BOUNDARY(pos); - skip(ci, header - (pos+1)); - (void)readU4(ci); - low = readU4(ci); - high = readU4(ci); - skip(ci, (high+1-low) * 4); - break; - case JVM_OPC_lookupswitch: - header = NEXT_4BYTE_BOUNDARY(pos); - skip(ci, header - (pos+1)); - (void)readU4(ci); - npairs = readU4(ci); - skip(ci, npairs * 8); - break; - default: - instr_len = opcode_length(ci, opcode); - skip(ci, instr_len-1); - break; - } - - /* Get position after this opcode is processed */ - pos = input_code_offset(mi); - - /* Adjust for any before_injection_code() */ - if ( len > 0 ) { - /* Adjust everything past this opcode. - * Why past it? Because we want any jumps to this bytecode loc - * to go to the injected code, not where the opcode - * was moved too. - * Consider a 'return' opcode that is jumped too. - * NOTE: This may not be correct in all cases, but will - * when we are only dealing with non-variable opcodes - * like the return opcodes. Be careful if the - * before_injection_code() changes to include other - * opcodes that have variable length. - */ - adjust_map(mi, pos, len); - } - - /* Get bytecodes to inject after this opcode */ - len = after_injection_code(mi, opcode, bytecodes, (int)sizeof(bytecodes)); - if ( len > 0 ) { - inject_bytecodes(mi, pos, bytecodes, len); - - /* Adjust for any after_injection_code() */ - adjust_map(mi, pos, len); - } - - } -} - -/* Map original bytecode location to it's new location. (See adjust_map()). */ -static ByteOffset -method_code_map(MethodImage *mi, ByteOffset pos) -{ - CRW_ASSERT_MI(mi); - CRW_ASSERT(mi->ci, pos <= mi->code_len); - return mi->map[pos]; -} - -static int -adjust_instruction(MethodImage *mi) -{ - CrwClassImage * ci; - ClassOpcode opcode; - int pos; - int new_pos; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - pos = input_code_offset(mi); - new_pos = method_code_map(mi,pos); - - opcode = readU1(ci); - - if (opcode == JVM_OPC_wide) { - ClassOpcode wopcode; - - wopcode = readU1(ci); - /* lvIndex not used */ - (void)readU2(ci); - verify_opc_wide(ci, wopcode); - if ( wopcode==JVM_OPC_iinc ) { - (void)readU1(ci); - (void)readU1(ci); - } - } else { - - int widened; - int header; - int newHeader; - int low; - int high; - int new_pad; - int old_pad; - int delta; - int new_delta; - int delta_pad; - int npairs; - int instr_len; - - switch (opcode) { - - case JVM_OPC_tableswitch: - widened = mi->widening[pos]; - header = NEXT_4BYTE_BOUNDARY(pos); - newHeader = NEXT_4BYTE_BOUNDARY(new_pos); - - skip(ci, header - (pos+1)); - - delta = readU4(ci); - low = readU4(ci); - high = readU4(ci); - skip(ci, (high+1-low) * 4); - new_pad = newHeader - new_pos; - old_pad = header - pos; - delta_pad = new_pad - old_pad; - if (widened != delta_pad) { - widen(mi, pos, delta_pad); - return 0; - } - break; - - case JVM_OPC_lookupswitch: - widened = mi->widening[pos]; - header = NEXT_4BYTE_BOUNDARY(pos); - newHeader = NEXT_4BYTE_BOUNDARY(new_pos); - - skip(ci, header - (pos+1)); - - delta = readU4(ci); - npairs = readU4(ci); - skip(ci, npairs * 8); - new_pad = newHeader - new_pos; - old_pad = header - pos; - delta_pad = new_pad - old_pad; - if (widened != delta_pad) { - widen(mi, pos, delta_pad); - return 0; - } - break; - - case JVM_OPC_jsr: case JVM_OPC_goto: - case JVM_OPC_ifeq: case JVM_OPC_ifge: case JVM_OPC_ifgt: - case JVM_OPC_ifle: case JVM_OPC_iflt: case JVM_OPC_ifne: - case JVM_OPC_if_icmpeq: case JVM_OPC_if_icmpne: case JVM_OPC_if_icmpge: - case JVM_OPC_if_icmpgt: case JVM_OPC_if_icmple: case JVM_OPC_if_icmplt: - case JVM_OPC_if_acmpeq: case JVM_OPC_if_acmpne: - case JVM_OPC_ifnull: case JVM_OPC_ifnonnull: - widened = mi->widening[pos]; - delta = readS2(ci); - if (widened == 0) { - new_delta = method_code_map(mi,pos+delta) - new_pos; - if ((new_delta < -32768) || (new_delta > 32767)) { - switch (opcode) { - case JVM_OPC_jsr: case JVM_OPC_goto: - widen(mi, pos, 2); - break; - default: - widen(mi, pos, 5); - break; - } - return 0; - } - } - break; - - case JVM_OPC_jsr_w: - case JVM_OPC_goto_w: - (void)readU4(ci); - break; - - default: - instr_len = opcode_length(ci, opcode); - skip(ci, instr_len-1); - break; - } - } - return 1; -} - -static void -write_instruction(MethodImage *mi) -{ - CrwClassImage * ci; - ClassOpcode opcode; - ByteOffset new_code_len; - int pos; - int new_pos; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - pos = input_code_offset(mi); - new_pos = method_code_map(mi,pos); - new_code_len = mi->injections[pos].len; - if (new_code_len > 0) { - write_bytes(ci, (void*)mi->injections[pos].code, new_code_len); - } - - opcode = readU1(ci); - if (opcode == JVM_OPC_wide) { - ClassOpcode wopcode; - - writeU1(ci, opcode); - - wopcode = copyU1(ci); - /* lvIndex not used */ - (void)copyU2(ci); - verify_opc_wide(ci, wopcode); - if ( wopcode==JVM_OPC_iinc ) { - (void)copyU1(ci); - (void)copyU1(ci); - } - } else { - - ClassOpcode new_opcode; - int header; - int newHeader; - int low; - int high; - int i; - int npairs; - int widened; - int instr_len; - int delta; - int new_delta; - - switch (opcode) { - - case JVM_OPC_tableswitch: - header = NEXT_4BYTE_BOUNDARY(pos); - newHeader = NEXT_4BYTE_BOUNDARY(new_pos); - - skip(ci, header - (pos+1)); - - delta = readU4(ci); - new_delta = method_code_map(mi,pos+delta) - new_pos; - low = readU4(ci); - high = readU4(ci); - - writeU1(ci, opcode); - for (i = new_pos+1; i < newHeader; ++i) { - writeU1(ci, 0); - } - writeU4(ci, new_delta); - writeU4(ci, low); - writeU4(ci, high); - - for (i = low; i <= high; ++i) { - delta = readU4(ci); - new_delta = method_code_map(mi,pos+delta) - new_pos; - writeU4(ci, new_delta); - } - break; - - case JVM_OPC_lookupswitch: - header = NEXT_4BYTE_BOUNDARY(pos); - newHeader = NEXT_4BYTE_BOUNDARY(new_pos); - - skip(ci, header - (pos+1)); - - delta = readU4(ci); - new_delta = method_code_map(mi,pos+delta) - new_pos; - npairs = readU4(ci); - writeU1(ci, opcode); - for (i = new_pos+1; i < newHeader; ++i) { - writeU1(ci, 0); - } - writeU4(ci, new_delta); - writeU4(ci, npairs); - for (i = 0; i< npairs; ++i) { - unsigned match = readU4(ci); - delta = readU4(ci); - new_delta = method_code_map(mi,pos+delta) - new_pos; - writeU4(ci, match); - writeU4(ci, new_delta); - } - break; - - case JVM_OPC_jsr: case JVM_OPC_goto: - case JVM_OPC_ifeq: case JVM_OPC_ifge: case JVM_OPC_ifgt: - case JVM_OPC_ifle: case JVM_OPC_iflt: case JVM_OPC_ifne: - case JVM_OPC_if_icmpeq: case JVM_OPC_if_icmpne: case JVM_OPC_if_icmpge: - case JVM_OPC_if_icmpgt: case JVM_OPC_if_icmple: case JVM_OPC_if_icmplt: - case JVM_OPC_if_acmpeq: case JVM_OPC_if_acmpne: - case JVM_OPC_ifnull: case JVM_OPC_ifnonnull: - widened = mi->widening[pos]; - delta = readS2(ci); - new_delta = method_code_map(mi,pos+delta) - new_pos; - new_opcode = opcode; - if (widened == 0) { - writeU1(ci, opcode); - writeU2(ci, new_delta); - } else if (widened == 2) { - switch (opcode) { - case JVM_OPC_jsr: - new_opcode = JVM_OPC_jsr_w; - break; - case JVM_OPC_goto: - new_opcode = JVM_OPC_goto_w; - break; - default: - CRW_FATAL(ci, "unexpected opcode"); - break; - } - writeU1(ci, new_opcode); - writeU4(ci, new_delta); - } else if (widened == 5) { - switch (opcode) { - case JVM_OPC_ifeq: - new_opcode = JVM_OPC_ifne; - break; - case JVM_OPC_ifge: - new_opcode = JVM_OPC_iflt; - break; - case JVM_OPC_ifgt: - new_opcode = JVM_OPC_ifle; - break; - case JVM_OPC_ifle: - new_opcode = JVM_OPC_ifgt; - break; - case JVM_OPC_iflt: - new_opcode = JVM_OPC_ifge; - break; - case JVM_OPC_ifne: - new_opcode = JVM_OPC_ifeq; - break; - case JVM_OPC_if_icmpeq: - new_opcode = JVM_OPC_if_icmpne; - break; - case JVM_OPC_if_icmpne: - new_opcode = JVM_OPC_if_icmpeq; - break; - case JVM_OPC_if_icmpge: - new_opcode = JVM_OPC_if_icmplt; - break; - case JVM_OPC_if_icmpgt: - new_opcode = JVM_OPC_if_icmple; - break; - case JVM_OPC_if_icmple: - new_opcode = JVM_OPC_if_icmpgt; - break; - case JVM_OPC_if_icmplt: - new_opcode = JVM_OPC_if_icmpge; - break; - case JVM_OPC_if_acmpeq: - new_opcode = JVM_OPC_if_acmpne; - break; - case JVM_OPC_if_acmpne: - new_opcode = JVM_OPC_if_acmpeq; - break; - case JVM_OPC_ifnull: - new_opcode = JVM_OPC_ifnonnull; - break; - case JVM_OPC_ifnonnull: - new_opcode = JVM_OPC_ifnull; - break; - default: - CRW_FATAL(ci, "Unexpected opcode"); - break; - } - writeU1(ci, new_opcode); /* write inverse branch */ - writeU2(ci, 3 + 5); /* beyond if and goto_w */ - writeU1(ci, JVM_OPC_goto_w); /* add a goto_w */ - writeU4(ci, new_delta-3); /* write new and wide delta */ - } else { - CRW_FATAL(ci, "Unexpected widening"); - } - break; - - case JVM_OPC_jsr_w: - case JVM_OPC_goto_w: - delta = readU4(ci); - new_delta = method_code_map(mi,pos+delta) - new_pos; - writeU1(ci, opcode); - writeU4(ci, new_delta); - break; - - default: - instr_len = opcode_length(ci, opcode); - writeU1(ci, opcode); - copy(ci, instr_len-1); - break; - } - } -} - -static void -method_inject_and_write_code(MethodImage *mi) -{ - ByteCode bytecodes[LARGEST_INJECTION+1]; - ByteOffset len; - - CRW_ASSERT_MI(mi); - - /* Do injections */ - rewind_to_beginning_of_input_bytecodes(mi); - len = entry_injection_code(mi, bytecodes, (int)sizeof(bytecodes)); - if ( len > 0 ) { - int pos; - - pos = 0; - inject_bytecodes(mi, pos, bytecodes, len); - /* Adjust pos 0 to map to new pos 0, you never want to - * jump into this entry code injection. So the new pos 0 - * will be past this entry_injection_code(). - */ - adjust_map(mi, pos, len); /* Inject before behavior */ - } - while (input_code_offset(mi) < mi->code_len) { - inject_for_opcode(mi); - } - - /* Adjust instructions */ - rewind_to_beginning_of_input_bytecodes(mi); - while (input_code_offset(mi) < mi->code_len) { - if (!adjust_instruction(mi)) { - rewind_to_beginning_of_input_bytecodes(mi); - } - } - - /* Write new instructions */ - rewind_to_beginning_of_input_bytecodes(mi); - while (input_code_offset(mi) < mi->code_len) { - write_instruction(mi); - } -} - -static void -copy_attribute(CrwClassImage *ci) -{ - int len; - - (void)copyU2(ci); - len = copyU4(ci); - copy(ci, len); -} - -static void -copy_attributes(CrwClassImage *ci) -{ - unsigned i; - unsigned count; - - count = copyU2(ci); - for (i = 0; i < count; ++i) { - copy_attribute(ci); - } -} - -static void -copy_all_fields(CrwClassImage *ci) -{ - unsigned i; - unsigned count; - - count = copyU2(ci); - for (i = 0; i < count; ++i) { - /* access, name, descriptor */ - copy(ci, 6); - copy_attributes(ci); - } -} - -static void -write_line_table(MethodImage *mi) -{ - unsigned i; - unsigned count; - CrwClassImage * ci; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - (void)copyU4(ci); - count = copyU2(ci); - for(i=0; ici; - (void)copyU4(ci); - count = copyU2(ci); - for(i=0; icode_len > 65535 ) { - return readU4(mi->ci); - } - return readU2(mi->ci); -} - -static void -writeUoffset(MethodImage *mi, unsigned val) -{ - if ( mi->new_code_len > 65535 ) { - writeU4(mi->ci, val); - } - writeU2(mi->ci, val); -} - -static unsigned -copyUoffset(MethodImage *mi) -{ - unsigned uoffset; - - uoffset = readUoffset(mi); - writeUoffset(mi, uoffset); - return uoffset; -} - -/* Copy over verification_type_info structure */ -static void -copy_verification_types(MethodImage *mi, int ntypes) -{ - /* If there were ntypes, we just copy that over, no changes */ - if ( ntypes > 0 ) { - int j; - - for ( j = 0 ; j < ntypes ; j++ ) { - unsigned tag; - - tag = copyU1(mi->ci); - switch ( tag ) { - case JVM_ITEM_Object: - (void)copyU2(mi->ci); /* Constant pool entry */ - break; - case JVM_ITEM_Uninitialized: - /* Code offset for 'new' opcode is for this object */ - writeUoffset(mi, method_code_map(mi, readUoffset(mi))); - break; - } - } - } -} - -/* Process the StackMapTable attribute. We didn't add any basic blocks - * so the frame count remains the same but we may need to process the - * frame types due to offset changes putting things out of range. - */ -static void -write_stackmap_table(MethodImage *mi) -{ - CrwClassImage *ci; - CrwPosition save_position; - ByteOffset last_pc; - ByteOffset last_new_pc; - unsigned i; - unsigned attr_len; - unsigned new_attr_len; - unsigned count; - unsigned delta_adj; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - - /* Save the position of the attribute length so we can fix it later */ - save_position = ci->output_position; - attr_len = copyU4(ci); - count = copyUoffset(mi); /* uoffset: number_of_entries */ - if ( count == 0 ) { - CRW_ASSERT(ci, attr_len==2); - return; - } - - /* Process entire stackmap */ - last_pc = 0; - last_new_pc = 0; - delta_adj = 0; - for ( i = 0 ; i < count ; i++ ) { - ByteOffset new_pc=0; /* new pc in instrumented code */ - unsigned ft; /* frame_type */ - int delta=0; /* pc delta */ - int new_delta=0; /* new pc delta */ - - ft = readU1(ci); - if ( ft <= 63 ) { - /* Frame Type: same_frame ([0,63]) */ - unsigned new_ft; /* new frame_type */ - - delta = (delta_adj + ft); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - new_ft = (new_delta - delta_adj); - if ( new_ft > 63 ) { - /* Change to same_frame_extended (251) */ - new_ft = 251; - writeU1(ci, new_ft); - writeUoffset(mi, (new_delta - delta_adj)); - } else { - writeU1(ci, new_ft); - } - } else if ( ft >= 64 && ft <= 127 ) { - /* Frame Type: same_locals_1_stack_item_frame ([64,127]) */ - unsigned new_ft; /* new frame_type */ - - delta = (delta_adj + ft - 64); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - if ( (new_delta - delta_adj) > 63 ) { - /* Change to same_locals_1_stack_item_frame_extended (247) */ - new_ft = 247; - writeU1(ci, new_ft); - writeUoffset(mi, (new_delta - delta_adj)); - } else { - new_ft = (new_delta - delta_adj) + 64; - writeU1(ci, new_ft); - } - copy_verification_types(mi, 1); - } else if ( ft >= 128 && ft <= 246 ) { - /* Frame Type: reserved_for_future_use ([128,246]) */ - CRW_FATAL(ci, "Unknown frame type in StackMapTable attribute"); - } else if ( ft == 247 ) { - /* Frame Type: same_locals_1_stack_item_frame_extended (247) */ - delta = (delta_adj + readUoffset(mi)); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - writeU1(ci, ft); - writeUoffset(mi, (new_delta - delta_adj)); - copy_verification_types(mi, 1); - } else if ( ft >= 248 && ft <= 250 ) { - /* Frame Type: chop_frame ([248,250]) */ - delta = (delta_adj + readUoffset(mi)); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - writeU1(ci, ft); - writeUoffset(mi, (new_delta - delta_adj)); - } else if ( ft == 251 ) { - /* Frame Type: same_frame_extended (251) */ - delta = (delta_adj + readUoffset(mi)); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - writeU1(ci, ft); - writeUoffset(mi, (new_delta - delta_adj)); - } else if ( ft >= 252 && ft <= 254 ) { - /* Frame Type: append_frame ([252,254]) */ - delta = (delta_adj + readUoffset(mi)); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - writeU1(ci, ft); - writeUoffset(mi, (new_delta - delta_adj)); - copy_verification_types(mi, (ft - 251)); - } else if ( ft == 255 ) { - unsigned ntypes; - - /* Frame Type: full_frame (255) */ - delta = (delta_adj + readUoffset(mi)); - new_pc = method_code_map(mi, last_pc + delta); - new_delta = new_pc - last_new_pc; - writeU1(ci, ft); - writeUoffset(mi, (new_delta - delta_adj)); - ntypes = copyU2(ci); /* ulocalvar */ - copy_verification_types(mi, ntypes); - ntypes = copyU2(ci); /* ustack */ - copy_verification_types(mi, ntypes); - } - - /* Update last_pc and last_new_pc (save on calls to method_code_map) */ - CRW_ASSERT(ci, delta >= 0); - CRW_ASSERT(ci, new_delta >= 0); - last_pc += delta; - last_new_pc = new_pc; - CRW_ASSERT(ci, last_pc <= mi->code_len); - CRW_ASSERT(ci, last_new_pc <= mi->new_code_len); - - /* Delta adjustment, all deltas are -1 now in attribute */ - delta_adj = 1; - } - - /* Update the attribute length */ - new_attr_len = ci->output_position - (save_position + 4); - CRW_ASSERT(ci, new_attr_len >= attr_len); - random_writeU4(ci, save_position, new_attr_len); -} - -/* Process the CLDC StackMap attribute. We didn't add any basic blocks - * so the frame count remains the same but we may need to process the - * frame types due to offset changes putting things out of range. - */ -static void -write_cldc_stackmap_table(MethodImage *mi) -{ - CrwClassImage *ci; - CrwPosition save_position; - unsigned i; - unsigned attr_len; - unsigned new_attr_len; - unsigned count; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - - /* Save the position of the attribute length so we can fix it later */ - save_position = ci->output_position; - attr_len = copyU4(ci); - count = copyUoffset(mi); /* uoffset: number_of_entries */ - if ( count == 0 ) { - CRW_ASSERT(ci, attr_len==2); - return; - } - - /* Process entire stackmap */ - for ( i = 0 ; i < count ; i++ ) { - unsigned ntypes; - - writeUoffset(mi, method_code_map(mi, readUoffset(mi))); - ntypes = copyU2(ci); /* ulocalvar */ - copy_verification_types(mi, ntypes); - ntypes = copyU2(ci); /* ustack */ - copy_verification_types(mi, ntypes); - } - - /* Update the attribute length */ - new_attr_len = ci->output_position - (save_position + 4); - CRW_ASSERT(ci, new_attr_len >= attr_len); - random_writeU4(ci, save_position, new_attr_len); -} - -static void -method_write_exception_table(MethodImage *mi) -{ - unsigned i; - unsigned count; - CrwClassImage * ci; - - CRW_ASSERT_MI(mi); - ci = mi->ci; - count = copyU2(ci); - for(i=0; ici; - name_index = copyU2(ci); - if ( attribute_match(ci, name_index, "LineNumberTable") ) { - write_line_table(mi); - } else if ( attribute_match(ci, name_index, "LocalVariableTable") ) { - write_var_table(mi); - } else if ( attribute_match(ci, name_index, "LocalVariableTypeTable") ) { - write_var_table(mi); /* Exact same format as the LocalVariableTable */ - } else if ( attribute_match(ci, name_index, "StackMapTable") ) { - write_stackmap_table(mi); - } else if ( attribute_match(ci, name_index, "StackMap") ) { - write_cldc_stackmap_table(mi); - } else { - unsigned len; - len = copyU4(ci); - copy(ci, len); - } -} - -static int -is_init_method(const char *name) -{ - if ( name!=NULL && strcmp(name,"")==0 ) { - return JNI_TRUE; - } - return JNI_FALSE; -} - -static int -is_clinit_method(const char *name) -{ - if ( name!=NULL && strcmp(name,"")==0 ) { - return JNI_TRUE; - } - return JNI_FALSE; -} - -static int -is_finalize_method(const char *name) -{ - if ( name!=NULL && strcmp(name,"finalize")==0 ) { - return JNI_TRUE; - } - return JNI_FALSE; -} - -static int -skip_method(CrwClassImage *ci, const char *name, - unsigned access_flags, ByteOffset code_len, - int system_class, jboolean *pskip_call_return_sites) -{ - *pskip_call_return_sites = JNI_FALSE; - if ( system_class ) { - if ( code_len == 1 && is_init_method(name) ) { - return JNI_TRUE; - } else if ( code_len == 1 && is_finalize_method(name) ) { - return JNI_TRUE; - } else if ( is_clinit_method(name) ) { - return JNI_TRUE; - } else if ( ci->is_thread_class && strcmp(name,"currentThread")==0 ) { - return JNI_TRUE; - } - /* - if ( access_flags & JVM_ACC_PRIVATE ) { - *pskip_call_return_sites = JNI_TRUE; - } - */ - } - return JNI_FALSE; -} - -/* Process all code attributes */ -static void -method_write_bytecodes(CrwClassImage *ci, unsigned mnum, unsigned access_flags) -{ - CrwPosition output_attr_len_position; - CrwPosition output_max_stack_position; - CrwPosition output_code_len_position; - CrwPosition start_of_output_bytecodes; - unsigned i; - unsigned attr_len; - unsigned max_stack; - ByteOffset code_len; - unsigned attr_count; - unsigned new_attr_len; - MethodImage * mi; - jboolean object_init_method; - jboolean skip_call_return_sites; - - CRW_ASSERT_CI(ci); - - /* Attribute Length */ - output_attr_len_position = ci->output_position; - attr_len = copyU4(ci); - - /* Max Stack */ - output_max_stack_position = ci->output_position; - max_stack = copyU2(ci); - - /* Max Locals */ - (void)copyU2(ci); - - /* Code Length */ - output_code_len_position = ci->output_position; - code_len = copyU4(ci); - start_of_output_bytecodes = ci->output_position; - - /* Some methods should not be instrumented */ - object_init_method = JNI_FALSE; - skip_call_return_sites = JNI_FALSE; - if ( ci->is_object_class && - is_init_method(ci->method_name[mnum]) && - strcmp(ci->method_descr[mnum],"()V")==0 ) { - object_init_method = JNI_TRUE; - skip_call_return_sites = JNI_TRUE; - } else if ( skip_method(ci, ci->method_name[mnum], access_flags, - code_len, ci->system_class, &skip_call_return_sites) ) { - /* Copy remainder minus already copied, the U2 max_stack, - * U2 max_locals, and U4 code_length fields have already - * been processed. - */ - copy(ci, attr_len - (2+2+4)); - return; - } - - /* Start Injection */ - mi = method_init(ci, mnum, code_len); - mi->object_init_method = object_init_method; - mi->access_flags = access_flags; - mi->skip_call_return_sites = skip_call_return_sites; - - /* Save the current position as the start of the input bytecodes */ - mi->start_of_input_bytecodes = ci->input_position; - - /* The max stack may increase */ - mi->max_stack = max_stack; - mi->new_max_stack = max_stack; - - /* Adjust all code offsets */ - method_inject_and_write_code(mi); - - /* Fix up code length (save new_code_len for later attribute processing) */ - mi->new_code_len = (int)(ci->output_position - start_of_output_bytecodes); - random_writeU4(ci, output_code_len_position, mi->new_code_len); - - /* Fixup max stack */ - CRW_ASSERT(ci, mi->new_max_stack <= 0xFFFF); - random_writeU2(ci, output_max_stack_position, mi->new_max_stack); - - /* Copy exception table */ - method_write_exception_table(mi); - - /* Copy code attributes (needs mi->new_code_len) */ - attr_count = copyU2(ci); - for (i = 0; i < attr_count; ++i) { - method_write_code_attribute(mi); - } - - /* Fix up attribute length */ - new_attr_len = (int)(ci->output_position - (output_attr_len_position + 4)); - random_writeU4(ci, output_attr_len_position, new_attr_len); - - /* Free method data */ - method_term(mi); - mi = NULL; - -} - -static void -method_write(CrwClassImage *ci, unsigned mnum) -{ - unsigned i; - unsigned access_flags; - CrwCpoolIndex name_index; - CrwCpoolIndex descr_index; - unsigned attr_count; - - access_flags = copyU2(ci); - name_index = copyU2(ci); - ci->method_name[mnum] = cpool_entry(ci, name_index).ptr; - descr_index = copyU2(ci); - ci->method_descr[mnum] = cpool_entry(ci, descr_index).ptr; - attr_count = copyU2(ci); - - for (i = 0; i < attr_count; ++i) { - CrwCpoolIndex name_index; - - name_index = copyU2(ci); - if ( attribute_match(ci, name_index, "Code") ) { - method_write_bytecodes(ci, mnum, access_flags); - } else { - unsigned len; - len = copyU4(ci); - copy(ci, len); - } - } -} - -static void -method_write_all(CrwClassImage *ci) -{ - unsigned i; - unsigned count; - - count = copyU2(ci); - ci->method_count = count; - if ( count > 0 ) { - ci->method_name = (const char **)allocate_clean(ci, count*(int)sizeof(const char*)); - ci->method_descr = (const char **)allocate_clean(ci, count*(int)sizeof(const char*)); - } - - for (i = 0; i < count; ++i) { - method_write(ci, i); - } - - if ( ci->mnum_callback != NULL ) { - (*(ci->mnum_callback))(ci->number, ci->method_name, ci->method_descr, - count); - } -} - -/* ------------------------------------------------------------------- */ -/* Cleanup function. */ - -static void -cleanup(CrwClassImage *ci) -{ - CRW_ASSERT_CI(ci); - if ( ci->name != NULL ) { - deallocate(ci, (void*)ci->name); - ci->name = NULL; - } - if ( ci->method_name != NULL ) { - deallocate(ci, (void*)ci->method_name); - ci->method_name = NULL; - } - if ( ci->method_descr != NULL ) { - deallocate(ci, (void*)ci->method_descr); - ci->method_descr = NULL; - } - if ( ci->cpool != NULL ) { - CrwCpoolIndex i; - for(i=0; icpool_count_plus_one; i++) { - if ( ci->cpool[i].ptr != NULL ) { - deallocate(ci, (void*)(ci->cpool[i].ptr)); - ci->cpool[i].ptr = NULL; - } - } - deallocate(ci, (void*)ci->cpool); - ci->cpool = NULL; - } -} - -static jboolean -skip_class(unsigned access_flags) -{ - if ( access_flags & JVM_ACC_INTERFACE ) { - return JNI_TRUE; - } - return JNI_FALSE; -} - -static long -inject_class(struct CrwClassImage *ci, - int system_class, - char* tclass_name, - char* tclass_sig, - char* call_name, - char* call_sig, - char* return_name, - char* return_sig, - char* obj_init_name, - char* obj_init_sig, - char* newarray_name, - char* newarray_sig, - unsigned char *buf, - long buf_len) -{ - CrwConstantPoolEntry cs; - CrwCpoolIndex this_class; - CrwCpoolIndex super_class; - unsigned magic; - unsigned classfileMajorVersion; - unsigned classfileMinorVersion; - unsigned interface_count; - - CRW_ASSERT_CI(ci); - CRW_ASSERT(ci, buf!=NULL); - CRW_ASSERT(ci, buf_len!=0); - - CRW_ASSERT(ci, strchr(tclass_name,'.')==NULL); /* internal qualified name */ - - ci->injection_count = 0; - ci->system_class = system_class; - ci->tclass_name = tclass_name; - ci->tclass_sig = tclass_sig; - ci->call_name = call_name; - ci->call_sig = call_sig; - ci->return_name = return_name; - ci->return_sig = return_sig; - ci->obj_init_name = obj_init_name; - ci->obj_init_sig = obj_init_sig; - ci->newarray_name = newarray_name; - ci->newarray_sig = newarray_sig; - ci->output = buf; - ci->output_len = buf_len; - - magic = copyU4(ci); - CRW_ASSERT(ci, magic==0xCAFEBABE); - if ( magic != 0xCAFEBABE ) { - return (long)0; - } - - /* minor version number not used */ - classfileMinorVersion = copyU2(ci); - /* major version number not used */ - classfileMajorVersion = copyU2(ci); - CRW_ASSERT(ci, (classfileMajorVersion <= JVM_CLASSFILE_MAJOR_VERSION) || - ((classfileMajorVersion == JVM_CLASSFILE_MAJOR_VERSION) && - (classfileMinorVersion <= JVM_CLASSFILE_MINOR_VERSION))); - - cpool_setup(ci); - - ci->access_flags = copyU2(ci); - if ( skip_class(ci->access_flags) ) { - return (long)0; - } - - this_class = copyU2(ci); - - cs = cpool_entry(ci, (CrwCpoolIndex)(cpool_entry(ci, this_class).index1)); - if ( ci->name == NULL ) { - ci->name = duplicate(ci, cs.ptr, cs.len); - CRW_ASSERT(ci, strchr(ci->name,'.')==NULL); /* internal qualified name */ - } - CRW_ASSERT(ci, (int)strlen(ci->name)==cs.len && strncmp(ci->name, cs.ptr, cs.len)==0); - - super_class = copyU2(ci); - if ( super_class == 0 ) { - ci->is_object_class = JNI_TRUE; - CRW_ASSERT(ci, strcmp(ci->name,"java/lang/Object")==0); - } - - interface_count = copyU2(ci); - copy(ci, interface_count * 2); - - copy_all_fields(ci); - - method_write_all(ci); - - if ( ci->injection_count == 0 ) { - return (long)0; - } - - copy_attributes(ci); - - return (long)ci->output_position; -} - -/* ------------------------------------------------------------------- */ -/* Exported interfaces */ - -JNIEXPORT void JNICALL -java_crw_demo(unsigned class_number, - const char *name, - const unsigned char *file_image, - long file_len, - int system_class, - char* tclass_name, /* Name of class that has tracker methods. */ - char* tclass_sig, /* Signature of tclass */ - char* call_name, /* Method name to call at offset 0 */ - char* call_sig, /* Signature of this method */ - char* return_name, /* Method name to call before any return */ - char* return_sig, /* Signature of this method */ - char* obj_init_name, /* Method name to call in Object */ - char* obj_init_sig, /* Signature of this method */ - char* newarray_name, /* Method name to call after newarray opcodes */ - char* newarray_sig, /* Signature of this method */ - unsigned char **pnew_file_image, - long *pnew_file_len, - FatalErrorHandler fatal_error_handler, - MethodNumberRegister mnum_callback) -{ - CrwClassImage ci; - long max_length; - long new_length; - void *new_image; - int len; - - /* Initial setup of the CrwClassImage structure */ - (void)memset(&ci, 0, (int)sizeof(CrwClassImage)); - ci.fatal_error_handler = fatal_error_handler; - ci.mnum_callback = mnum_callback; - - /* Do some interface error checks */ - if ( pnew_file_image==NULL ) { - CRW_FATAL(&ci, "pnew_file_image==NULL"); - } - if ( pnew_file_len==NULL ) { - CRW_FATAL(&ci, "pnew_file_len==NULL"); - } - - /* No file length means do nothing */ - *pnew_file_image = NULL; - *pnew_file_len = 0; - if ( file_len==0 ) { - return; - } - - /* Do some more interface error checks */ - if ( file_image == NULL ) { - CRW_FATAL(&ci, "file_image == NULL"); - } - if ( file_len < 0 ) { - CRW_FATAL(&ci, "file_len < 0"); - } - if ( system_class != 0 && system_class != 1 ) { - CRW_FATAL(&ci, "system_class is not 0 or 1"); - } - if ( tclass_name == NULL ) { - CRW_FATAL(&ci, "tclass_name == NULL"); - } - if ( tclass_sig == NULL || tclass_sig[0]!='L' ) { - CRW_FATAL(&ci, "tclass_sig is not a valid class signature"); - } - len = (int)strlen(tclass_sig); - if ( tclass_sig[len-1]!=';' ) { - CRW_FATAL(&ci, "tclass_sig is not a valid class signature"); - } - if ( call_name != NULL ) { - if ( call_sig == NULL || strcmp(call_sig, "(II)V") != 0 ) { - CRW_FATAL(&ci, "call_sig is not (II)V"); - } - } - if ( return_name != NULL ) { - if ( return_sig == NULL || strcmp(return_sig, "(II)V") != 0 ) { - CRW_FATAL(&ci, "return_sig is not (II)V"); - } - } - if ( obj_init_name != NULL ) { - if ( obj_init_sig == NULL || strcmp(obj_init_sig, "(Ljava/lang/Object;)V") != 0 ) { - CRW_FATAL(&ci, "obj_init_sig is not (Ljava/lang/Object;)V"); - } - } - if ( newarray_name != NULL ) { - if ( newarray_sig == NULL || strcmp(newarray_sig, "(Ljava/lang/Object;)V") != 0 ) { - CRW_FATAL(&ci, "newarray_sig is not (Ljava/lang/Object;)V"); - } - } - - /* Finish setup the CrwClassImage structure */ - ci.is_thread_class = JNI_FALSE; - if ( name != NULL ) { - CRW_ASSERT(&ci, strchr(name,'.')==NULL); /* internal qualified name */ - - ci.name = duplicate(&ci, name, (int)strlen(name)); - if ( strcmp(name, "java/lang/Thread")==0 ) { - ci.is_thread_class = JNI_TRUE; - } - } - ci.number = class_number; - ci.input = file_image; - ci.input_len = file_len; - - /* Do the injection */ - max_length = file_len*2 + 512; /* Twice as big + 512 */ - new_image = allocate(&ci, (int)max_length); - new_length = inject_class(&ci, - system_class, - tclass_name, - tclass_sig, - call_name, - call_sig, - return_name, - return_sig, - obj_init_name, - obj_init_sig, - newarray_name, - newarray_sig, - new_image, - max_length); - - /* Dispose or shrink the space to be returned. */ - if ( new_length == 0 ) { - deallocate(&ci, (void*)new_image); - new_image = NULL; - } else { - new_image = (void*)reallocate(&ci, (void*)new_image, (int)new_length); - } - - /* Return the new class image */ - *pnew_file_image = (unsigned char *)new_image; - *pnew_file_len = (long)new_length; - - /* Cleanup before we leave. */ - cleanup(&ci); -} - -/* Return the classname for this class which is inside the classfile image. */ -JNIEXPORT char * JNICALL -java_crw_demo_classname(const unsigned char *file_image, long file_len, - FatalErrorHandler fatal_error_handler) -{ - CrwClassImage ci; - CrwConstantPoolEntry cs; - CrwCpoolIndex this_class; - unsigned magic; - char * name; - - name = NULL; - - if ( file_len==0 || file_image==NULL ) { - return name; - } - - /* The only fields we need filled in are the image pointer and the error - * handler. - * By not adding an output buffer pointer, no output is created. - */ - (void)memset(&ci, 0, (int)sizeof(CrwClassImage)); - ci.input = file_image; - ci.input_len = file_len; - ci.fatal_error_handler = fatal_error_handler; - - /* Read out the bytes from the classfile image */ - - magic = readU4(&ci); /* magic number */ - CRW_ASSERT(&ci, magic==0xCAFEBABE); - if ( magic != 0xCAFEBABE ) { - return name; - } - (void)readU2(&ci); /* minor version number */ - (void)readU2(&ci); /* major version number */ - - /* Read in constant pool. Since no output setup, writes are NOP's */ - cpool_setup(&ci); - - (void)readU2(&ci); /* access flags */ - this_class = readU2(&ci); /* 'this' class */ - - /* Get 'this' constant pool entry */ - cs = cpool_entry(&ci, (CrwCpoolIndex)(cpool_entry(&ci, this_class).index1)); - - /* Duplicate the name */ - name = (char *)duplicate(&ci, cs.ptr, cs.len); - - /* Cleanup before we leave. */ - cleanup(&ci); - - /* Return malloc space */ - return name; -} diff --git a/jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.h b/jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.h deleted file mode 100644 index e2626784341..00000000000 --- a/jdk/src/demo/share/jvmti/java_crw_demo/java_crw_demo.h +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Copyright (c) 2003, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#ifndef JAVA_CRW_DEMO_H -#define JAVA_CRW_DEMO_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* This callback is used to notify the caller of a fatal error. */ - -typedef void (*FatalErrorHandler)(const char*message, const char*file, int line); - -/* This callback is used to return the method information for a class. - * Since the information was already read here, it was useful to - * return it here, with no JVMTI phase restrictions. - * If the class file does represent a "class" and it has methods, then - * this callback will be called with the class number and pointers to - * the array of names, array of signatures, and the count of methods. - */ - -typedef void (*MethodNumberRegister)(unsigned, const char**, const char**, int); - -/* Class file reader/writer interface. Basic input is a classfile image - * and details about what to inject. The output is a new classfile image - * that was allocated with malloc(), and should be freed by the caller. - */ - -/* Names of external symbols to look for. These are the names that we - * try and lookup in the shared library. On Windows 2000, the naming - * convention is to prefix a "_" and suffix a "@N" where N is 4 times - * the number or arguments supplied.It has 19 args, so 76 = 19*4. - * On Windows 2003, Linux, and Solaris, the first name will be - * found, on Windows 2000 a second try should find the second name. - * - * WARNING: If You change the JavaCrwDemo typedef, you MUST change - * multiple things in this file, including this name. - */ - -#define JAVA_CRW_DEMO_SYMBOLS { "java_crw_demo", "_java_crw_demo@76" } - -/* Typedef needed for type casting in dynamic access situations. */ - -typedef void (JNICALL *JavaCrwDemo)( - unsigned class_number, - const char *name, - const unsigned char *file_image, - long file_len, - int system_class, - char* tclass_name, - char* tclass_sig, - char* call_name, - char* call_sig, - char* return_name, - char* return_sig, - char* obj_init_name, - char* obj_init_sig, - char* newarray_name, - char* newarray_sig, - unsigned char **pnew_file_image, - long *pnew_file_len, - FatalErrorHandler fatal_error_handler, - MethodNumberRegister mnum_callback -); - -/* Function export (should match typedef above) */ - -JNIEXPORT void JNICALL java_crw_demo( - - unsigned class_number, /* Caller assigned class number for class */ - - const char *name, /* Internal class name, e.g. java/lang/Object */ - /* (Do not use "java.lang.Object" format) */ - - const unsigned char - *file_image, /* Pointer to classfile image for this class */ - - long file_len, /* Length of the classfile in bytes */ - - int system_class, /* Set to 1 if this is a system class */ - /* (prevents injections into empty */ - /* , finalize, and methods) */ - - char* tclass_name, /* Class that has methods we will call at */ - /* the injection sites (tclass) */ - - char* tclass_sig, /* Signature of tclass */ - /* (Must be "L" + tclass_name + ";") */ - - char* call_name, /* Method name in tclass to call at offset 0 */ - /* for every method */ - - char* call_sig, /* Signature of this call_name method */ - /* (Must be "(II)V") */ - - char* return_name, /* Method name in tclass to call at all */ - /* return opcodes in every method */ - - char* return_sig, /* Signature of this return_name method */ - /* (Must be "(II)V") */ - - char* obj_init_name, /* Method name in tclass to call first thing */ - /* when injecting java.lang.Object. */ - - char* obj_init_sig, /* Signature of this obj_init_name method */ - /* (Must be "(Ljava/lang/Object;)V") */ - - char* newarray_name, /* Method name in tclass to call after every */ - /* newarray opcode in every method */ - - char* newarray_sig, /* Signature of this method */ - /* (Must be "(Ljava/lang/Object;II)V") */ - - unsigned char - **pnew_file_image, /* Returns a pointer to new classfile image */ - - long *pnew_file_len, /* Returns the length of the new image */ - - FatalErrorHandler - fatal_error_handler, /* Pointer to function to call on any */ - /* fatal error. NULL sends error to stderr */ - - MethodNumberRegister - mnum_callback /* Pointer to function that gets called */ - /* with all details on methods in this */ - /* class. NULL means skip this call. */ - - ); - - -/* External to read the class name out of a class file . - * - * WARNING: If You change the typedef, you MUST change - * multiple things in this file, including this name. - */ - -#define JAVA_CRW_DEMO_CLASSNAME_SYMBOLS \ - { "java_crw_demo_classname", "_java_crw_demo_classname@12" } - -/* Typedef needed for type casting in dynamic access situations. */ - -typedef char * (JNICALL *JavaCrwDemoClassname)( - const unsigned char *file_image, - long file_len, - FatalErrorHandler fatal_error_handler); - -JNIEXPORT char * JNICALL java_crw_demo_classname( - const unsigned char *file_image, - long file_len, - FatalErrorHandler fatal_error_handler); - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - -#endif diff --git a/jdk/src/demo/share/jvmti/java_crw_demo/sample.makefile.txt b/jdk/src/demo/share/jvmti/java_crw_demo/sample.makefile.txt deleted file mode 100644 index 81ce07938d4..00000000000 --- a/jdk/src/demo/share/jvmti/java_crw_demo/sample.makefile.txt +++ /dev/null @@ -1,144 +0,0 @@ -# -# Copyright (c) 2004, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=java_crw_demo -SOURCES=java_crw_demo.c - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES=-lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule (build both native library and jar file) -all: $(LIBRARY) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Cleanup the built bits -clean: - rm -f -r classes - rm -f $(LIBRARY) $(OBJECTS) - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/minst/Minst.java b/jdk/src/demo/share/jvmti/minst/Minst.java deleted file mode 100644 index 2826cea04ba..00000000000 --- a/jdk/src/demo/share/jvmti/minst/Minst.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - - -/* Java class to hold static methods which will be called in byte code - * injections of all class files. - */ - -public class Minst { - - /* Master switch that activates methods. */ - - private static int engaged = 0; - - /* At the very beginning of every method, a call to method_entry() - * is injected. - */ - - public static void method_entry(int cnum, int mnum) { - Class x = Minst.class; - synchronized ( x ) { - if ( engaged > 0 ) { - engaged = 0; - String className = "Unknown"; - String methodName = "Unknown"; - Exception exp = new Exception(); - StackTraceElement[] stack = exp.getStackTrace(); - if (stack.length > 1) { - StackTraceElement location = stack[1]; - className = location.getClassName(); - methodName = location.getMethodName(); - } - System.out.println("Reached method entry: " + - className + "." + methodName + "()"); - engaged++; - } - } - } - -} diff --git a/jdk/src/demo/share/jvmti/minst/README.txt b/jdk/src/demo/share/jvmti/minst/README.txt deleted file mode 100644 index 3cc9b4fff3c..00000000000 --- a/jdk/src/demo/share/jvmti/minst/README.txt +++ /dev/null @@ -1,49 +0,0 @@ -# -# Copyright (c) 2006, 2007, 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. -# - -minst - -This agent library can be used to inject code at method calls. -It uses the same java_crw_demo library used by HPROF to do BCI on all -or selected classfiles loaded into the Virtual Machine. -The class Minst.java can be customized to do whatever you wish, -within reason of course, and does not call native methods directly. - -You can use this agent library as follows: - - java -agentlib:minst ... - -To get help on the available options try: - - java -agentlib:minst=help - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/minst/minst.c b/jdk/src/demo/share/jvmti/minst/minst.c deleted file mode 100644 index 8317c1d3d61..00000000000 --- a/jdk/src/demo/share/jvmti/minst/minst.c +++ /dev/null @@ -1,481 +0,0 @@ -/* - * Copyright (c) 2006, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include "stdlib.h" - -#include "minst.h" -#include "java_crw_demo.h" - - -/* ------------------------------------------------------------------- */ -/* Some constant maximum sizes */ - -#define MAX_TOKEN_LENGTH 80 -#define MAX_METHOD_NAME_LENGTH 256 - -/* Some constant names that tie to Java class/method names. - * We assume the Java class whose static methods we will be calling - * looks like: - * - * public class Minst { - * private static int engaged; - * private static native void _method_entry(Object thr, int cnum, int mnum); - * public static void method_entry(int cnum, int mnum) - * { - * ... - * } - * } - * - */ - -#define MINST_class Minst /* Name of class we are using */ -#define MINST_entry method_entry /* Name of java entry method */ -#define MINST_engaged engaged /* Name of java static field */ - -/* C macros to create strings from tokens */ -#define _STRING(s) #s -#define STRING(s) _STRING(s) - -/* ------------------------------------------------------------------- */ - -/* Global agent data structure */ - -typedef struct { - /* JVMTI Environment */ - jvmtiEnv *jvmti; - jboolean vm_is_dead; - jboolean vm_is_started; - /* Data access Lock */ - jrawMonitorID lock; - /* Options */ - char *include; - char *exclude; - /* Class Count/ID */ - jint ccount; -} GlobalAgentData; - -static GlobalAgentData *gdata; - -/* Enter a critical section by doing a JVMTI Raw Monitor Enter */ -static void -enter_critical_section(jvmtiEnv *jvmti) -{ - jvmtiError error; - - error = (*jvmti)->RawMonitorEnter(jvmti, gdata->lock); - check_jvmti_error(jvmti, error, "Cannot enter with raw monitor"); -} - -/* Exit a critical section by doing a JVMTI Raw Monitor Exit */ -static void -exit_critical_section(jvmtiEnv *jvmti) -{ - jvmtiError error; - - error = (*jvmti)->RawMonitorExit(jvmti, gdata->lock); - check_jvmti_error(jvmti, error, "Cannot exit with raw monitor"); -} - -/* Callback for JVMTI_EVENT_VM_START */ -static void JNICALL -cbVMStart(jvmtiEnv *jvmti, JNIEnv *env) -{ - enter_critical_section(jvmti); { - /* Indicate VM has started */ - gdata->vm_is_started = JNI_TRUE; - } exit_critical_section(jvmti); -} - -/* Callback for JVMTI_EVENT_VM_INIT */ -static void JNICALL -cbVMInit(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - enter_critical_section(jvmti); { - jclass klass; - jfieldID field; - - /* Register Natives for class whose methods we use */ - klass = (*env)->FindClass(env, STRING(MINST_class)); - if ( klass == NULL ) { - fatal_error("ERROR: JNI: Cannot find %s with FindClass\n", - STRING(MINST_class)); - } - - /* Engage calls. */ - field = (*env)->GetStaticFieldID(env, klass, STRING(MINST_engaged), "I"); - if ( field == NULL ) { - fatal_error("ERROR: JNI: Cannot get field from %s\n", - STRING(MINST_class)); - } - (*env)->SetStaticIntField(env, klass, field, 1); - } exit_critical_section(jvmti); -} - -/* Callback for JVMTI_EVENT_VM_DEATH */ -static void JNICALL -cbVMDeath(jvmtiEnv *jvmti, JNIEnv *env) -{ - enter_critical_section(jvmti); { - jclass klass; - jfieldID field; - - /* The VM has died. */ - stdout_message("VMDeath\n"); - - /* Disengage calls in MINST_class. */ - klass = (*env)->FindClass(env, STRING(MINST_class)); - if ( klass == NULL ) { - fatal_error("ERROR: JNI: Cannot find %s with FindClass\n", - STRING(MINST_class)); - } - field = (*env)->GetStaticFieldID(env, klass, STRING(MINST_engaged), "I"); - if ( field == NULL ) { - fatal_error("ERROR: JNI: Cannot get field from %s\n", - STRING(MINST_class)); - } - (*env)->SetStaticIntField(env, klass, field, -1); - - /* The critical section here is important to hold back the VM death - * until all other callbacks have completed. - */ - - /* Since this critical section could be holding up other threads - * in other event callbacks, we need to indicate that the VM is - * dead so that the other callbacks can short circuit their work. - * We don't expect any further events after VmDeath but we do need - * to be careful that existing threads might be in our own agent - * callback code. - */ - gdata->vm_is_dead = JNI_TRUE; - - } exit_critical_section(jvmti); - -} - -/* Callback for JVMTI_EVENT_CLASS_FILE_LOAD_HOOK */ -static void JNICALL -cbClassFileLoadHook(jvmtiEnv *jvmti, JNIEnv* env, - jclass class_being_redefined, jobject loader, - const char* name, jobject protection_domain, - jint class_data_len, const unsigned char* class_data, - jint* new_class_data_len, unsigned char** new_class_data) -{ - enter_critical_section(jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vm_is_dead ) { - - const char *classname; - - /* Name could be NULL */ - if ( name == NULL ) { - classname = java_crw_demo_classname(class_data, class_data_len, - NULL); - if ( classname == NULL ) { - fatal_error("ERROR: No classname inside classfile\n"); - } - } else { - classname = strdup(name); - if ( classname == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - } - - *new_class_data_len = 0; - *new_class_data = NULL; - - /* The tracker class itself? */ - if ( interested((char*)classname, "", gdata->include, gdata->exclude) - && strcmp(classname, STRING(MINST_class)) != 0 ) { - jint cnum; - int system_class; - unsigned char *new_image; - long new_length; - - /* Get unique number for every class file image loaded */ - cnum = gdata->ccount++; - - /* Is it a system class? If the class load is before VmStart - * then we will consider it a system class that should - * be treated carefully. (See java_crw_demo) - */ - system_class = 0; - if ( !gdata->vm_is_started ) { - system_class = 1; - } - - new_image = NULL; - new_length = 0; - - /* Call the class file reader/write demo code */ - java_crw_demo(cnum, - classname, - class_data, - class_data_len, - system_class, - STRING(MINST_class), "L" STRING(MINST_class) ";", - STRING(MINST_entry), "(II)V", - NULL, NULL, - NULL, NULL, - NULL, NULL, - &new_image, - &new_length, - NULL, - NULL); - - /* If we got back a new class image, return it back as "the" - * new class image. This must be JVMTI Allocate space. - */ - if ( new_length > 0 ) { - unsigned char *jvmti_space; - - jvmti_space = (unsigned char *)allocate(jvmti, (jint)new_length); - (void)memcpy((void*)jvmti_space, (void*)new_image, (int)new_length); - *new_class_data_len = (jint)new_length; - *new_class_data = jvmti_space; /* VM will deallocate */ - } - - /* Always free up the space we get from java_crw_demo() */ - if ( new_image != NULL ) { - (void)free((void*)new_image); /* Free malloc() space with free() */ - } - } - (void)free((void*)classname); - } - } exit_critical_section(jvmti); -} - -/* Parse the options for this minst agent */ -static void -parse_agent_options(char *options) -{ - char token[MAX_TOKEN_LENGTH]; - char *next; - - /* Parse options and set flags in gdata */ - if ( options==NULL ) { - return; - } - - /* Get the first token from the options string. */ - next = get_token(options, ",=", token, sizeof(token)); - - /* While not at the end of the options string, process this option. */ - while ( next != NULL ) { - if ( strcmp(token,"help")==0 ) { - stdout_message("The minst JVMTI demo agent\n"); - stdout_message("\n"); - stdout_message(" java -agent:minst[=options] ...\n"); - stdout_message("\n"); - stdout_message("The options are comma separated:\n"); - stdout_message("\t help\t\t\t Print help information\n"); - stdout_message("\t include=item\t\t Only these classes/methods\n"); - stdout_message("\t exclude=item\t\t Exclude these classes/methods\n"); - stdout_message("\n"); - stdout_message("item\t Qualified class and/or method names\n"); - stdout_message("\t\t e.g. (*.;Foobar.method;sun.*)\n"); - stdout_message("\n"); - exit(0); - } else if ( strcmp(token,"include")==0 ) { - int used; - int maxlen; - - maxlen = MAX_METHOD_NAME_LENGTH; - if ( gdata->include == NULL ) { - gdata->include = (char*)calloc(maxlen+1, 1); - used = 0; - } else { - used = (int)strlen(gdata->include); - gdata->include[used++] = ','; - gdata->include[used] = 0; - gdata->include = (char*) - realloc((void*)gdata->include, used+maxlen+1); - } - if ( gdata->include == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - /* Add this item to the list */ - next = get_token(next, ",=", gdata->include+used, maxlen); - /* Check for token scan error */ - if ( next==NULL ) { - fatal_error("ERROR: include option error\n"); - } - } else if ( strcmp(token,"exclude")==0 ) { - int used; - int maxlen; - - maxlen = MAX_METHOD_NAME_LENGTH; - if ( gdata->exclude == NULL ) { - gdata->exclude = (char*)calloc(maxlen+1, 1); - used = 0; - } else { - used = (int)strlen(gdata->exclude); - gdata->exclude[used++] = ','; - gdata->exclude[used] = 0; - gdata->exclude = (char*) - realloc((void*)gdata->exclude, used+maxlen+1); - } - if ( gdata->exclude == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - /* Add this item to the list */ - next = get_token(next, ",=", gdata->exclude+used, maxlen); - /* Check for token scan error */ - if ( next==NULL ) { - fatal_error("ERROR: exclude option error\n"); - } - } else if ( token[0]!=0 ) { - /* We got a non-empty token and we don't know what it is. */ - fatal_error("ERROR: Unknown option: %s\n", token); - } - /* Get the next token (returns NULL if there are no more) */ - next = get_token(next, ",=", token, sizeof(token)); - } -} - -/* Agent_OnLoad: This is called immediately after the shared library is - * loaded. This is the first code executed. - */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - static GlobalAgentData data; - jvmtiEnv *jvmti; - jvmtiError error; - jint res; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - - /* Setup initial global agent data area - * Use of static/extern data should be handled carefully here. - * We need to make sure that we are able to cleanup after ourselves - * so anything allocated in this library needs to be freed in - * the Agent_OnUnload() function. - */ - (void)memset((void*)&data, 0, sizeof(data)); - gdata = &data; - - /* First thing we need to do is get the jvmtiEnv* or JVMTI environment */ - res = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION_1); - if (res != JNI_OK) { - /* This means that the VM was unable to obtain this version of the - * JVMTI interface, this is a fatal error. - */ - fatal_error("ERROR: Unable to access JVMTI Version 1 (0x%x)," - " is your JDK a 5.0 or newer version?" - " JNIEnv's GetEnv() returned %d\n", - JVMTI_VERSION_1, res); - } - - /* Here we save the jvmtiEnv* for Agent_OnUnload(). */ - gdata->jvmti = jvmti; - - /* Parse any options supplied on java command line */ - parse_agent_options(options); - - /* Immediately after getting the jvmtiEnv* we need to ask for the - * capabilities this agent will need. In this case we need to make - * sure that we can get all class load hooks. - */ - (void)memset(&capabilities,0, sizeof(capabilities)); - capabilities.can_generate_all_class_hook_events = 1; - error = (*jvmti)->AddCapabilities(jvmti, &capabilities); - check_jvmti_error(jvmti, error, "Unable to get necessary JVMTI capabilities."); - - /* Next we need to provide the pointers to the callback functions to - * to this jvmtiEnv* - */ - (void)memset(&callbacks,0, sizeof(callbacks)); - /* JVMTI_EVENT_VM_START */ - callbacks.VMStart = &cbVMStart; - /* JVMTI_EVENT_VM_INIT */ - callbacks.VMInit = &cbVMInit; - /* JVMTI_EVENT_VM_DEATH */ - callbacks.VMDeath = &cbVMDeath; - /* JVMTI_EVENT_CLASS_FILE_LOAD_HOOK */ - callbacks.ClassFileLoadHook = &cbClassFileLoadHook; - error = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, (jint)sizeof(callbacks)); - check_jvmti_error(jvmti, error, "Cannot set jvmti callbacks"); - - /* At first the only initial events we are interested in are VM - * initialization, VM death, and Class File Loads. - * Once the VM is initialized we will request more events. - */ - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_START, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_DEATH, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - - /* Here we create a raw monitor for our use in this agent to - * protect critical sections of code. - */ - error = (*jvmti)->CreateRawMonitor(jvmti, "agent data", &(gdata->lock)); - check_jvmti_error(jvmti, error, "Cannot create raw monitor"); - - /* Add demo jar file to boot classpath */ - add_demo_jar_to_bootclasspath(jvmti, "minst"); - - /* We return JNI_OK to signify success */ - return JNI_OK; -} - -/* Agent_OnUnload: This is called immediately before the shared library is - * unloaded. This is the last code executed. - */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ - /* Make sure all malloc/calloc/strdup space is freed */ - if ( gdata->include != NULL ) { - (void)free((void*)gdata->include); - gdata->include = NULL; - } - if ( gdata->exclude != NULL ) { - (void)free((void*)gdata->exclude); - gdata->exclude = NULL; - } -} diff --git a/jdk/src/demo/share/jvmti/minst/minst.h b/jdk/src/demo/share/jvmti/minst/minst.h deleted file mode 100644 index d852ad4dcb8..00000000000 --- a/jdk/src/demo/share/jvmti/minst/minst.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2006, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Primary minst #include file, should be included by most if not - * all minst source files. Gives access to the global data structure - * and all global macros. - */ - -#ifndef MINST_H -#define MINST_H - -/* Standard C functions used throughout. */ - -#include -#include -#include -#include -#include - -/* General JVM/Java functions, types and macros. */ - -#include -#include "jni.h" -#include "jvmti.h" - -/* Utility functions */ - -#include "agent_util.h" - -#endif diff --git a/jdk/src/demo/share/jvmti/minst/sample.makefile.txt b/jdk/src/demo/share/jvmti/minst/sample.makefile.txt deleted file mode 100644 index 5c8f422fb40..00000000000 --- a/jdk/src/demo/share/jvmti/minst/sample.makefile.txt +++ /dev/null @@ -1,163 +0,0 @@ -# -# Copyright (c) 2006, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo minst -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=minst -SOURCES=minst.c ../agent_util/agent_util.c -JAVA_SOURCES=Minst.java - -# Name of jar file that needs to be created -JARFILE=minst.jar - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Add in java_crw_demo obj file on windows (easier) - SOURCES+=../java_crw_demo/java_crw_demo.c - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES=$(JDK)/ - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I../agent_util -CFLAGS += -I../java_crw_demo -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule (build both native library and jar file) -all: $(LIBRARY) $(JARFILE) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Build jar file -$(JARFILE): $(JAVA_SOURCES) - rm -f -r classes - mkdir -p classes - $(JDK)/bin/javac -d classes $(JAVA_SOURCES) - (cd classes; $(JDK)/bin/jar cf ../$@ *) - -# Cleanup the built bits -clean: - rm -f -r classes - rm -f $(LIBRARY) $(JARFILE) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=. $(JDK)/bin/java -agentlib:$(LIBNAME) -Xbootclasspath/a:./$(JARFILE) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/mtrace/Mtrace.java b/jdk/src/demo/share/jvmti/mtrace/Mtrace.java deleted file mode 100644 index ecebf75a450..00000000000 --- a/jdk/src/demo/share/jvmti/mtrace/Mtrace.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - - -/* Java class to hold static methods which will be called in byte code - * injections of all class files. - */ - -public class Mtrace { - - /* Master switch that activates methods. */ - - private static int engaged = 0; - - /* At the very beginning of every method, a call to method_entry() - * is injected. - */ - - private static native void _method_entry(Object thr, int cnum, int mnum); - public static void method_entry(int cnum, int mnum) - { - if ( engaged != 0 ) { - _method_entry(Thread.currentThread(), cnum, mnum); - } - } - - /* Before any of the return bytecodes, a call to method_exit() - * is injected. - */ - - private static native void _method_exit(Object thr, int cnum, int mnum); - public static void method_exit(int cnum, int mnum) - { - if ( engaged != 0 ) { - _method_exit(Thread.currentThread(), cnum, mnum); - } - } - -} diff --git a/jdk/src/demo/share/jvmti/mtrace/README.txt b/jdk/src/demo/share/jvmti/mtrace/README.txt deleted file mode 100644 index 3c5519726da..00000000000 --- a/jdk/src/demo/share/jvmti/mtrace/README.txt +++ /dev/null @@ -1,50 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -mtrace - -This agent library can be used to track method call and return counts. -It uses the same java_crw_demo library used by HPROF to do BCI on all or -selected classfiles loaded into the Virtual Machine. It will print out a -sorted list of the most heavily used classes (as determined by the number -of method calls into the class) and also include the call and return counts -for all methods that are called. - -You can use this agent library as follows: - - java -Xbootclasspath/a:mtrace.jar -agentlib:mtrace ... - -To get help on the available options try: - - java -agentlib:mtrace=help - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/mtrace/mtrace.c b/jdk/src/demo/share/jvmti/mtrace/mtrace.c deleted file mode 100644 index 82b9e662e40..00000000000 --- a/jdk/src/demo/share/jvmti/mtrace/mtrace.c +++ /dev/null @@ -1,833 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include "stdlib.h" - -#include "mtrace.h" -#include "java_crw_demo.h" - - -/* ------------------------------------------------------------------- */ -/* Some constant maximum sizes */ - -#define MAX_TOKEN_LENGTH 16 -#define MAX_THREAD_NAME_LENGTH 512 -#define MAX_METHOD_NAME_LENGTH 1024 - -/* Some constant names that tie to Java class/method names. - * We assume the Java class whose static methods we will be calling - * looks like: - * - * public class Mtrace { - * private static int engaged; - * private static native void _method_entry(Object thr, int cnum, int mnum); - * public static void method_entry(int cnum, int mnum) - * { - * if ( engaged != 0 ) { - * _method_entry(Thread.currentThread(), cnum, mnum); - * } - * } - * private static native void _method_exit(Object thr, int cnum, int mnum); - * public static void method_exit(int cnum, int mnum) - * { - * if ( engaged != 0 ) { - * _method_exit(Thread.currentThread(), cnum, mnum); - * } - * } - * } - * - * The engaged field allows us to inject all classes (even system classes) - * and delay the actual calls to the native code until the VM has reached - * a safe time to call native methods (Past the JVMTI VM_START event). - * - */ - -#define MTRACE_class Mtrace /* Name of class we are using */ -#define MTRACE_entry method_entry /* Name of java entry method */ -#define MTRACE_exit method_exit /* Name of java exit method */ -#define MTRACE_native_entry _method_entry /* Name of java entry native */ -#define MTRACE_native_exit _method_exit /* Name of java exit native */ -#define MTRACE_engaged engaged /* Name of java static field */ - -/* C macros to create strings from tokens */ -#define _STRING(s) #s -#define STRING(s) _STRING(s) - -/* ------------------------------------------------------------------- */ - -/* Data structure to hold method and class information in agent */ - -typedef struct MethodInfo { - const char *name; /* Method name */ - const char *signature; /* Method signature */ - int calls; /* Method call count */ - int returns; /* Method return count */ -} MethodInfo; - -typedef struct ClassInfo { - const char *name; /* Class name */ - int mcount; /* Method count */ - MethodInfo *methods; /* Method information */ - int calls; /* Method call count for this class */ -} ClassInfo; - -/* Global agent data structure */ - -typedef struct { - /* JVMTI Environment */ - jvmtiEnv *jvmti; - jboolean vm_is_dead; - jboolean vm_is_started; - /* Data access Lock */ - jrawMonitorID lock; - /* Options */ - char *include; - char *exclude; - int max_count; - /* ClassInfo Table */ - ClassInfo *classes; - jint ccount; -} GlobalAgentData; - -static GlobalAgentData *gdata; - -/* Enter a critical section by doing a JVMTI Raw Monitor Enter */ -static void -enter_critical_section(jvmtiEnv *jvmti) -{ - jvmtiError error; - - error = (*jvmti)->RawMonitorEnter(jvmti, gdata->lock); - check_jvmti_error(jvmti, error, "Cannot enter with raw monitor"); -} - -/* Exit a critical section by doing a JVMTI Raw Monitor Exit */ -static void -exit_critical_section(jvmtiEnv *jvmti) -{ - jvmtiError error; - - error = (*jvmti)->RawMonitorExit(jvmti, gdata->lock); - check_jvmti_error(jvmti, error, "Cannot exit with raw monitor"); -} - -/* Get a name for a jthread */ -static void -get_thread_name(jvmtiEnv *jvmti, jthread thread, char *tname, int maxlen) -{ - jvmtiThreadInfo info; - jvmtiError error; - - /* Make sure the stack variables are garbage free */ - (void)memset(&info,0, sizeof(info)); - - /* Assume the name is unknown for now */ - (void)strcpy(tname, "Unknown"); - - /* Get the thread information, which includes the name */ - error = (*jvmti)->GetThreadInfo(jvmti, thread, &info); - check_jvmti_error(jvmti, error, "Cannot get thread info"); - - /* The thread might not have a name, be careful here. */ - if ( info.name != NULL ) { - int len; - - /* Copy the thread name into tname if it will fit */ - len = (int)strlen(info.name); - if ( len < maxlen ) { - (void)strcpy(tname, info.name); - } - - /* Every string allocated by JVMTI needs to be freed */ - deallocate(jvmti, (void*)info.name); - } -} - -/* Qsort class compare routine */ -static int -class_compar(const void *e1, const void *e2) -{ - ClassInfo *c1 = (ClassInfo*)e1; - ClassInfo *c2 = (ClassInfo*)e2; - if ( c1->calls > c2->calls ) return 1; - if ( c1->calls < c2->calls ) return -1; - return 0; -} - -/* Qsort method compare routine */ -static int -method_compar(const void *e1, const void *e2) -{ - MethodInfo *m1 = (MethodInfo*)e1; - MethodInfo *m2 = (MethodInfo*)e2; - if ( m1->calls > m2->calls ) return 1; - if ( m1->calls < m2->calls ) return -1; - return 0; -} - -/* Callback from java_crw_demo() that gives us mnum mappings */ -static void -mnum_callbacks(unsigned cnum, const char **names, const char**sigs, int mcount) -{ - ClassInfo *cp; - int mnum; - - if ( cnum >= (unsigned)gdata->ccount ) { - fatal_error("ERROR: Class number out of range\n"); - } - if ( mcount == 0 ) { - return; - } - - cp = gdata->classes + (int)cnum; - cp->calls = 0; - cp->mcount = mcount; - cp->methods = (MethodInfo*)calloc(mcount, sizeof(MethodInfo)); - if ( cp->methods == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - - for ( mnum = 0 ; mnum < mcount ; mnum++ ) { - MethodInfo *mp; - - mp = cp->methods + mnum; - mp->name = (const char *)strdup(names[mnum]); - if ( mp->name == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - mp->signature = (const char *)strdup(sigs[mnum]); - if ( mp->signature == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - } -} - -/* Java Native Method for entry */ -static void -MTRACE_native_entry(JNIEnv *env, jclass klass, jobject thread, jint cnum, jint mnum) -{ - enter_critical_section(gdata->jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vm_is_dead ) { - ClassInfo *cp; - MethodInfo *mp; - - if ( cnum >= gdata->ccount ) { - fatal_error("ERROR: Class number out of range\n"); - } - cp = gdata->classes + cnum; - if ( mnum >= cp->mcount ) { - fatal_error("ERROR: Method number out of range\n"); - } - mp = cp->methods + mnum; - if ( interested((char*)cp->name, (char*)mp->name, - gdata->include, gdata->exclude) ) { - mp->calls++; - cp->calls++; - } - } - } exit_critical_section(gdata->jvmti); -} - -/* Java Native Method for exit */ -static void -MTRACE_native_exit(JNIEnv *env, jclass klass, jobject thread, jint cnum, jint mnum) -{ - enter_critical_section(gdata->jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vm_is_dead ) { - ClassInfo *cp; - MethodInfo *mp; - - if ( cnum >= gdata->ccount ) { - fatal_error("ERROR: Class number out of range\n"); - } - cp = gdata->classes + cnum; - if ( mnum >= cp->mcount ) { - fatal_error("ERROR: Method number out of range\n"); - } - mp = cp->methods + mnum; - if ( interested((char*)cp->name, (char*)mp->name, - gdata->include, gdata->exclude) ) { - mp->returns++; - } - } - } exit_critical_section(gdata->jvmti); -} - -/* Callback for JVMTI_EVENT_VM_START */ -static void JNICALL -cbVMStart(jvmtiEnv *jvmti, JNIEnv *env) -{ - enter_critical_section(jvmti); { - jclass klass; - jfieldID field; - int rc; - - /* Java Native Methods for class */ - static JNINativeMethod registry[2] = { - {STRING(MTRACE_native_entry), "(Ljava/lang/Object;II)V", - (void*)&MTRACE_native_entry}, - {STRING(MTRACE_native_exit), "(Ljava/lang/Object;II)V", - (void*)&MTRACE_native_exit} - }; - - /* The VM has started. */ - stdout_message("VMStart\n"); - - /* Register Natives for class whose methods we use */ - klass = (*env)->FindClass(env, STRING(MTRACE_class)); - if ( klass == NULL ) { - fatal_error("ERROR: JNI: Cannot find %s with FindClass\n", - STRING(MTRACE_class)); - } - rc = (*env)->RegisterNatives(env, klass, registry, 2); - if ( rc != 0 ) { - fatal_error("ERROR: JNI: Cannot register native methods for %s\n", - STRING(MTRACE_class)); - } - - /* Engage calls. */ - field = (*env)->GetStaticFieldID(env, klass, STRING(MTRACE_engaged), "I"); - if ( field == NULL ) { - fatal_error("ERROR: JNI: Cannot get field from %s\n", - STRING(MTRACE_class)); - } - (*env)->SetStaticIntField(env, klass, field, 1); - - /* Indicate VM has started */ - gdata->vm_is_started = JNI_TRUE; - - } exit_critical_section(jvmti); -} - -/* Callback for JVMTI_EVENT_VM_INIT */ -static void JNICALL -cbVMInit(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - enter_critical_section(jvmti); { - char tname[MAX_THREAD_NAME_LENGTH]; - static jvmtiEvent events[] = - { JVMTI_EVENT_THREAD_START, JVMTI_EVENT_THREAD_END }; - int i; - - /* The VM has started. */ - get_thread_name(jvmti, thread, tname, sizeof(tname)); - stdout_message("VMInit %s\n", tname); - - /* The VM is now initialized, at this time we make our requests - * for additional events. - */ - - for( i=0; i < (int)(sizeof(events)/sizeof(jvmtiEvent)); i++) { - jvmtiError error; - - /* Setup event notification modes */ - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - events[i], (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - } - - } exit_critical_section(jvmti); -} - -/* Callback for JVMTI_EVENT_VM_DEATH */ -static void JNICALL -cbVMDeath(jvmtiEnv *jvmti, JNIEnv *env) -{ - enter_critical_section(jvmti); { - jclass klass; - jfieldID field; - - /* The VM has died. */ - stdout_message("VMDeath\n"); - - /* Disengage calls in MTRACE_class. */ - klass = (*env)->FindClass(env, STRING(MTRACE_class)); - if ( klass == NULL ) { - fatal_error("ERROR: JNI: Cannot find %s with FindClass\n", - STRING(MTRACE_class)); - } - field = (*env)->GetStaticFieldID(env, klass, STRING(MTRACE_engaged), "I"); - if ( field == NULL ) { - fatal_error("ERROR: JNI: Cannot get field from %s\n", - STRING(MTRACE_class)); - } - (*env)->SetStaticIntField(env, klass, field, 0); - - /* The critical section here is important to hold back the VM death - * until all other callbacks have completed. - */ - - /* Since this critical section could be holding up other threads - * in other event callbacks, we need to indicate that the VM is - * dead so that the other callbacks can short circuit their work. - * We don't expect any further events after VmDeath but we do need - * to be careful that existing threads might be in our own agent - * callback code. - */ - gdata->vm_is_dead = JNI_TRUE; - - /* Dump out stats */ - stdout_message("Begin Class Stats\n"); - if ( gdata->ccount > 0 ) { - int cnum; - - /* Sort table (in place) by number of method calls into class. */ - /* Note: Do not use this table after this qsort! */ - qsort(gdata->classes, gdata->ccount, sizeof(ClassInfo), - &class_compar); - - /* Dump out gdata->max_count most called classes */ - for ( cnum=gdata->ccount-1 ; - cnum >= 0 && cnum >= gdata->ccount - gdata->max_count; - cnum-- ) { - ClassInfo *cp; - int mnum; - - cp = gdata->classes + cnum; - stdout_message("Class %s %d calls\n", cp->name, cp->calls); - if ( cp->calls==0 ) continue; - - /* Sort method table (in place) by number of method calls. */ - /* Note: Do not use this table after this qsort! */ - qsort(cp->methods, cp->mcount, sizeof(MethodInfo), - &method_compar); - for ( mnum=cp->mcount-1 ; mnum >= 0 ; mnum-- ) { - MethodInfo *mp; - - mp = cp->methods + mnum; - if ( mp->calls==0 ) continue; - stdout_message("\tMethod %s %s %d calls %d returns\n", - mp->name, mp->signature, mp->calls, mp->returns); - } - } - } - stdout_message("End Class Stats\n"); - (void)fflush(stdout); - - } exit_critical_section(jvmti); - -} - -/* Callback for JVMTI_EVENT_THREAD_START */ -static void JNICALL -cbThreadStart(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - enter_critical_section(jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vm_is_dead ) { - char tname[MAX_THREAD_NAME_LENGTH]; - - get_thread_name(jvmti, thread, tname, sizeof(tname)); - stdout_message("ThreadStart %s\n", tname); - } - } exit_critical_section(jvmti); -} - -/* Callback for JVMTI_EVENT_THREAD_END */ -static void JNICALL -cbThreadEnd(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - enter_critical_section(jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vm_is_dead ) { - char tname[MAX_THREAD_NAME_LENGTH]; - - get_thread_name(jvmti, thread, tname, sizeof(tname)); - stdout_message("ThreadEnd %s\n", tname); - } - } exit_critical_section(jvmti); -} - -/* Callback for JVMTI_EVENT_CLASS_FILE_LOAD_HOOK */ -static void JNICALL -cbClassFileLoadHook(jvmtiEnv *jvmti, JNIEnv* env, - jclass class_being_redefined, jobject loader, - const char* name, jobject protection_domain, - jint class_data_len, const unsigned char* class_data, - jint* new_class_data_len, unsigned char** new_class_data) -{ - enter_critical_section(jvmti); { - /* It's possible we get here right after VmDeath event, be careful */ - if ( !gdata->vm_is_dead ) { - - const char *classname; - - /* Name could be NULL */ - if ( name == NULL ) { - classname = java_crw_demo_classname(class_data, class_data_len, - NULL); - if ( classname == NULL ) { - fatal_error("ERROR: No classname inside classfile\n"); - } - } else { - classname = strdup(name); - if ( classname == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - } - - *new_class_data_len = 0; - *new_class_data = NULL; - - /* The tracker class itself? */ - if ( interested((char*)classname, "", gdata->include, gdata->exclude) - && strcmp(classname, STRING(MTRACE_class)) != 0 ) { - jint cnum; - int system_class; - unsigned char *new_image; - long new_length; - ClassInfo *cp; - - /* Get unique number for every class file image loaded */ - cnum = gdata->ccount++; - - /* Save away class information */ - if ( gdata->classes == NULL ) { - gdata->classes = (ClassInfo*)malloc( - gdata->ccount*sizeof(ClassInfo)); - } else { - gdata->classes = (ClassInfo*) - realloc((void*)gdata->classes, - gdata->ccount*sizeof(ClassInfo)); - } - if ( gdata->classes == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - cp = gdata->classes + cnum; - cp->name = (const char *)strdup(classname); - if ( cp->name == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - cp->calls = 0; - cp->mcount = 0; - cp->methods = NULL; - - /* Is it a system class? If the class load is before VmStart - * then we will consider it a system class that should - * be treated carefully. (See java_crw_demo) - */ - system_class = 0; - if ( !gdata->vm_is_started ) { - system_class = 1; - } - - new_image = NULL; - new_length = 0; - - /* Call the class file reader/write demo code */ - java_crw_demo(cnum, - classname, - class_data, - class_data_len, - system_class, - STRING(MTRACE_class), "L" STRING(MTRACE_class) ";", - STRING(MTRACE_entry), "(II)V", - STRING(MTRACE_exit), "(II)V", - NULL, NULL, - NULL, NULL, - &new_image, - &new_length, - NULL, - &mnum_callbacks); - - /* If we got back a new class image, return it back as "the" - * new class image. This must be JVMTI Allocate space. - */ - if ( new_length > 0 ) { - unsigned char *jvmti_space; - - jvmti_space = (unsigned char *)allocate(jvmti, (jint)new_length); - (void)memcpy((void*)jvmti_space, (void*)new_image, (int)new_length); - *new_class_data_len = (jint)new_length; - *new_class_data = jvmti_space; /* VM will deallocate */ - } - - /* Always free up the space we get from java_crw_demo() */ - if ( new_image != NULL ) { - (void)free((void*)new_image); /* Free malloc() space with free() */ - } - } - (void)free((void*)classname); - } - } exit_critical_section(jvmti); -} - -/* Parse the options for this mtrace agent */ -static void -parse_agent_options(char *options) -{ - char token[MAX_TOKEN_LENGTH]; - char *next; - - gdata->max_count = 10; /* Default max=n */ - - /* Parse options and set flags in gdata */ - if ( options==NULL ) { - return; - } - - /* Get the first token from the options string. */ - next = get_token(options, ",=", token, sizeof(token)); - - /* While not at the end of the options string, process this option. */ - while ( next != NULL ) { - if ( strcmp(token,"help")==0 ) { - stdout_message("The mtrace JVMTI demo agent\n"); - stdout_message("\n"); - stdout_message(" java -agent:mtrace[=options] ...\n"); - stdout_message("\n"); - stdout_message("The options are comma separated:\n"); - stdout_message("\t help\t\t\t Print help information\n"); - stdout_message("\t max=n\t\t Only list top n classes\n"); - stdout_message("\t include=item\t\t Only these classes/methods\n"); - stdout_message("\t exclude=item\t\t Exclude these classes/methods\n"); - stdout_message("\n"); - stdout_message("item\t Qualified class and/or method names\n"); - stdout_message("\t\t e.g. (*.;Foobar.method;sun.*)\n"); - stdout_message("\n"); - exit(0); - } else if ( strcmp(token,"max")==0 ) { - char number[MAX_TOKEN_LENGTH]; - - /* Get the numeric option */ - next = get_token(next, ",=", number, (int)sizeof(number)); - /* Check for token scan error */ - if ( next==NULL ) { - fatal_error("ERROR: max=n option error\n"); - } - /* Save numeric value */ - gdata->max_count = atoi(number); - } else if ( strcmp(token,"include")==0 ) { - int used; - int maxlen; - - maxlen = MAX_METHOD_NAME_LENGTH; - if ( gdata->include == NULL ) { - gdata->include = (char*)calloc(maxlen+1, 1); - used = 0; - } else { - used = (int)strlen(gdata->include); - gdata->include[used++] = ','; - gdata->include[used] = 0; - gdata->include = (char*) - realloc((void*)gdata->include, used+maxlen+1); - } - if ( gdata->include == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - /* Add this item to the list */ - next = get_token(next, ",=", gdata->include+used, maxlen); - /* Check for token scan error */ - if ( next==NULL ) { - fatal_error("ERROR: include option error\n"); - } - } else if ( strcmp(token,"exclude")==0 ) { - int used; - int maxlen; - - maxlen = MAX_METHOD_NAME_LENGTH; - if ( gdata->exclude == NULL ) { - gdata->exclude = (char*)calloc(maxlen+1, 1); - used = 0; - } else { - used = (int)strlen(gdata->exclude); - gdata->exclude[used++] = ','; - gdata->exclude[used] = 0; - gdata->exclude = (char*) - realloc((void*)gdata->exclude, used+maxlen+1); - } - if ( gdata->exclude == NULL ) { - fatal_error("ERROR: Out of malloc memory\n"); - } - /* Add this item to the list */ - next = get_token(next, ",=", gdata->exclude+used, maxlen); - /* Check for token scan error */ - if ( next==NULL ) { - fatal_error("ERROR: exclude option error\n"); - } - } else if ( token[0]!=0 ) { - /* We got a non-empty token and we don't know what it is. */ - fatal_error("ERROR: Unknown option: %s\n", token); - } - /* Get the next token (returns NULL if there are no more) */ - next = get_token(next, ",=", token, sizeof(token)); - } -} - -/* Agent_OnLoad: This is called immediately after the shared library is - * loaded. This is the first code executed. - */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - static GlobalAgentData data; - jvmtiEnv *jvmti; - jvmtiError error; - jint res; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - - /* Setup initial global agent data area - * Use of static/extern data should be handled carefully here. - * We need to make sure that we are able to cleanup after ourselves - * so anything allocated in this library needs to be freed in - * the Agent_OnUnload() function. - */ - (void)memset((void*)&data, 0, sizeof(data)); - gdata = &data; - - /* First thing we need to do is get the jvmtiEnv* or JVMTI environment */ - res = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION_1); - if (res != JNI_OK) { - /* This means that the VM was unable to obtain this version of the - * JVMTI interface, this is a fatal error. - */ - fatal_error("ERROR: Unable to access JVMTI Version 1 (0x%x)," - " is your JDK a 5.0 or newer version?" - " JNIEnv's GetEnv() returned %d\n", - JVMTI_VERSION_1, res); - } - - /* Here we save the jvmtiEnv* for Agent_OnUnload(). */ - gdata->jvmti = jvmti; - - /* Parse any options supplied on java command line */ - parse_agent_options(options); - - /* Immediately after getting the jvmtiEnv* we need to ask for the - * capabilities this agent will need. In this case we need to make - * sure that we can get all class load hooks. - */ - (void)memset(&capabilities,0, sizeof(capabilities)); - capabilities.can_generate_all_class_hook_events = 1; - error = (*jvmti)->AddCapabilities(jvmti, &capabilities); - check_jvmti_error(jvmti, error, "Unable to get necessary JVMTI capabilities."); - - /* Next we need to provide the pointers to the callback functions to - * to this jvmtiEnv* - */ - (void)memset(&callbacks,0, sizeof(callbacks)); - /* JVMTI_EVENT_VM_START */ - callbacks.VMStart = &cbVMStart; - /* JVMTI_EVENT_VM_INIT */ - callbacks.VMInit = &cbVMInit; - /* JVMTI_EVENT_VM_DEATH */ - callbacks.VMDeath = &cbVMDeath; - /* JVMTI_EVENT_CLASS_FILE_LOAD_HOOK */ - callbacks.ClassFileLoadHook = &cbClassFileLoadHook; - /* JVMTI_EVENT_THREAD_START */ - callbacks.ThreadStart = &cbThreadStart; - /* JVMTI_EVENT_THREAD_END */ - callbacks.ThreadEnd = &cbThreadEnd; - error = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, (jint)sizeof(callbacks)); - check_jvmti_error(jvmti, error, "Cannot set jvmti callbacks"); - - /* At first the only initial events we are interested in are VM - * initialization, VM death, and Class File Loads. - * Once the VM is initialized we will request more events. - */ - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_START, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_DEATH, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - error = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, (jthread)NULL); - check_jvmti_error(jvmti, error, "Cannot set event notification"); - - /* Here we create a raw monitor for our use in this agent to - * protect critical sections of code. - */ - error = (*jvmti)->CreateRawMonitor(jvmti, "agent data", &(gdata->lock)); - check_jvmti_error(jvmti, error, "Cannot create raw monitor"); - - /* Add demo jar file to boot classpath */ - add_demo_jar_to_bootclasspath(jvmti, "mtrace"); - - /* We return JNI_OK to signify success */ - return JNI_OK; -} - -/* Agent_OnUnload: This is called immediately before the shared library is - * unloaded. This is the last code executed. - */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ - /* Make sure all malloc/calloc/strdup space is freed */ - if ( gdata->include != NULL ) { - (void)free((void*)gdata->include); - gdata->include = NULL; - } - if ( gdata->exclude != NULL ) { - (void)free((void*)gdata->exclude); - gdata->exclude = NULL; - } - if ( gdata->classes != NULL ) { - int cnum; - - for ( cnum = 0 ; cnum < gdata->ccount ; cnum++ ) { - ClassInfo *cp; - - cp = gdata->classes + cnum; - (void)free((void*)cp->name); - if ( cp->mcount > 0 ) { - int mnum; - - for ( mnum = 0 ; mnum < cp->mcount ; mnum++ ) { - MethodInfo *mp; - - mp = cp->methods + mnum; - (void)free((void*)mp->name); - (void)free((void*)mp->signature); - } - (void)free((void*)cp->methods); - } - } - (void)free((void*)gdata->classes); - gdata->classes = NULL; - } -} diff --git a/jdk/src/demo/share/jvmti/mtrace/mtrace.h b/jdk/src/demo/share/jvmti/mtrace/mtrace.h deleted file mode 100644 index 39f483ddf14..00000000000 --- a/jdk/src/demo/share/jvmti/mtrace/mtrace.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Primary mtrace #include file, should be included by most if not - * all mtrace source files. Gives access to the global data structure - * and all global macros. - */ - -#ifndef MTRACE_H -#define MTRACE_H - -/* Standard C functions used throughout. */ - -#include -#include -#include -#include -#include - -/* General JVM/Java functions, types and macros. */ - -#include -#include "jni.h" -#include "jvmti.h" - -/* Utility functions */ - -#include "agent_util.h" - -#endif diff --git a/jdk/src/demo/share/jvmti/mtrace/sample.makefile.txt b/jdk/src/demo/share/jvmti/mtrace/sample.makefile.txt deleted file mode 100644 index b342e785020..00000000000 --- a/jdk/src/demo/share/jvmti/mtrace/sample.makefile.txt +++ /dev/null @@ -1,163 +0,0 @@ -# -# Copyright (c) 2004, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo mtrace -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=mtrace -SOURCES=mtrace.c ../agent_util/agent_util.c -JAVA_SOURCES=Mtrace.java - -# Name of jar file that needs to be created -JARFILE=mtrace.jar - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-L $(JDK)/jre/lib/$(LIBARCH) -ljava_crw_demo -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Add in java_crw_demo obj file on windows (easier) - SOURCES+=../java_crw_demo/java_crw_demo.c - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES=$(JDK)/ - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I../agent_util -CFLAGS += -I../java_crw_demo -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule (build both native library and jar file) -all: $(LIBRARY) $(JARFILE) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Build jar file -$(JARFILE): $(JAVA_SOURCES) - rm -f -r classes - mkdir -p classes - $(JDK)/bin/javac -d classes $(JAVA_SOURCES) - (cd classes; $(JDK)/bin/jar cf ../$@ *) - -# Cleanup the built bits -clean: - rm -f -r classes - rm -f $(LIBRARY) $(JARFILE) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=. $(JDK)/bin/java -agentlib:$(LIBNAME) -Xbootclasspath/a:./$(JARFILE) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/versionCheck/README.txt b/jdk/src/demo/share/jvmti/versionCheck/README.txt deleted file mode 100644 index 838af415252..00000000000 --- a/jdk/src/demo/share/jvmti/versionCheck/README.txt +++ /dev/null @@ -1,43 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -versionCheck - -This agent library just makes some simple calls and checks -the version of the interface being used to build the agent, -with that supplied by the VM at runtime. - -You can use this agent library as follows: - - java -agentlib:versionCheck ... - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/versionCheck/sample.makefile.txt b/jdk/src/demo/share/jvmti/versionCheck/sample.makefile.txt deleted file mode 100644 index 01240330398..00000000000 --- a/jdk/src/demo/share/jvmti/versionCheck/sample.makefile.txt +++ /dev/null @@ -1,148 +0,0 @@ -# -# Copyright (c) 2004, 2016, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo versionCheck -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=versionCheck -SOURCES=versionCheck.c ../agent_util/agent_util.c - -# Solaris Studio C Compiler Version 12.4 -ifeq ($(OSNAME), solaris) - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Options that help find errors - COMMON_FLAGS+= -Xa -v -xc99=%none - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CFLAGS=-xO2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES= -lc - # Building a shared library - LINK_SHARED=$(LINK.c) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CFLAGS=-O2 $(COMMON_FLAGS) - else - CFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES=-lc - # Building a shared library - LINK_SHARED=$(LINK.c) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.c=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CFLAGS += -I. -CFLAGS += -I../agent_util -CFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule -all: $(LIBRARY) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Cleanup the built bits -clean: - rm -f $(LIBRARY) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.c - $(COMPILE.c) $< -endif - diff --git a/jdk/src/demo/share/jvmti/versionCheck/versionCheck.c b/jdk/src/demo/share/jvmti/versionCheck/versionCheck.c deleted file mode 100644 index 0ed58263b26..00000000000 --- a/jdk/src/demo/share/jvmti/versionCheck/versionCheck.c +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -/* Create major.minor.micro version string */ -static void -version_check(jint cver, jint rver) -{ - jint cmajor, cminor, cmicro; - jint rmajor, rminor, rmicro; - - cmajor = (cver & JVMTI_VERSION_MASK_MAJOR) >> JVMTI_VERSION_SHIFT_MAJOR; - cminor = (cver & JVMTI_VERSION_MASK_MINOR) >> JVMTI_VERSION_SHIFT_MINOR; - cmicro = (cver & JVMTI_VERSION_MASK_MICRO) >> JVMTI_VERSION_SHIFT_MICRO; - rmajor = (rver & JVMTI_VERSION_MASK_MAJOR) >> JVMTI_VERSION_SHIFT_MAJOR; - rminor = (rver & JVMTI_VERSION_MASK_MINOR) >> JVMTI_VERSION_SHIFT_MINOR; - rmicro = (rver & JVMTI_VERSION_MASK_MICRO) >> JVMTI_VERSION_SHIFT_MICRO; - stdout_message("Compile Time JVMTI Version: %d.%d.%d (0x%08x)\n", - cmajor, cminor, cmicro, cver); - stdout_message("Run Time JVMTI Version: %d.%d.%d (0x%08x)\n", - rmajor, rminor, rmicro, rver); - if ( (cmajor > rmajor) || (cmajor == rmajor && cminor > rminor) ) { - fatal_error( - "ERROR: Compile Time JVMTI and Run Time JVMTI are incompatible\n"); - } -} - -/* Callback for JVMTI_EVENT_VM_INIT */ -static void JNICALL -vm_init(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiError err; - jint runtime_version; - - /* The exact JVMTI version doesn't have to match, however this - * code demonstrates how you can check that the JVMTI version seen - * in the jvmti.h include file matches that being supplied at runtime - * by the VM. - */ - err = (*jvmti)->GetVersionNumber(jvmti, &runtime_version); - check_jvmti_error(jvmti, err, "get version number"); - version_check(JVMTI_VERSION, runtime_version); -} - -/* Agent_OnLoad() is called first, we prepare for a VM_INIT event here. */ -JNIEXPORT jint JNICALL -DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) -{ - jint rc; - jvmtiError err; - jvmtiEventCallbacks callbacks; - jvmtiEnv *jvmti; - - /* Get JVMTI environment */ - rc = (*vm)->GetEnv(vm, (void **)&jvmti, JVMTI_VERSION); - if (rc != JNI_OK) { - fatal_error("ERROR: Unable to create jvmtiEnv, GetEnv failed, error=%d\n", rc); - return -1; - } - - /* Set callbacks and enable event notifications */ - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.VMInit = &vm_init; - err = (*jvmti)->SetEventCallbacks(jvmti, &callbacks, sizeof(callbacks)); - check_jvmti_error(jvmti, err, "set event callbacks"); - err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - return 0; -} - -/* Agent_OnUnload() is called last */ -JNIEXPORT void JNICALL -DEF_Agent_OnUnload(JavaVM *vm) -{ -} diff --git a/jdk/src/demo/share/jvmti/waiters/Agent.cpp b/jdk/src/demo/share/jvmti/waiters/Agent.cpp deleted file mode 100644 index 8f67f5480a5..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/Agent.cpp +++ /dev/null @@ -1,225 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -#include "Monitor.hpp" -#include "Thread.hpp" -#include "Agent.hpp" - -/* Implementation of the Agent class */ - -/* Given a jvmtiEnv* and jthread, find the Thread instance */ -Thread * -Agent::get_thread(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiError err; - Thread *t; - - /* This should always be in the Thread Local Storage */ - t = NULL; - err = jvmti->GetThreadLocalStorage(thread, (void**)&t); - check_jvmti_error(jvmti, err, "get thread local storage"); - if ( t == NULL ) { - /* This jthread has never been seen before? */ - stdout_message("WARNING: Never before seen jthread?\n"); - t = new Thread(jvmti, env, thread); - err = jvmti->SetThreadLocalStorage(thread, (const void*)t); - check_jvmti_error(jvmti, err, "set thread local storage"); - } - return t; -} - -/* Given a jvmtiEnv* and jobject, find the Monitor instance or create one */ -Monitor * -Agent::get_monitor(jvmtiEnv *jvmti, JNIEnv *env, jobject object) -{ - jvmtiError err; - Monitor *m; - jlong tag; - - m = NULL; - tag = (jlong)0; - err = jvmti->GetTag(object, &tag); - check_jvmti_error(jvmti, err, "get tag"); - /*LINTED*/ - m = (Monitor *)(void *)(ptrdiff_t)tag; - if ( m == NULL ) { - m = new Monitor(jvmti, env, object); - /* Save monitor on list */ - if (monitor_count == monitor_list_size) { - monitor_list_size += monitor_list_grow_size; - monitor_list = (Monitor**)realloc((void*)monitor_list, - (monitor_list_size)*(int)sizeof(Monitor*)); - } - monitor_list[monitor_count] = m; - m->set_slot(monitor_count); - monitor_count++; - /*LINTED*/ - tag = (jlong)(ptrdiff_t)(void *)m; - err = jvmti->SetTag(object, tag); - check_jvmti_error(jvmti, err, "set tag"); - } - return m; -} - -/* VM initialization and VM death calls to Agent */ -Agent::Agent(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - stdout_message("Agent created..\n"); - stdout_message("VMInit...\n"); - /* Start monitor list */ - monitor_count = 0; - monitor_list_size = initial_monitor_list_size; - monitor_list = (Monitor**) - malloc(monitor_list_size*(int)sizeof(Monitor*)); -} - -Agent::~Agent() -{ - stdout_message("Agent reclaimed..\n"); -} - -void Agent::vm_death(jvmtiEnv *jvmti, JNIEnv *env) -{ - /* Delete all Monitors we allocated */ - for ( int i = 0; i < (int)monitor_count; i++ ) { - delete monitor_list[i]; - } - free(monitor_list); - /* Print death message */ - stdout_message("VMDeath...\n"); -} - -/* Thread start event, setup a new thread */ -void Agent::thread_start(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiError err; - Thread *t; - - /* Allocate a new Thread instance, put it in the Thread Local - * Storage for easy access later. - */ - t = new Thread(jvmti, env, thread); - err = jvmti->SetThreadLocalStorage(thread, (const void*)t); - check_jvmti_error(jvmti, err, "set thread local storage"); -} - - -/* Thread end event, we need to reclaim the space */ -void Agent::thread_end(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiError err; - Thread *t; - - /* Find the thread */ - t = get_thread(jvmti, env, thread); - - /* Clear out the Thread Local Storage */ - err = jvmti->SetThreadLocalStorage(thread, (const void*)NULL); - check_jvmti_error(jvmti, err, "set thread local storage"); - - /* Reclaim the C++ object space */ - delete t; -} - -/* Monitor contention begins for a thread. */ -void Agent::monitor_contended_enter(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object) -{ - get_monitor(jvmti, env, object)->contended(); - get_thread(jvmti, env, thread)-> - monitor_contended_enter(jvmti, env, thread, object); -} - -/* Monitor contention ends for a thread. */ -void Agent::monitor_contended_entered(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object) -{ - /* Do nothing for now */ -} - -/* Monitor wait begins for a thread. */ -void Agent::monitor_wait(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jlong timeout) -{ - get_monitor(jvmti, env, object)->waited(); - get_thread(jvmti, env, thread)-> - monitor_wait(jvmti, env, thread, object, timeout); -} - -/* Monitor wait ends for a thread. */ -void Agent::monitor_waited(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jboolean timed_out) -{ - if ( timed_out ) { - get_monitor(jvmti, env, object)->timeout(); - } - get_thread(jvmti, env, thread)-> - monitor_waited(jvmti, env, thread, object, timed_out); -} - -/* A tagged object has been freed */ -void Agent::object_free(jvmtiEnv* jvmti, jlong tag) -{ - /* We just cast the tag to a C++ pointer and delete it. - * we know it can only be a Monitor *. - */ - Monitor *m; - /*LINTED*/ - m = (Monitor *)(ptrdiff_t)tag; - if (monitor_count > 1) { - /* Move the last element to this Monitor's slot */ - int slot = m->get_slot(); - Monitor *last = monitor_list[monitor_count-1]; - monitor_list[slot] = last; - last->set_slot(slot); - } - monitor_count--; - delete m; -} diff --git a/jdk/src/demo/share/jvmti/waiters/Agent.hpp b/jdk/src/demo/share/jvmti/waiters/Agent.hpp deleted file mode 100644 index 20f03229ef9..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/Agent.hpp +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* C++ Agent class */ - -class Agent { - - private: - enum { - initial_monitor_list_size = 64, - monitor_list_grow_size = 16 - }; - Monitor **monitor_list; - unsigned monitor_list_size; - unsigned monitor_count; - Thread *get_thread(jvmtiEnv *jvmti, JNIEnv *env, jthread thread); - Monitor *get_monitor(jvmtiEnv *jvmti, JNIEnv *env, jobject object); - - public: - Agent(jvmtiEnv *jvmti, JNIEnv *env, jthread thread); - ~Agent(); - void vm_death(jvmtiEnv *jvmti, JNIEnv *env); - void thread_start(jvmtiEnv *jvmti, JNIEnv *env, jthread thread); - void thread_end(jvmtiEnv *jvmti, JNIEnv *env, jthread thread); - void monitor_contended_enter(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object); - void monitor_contended_entered(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object); - void monitor_wait(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jlong timeout); - void monitor_waited(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jboolean timed_out); - void object_free(jvmtiEnv* jvmti, jlong tag); - -}; diff --git a/jdk/src/demo/share/jvmti/waiters/Monitor.cpp b/jdk/src/demo/share/jvmti/waiters/Monitor.cpp deleted file mode 100644 index db215c8b7b7..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/Monitor.cpp +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -#include "Monitor.hpp" - -/* Implementation of the Monitor class */ - -Monitor::Monitor(jvmtiEnv *jvmti, JNIEnv *env, jobject object) -{ - jvmtiError err; - jclass klass; - char *signature; - - /* Clear counters */ - contends = 0; - waits = 0; - timeouts = 0; - - /* Get the class name for this monitor object */ - (void)strcpy(name, "Unknown"); - klass = env->GetObjectClass(object); - if ( klass == NULL ) { - fatal_error("ERROR: Cannot find jclass from jobject\n"); - } - err = jvmti->GetClassSignature(klass, &signature, NULL); - check_jvmti_error(jvmti, err, "get class signature"); - if ( signature != NULL ) { - (void)strncpy(name, signature, (int)sizeof(name)-1); - deallocate(jvmti, signature); - } -} - -Monitor::~Monitor() -{ - stdout_message("Monitor %s summary: %d contends, %d waits, %d timeouts\n", - name, contends, waits, timeouts); -} - -int Monitor::get_slot() -{ - return slot; -} - -void Monitor::set_slot(int aslot) -{ - slot = aslot; -} - -void Monitor::contended() -{ - contends++; -} - -void Monitor::waited() -{ - waits++; -} - -void Monitor::timeout() -{ - timeouts++; -} diff --git a/jdk/src/demo/share/jvmti/waiters/Monitor.hpp b/jdk/src/demo/share/jvmti/waiters/Monitor.hpp deleted file mode 100644 index 2906e5779f6..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/Monitor.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - -#ifdef STATIC_BUILD -#define Monitor WaiterMonitor -#endif - - -/* C++ Monitor class */ - -class Monitor { - - private: - char name[64]; - int slot; - unsigned contends; - unsigned waits; - unsigned timeouts; - - public: - Monitor(jvmtiEnv *jvmti, JNIEnv *env, jobject object); - ~Monitor(); - int get_slot(); - void set_slot(int i); - void contended(); - void waited(); - void timeout(); - -}; diff --git a/jdk/src/demo/share/jvmti/waiters/README.txt b/jdk/src/demo/share/jvmti/waiters/README.txt deleted file mode 100644 index f0d940bd34e..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/README.txt +++ /dev/null @@ -1,46 +0,0 @@ -# -# Copyright (c) 2004, 2007, 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. -# - -waiters - -This agent library can be used to track threads that wait on monitors. -This agent is written in C++. - -You can use this agent library as follows: - - java -agentlib:waiters ... - -To get help on the available options try: - - java -agentlib:waiters=help - -See ${JAVA_HOME}/demo/jvmti/index.html for help running and building agents. - diff --git a/jdk/src/demo/share/jvmti/waiters/Thread.cpp b/jdk/src/demo/share/jvmti/waiters/Thread.cpp deleted file mode 100644 index 589976963e0..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/Thread.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - -#ifdef STATIC_BUILD -#define Thread WaiterThread -#endif - -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -#include "Thread.hpp" - -/* Implementation of the Thread class */ - -Thread::Thread(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) -{ - jvmtiError err; - jvmtiThreadInfo info; - - /* Get and save the name of the thread */ - info.name = NULL; - (void)strcpy(name, "Unknown"); - err = jvmti->GetThreadInfo(thread, &info); - check_jvmti_error(jvmti, err, "get thread info"); - if ( info.name != NULL ) { - (void)strncpy(name, info.name, (int)sizeof(name)-1); - name[(int)sizeof(name)-1] = 0; - deallocate(jvmti, info.name); - } - - /* Clear thread counters */ - contends = 0; - waits = 0; - timeouts = 0; -} - -Thread::~Thread() -{ - /* Send out summary message */ - stdout_message("Thread %s summary: %d waits plus %d contended\n", - name, waits, contends); -} - -void Thread::monitor_contended_enter(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object) -{ - contends++; -} - -void Thread::monitor_wait(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jlong timeout) -{ - waits++; -} - -void Thread::monitor_waited(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jboolean timed_out) -{ - if ( timed_out ) { - timeouts++; - } -} diff --git a/jdk/src/demo/share/jvmti/waiters/Thread.hpp b/jdk/src/demo/share/jvmti/waiters/Thread.hpp deleted file mode 100644 index 0ad661521e6..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/Thread.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* C++ Thread class */ - -class Thread { - - private: - char name[64]; - unsigned contends; - unsigned waits; - unsigned timeouts; - - public: - Thread(jvmtiEnv *jvmti, JNIEnv *env, jthread thread); - ~Thread(); - void monitor_contended_enter(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object); - void monitor_wait(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jlong timeout); - void monitor_waited(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jboolean timed_out); - -}; diff --git a/jdk/src/demo/share/jvmti/waiters/sample.makefile.txt b/jdk/src/demo/share/jvmti/waiters/sample.makefile.txt deleted file mode 100644 index 51cbca4a395..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/sample.makefile.txt +++ /dev/null @@ -1,149 +0,0 @@ -# -# Copyright (c) 2004, 2012, 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. -# - -######################################################################## -# -# Sample GNU Makefile for building JVMTI Demo waiters -# -# Example uses: -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparc] -# gnumake JDK= OSNAME=solaris [OPT=true] [LIBARCH=sparcv9] -# gnumake JDK= OSNAME=linux [OPT=true] -# gnumake JDK= OSNAME=win32 [OPT=true] -# -######################################################################## - -# Source lists -LIBNAME=waiters -SOURCES=waiters.cpp Agent.cpp Thread.cpp Monitor.cpp ../agent_util/agent_util.c - -# Solaris Sun C Compiler Version 5.5 -ifeq ($(OSNAME), solaris) - # Tell gnumake which compilers to use - CC=cc - CXX=CC - # Sun Solaris Compiler options needed - COMMON_FLAGS=-mt -KPIC - # Check LIBARCH for any special compiler options - LIBARCH=$(shell uname -p) - ifeq ($(LIBARCH), sparc) - COMMON_FLAGS+=-xarch=v8 -xregs=no%appl - endif - ifeq ($(LIBARCH), sparcv9) - COMMON_FLAGS+=-xarch=v9 -xregs=no%appl - endif - ifeq ($(OPT), true) - CXXFLAGS=-xO2 $(COMMON_FLAGS) - else - CXXFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.cpp=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-z defs -ztext - # Libraries we are dependent on - LIBRARIES= -lc - # Building a shared library - LINK_SHARED=$(LINK.cc) -G -o $@ -endif - -# Linux GNU C Compiler -ifeq ($(OSNAME), linux) - # GNU Compiler options needed to build it - COMMON_FLAGS=-fno-strict-aliasing -fPIC -fno-omit-frame-pointer - # Options that help find errors - COMMON_FLAGS+= -W -Wall -Wno-unused -Wno-parentheses - ifeq ($(OPT), true) - CXXFLAGS=-O2 $(COMMON_FLAGS) - else - CXXFLAGS=-g $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.cpp=%.o) - # Library name and options needed to build it - LIBRARY=lib$(LIBNAME).so - LDFLAGS=-Wl,-soname=$(LIBRARY) -static-libgcc - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=$(LINK.cc) -shared -o $@ -endif - -# Windows Microsoft C/C++ Optimizing Compiler Version 12 -ifeq ($(OSNAME), win32) - CC=cl - # Compiler options needed to build it - COMMON_FLAGS=-Gy -DWIN32 - # Options that help find errors - COMMON_FLAGS+=-W0 -WX - ifeq ($(OPT), true) - CXXFLAGS= -Ox -Op -Zi $(COMMON_FLAGS) - else - CXXFLAGS= -Od -Zi $(COMMON_FLAGS) - endif - # Object files needed to create library - OBJECTS=$(SOURCES:%.cpp=%.obj) - # Library name and options needed to build it - LIBRARY=$(LIBNAME).dll - LDFLAGS= - # Libraries we are dependent on - LIBRARIES= - # Building a shared library - LINK_SHARED=link -dll -out:$@ -endif - -# Common -I options -CXXFLAGS += -I. -CXXFLAGS += -I../agent_util -CXXFLAGS += -I$(JDK)/include -I$(JDK)/include/$(OSNAME) - -# Default rule -all: $(LIBRARY) - -# Build native library -$(LIBRARY): $(OBJECTS) - $(LINK_SHARED) $(OBJECTS) $(LIBRARIES) - -# Cleanup the built bits -clean: - rm -f $(LIBRARY) $(OBJECTS) - -# Simple tester -test: all - LD_LIBRARY_PATH=`pwd` $(JDK)/bin/java -agentlib:$(LIBNAME) -version - -# Compilation rule only needed on Windows -ifeq ($(OSNAME), win32) -%.obj: %.cpp - $(COMPILE.cc) $< -endif - diff --git a/jdk/src/demo/share/jvmti/waiters/waiters.cpp b/jdk/src/demo/share/jvmti/waiters/waiters.cpp deleted file mode 100644 index cf38e00e160..00000000000 --- a/jdk/src/demo/share/jvmti/waiters/waiters.cpp +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2004, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* Example of using JVMTI events: - * JVMTI_EVENT_VM_INIT - * JVMTI_EVENT_VM_DEATH - * JVMTI_EVENT_THREAD_START - * JVMTI_EVENT_THREAD_END - * JVMTI_EVENT_MONITOR_CONTENDED_ENTER - * JVMTI_EVENT_MONITOR_WAIT - * JVMTI_EVENT_MONITOR_WAITED - * JVMTI_EVENT_OBJECT_FREE - */ - -#include -#include -#include - -#include "jni.h" -#include "jvmti.h" - -#include "agent_util.h" - -#include "Monitor.hpp" -#include "Thread.hpp" -#include "Agent.hpp" - -static jrawMonitorID vm_death_lock; -static jboolean vm_death_active; - -/* Given a jvmtiEnv*, return the C++ Agent class instance */ -static Agent * -get_agent(jvmtiEnv *jvmti) -{ - jvmtiError err; - Agent *agent; - - agent = NULL; - err = jvmti->GetEnvironmentLocalStorage((void**)&agent); - check_jvmti_error(jvmti, err, "get env local storage"); - if ( agent == NULL ) { - /* This should never happen, but we should check */ - fatal_error("ERROR: GetEnvironmentLocalStorage() returned NULL"); - } - return agent; -} - -/* Enter raw monitor */ -static void -menter(jvmtiEnv *jvmti, jrawMonitorID rmon) -{ - jvmtiError err; - - err = jvmti->RawMonitorEnter(rmon); - check_jvmti_error(jvmti, err, "raw monitor enter"); -} - -/* Exit raw monitor */ -static void -mexit(jvmtiEnv *jvmti, jrawMonitorID rmon) -{ - jvmtiError err; - - err = jvmti->RawMonitorExit(rmon); - check_jvmti_error(jvmti, err, "raw monitor exit"); -} - - -/* All callbacks need to be extern "C" */ -extern "C" { - static void JNICALL - vm_init(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) - { - jvmtiError err; - Agent *agent; - - /* Create raw monitor to protect against threads running after death */ - err = jvmti->CreateRawMonitor("Waiters vm_death lock", &vm_death_lock); - check_jvmti_error(jvmti, err, "create raw monitor"); - vm_death_active = JNI_FALSE; - - /* Create an Agent instance, set JVMTI Local Storage */ - agent = new Agent(jvmti, env, thread); - err = jvmti->SetEnvironmentLocalStorage((const void*)agent); - check_jvmti_error(jvmti, err, "set env local storage"); - - /* Enable all other events we want */ - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_VM_DEATH, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_THREAD_START, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_THREAD_END, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_MONITOR_CONTENDED_ENTER, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_MONITOR_CONTENDED_ENTERED, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_MONITOR_WAIT, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_MONITOR_WAITED, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_OBJECT_FREE, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - } - static void JNICALL - vm_death(jvmtiEnv *jvmti, JNIEnv *env) - { - jvmtiError err; - Agent *agent; - - /* Block all callbacks */ - menter(jvmti, vm_death_lock); { - /* Set flag for other callbacks */ - vm_death_active = JNI_TRUE; - - /* Inform Agent instance of VM_DEATH */ - agent = get_agent(jvmti); - agent->vm_death(jvmti, env); - - /* Reclaim space of Agent */ - err = jvmti->SetEnvironmentLocalStorage((const void*)NULL); - check_jvmti_error(jvmti, err, "set env local storage"); - delete agent; - } mexit(jvmti, vm_death_lock); - - } - static void JNICALL - thread_start(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->thread_start(jvmti, env, thread); - } - } mexit(jvmti, vm_death_lock); - } - static void JNICALL - thread_end(jvmtiEnv *jvmti, JNIEnv *env, jthread thread) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->thread_end(jvmti, env, thread); - } - } mexit(jvmti, vm_death_lock); - } - static void JNICALL - monitor_contended_enter(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->monitor_contended_enter(jvmti, env, - thread, object); - } - } mexit(jvmti, vm_death_lock); - } - static void JNICALL - monitor_contended_entered(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->monitor_contended_entered(jvmti, env, - thread, object); - } - } mexit(jvmti, vm_death_lock); - } - static void JNICALL - monitor_wait(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jlong timeout) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->monitor_wait(jvmti, env, thread, - object, timeout); - } - } mexit(jvmti, vm_death_lock); - } - static void JNICALL - monitor_waited(jvmtiEnv* jvmti, JNIEnv *env, - jthread thread, jobject object, jboolean timed_out) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->monitor_waited(jvmti, env, thread, - object, timed_out); - } - } mexit(jvmti, vm_death_lock); - } - static void JNICALL - object_free(jvmtiEnv* jvmti, jlong tag) - { - menter(jvmti, vm_death_lock); { - if ( !vm_death_active ) { - get_agent(jvmti)->object_free(jvmti, tag); - } - } mexit(jvmti, vm_death_lock); - } - - /* Agent_OnLoad() is called first, we prepare for a VM_INIT event here. */ - JNIEXPORT jint JNICALL - DEF_Agent_OnLoad(JavaVM *vm, char *options, void *reserved) - { - jvmtiEnv *jvmti; - jint rc; - jvmtiError err; - jvmtiCapabilities capabilities; - jvmtiEventCallbacks callbacks; - - /* Get JVMTI environment */ - rc = vm->GetEnv((void **)&jvmti, JVMTI_VERSION); - if (rc != JNI_OK) { - fatal_error("ERROR: Unable to create jvmtiEnv, GetEnv failed, error=%d\n", rc); - return -1; - } - - /* Get/Add JVMTI capabilities */ - (void)memset(&capabilities, 0, sizeof(capabilities)); - capabilities.can_generate_monitor_events = 1; - capabilities.can_get_monitor_info = 1; - capabilities.can_tag_objects = 1; - capabilities.can_generate_object_free_events = 1; - err = jvmti->AddCapabilities(&capabilities); - check_jvmti_error(jvmti, err, "add capabilities"); - - /* Set all callbacks and enable VM_INIT event notification */ - memset(&callbacks, 0, sizeof(callbacks)); - callbacks.VMInit = &vm_init; - callbacks.VMDeath = &vm_death; - callbacks.ThreadStart = &thread_start; - callbacks.ThreadEnd = &thread_end; - callbacks.MonitorContendedEnter = &monitor_contended_enter; - callbacks.MonitorContendedEntered = &monitor_contended_entered; - callbacks.MonitorWait = &monitor_wait; - callbacks.MonitorWaited = &monitor_waited; - callbacks.ObjectFree = &object_free; - err = jvmti->SetEventCallbacks(&callbacks, (jint)sizeof(callbacks)); - check_jvmti_error(jvmti, err, "set event callbacks"); - err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, - JVMTI_EVENT_VM_INIT, NULL); - check_jvmti_error(jvmti, err, "set event notify"); - return 0; - } - - /* Agent_OnUnload() is called last */ - JNIEXPORT void JNICALL - DEF_Agent_OnUnload(JavaVM *vm) - { - } - -} /* of extern "C" */ diff --git a/jdk/src/demo/share/management/FullThreadDump/Deadlock.java b/jdk/src/demo/share/management/FullThreadDump/Deadlock.java deleted file mode 100644 index 85668ee50da..00000000000 --- a/jdk/src/demo/share/management/FullThreadDump/Deadlock.java +++ /dev/null @@ -1,214 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import java.util.concurrent.CyclicBarrier; -import java.util.concurrent.BrokenBarrierException; -import java.util.concurrent.locks.Lock; -import java.util.concurrent.locks.ReentrantLock; -import java.io.IOException; - -/** - * This Deadlock class demonstrates the capability of performing - * deadlock detection programmatically within the application using - * the java.lang.management API. - * - * See ThreadMonitor.java for the use of java.lang.management.ThreadMXBean - * API. - */ -public class Deadlock { - public static void main(String[] argv) { - new Deadlock(); - - // Now find deadlock - ThreadMonitor monitor = new ThreadMonitor(); - boolean found = false; - while (!found) { - found = monitor.findDeadlock(); - try { - Thread.sleep(500); - } catch (InterruptedException e) { - System.exit(1); - } - } - - System.out.println("\nPress to exit this Deadlock program.\n"); - waitForEnterPressed(); - } - - - private CyclicBarrier barrier = new CyclicBarrier(6); - public Deadlock() { - DeadlockThread[] dThreads = new DeadlockThread[6]; - - Monitor a = new Monitor("a"); - Monitor b = new Monitor("b"); - Monitor c = new Monitor("c"); - dThreads[0] = new DeadlockThread("MThread-1", a, b); - dThreads[1] = new DeadlockThread("MThread-2", b, c); - dThreads[2] = new DeadlockThread("MThread-3", c, a); - - Lock d = new ReentrantLock(); - Lock e = new ReentrantLock(); - Lock f = new ReentrantLock(); - - dThreads[3] = new DeadlockThread("SThread-4", d, e); - dThreads[4] = new DeadlockThread("SThread-5", e, f); - dThreads[5] = new DeadlockThread("SThread-6", f, d); - - // make them daemon threads so that the test will exit - for (int i = 0; i < 6; i++) { - dThreads[i].setDaemon(true); - dThreads[i].start(); - } - } - - class DeadlockThread extends Thread { - private Lock lock1 = null; - private Lock lock2 = null; - private Monitor mon1 = null; - private Monitor mon2 = null; - private boolean useSync; - - DeadlockThread(String name, Lock lock1, Lock lock2) { - super(name); - this.lock1 = lock1; - this.lock2 = lock2; - this.useSync = true; - } - DeadlockThread(String name, Monitor mon1, Monitor mon2) { - super(name); - this.mon1 = mon1; - this.mon2 = mon2; - this.useSync = false; - } - @Override - public void run() { - if (useSync) { - syncLock(); - } else { - monitorLock(); - } - } - private void syncLock() { - lock1.lock(); - try { - try { - barrier.await(); - } catch (InterruptedException e) { - e.printStackTrace(); - System.exit(1); - } catch (BrokenBarrierException e) { - e.printStackTrace(); - System.exit(1); - } - goSyncDeadlock(); - } finally { - lock1.unlock(); - } - } - private void goSyncDeadlock() { - try { - barrier.await(); - } catch (InterruptedException e) { - e.printStackTrace(); - System.exit(1); - } catch (BrokenBarrierException e) { - e.printStackTrace(); - System.exit(1); - } - lock2.lock(); - throw new RuntimeException("should not reach here."); - } - private void monitorLock() { - synchronized (mon1) { - try { - barrier.await(); - } catch (InterruptedException e) { - e.printStackTrace(); - System.exit(1); - } catch (BrokenBarrierException e) { - e.printStackTrace(); - System.exit(1); - } - goMonitorDeadlock(); - } - } - private void goMonitorDeadlock() { - try { - barrier.await(); - } catch (InterruptedException e) { - e.printStackTrace(); - System.exit(1); - } catch (BrokenBarrierException e) { - e.printStackTrace(); - System.exit(1); - } - synchronized (mon2) { - throw new RuntimeException(getName() + " should not reach here."); - } - } - } - - class Monitor { - String name; - Monitor(String name) { - this.name = name; - } - } - - private static void waitForEnterPressed() { - try { - boolean done = false; - while (!done) { - char ch = (char) System.in.read(); - if (ch<0||ch=='\n') { - done = true; - } - } - } - catch (IOException e) { - e.printStackTrace(); - System.exit(0); - } - } -} diff --git a/jdk/src/demo/share/management/FullThreadDump/FullThreadDump.java b/jdk/src/demo/share/management/FullThreadDump/FullThreadDump.java deleted file mode 100644 index ba46eeb828c..00000000000 --- a/jdk/src/demo/share/management/FullThreadDump/FullThreadDump.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import javax.management.*; -import javax.management.remote.*; -import java.io.IOException; -import java.net.MalformedURLException; - -/** - * This FullThreadDump class demonstrates the capability to get - * a full thread dump and also detect deadlock remotely. - */ -public class FullThreadDump { - private MBeanServerConnection server; - private JMXConnector jmxc; - public FullThreadDump(String hostname, int port) { - System.out.println("Connecting to " + hostname + ":" + port); - - // Create an RMI connector client and connect it to - // the RMI connector server - String urlPath = "/jndi/rmi://" + hostname + ":" + port + "/jmxrmi"; - connect(urlPath); - } - - public void dump() { - try { - ThreadMonitor monitor = new ThreadMonitor(server); - monitor.threadDump(); - if (!monitor.findDeadlock()) { - System.out.println("No deadlock found."); - } - } catch (IOException e) { - System.err.println("\nCommunication error: " + e.getMessage()); - System.exit(1); - } - } - - /** - * Connect to a JMX agent of a given URL. - */ - private void connect(String urlPath) { - try { - JMXServiceURL url = new JMXServiceURL("rmi", "", 0, urlPath); - this.jmxc = JMXConnectorFactory.connect(url); - this.server = jmxc.getMBeanServerConnection(); - } catch (MalformedURLException e) { - // should not reach here - } catch (IOException e) { - System.err.println("\nCommunication error: " + e.getMessage()); - System.exit(1); - } - } - - public static void main(String[] args) { - if (args.length != 1) { - usage(); - } - - String[] arg2 = args[0].split(":"); - if (arg2.length != 2) { - usage(); - } - String hostname = arg2[0]; - int port = -1; - try { - port = Integer.parseInt(arg2[1]); - } catch (NumberFormatException x) { - usage(); - } - if (port < 0) { - usage(); - } - - // get full thread dump and perform deadlock detection - FullThreadDump ftd = new FullThreadDump(hostname, port); - ftd.dump(); - } - - private static void usage() { - System.out.println("Usage: java FullThreadDump :"); - } -} diff --git a/jdk/src/demo/share/management/FullThreadDump/README.txt b/jdk/src/demo/share/management/FullThreadDump/README.txt deleted file mode 100644 index 1571fb86596..00000000000 --- a/jdk/src/demo/share/management/FullThreadDump/README.txt +++ /dev/null @@ -1,52 +0,0 @@ -FullThreadDump demonstrates the use of the java.lang.management API -to print the full thread dump. JDK 6 defines a new API to dump -the information about monitors and java.util.concurrent ownable -synchronizers. - -This demo also illustrates how to monitor JDK 5 and JDK 6 VMs with -two versions of APIs. - -It contains two parts: -a) Local monitoring within the application -b) Remote monitoring by connecting to a JMX agent with a JMX service URL: - service:jmx:rmi:///jndi/rmi://:/jmxrmi - where is the hostname and is the port number - to which the JMX agent will be connected. - -To run the demo ---------------- -a) Local Monitoring - - java -cp /demo/management/FullThreadDump/FullThreadDump.jar Deadlock - - This will dump the stack trace and then detect deadlocks locally - within the application. - -b) Remote Monitoring - - (1) Start the Deadlock application (or any other application) - with the JMX agent as follows: - - java -Dcom.sun.management.jmxremote.port=1090 - -Dcom.sun.management.jmxremote.ssl=false - -Dcom.sun.management.jmxremote.authenticate=false - -cp /demo/management/FullThreadDump/FullThreadDump.jar - Deadlock - - This instruction uses the Sun's built-in support to enable a JMX agent. - You can programmatically start a JMX agent with the RMI connector - using javax.management.remote API. See the javadoc and examples for - javax.management.remote API for details. - - (2) Run FullThreadDump - - java -jar /demo/management/FullThreadDump/FullThreadDump.jar \ - localhost:1090 - - This will dump the stack trace and then print out the deadlocked threads. - -These instructions assume that this installation's version of the java -command is in your path. If it isn't, then you should either -specify the complete path to the java command or update your -PATH environment variable as described in the installation -instructions for the Java(TM) SDK. diff --git a/jdk/src/demo/share/management/FullThreadDump/ThreadMonitor.java b/jdk/src/demo/share/management/FullThreadDump/ThreadMonitor.java deleted file mode 100644 index 05846e7c182..00000000000 --- a/jdk/src/demo/share/management/FullThreadDump/ThreadMonitor.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import static java.lang.management.ManagementFactory.*; -import java.lang.management.ThreadMXBean; -import java.lang.management.ThreadInfo; -import java.lang.management.LockInfo; -import java.lang.management.MonitorInfo; -import javax.management.*; -import java.io.*; - -/** - * Example of using the java.lang.management API to dump stack trace - * and to perform deadlock detection. - * - * @author Mandy Chung - */ -public class ThreadMonitor { - private MBeanServerConnection server; - private ThreadMXBean tmbean; - private ObjectName objname; - - // default - JDK 6+ VM - private String findDeadlocksMethodName = "findDeadlockedThreads"; - private boolean canDumpLocks = true; - - /** - * Constructs a ThreadMonitor object to get thread information - * in a remote JVM. - */ - public ThreadMonitor(MBeanServerConnection server) throws IOException { - this.server = server; - this.tmbean = newPlatformMXBeanProxy(server, - THREAD_MXBEAN_NAME, - ThreadMXBean.class); - try { - objname = new ObjectName(THREAD_MXBEAN_NAME); - } catch (MalformedObjectNameException e) { - // should not reach here - InternalError ie = new InternalError(e.getMessage()); - ie.initCause(e); - throw ie; - } - parseMBeanInfo(); - } - - /** - * Constructs a ThreadMonitor object to get thread information - * in the local JVM. - */ - public ThreadMonitor() { - this.tmbean = getThreadMXBean(); - } - - /** - * Prints the thread dump information to System.out. - */ - public void threadDump() { - if (canDumpLocks) { - if (tmbean.isObjectMonitorUsageSupported() && - tmbean.isSynchronizerUsageSupported()) { - // Print lock info if both object monitor usage - // and synchronizer usage are supported. - // This sample code can be modified to handle if - // either monitor usage or synchronizer usage is supported. - dumpThreadInfoWithLocks(); - } - } else { - dumpThreadInfo(); - } - } - - private void dumpThreadInfo() { - System.out.println("Full Java thread dump"); - long[] tids = tmbean.getAllThreadIds(); - ThreadInfo[] tinfos = tmbean.getThreadInfo(tids, Integer.MAX_VALUE); - for (ThreadInfo ti : tinfos) { - printThreadInfo(ti); - } - } - - /** - * Prints the thread dump information with locks info to System.out. - */ - private void dumpThreadInfoWithLocks() { - System.out.println("Full Java thread dump with locks info"); - - ThreadInfo[] tinfos = tmbean.dumpAllThreads(true, true); - for (ThreadInfo ti : tinfos) { - printThreadInfo(ti); - LockInfo[] syncs = ti.getLockedSynchronizers(); - printLockInfo(syncs); - } - System.out.println(); - } - - private static String INDENT = " "; - - private void printThreadInfo(ThreadInfo ti) { - // print thread information - printThread(ti); - - // print stack trace with locks - StackTraceElement[] stacktrace = ti.getStackTrace(); - MonitorInfo[] monitors = ti.getLockedMonitors(); - for (int i = 0; i < stacktrace.length; i++) { - StackTraceElement ste = stacktrace[i]; - System.out.println(INDENT + "at " + ste.toString()); - for (MonitorInfo mi : monitors) { - if (mi.getLockedStackDepth() == i) { - System.out.println(INDENT + " - locked " + mi); - } - } - } - System.out.println(); - } - - private void printThread(ThreadInfo ti) { - StringBuilder sb = new StringBuilder("\"" + ti.getThreadName() + "\"" + - " Id=" + ti.getThreadId() + - " in " + ti.getThreadState()); - if (ti.getLockName() != null) { - sb.append(" on lock=" + ti.getLockName()); - } - if (ti.isSuspended()) { - sb.append(" (suspended)"); - } - if (ti.isInNative()) { - sb.append(" (running in native)"); - } - System.out.println(sb.toString()); - if (ti.getLockOwnerName() != null) { - System.out.println(INDENT + " owned by " + ti.getLockOwnerName() + - " Id=" + ti.getLockOwnerId()); - } - } - - private void printMonitorInfo(ThreadInfo ti) { - MonitorInfo[] monitors = ti.getLockedMonitors(); - System.out.println(INDENT + "Locked monitors: count = " + monitors.length); - for (MonitorInfo mi : monitors) { - System.out.println(INDENT + " - " + mi + " locked at "); - System.out.println(INDENT + " " + mi.getLockedStackDepth() + - " " + mi.getLockedStackFrame()); - } - } - - private void printLockInfo(LockInfo[] locks) { - System.out.println(INDENT + "Locked synchronizers: count = " + locks.length); - for (LockInfo li : locks) { - System.out.println(INDENT + " - " + li); - } - System.out.println(); - } - - /** - * Checks if any threads are deadlocked. If any, print - * the thread dump information. - */ - public boolean findDeadlock() { - long[] tids; - if (findDeadlocksMethodName.equals("findDeadlockedThreads") && - tmbean.isSynchronizerUsageSupported()) { - tids = tmbean.findDeadlockedThreads(); - if (tids == null) { - return false; - } - - System.out.println("Deadlock found :-"); - ThreadInfo[] infos = tmbean.getThreadInfo(tids, true, true); - for (ThreadInfo ti : infos) { - printThreadInfo(ti); - printMonitorInfo(ti); - printLockInfo(ti.getLockedSynchronizers()); - System.out.println(); - } - } else { - tids = tmbean.findMonitorDeadlockedThreads(); - if (tids == null) { - return false; - } - ThreadInfo[] infos = tmbean.getThreadInfo(tids, Integer.MAX_VALUE); - for (ThreadInfo ti : infos) { - // print thread information - printThreadInfo(ti); - } - } - - return true; - } - - - private void parseMBeanInfo() throws IOException { - try { - MBeanOperationInfo[] mopis = server.getMBeanInfo(objname).getOperations(); - - // look for findDeadlockedThreads operations; - boolean found = false; - for (MBeanOperationInfo op : mopis) { - if (op.getName().equals(findDeadlocksMethodName)) { - found = true; - break; - } - } - if (!found) { - // if findDeadlockedThreads operation doesn't exist, - // the target VM is running on JDK 5 and details about - // synchronizers and locks cannot be dumped. - findDeadlocksMethodName = "findMonitorDeadlockedThreads"; - canDumpLocks = false; - } - } catch (IntrospectionException e) { - InternalError ie = new InternalError(e.getMessage()); - ie.initCause(e); - throw ie; - } catch (InstanceNotFoundException e) { - InternalError ie = new InternalError(e.getMessage()); - ie.initCause(e); - throw ie; - } catch (ReflectionException e) { - InternalError ie = new InternalError(e.getMessage()); - ie.initCause(e); - throw ie; - } - } -} diff --git a/jdk/src/demo/share/management/JTop/JTop.java b/jdk/src/demo/share/management/JTop/JTop.java deleted file mode 100644 index c1d48cc3716..00000000000 --- a/jdk/src/demo/share/management/JTop/JTop.java +++ /dev/null @@ -1,427 +0,0 @@ -/* - * Copyright (c) 2005, 2015, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * - * Example of using the java.lang.management API to sort threads - * by CPU usage. - * - * JTop class can be run as a standalone application. - * It first establishs a connection to a target VM specified - * by the given hostname and port number where the JMX agent - * to be connected. It then polls for the thread information - * and the CPU consumption of each thread to display every 2 - * seconds. - * - * It is also used by JTopPlugin which is a JConsolePlugin - * that can be used with JConsole (see README.txt). The JTop - * GUI will be added as a JConsole tab by the JTop plugin. - * - * @see com.sun.tools.jconsole.JConsolePlugin - * - * @author Mandy Chung - */ -import java.lang.management.*; -import javax.management.*; -import javax.management.remote.*; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.SortedMap; -import java.util.Timer; -import java.util.TimerTask; -import java.util.TreeMap; -import java.util.concurrent.ExecutionException; -import java.text.NumberFormat; -import java.net.MalformedURLException; -import static java.lang.management.ManagementFactory.*; - -import java.awt.*; -import javax.swing.*; -import javax.swing.border.*; -import javax.swing.table.*; - -/** - * JTop is a JPanel to display thread's name, CPU time, and its state - * in a table. - */ -public class JTop extends JPanel { - - private static class StatusBar extends JPanel { - private static final long serialVersionUID = -6483392381797633018L; - private final JLabel statusText; - - public StatusBar(boolean defaultVisible) { - super(new GridLayout(1, 1)); - statusText = new JLabel(); - statusText.setVisible(defaultVisible); - add(statusText); - } - - @Override - public Dimension getMaximumSize() { - Dimension maximum = super.getMaximumSize(); - Dimension minimum = getMinimumSize(); - return new Dimension(maximum.width, minimum.height); - } - - public void setMessage(String text) { - statusText.setText(text); - statusText.setVisible(true); - } - } - private static final long serialVersionUID = -1499762160973870696L; - private MBeanServerConnection server; - private ThreadMXBean tmbean; - private MyTableModel tmodel; - private final StatusBar statusBar; - public JTop() { - super(new GridBagLayout()); - - tmodel = new MyTableModel(); - JTable table = new JTable(tmodel); - table.setPreferredScrollableViewportSize(new Dimension(500, 300)); - - // Set the renderer to format Double - table.setDefaultRenderer(Double.class, new DoubleRenderer()); - // Add some space - table.setIntercellSpacing(new Dimension(6,3)); - table.setRowHeight(table.getRowHeight() + 4); - - // Create the scroll pane and add the table to it. - JScrollPane scrollPane = new JScrollPane(table); - - // Add the scroll pane to this panel. - GridBagConstraints c1 = new GridBagConstraints(); - c1.fill = GridBagConstraints.BOTH; - c1.gridy = 0; - c1.gridx = 0; - c1.weightx = 1; - c1.weighty = 1; - add(scrollPane, c1); - - statusBar = new StatusBar(false); - GridBagConstraints c2 = new GridBagConstraints(); - c2.fill = GridBagConstraints.HORIZONTAL; - c2.gridy = 1; - c2.gridx = 0; - c2.weightx = 1.0; - c2.weighty = 0.0; - add(statusBar, c2); - } - - // Set the MBeanServerConnection object for communicating - // with the target VM - public void setMBeanServerConnection(MBeanServerConnection mbs) { - this.server = mbs; - try { - this.tmbean = newPlatformMXBeanProxy(server, - THREAD_MXBEAN_NAME, - ThreadMXBean.class); - } catch (IOException e) { - e.printStackTrace(); - } - if (!tmbean.isThreadCpuTimeSupported()) { - statusBar.setMessage("Monitored VM does not support thread CPU time measurement"); - } else { - try { - tmbean.setThreadCpuTimeEnabled(true); - } catch (SecurityException e) { - statusBar.setMessage("Monitored VM does not have permission for enabling thread cpu time measurement"); - } - } - } - - class MyTableModel extends AbstractTableModel { - private static final long serialVersionUID = -7877310288576779514L; - private String[] columnNames = {"ThreadName", - "CPU(sec)", - "State"}; - // List of all threads. The key of each entry is the CPU time - // and its value is the ThreadInfo object with no stack trace. - private List> threadList = - Collections.emptyList(); - - public MyTableModel() { - } - - @Override - public int getColumnCount() { - return columnNames.length; - } - - @Override - public int getRowCount() { - return threadList.size(); - } - - @Override - public String getColumnName(int col) { - return columnNames[col]; - } - - @Override - public Object getValueAt(int row, int col) { - Map.Entry me = threadList.get(row); - switch (col) { - case 0 : - // Column 0 shows the thread name - return me.getValue().getThreadName(); - case 1 : - // Column 1 shows the CPU usage - long ns = me.getKey().longValue(); - double sec = ns / 1000000000; - return new Double(sec); - case 2 : - // Column 2 shows the thread state - return me.getValue().getThreadState(); - default: - return null; - } - } - - @Override - public Class getColumnClass(int c) { - return getValueAt(0, c).getClass(); - } - - void setThreadList(List> list) { - threadList = list; - } - } - - /** - * Get the thread list with CPU consumption and the ThreadInfo - * for each thread sorted by the CPU time. - */ - private List> getThreadList() { - // Get all threads and their ThreadInfo objects - // with no stack trace - long[] tids = tmbean.getAllThreadIds(); - ThreadInfo[] tinfos = tmbean.getThreadInfo(tids); - - // build a map with key = CPU time and value = ThreadInfo - SortedMap map = new TreeMap(); - for (int i = 0; i < tids.length; i++) { - long cpuTime = tmbean.getThreadCpuTime(tids[i]); - // filter out threads that have been terminated - if (cpuTime != -1 && tinfos[i] != null) { - map.put(new Long(cpuTime), tinfos[i]); - } - } - - // build the thread list and sort it with CPU time - // in decreasing order - Set> set = map.entrySet(); - List> list = - new ArrayList>(set); - Collections.reverse(list); - return list; - } - - - /** - * Format Double with 4 fraction digits - */ - class DoubleRenderer extends DefaultTableCellRenderer { - private static final long serialVersionUID = 1704639497162584382L; - NumberFormat formatter; - public DoubleRenderer() { - super(); - setHorizontalAlignment(JLabel.RIGHT); - } - - @Override - public void setValue(Object value) { - if (formatter==null) { - formatter = NumberFormat.getInstance(); - formatter.setMinimumFractionDigits(4); - } - setText((value == null) ? "" : formatter.format(value)); - } - } - - // SwingWorker responsible for updating the GUI - // - // It first gets the thread and CPU usage information as a - // background task done by a worker thread so that - // it will not block the event dispatcher thread. - // - // When the worker thread finishes, the event dispatcher - // thread will invoke the done() method which will update - // the UI. - class Worker extends SwingWorker>,Object> { - private MyTableModel tmodel; - Worker(MyTableModel tmodel) { - this.tmodel = tmodel; - } - - // Get the current thread info and CPU time - @Override - public List> doInBackground() { - return getThreadList(); - } - - // fire table data changed to trigger GUI update - // when doInBackground() is finished - @Override - protected void done() { - try { - // Set table model with the new thread list - tmodel.setThreadList(get()); - // refresh the table model - tmodel.fireTableDataChanged(); - } catch (InterruptedException e) { - } catch (ExecutionException e) { - } - } - } - - // Return a new SwingWorker for UI update - public SwingWorker newSwingWorker() { - return new Worker(tmodel); - } - - public static void main(String[] args) throws Exception { - // Validate the input arguments - if (args.length != 1) { - usage(); - } - - String[] arg2 = args[0].split(":"); - if (arg2.length != 2) { - usage(); - } - String hostname = arg2[0]; - int port = -1; - try { - port = Integer.parseInt(arg2[1]); - } catch (NumberFormatException x) { - usage(); - } - if (port < 0) { - usage(); - } - - // Create the JTop Panel - final JTop jtop = new JTop(); - // Set up the MBeanServerConnection to the target VM - MBeanServerConnection server = connect(hostname, port); - jtop.setMBeanServerConnection(server); - - // A timer task to update GUI per each interval - TimerTask timerTask = new TimerTask() { - @Override - public void run() { - // Schedule the SwingWorker to update the GUI - jtop.newSwingWorker().execute(); - } - }; - - // Create the standalone window with JTop panel - // by the event dispatcher thread - SwingUtilities.invokeAndWait(new Runnable() { - @Override - public void run() { - createAndShowGUI(jtop); - } - }); - - // refresh every 2 seconds - Timer timer = new Timer("JTop Sampling thread"); - timer.schedule(timerTask, 0, 2000); - - } - - // Establish a connection with the remote application - // - // You can modify the urlPath to the address of the JMX agent - // of your application if it has a different URL. - // - // You can also modify the following code to take - // username and password for client authentication. - private static MBeanServerConnection connect(String hostname, int port) { - // Create an RMI connector client and connect it to - // the RMI connector server - String urlPath = "/jndi/rmi://" + hostname + ":" + port + "/jmxrmi"; - MBeanServerConnection server = null; - try { - JMXServiceURL url = new JMXServiceURL("rmi", "", 0, urlPath); - JMXConnector jmxc = JMXConnectorFactory.connect(url); - server = jmxc.getMBeanServerConnection(); - } catch (MalformedURLException e) { - // should not reach here - } catch (IOException e) { - System.err.println("\nCommunication error: " + e.getMessage()); - System.exit(1); - } - return server; - } - - private static void usage() { - System.out.println("Usage: java JTop :"); - System.exit(1); - } - /** - * Create the GUI and show it. For thread safety, - * this method should be invoked from the - * event-dispatching thread. - */ - private static void createAndShowGUI(JPanel jtop) { - // Create and set up the window. - JFrame frame = new JFrame("JTop"); - frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); - - // Create and set up the content pane. - JComponent contentPane = (JComponent) frame.getContentPane(); - contentPane.add(jtop, BorderLayout.CENTER); - contentPane.setOpaque(true); //content panes must be opaque - contentPane.setBorder(new EmptyBorder(12, 12, 12, 12)); - frame.setContentPane(contentPane); - - // Display the window. - frame.pack(); - frame.setVisible(true); - } - -} diff --git a/jdk/src/demo/share/management/JTop/JTopPlugin.java b/jdk/src/demo/share/management/JTop/JTopPlugin.java deleted file mode 100644 index 785bb328db4..00000000000 --- a/jdk/src/demo/share/management/JTop/JTopPlugin.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * - * Example of a JConsole Plugin. This loads JTop as a JConsole tab. - * - * @author Mandy Chung - */ - -import java.beans.PropertyChangeEvent; -import java.beans.PropertyChangeListener; -import java.util.LinkedHashMap; -import java.util.Map; - -import javax.swing.JPanel; -import javax.swing.SwingWorker; - -import com.sun.tools.jconsole.JConsoleContext; -import com.sun.tools.jconsole.JConsoleContext.ConnectionState; -import com.sun.tools.jconsole.JConsolePlugin; - -/** - * JTopPlugin is a subclass to com.sun.tools.jconsole.JConsolePlugin - * - * JTopPlugin is loaded and instantiated by JConsole. One instance - * is created for each window that JConsole creates. It listens to - * the connected property change so that it will update JTop with - * the valid MBeanServerConnection object. JTop is a JPanel object - * displaying the thread and its CPU usage information. - */ -public class JTopPlugin extends JConsolePlugin implements PropertyChangeListener -{ - private JTop jtop = null; - private Map tabs = null; - - public JTopPlugin() { - // register itself as a listener - addContextPropertyChangeListener(this); - } - - /* - * Returns a JTop tab to be added in JConsole. - */ - @Override - public synchronized Map getTabs() { - if (tabs == null) { - jtop = new JTop(); - jtop.setMBeanServerConnection( - getContext().getMBeanServerConnection()); - // use LinkedHashMap if you want a predictable order - // of the tabs to be added in JConsole - tabs = new LinkedHashMap(); - tabs.put("JTop", jtop); - } - return tabs; - } - - /* - * Returns a SwingWorker which is responsible for updating the JTop tab. - */ - @Override - public SwingWorker newSwingWorker() { - return jtop.newSwingWorker(); - } - - // You can implement the dispose() method if you need to release - // any resource when the plugin instance is disposed when the JConsole - // window is closed. - // - // public void dispose() { - // } - - /* - * Property listener to reset the MBeanServerConnection - * at reconnection time. - */ - @Override - public void propertyChange(PropertyChangeEvent ev) { - String prop = ev.getPropertyName(); - if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) { - ConnectionState newState = (ConnectionState)ev.getNewValue(); - // JConsole supports disconnection and reconnection - // The MBeanServerConnection will become invalid when - // disconnected. Need to use the new MBeanServerConnection object - // created at reconnection time. - if (newState == ConnectionState.CONNECTED && jtop != null) { - jtop.setMBeanServerConnection( - getContext().getMBeanServerConnection()); - } - } - } -} diff --git a/jdk/src/demo/share/management/JTop/META-INF/services/com.sun.tools.jconsole.JConsolePlugin b/jdk/src/demo/share/management/JTop/META-INF/services/com.sun.tools.jconsole.JConsolePlugin deleted file mode 100644 index 11aa2aea385..00000000000 --- a/jdk/src/demo/share/management/JTop/META-INF/services/com.sun.tools.jconsole.JConsolePlugin +++ /dev/null @@ -1 +0,0 @@ -JTopPlugin diff --git a/jdk/src/demo/share/management/JTop/README.txt b/jdk/src/demo/share/management/JTop/README.txt deleted file mode 100644 index b2d3ae43c04..00000000000 --- a/jdk/src/demo/share/management/JTop/README.txt +++ /dev/null @@ -1,61 +0,0 @@ -JTop monitors the CPU usage of all threads in a remote application -which has remote management enabled. JTop demonstrates the use of -the java.lang.management API to obtain the CPU consumption for -each thread. - -JTop is also a JConsole Plugin. See below for details. - -JTop Standalone GUI -=================== - -JTop first establishes a connection to a JMX agent in a remote -application with a JMX service URL: - service:jmx:rmi:///jndi/rmi://:/jmxrmi - -where is the hostname and is the port number -to which the JMX agent will be connected. - -To run the demo ---------------- -(1) Start the application with the JMX agent - here's an example of - how the Java2D is started - - java -Dcom.sun.management.jmxremote.port=1090 - -Dcom.sun.management.jmxremote.ssl=false - -Dcom.sun.management.jmxremote.authenticate=false - -jar /demo/jfc/Java2D/Java2Demo.jar - - This instruction uses the Sun's built-in support to enable a JMX agent - with a JMX service URL as described above. - You can programmatically start a JMX agent with the RMI connector - using javax.management.remote API. See the javadoc and examples for - javax.management.remote API for details. - -(2) Run JTop on a different machine: - - java -jar /demo/management/JTop/JTop.jar :1090 - - where is where the Java2Demo.jar runs in step (1). - -These instructions assume that this installation's version of the java -command is in your path. If it isn't, then you should either -specify the complete path to the java command or update your -PATH environment variable as described in the installation -instructions for the Java(TM) SDK. - -JTop JConsole Plugin -==================== - -JTop is a JConsole Plugin which adds a "JTop" tab to JConsole. - -To run JConsole with the JTop plugin ------------------------------------- - jconsole -pluginpath /demo/management/JTop/JTop.jar - - -To compile ----------- - javac -classpath /lib/jconsole.jar JTopPlugin.java - -com.sun.tools.jconsole API is in jconsole.jar which is needed -in the classpath for compilation. diff --git a/jdk/src/demo/share/management/MemoryMonitor/MemoryMonitor.java b/jdk/src/demo/share/management/MemoryMonitor/MemoryMonitor.java deleted file mode 100644 index 3d2769b917a..00000000000 --- a/jdk/src/demo/share/management/MemoryMonitor/MemoryMonitor.java +++ /dev/null @@ -1,491 +0,0 @@ -/* - * Copyright (c) 2004, 2012, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import java.awt.*; -import java.awt.event.*; -import java.awt.image.BufferedImage; -import java.awt.geom.Line2D; -import java.awt.geom.Rectangle2D; -import java.util.Date; -import javax.swing.*; -import javax.swing.border.EtchedBorder; -import javax.swing.border.TitledBorder; -import java.lang.management.*; -/** - * Demo code which plots the memory usage by all memory pools. - * The memory usage is sampled at some time interval using - * java.lang.management API. This demo code is modified based - * java2d MemoryMonitor demo. - */ -public class MemoryMonitor extends JPanel { - - private static final long serialVersionUID = -3463003810776195761L; - static JCheckBox dateStampCB = new JCheckBox("Output Date Stamp"); - public Surface surf; - JPanel controls; - boolean doControls; - JTextField tf; - // Get memory pools. - static java.util.List mpools = - ManagementFactory.getMemoryPoolMXBeans(); - // Total number of memory pools. - static int numPools = mpools.size(); - - public MemoryMonitor() { - setLayout(new BorderLayout()); - setBorder(new TitledBorder(new EtchedBorder(), "Memory Monitor")); - add(surf = new Surface()); - controls = new JPanel(); - controls.setPreferredSize(new Dimension(135,80)); - Font font = new Font("serif", Font.PLAIN, 10); - JLabel label = new JLabel("Sample Rate"); - label.setFont(font); - label.setForeground(Color.red); - controls.add(label); - tf = new JTextField("1000"); - tf.setPreferredSize(new Dimension(45,20)); - controls.add(tf); - controls.add(label = new JLabel("ms")); - label.setFont(font); - label.setForeground(Color.red); - controls.add(dateStampCB); - dateStampCB.setFont(font); - addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - removeAll(); - if ((doControls = !doControls)) { - surf.stop(); - add(controls); - } else { - try { - surf.sleepAmount = Long.parseLong(tf.getText().trim()); - } catch (Exception ex) {} - surf.start(); - add(surf); - } - validate(); - repaint(); - } - }); - } - - - public class Surface extends JPanel implements Runnable { - - public Thread thread; - public long sleepAmount = 1000; - public int usageHistCount = 20000; - private int w, h; - private BufferedImage bimg; - private Graphics2D big; - private Font font = new Font("Times New Roman", Font.PLAIN, 11); - private int columnInc; - private float usedMem[][]; - private float usedMemMax[]; // Used when max pool size is undefined - private int ptNum[]; - private int ascent, descent; - private Rectangle graphOutlineRect = new Rectangle(); - private Rectangle2D mfRect = new Rectangle2D.Float(); - private Rectangle2D muRect = new Rectangle2D.Float(); - private Line2D graphLine = new Line2D.Float(); - private Color graphColor = new Color(46, 139, 87); - private Color mfColor = new Color(0, 100, 0); - private String usedStr; - - - public Surface() { - setBackground(Color.black); - addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (thread == null) start(); else stop(); - } - }); - usedMem = new float[numPools][]; - usedMemMax = new float[numPools]; - for (int i = 0; i < numPools; i++) { - usedMemMax[i] = 1024f * 1024f ; - } - ptNum = new int[numPools]; - } - - @Override - public Dimension getMinimumSize() { - return getPreferredSize(); - } - - @Override - public Dimension getMaximumSize() { - return getPreferredSize(); - } - - @Override - public Dimension getPreferredSize() { - return new Dimension(135,80); - } - - - @Override - public void paint(Graphics g) { - - if (big == null) { - return; - } - - big.setBackground(getBackground()); - big.clearRect(0,0,w,h); - - - h = h / ((numPools + numPools%2) / 2); - w = w / 2; - - int k=0; // index of memory pool. - for (int i=0; i < 2;i++) { - for (int j=0; j < (numPools + numPools%2)/ 2; j++) { - plotMemoryUsage(w*i,h*j,w,h,k); - if (++k >= numPools) { - i = 3; - j = (numPools + numPools%2)/ 2; - break; - } - } - } - g.drawImage(bimg, 0, 0, this); - } - - public void plotMemoryUsage(int x1, int y1, int x2, int y2, int npool) { - - MemoryPoolMXBean mp = mpools.get(npool); - float usedMemory = mp.getUsage().getUsed(); - float totalMemory = mp.getUsage().getMax(); - if (totalMemory < 0) { // Max is undefined for this pool - if (usedMemory > usedMemMax[npool]) { - usedMemMax[npool] = usedMemory; - } - totalMemory = usedMemMax[npool]; - } - - // .. Draw allocated and used strings .. - big.setColor(Color.green); - - // Print Max memory allocated for this memory pool. - big.drawString(String.valueOf((int)totalMemory/1024) + "K Max ", x1+4.0f, (float) y1 + ascent+0.5f); - big.setColor(Color.yellow); - - // Print the memory pool name. - big.drawString(mp.getName(), x1+x2/2, (float) y1 + ascent+0.5f); - - // Print the memory used by this memory pool. - usedStr = String.valueOf((int)usedMemory/1024) - + "K used"; - big.setColor(Color.green); - big.drawString(usedStr, x1+4, y1+y2-descent); - - // Calculate remaining size - float ssH = ascent + descent; - float remainingHeight = y2 - (ssH*2) - 0.5f; - float blockHeight = remainingHeight/10; - float blockWidth = 20.0f; - float remainingWidth = x2 - blockWidth - 10; - - // .. Memory Free .. - big.setColor(mfColor); - int MemUsage = (int) (((totalMemory - usedMemory) / totalMemory) * 10); - int i = 0; - for ( ; i < MemUsage ; i++) { - mfRect.setRect(x1+5,(float) y1+ssH+i*blockHeight, - blockWidth, blockHeight-1); - big.fill(mfRect); - } - - // .. Memory Used .. - big.setColor(Color.green); - for ( ; i < 10; i++) { - muRect.setRect(x1+5,(float) y1 + ssH+i*blockHeight, - blockWidth, blockHeight-1); - big.fill(muRect); - } - - // .. Draw History Graph .. - if (remainingWidth <= 30) remainingWidth = (float)30; - if (remainingHeight <= ssH) remainingHeight = ssH; - big.setColor(graphColor); - int graphX = x1+30; - int graphY = y1 + (int) ssH; - int graphW = (int) remainingWidth; - int graphH = (int) remainingHeight; - - graphOutlineRect.setRect(graphX, graphY, graphW, graphH); - big.draw(graphOutlineRect); - - int graphRow = graphH/10; - - // .. Draw row .. - for (int j = graphY; j <= graphH+graphY; j += graphRow) { - graphLine.setLine(graphX,j,graphX+graphW,j); - big.draw(graphLine); - } - - // .. Draw animated column movement .. - int graphColumn = graphW/15; - - if (columnInc == 0) { - columnInc = graphColumn; - } - - for (int j = graphX+columnInc; j < graphW+graphX; j+=graphColumn) { - graphLine.setLine(j,graphY,j,graphY+graphH); - big.draw(graphLine); - } - - --columnInc; - - // Plot memory usage by this memory pool. - if (usedMem[npool] == null) { - usedMem[npool] = new float[usageHistCount]; - ptNum[npool] = 0; - } - - // save memory usage history. - usedMem[npool][ptNum[npool]] = usedMemory; - - big.setColor(Color.yellow); - - int w1; // width of memory usage history. - if (ptNum[npool] > graphW) { - w1 = graphW; - } else { - w1 = ptNum[npool]; - } - - - for (int j=graphX+graphW-w1, k=ptNum[npool]-w1; k < ptNum[npool]; - k++, j++) { - if (k != 0) { - if (usedMem[npool][k] != usedMem[npool][k-1]) { - int h1 = (int)(graphY + graphH * ((totalMemory -usedMem[npool][k-1])/totalMemory)); - int h2 = (int)(graphY + graphH * ((totalMemory -usedMem[npool][k])/totalMemory)); - big.drawLine(j-1, h1, j, h2); - } else { - int h1 = (int)(graphY + graphH * ((totalMemory -usedMem[npool][k])/totalMemory)); - big.fillRect(j, h1, 1, 1); - } - } - } - if (ptNum[npool]+2 == usedMem[npool].length) { - // throw out oldest point - for (int j = 1;j < ptNum[npool]; j++) { - usedMem[npool][j-1] = usedMem[npool][j]; - } - --ptNum[npool]; - } else { - ptNum[npool]++; - } - } - - - public void start() { - thread = new Thread(this); - thread.setPriority(Thread.MIN_PRIORITY); - thread.setName("MemoryMonitor"); - thread.start(); - } - - - public synchronized void stop() { - thread = null; - notify(); - } - - @Override - public void run() { - - Thread me = Thread.currentThread(); - - while (thread == me && !isShowing() || getSize().width == 0) { - try { - Thread.sleep(500); - } catch (InterruptedException e) { return; } - } - - while (thread == me && isShowing()) { - Dimension d = getSize(); - if (d.width != w || d.height != h) { - w = d.width; - h = d.height; - bimg = (BufferedImage) createImage(w, h); - big = bimg.createGraphics(); - big.setFont(font); - FontMetrics fm = big.getFontMetrics(font); - ascent = fm.getAscent(); - descent = fm.getDescent(); - } - repaint(); - try { - Thread.sleep(sleepAmount); - } catch (InterruptedException e) { break; } - if (MemoryMonitor.dateStampCB.isSelected()) { - System.out.println(new Date().toString() + " " + usedStr); - } - } - thread = null; - } - } - - - // Test thread to consume memory - static class Memeater extends ClassLoader implements Runnable { - Object y[]; - public Memeater() {} - @Override - public void run() { - y = new Object[10000000]; - int k =0; - while(true) { - if (k == 5000000) k=0; - y[k++] = new Object(); - try { - Thread.sleep(20); - } catch (Exception x){} - - // to consume perm gen storage - try { - // the classes are small so we load 10 at a time - for (int i=0; i<10; i++) { - loadNext(); - } - } catch (ClassNotFoundException x) { - // ignore exception - } - - } - - } - - Class loadNext() throws ClassNotFoundException { - - // public class TestNNNNNN extends java.lang.Object{ - // public TestNNNNNN(); - // Code: - // 0: aload_0 - // 1: invokespecial #1; //Method java/lang/Object."":()V - // 4: return - // } - - int begin[] = { - 0xca, 0xfe, 0xba, 0xbe, 0x00, 0x00, 0x00, 0x30, - 0x00, 0x0a, 0x0a, 0x00, 0x03, 0x00, 0x07, 0x07, - 0x00, 0x08, 0x07, 0x00, 0x09, 0x01, 0x00, 0x06, - 0x3c, 0x69, 0x6e, 0x69, 0x74, 0x3e, 0x01, 0x00, - 0x03, 0x28, 0x29, 0x56, 0x01, 0x00, 0x04, 0x43, - 0x6f, 0x64, 0x65, 0x0c, 0x00, 0x04, 0x00, 0x05, - 0x01, 0x00, 0x0a, 0x54, 0x65, 0x73, 0x74 }; - - int end [] = { - 0x01, 0x00, 0x10, - 0x6a, 0x61, 0x76, 0x61, 0x2f, 0x6c, 0x61, 0x6e, - 0x67, 0x2f, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, - 0x00, 0x21, 0x00, 0x02, 0x00, 0x03, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, - 0x00, 0x05, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, - 0x00, 0x11, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, - 0x00, 0x05, 0x2a, 0xb7, 0x00, 0x01, 0xb1, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00 }; - - - // TestNNNNNN - - String name = "Test" + Integer.toString(count++); - - byte value[]; - try { - value = name.substring(4).getBytes("UTF-8"); - } catch (java.io.UnsupportedEncodingException x) { - throw new Error(); - } - - // construct class file - - int len = begin.length + value.length + end.length; - byte b[] = new byte[len]; - int pos=0; - for (int i: begin) { - b[pos++] = (byte) i; - } - for (byte v: value) { - b[pos++] = v; - } - for (int e: end) { - b[pos++] = (byte) e; - } - - return defineClass(name, b, 0, b.length); - - } - static int count = 100000; - - } - - public static void main(String s[]) { - final MemoryMonitor demo = new MemoryMonitor(); - WindowListener l = new WindowAdapter() { - @Override - public void windowClosing(WindowEvent e) {System.exit(0);} - @Override - public void windowDeiconified(WindowEvent e) { demo.surf.start(); } - @Override - public void windowIconified(WindowEvent e) { demo.surf.stop(); } - }; - JFrame f = new JFrame("MemoryMonitor"); - f.addWindowListener(l); - f.getContentPane().add("Center", demo); - f.pack(); - f.setSize(new Dimension(400,500)); - f.setVisible(true); - demo.surf.start(); - Thread thr = new Thread(new Memeater()); - thr.start(); - } - -} diff --git a/jdk/src/demo/share/management/MemoryMonitor/README.txt b/jdk/src/demo/share/management/MemoryMonitor/README.txt deleted file mode 100644 index 5a421dbdc90..00000000000 --- a/jdk/src/demo/share/management/MemoryMonitor/README.txt +++ /dev/null @@ -1,48 +0,0 @@ -# -# Copyright (c) 2004, 2012, 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. -# - -MemoryMonitor demonstrates the use of the java.lang.management API -in observing the memory usage of all memory pools consumed by -the application. - -This simple demo program queries the memory usage of each memory pool -and plots the memory usage history graph. - -To run the MemoryMonitor demo - - java -jar /demo/management/MemoryMonitor/MemoryMonitor.jar - -These instructions assume that this installation's version of the java -command is in your path. If it isn't, then you should either -specify the complete path to the java command or update your -PATH environment variable as described in the installation -instructions for the Java(TM) SDK. - diff --git a/jdk/src/demo/share/management/VerboseGC/PrintGCStat.java b/jdk/src/demo/share/management/VerboseGC/PrintGCStat.java deleted file mode 100644 index 565c8dc5c2c..00000000000 --- a/jdk/src/demo/share/management/VerboseGC/PrintGCStat.java +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import static java.lang.management.ManagementFactory.*; -import java.lang.management.*; -import javax.management.*; -import java.io.*; -import java.util.*; - -/** - * Example of using the java.lang.management API to monitor - * the memory usage and garbage collection statistics. - * - * @author Mandy Chung - */ -public class PrintGCStat { - private RuntimeMXBean rmbean; - private MemoryMXBean mmbean; - private List pools; - private List gcmbeans; - - /** - * Constructs a PrintGCStat object to monitor a remote JVM. - */ - public PrintGCStat(MBeanServerConnection server) throws IOException { - // Create the platform mxbean proxies - this.rmbean = newPlatformMXBeanProxy(server, - RUNTIME_MXBEAN_NAME, - RuntimeMXBean.class); - this.mmbean = newPlatformMXBeanProxy(server, - MEMORY_MXBEAN_NAME, - MemoryMXBean.class); - ObjectName poolName = null; - ObjectName gcName = null; - try { - poolName = new ObjectName(MEMORY_POOL_MXBEAN_DOMAIN_TYPE+",*"); - gcName = new ObjectName(GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE+",*"); - } catch (MalformedObjectNameException e) { - // should not reach here - assert(false); - } - - Set mbeans = server.queryNames(poolName, null); - if (mbeans != null) { - pools = new ArrayList(); - for (ObjectName objName : mbeans) { - MemoryPoolMXBean p = - newPlatformMXBeanProxy(server, - objName.getCanonicalName(), - MemoryPoolMXBean.class); - pools.add(p); - } - } - - mbeans = server.queryNames(gcName, null); - if (mbeans != null) { - gcmbeans = new ArrayList(); - for (ObjectName objName : mbeans) { - GarbageCollectorMXBean gc = - newPlatformMXBeanProxy(server, - objName.getCanonicalName(), - GarbageCollectorMXBean.class); - gcmbeans.add(gc); - } - } - } - - /** - * Constructs a PrintGCStat object to monitor the local JVM. - */ - public PrintGCStat() { - // Obtain the platform mxbean instances for the running JVM. - this.rmbean = getRuntimeMXBean(); - this.mmbean = getMemoryMXBean(); - this.pools = getMemoryPoolMXBeans(); - this.gcmbeans = getGarbageCollectorMXBeans(); - } - - /** - * Prints the verbose GC log to System.out to list the memory usage - * of all memory pools as well as the GC statistics. - */ - public void printVerboseGc() { - System.out.println("Uptime: " + formatMillis(rmbean.getUptime())); - System.out.println("Heap usage: " + mmbean.getHeapMemoryUsage()); - System.out.println("Non-Heap memory usage: " + mmbean.getNonHeapMemoryUsage()); - for (GarbageCollectorMXBean gc : gcmbeans) { - System.out.print(" [" + gc.getName() + ": "); - System.out.print("Count=" + gc.getCollectionCount()); - System.out.print(" GCTime=" + formatMillis(gc.getCollectionTime())); - System.out.print("]"); - } - System.out.println(); - for (MemoryPoolMXBean p : pools) { - System.out.print(" [" + p.getName() + ":"); - MemoryUsage u = p.getUsage(); - System.out.print(" Used=" + formatBytes(u.getUsed())); - System.out.print(" Committed=" + formatBytes(u.getCommitted())); - System.out.println("]"); - } - } - - private String formatMillis(long ms) { - return String.format("%.4fsec", ms / (double) 1000); - } - private String formatBytes(long bytes) { - long kb = bytes; - if (bytes > 0) { - kb = bytes / 1024; - } - return kb + "K"; - } -} diff --git a/jdk/src/demo/share/management/VerboseGC/README.txt b/jdk/src/demo/share/management/VerboseGC/README.txt deleted file mode 100644 index f7a9011e422..00000000000 --- a/jdk/src/demo/share/management/VerboseGC/README.txt +++ /dev/null @@ -1,31 +0,0 @@ -VerboseGC demonstrates the use of the java.lang.management API to -print the garbage collection statistics and memory usage remotely -by connecting to a JMX agent with a JMX service URL: - service:jmx:rmi:///jndi/rmi://:/jmxrmi -where is the hostname and is the port number -to which the JMX agent will be connected. - -To run the VerboseGC demo - -(1) Start the application with the JMX agent - here's an example of - how the Java2D is started - - java -Dcom.sun.management.jmxremote.port=1090 - -Dcom.sun.management.jmxremote.ssl=false - -Dcom.sun.management.jmxremote.authenticate=false - -jar /demo/jfc/Java2D/Java2Demo.jar - - This instruction uses the Sun's built-in support to enable a JMX agent. - You can programmatically start a JMX agent with the RMI connector - using javax.management.remote API. See the javadoc and examples for - javax.management.remote API for details. - -(2) Run VerboseGC - - java -jar /demo/management/VerboseGC/VerboseGC.jar localhost:1090 - -These instructions assume that this installation's version of the java -command is in your path. If it isn't, then you should either -specify the complete path to the java command or update your -PATH environment variable as described in the installation -instructions for the Java(TM) SDK. diff --git a/jdk/src/demo/share/management/VerboseGC/VerboseGC.java b/jdk/src/demo/share/management/VerboseGC/VerboseGC.java deleted file mode 100644 index 57f78b8a53a..00000000000 --- a/jdk/src/demo/share/management/VerboseGC/VerboseGC.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2004, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - */ - -import javax.management.*; -import javax.management.remote.*; -import java.io.IOException; -import java.net.MalformedURLException; - -/** - * This VerboseGC class demonstrates the capability to get - * the garbage collection statistics and memory usage remotely. - */ -public class VerboseGC { - private MBeanServerConnection server; - private JMXConnector jmxc; - public VerboseGC(String hostname, int port) { - System.out.println("Connecting to " + hostname + ":" + port); - - // Create an RMI connector client and connect it to - // the RMI connector server - String urlPath = "/jndi/rmi://" + hostname + ":" + port + "/jmxrmi"; - connect(urlPath); - } - - public void dump(long interval, long samples) { - try { - PrintGCStat pstat = new PrintGCStat(server); - for (int i = 0; i < samples; i++) { - pstat.printVerboseGc(); - try { - Thread.sleep(interval); - } catch (InterruptedException e) { - System.exit(1); - } - } - } catch (IOException e) { - System.err.println("\nCommunication error: " + e.getMessage()); - System.exit(1); - } - } - - /** - * Connect to a JMX agent of a given URL. - */ - private void connect(String urlPath) { - try { - JMXServiceURL url = new JMXServiceURL("rmi", "", 0, urlPath); - this.jmxc = JMXConnectorFactory.connect(url); - this.server = jmxc.getMBeanServerConnection(); - } catch (MalformedURLException e) { - // should not reach here - } catch (IOException e) { - System.err.println("\nCommunication error: " + e.getMessage()); - System.exit(1); - } - } - - public static void main(String[] args) { - if (args.length < 1) { - usage(); - } - - String hostname = ""; - int port = -1; - long interval = 5000; // default is 5 second interval - long mins = 5; - for (String arg: args) { - if (arg.startsWith("-")) { - if (arg.equals("-h") || - arg.equals("-help") || - arg.equals("-?")) { - usage(); - } else if (arg.startsWith("-interval=")) { - try { - interval = Integer.parseInt(arg.substring(10)) * 1000; - } catch (NumberFormatException ex) { - usage(); - } - } else if (arg.startsWith("-duration=")) { - try { - mins = Integer.parseInt(arg.substring(10)); - } catch (NumberFormatException ex) { - usage(); - } - } else { - // Unknown switch - System.err.println("Unrecognized option: " + arg); - usage(); - } - } else { - String[] arg2 = arg.split(":"); - if (arg2.length != 2) { - usage(); - } - hostname = arg2[0]; - try { - port = Integer.parseInt(arg2[1]); - } catch (NumberFormatException x) { - usage(); - } - if (port < 0) { - usage(); - } - } - } - - // get full thread dump and perform deadlock detection - VerboseGC vgc = new VerboseGC(hostname, port); - long samples = (mins * 60 * 1000) / interval; - vgc.dump(interval, samples); - - } - - private static void usage() { - System.out.print("Usage: java VerboseGC : "); - System.out.println(" [-interval=seconds] [-duration=minutes]"); - } -} diff --git a/jdk/src/demo/share/management/index.html b/jdk/src/demo/share/management/index.html deleted file mode 100644 index f9f35064221..00000000000 --- a/jdk/src/demo/share/management/index.html +++ /dev/null @@ -1,46 +0,0 @@ - - java.lang.management Demonstration Code - - -

    java.lang.management Demonstration Code

    - -
      - -
    • -FullThreadDump -
      -Shows how to get thread dumps and look for deadlocks. -
    • - -
    • -VerboseGC -
      -Shows how you can find out about Garbage Collection in the VM. -
    • - -
    • -MemoryMonitor -
      -Shows how you can find out the memory usage in the VM. -
    • - -
    • -JTop -
      -Shows how you can find out the threads with top CPU usage. -
    • - - -
    - - - -

    Comments and Feedback

    - -

    -Comments regarding java.lang.management API or on any of these -demonstrations should be sent through -http://java.sun.com/mail/ - - - diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/README.txt b/jdk/src/demo/share/scripting/jconsole-plugin/README.txt deleted file mode 100644 index fc4bbf199aa..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/README.txt +++ /dev/null @@ -1,64 +0,0 @@ -What is this demo about? - -This is "script shell" plugin for jconsole - the monitoring and management -client tool shipped with JRE. This plugin adds "Script Shell" tab to jconsole. -This serves as a demo for jconsole plugin API (com.sun.tools.jconsole) as well -as a demo for scripting API (javax.script) for the Java platform. - -Script console is an interactive read-eval-print interface that can be used -used to execute advanced monitoring and management queries. By default, -JavaScript is used as the scripting language. The scripting language can be -changed using the system property com.sun.demo.jconsole.console.language. To -use other scripting languages, you need to specify the corresponding engine -jar file in pluginpath along with this plugin's jar file. - -The following 3 global variables are exposed to the script engine: - - window javax.swing.JPanel - engine javax.script.ScriptEngine - plugin com.sun.tools.jconsole.JConsolePlugin - -If you use JavaScript, there are many useful global functions defined in -./src/resources/jconsole.js. This is built into the script plugin jar file. -In addition, you can add other global functions and global variables by -defining those in ~/jconsole.js (or jconsole. where is the file -extension for your scripting language of choice under your home directory). - -How do I compile script console plugin? - -You can use the Java based build tool "ant" (http://ant.apache.org) to build -this plugin. To build using ant, please use the following command in the -current directory: - - ant - -How do I use script console plugin? - -To start jconsole with this plugin, please use the following command - - jconsole -pluginpath jconsole-plugin.jar - -How do I load my own script files in script console? - -If you use JavaScript (the default), then there is a global function called -"load" to load any script file from your file system. In script console -prompt, enter the following: - - load(); - -where is the path of your script file to load. If you don't -specify the file path, then the load function shows file dialog box to choose -the script file to load. - -How do I get help on script global functions? - -If you use JavaScript (the default), then there is a global function called -"help" that prints one-line help messages on global functions. In script -console prompt, enter the following: - - help(); - -Where are the sample JavaScript files? - -./src/scripts directory contains JavaScript files that can be loaded into -script console. diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/build.xml b/jdk/src/demo/share/scripting/jconsole-plugin/build.xml deleted file mode 100644 index aecefdcad5d..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/build.xml +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/META-INF/services/com.sun.tools.jconsole.JConsolePlugin b/jdk/src/demo/share/scripting/jconsole-plugin/src/META-INF/services/com.sun.tools.jconsole.JConsolePlugin deleted file mode 100644 index 9e05f3c164f..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/META-INF/services/com.sun.tools.jconsole.JConsolePlugin +++ /dev/null @@ -1 +0,0 @@ -com.sun.demo.scripting.jconsole.ScriptJConsolePlugin diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java b/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java deleted file mode 100644 index 2552f5ea5a7..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/EditableAtEndDocument.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -package com.sun.demo.scripting.jconsole; - -import javax.swing.text.*; - -/** This class implements a special type of document in which edits - * can only be performed at the end, from "mark" to the end of the - * document. This is used in ScriptShellPanel class as document for editor. - */ -public class EditableAtEndDocument extends PlainDocument { - - private static final long serialVersionUID = 5358116444851502167L; - private int mark; - - @Override - public void insertString(int offset, String text, AttributeSet a) - throws BadLocationException { - int len = getLength(); - super.insertString(len, text, a); - } - - @Override - public void remove(int offs, int len) throws BadLocationException { - int start = offs; - int end = offs + len; - - int markStart = mark; - int markEnd = getLength(); - - if ((end < markStart) || (start > markEnd)) { - // no overlap - return; - } - - // Determine interval intersection - int cutStart = Math.max(start, markStart); - int cutEnd = Math.min(end, markEnd); - super.remove(cutStart, cutEnd - cutStart); - } - - public void setMark() { - mark = getLength(); - } - - public String getMarkedText() throws BadLocationException { - return getText(mark, getLength() - mark); - } - - /** Used to reset the contents of this document */ - public void clear() { - try { - super.remove(0, getLength()); - setMark(); - } catch (BadLocationException e) { - } - } -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java b/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java deleted file mode 100644 index c955a968dcf..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptJConsolePlugin.java +++ /dev/null @@ -1,224 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -package com.sun.demo.scripting.jconsole; - -import com.sun.tools.jconsole.*; -import java.io.*; -import java.util.concurrent.CountDownLatch; -import javax.script.*; -import javax.swing.*; -import java.util.*; - -/** - * This is script console plugin. This class uses javax.script API to create - * interactive read-eval-print script shell within the jconsole GUI. - */ -public class ScriptJConsolePlugin extends JConsolePlugin - implements ScriptShellPanel.CommandProcessor { - // Panel for our tab - private volatile ScriptShellPanel window; - // Tabs that we add to jconsole GUI - private Map tabs; - - // Script engine that evaluates scripts - private volatile ScriptEngine engine; - - // script engine initialization occurs in background. - // This latch is used to coorrdinate engine init and eval. - private CountDownLatch engineReady = new CountDownLatch(1); - - // File extension used for scripts of chosen language. - // For eg. ".js" for JavaScript, ".bsh" for BeanShell. - private String extension; - - // Prompt to print in the read-eval-print loop. This is - // derived from the script file extension. - private volatile String prompt; - - /** - * Constructor to create this plugin - */ - public ScriptJConsolePlugin() { - } - - @Override public Map getTabs() { - // create ScriptEngine - createScriptEngine(); - - // create panel for tab - window = new ScriptShellPanel(this); - - // add tab to tabs map - tabs = new HashMap(); - tabs.put("Script Shell", window); - - new Thread(new Runnable() { - @Override - public void run() { - // initialize the script engine - initScriptEngine(); - engineReady.countDown(); - } - }).start(); - return tabs; - } - - @Override public SwingWorker newSwingWorker() { - return null; - } - - @Override public void dispose() { - window.dispose(); - } - - @Override - public String getPrompt() { - return prompt; - } - - @Override - public String executeCommand(String cmd) { - String res; - try { - engineReady.await(); - Object tmp = engine.eval(cmd); - res = (tmp == null)? null : tmp.toString(); - } catch (InterruptedException ie) { - res = ie.getMessage(); - } catch (ScriptException se) { - res = se.getMessage(); - } - return res; - } - - //-- Internals only below this point - private void createScriptEngine() { - ScriptEngineManager manager = new ScriptEngineManager(); - String language = getScriptLanguage(); - engine = manager.getEngineByName(language); - if (engine == null) { - throw new RuntimeException("cannot load " + language + " engine"); - } - extension = engine.getFactory().getExtensions().get(0); - prompt = extension + ">"; - engine.setBindings(createBindings(), ScriptContext.ENGINE_SCOPE); - } - - // Name of the System property used to select scripting language - private static final String LANGUAGE_KEY = "com.sun.demo.jconsole.console.language"; - - private String getScriptLanguage() { - // check whether explicit System property is set - String lang = System.getProperty(LANGUAGE_KEY); - if (lang == null) { - // default is JavaScript - lang = "JavaScript"; - } - return lang; - } - - // create Bindings that is backed by a synchronized HashMap - private Bindings createBindings() { - Map map = - Collections.synchronizedMap(new HashMap()); - return new SimpleBindings(map); - } - - // create and initialize script engine - private void initScriptEngine() { - // set pre-defined global variables - setGlobals(); - // load pre-defined initialization file - loadInitFile(); - // load current user's initialization file - loadUserInitFile(); - } - - // set pre-defined global variables for script - private void setGlobals() { - engine.put("engine", engine); - engine.put("window", window); - engine.put("plugin", this); - } - - // load initial script file (jconsole.) - private void loadInitFile() { - String oldFilename = (String) engine.get(ScriptEngine.FILENAME); - engine.put(ScriptEngine.FILENAME, ""); - try { - Class myClass = this.getClass(); - InputStream stream = myClass.getResourceAsStream("/resources/jconsole." + - extension); - if (stream != null) { - engine.eval(new InputStreamReader(new BufferedInputStream(stream))); - } - } catch (Exception exp) { - exp.printStackTrace(); - // FIXME: What else I can do here?? - } finally { - engine.put(ScriptEngine.FILENAME, oldFilename); - } - } - - // load user's initial script file (~/jconsole.) - private void loadUserInitFile() { - String oldFilename = (String) engine.get(ScriptEngine.FILENAME); - String home = System.getProperty("user.home"); - if (home == null) { - // no user.home?? should not happen?? - return; - } - String fileName = home + File.separator + "jconsole." + extension; - if (! (new File(fileName).exists())) { - // user does not have ~/jconsole. - return; - } - engine.put(ScriptEngine.FILENAME, fileName); - try { - engine.eval(new FileReader(fileName)); - } catch (Exception exp) { - exp.printStackTrace(); - // FIXME: What else I can do here?? - } finally { - engine.put(ScriptEngine.FILENAME, oldFilename); - } - } -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java b/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java deleted file mode 100644 index c7e4dee51bc..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/com/sun/demo/scripting/jconsole/ScriptShellPanel.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2006, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -package com.sun.demo.scripting.jconsole; - -import java.awt.*; -import java.awt.event.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import javax.swing.*; -import javax.swing.event.*; -import javax.swing.text.*; - - -/** - * A JPanel subclass containing a scrollable text area displaying the - * jconsole's script console. - */ - -public class ScriptShellPanel extends JPanel { - - private static final long serialVersionUID = 4116273141148726319L; - - // interface to evaluate script command and script prompt - interface CommandProcessor { - // execute given String as script and return the result - public String executeCommand(String cmd); - // get prompt used for interactive read-eval-loop - public String getPrompt(); - } - - // my script command processor - private CommandProcessor commandProcessor; - // editor component for command editing - private JTextComponent editor; - - private final ExecutorService commandExecutor = - Executors.newSingleThreadExecutor(); - - // document management - private boolean updating; - - public ScriptShellPanel(CommandProcessor cmdProc) { - setLayout(new BorderLayout()); - this.commandProcessor = cmdProc; - this.editor = new JTextArea(); - editor.setDocument(new EditableAtEndDocument()); - JScrollPane scroller = new JScrollPane(); - scroller.getViewport().add(editor); - add(scroller, BorderLayout.CENTER); - - editor.getDocument().addDocumentListener(new DocumentListener() { - @Override - public void changedUpdate(DocumentEvent e) { - } - - @Override - public void insertUpdate(DocumentEvent e) { - if (updating) return; - beginUpdate(); - editor.setCaretPosition(editor.getDocument().getLength()); - if (insertContains(e, '\n')) { - String cmd = getMarkedText(); - // Handle multi-line input - if ((cmd.length() == 0) || - (cmd.charAt(cmd.length() - 1) != '\\')) { - // Trim "\\n" combinations - final String cmd1 = trimContinuations(cmd); - commandExecutor.execute(new Runnable() { - @Override - public void run() { - final String result = executeCommand(cmd1); - - SwingUtilities.invokeLater(new Runnable() { - @Override - public void run() { - if (result != null) { - print(result + "\n"); - } - printPrompt(); - setMark(); - endUpdate(); - } - }); - } - }); - } else { - endUpdate(); - } - } else { - endUpdate(); - } - } - - @Override - public void removeUpdate(DocumentEvent e) { - } - }); - - // This is a bit of a hack but is probably better than relying on - // the JEditorPane to update the caret's position precisely the - // size of the insertion - editor.addCaretListener(new CaretListener() { - @Override - public void caretUpdate(CaretEvent e) { - int len = editor.getDocument().getLength(); - if (e.getDot() > len) { - editor.setCaretPosition(len); - } - } - }); - - Box hbox = Box.createHorizontalBox(); - hbox.add(Box.createGlue()); - JButton button = new JButton("Clear"); // FIXME: i18n? - button.addActionListener(new ActionListener() { - @Override - public void actionPerformed(ActionEvent e) { - clear(); - } - }); - hbox.add(button); - hbox.add(Box.createGlue()); - add(hbox, BorderLayout.SOUTH); - - clear(); - } - - public void dispose() { - commandExecutor.shutdown(); - } - - @Override - public void requestFocus() { - editor.requestFocus(); - } - - public void clear() { - clear(true); - } - - public void clear(boolean prompt) { - EditableAtEndDocument d = (EditableAtEndDocument) editor.getDocument(); - d.clear(); - if (prompt) printPrompt(); - setMark(); - editor.requestFocus(); - } - - public void setMark() { - ((EditableAtEndDocument) editor.getDocument()).setMark(); - } - - public String getMarkedText() { - try { - String s = ((EditableAtEndDocument) editor.getDocument()).getMarkedText(); - int i = s.length(); - while ((i > 0) && (s.charAt(i - 1) == '\n')) { - i--; - } - return s.substring(0, i); - } catch (BadLocationException e) { - e.printStackTrace(); - return null; - } - } - - public void print(String s) { - Document d = editor.getDocument(); - try { - d.insertString(d.getLength(), s, null); - } catch (BadLocationException e) { - e.printStackTrace(); - } - } - - - // - // Internals only below this point - // - - private String executeCommand(String cmd) { - return commandProcessor.executeCommand(cmd); - } - - private String getPrompt() { - return commandProcessor.getPrompt(); - } - - private void beginUpdate() { - editor.setEditable(false); - updating = true; - } - - private void endUpdate() { - editor.setEditable(true); - updating = false; - } - - private void printPrompt() { - print(getPrompt()); - } - - private boolean insertContains(DocumentEvent e, char c) { - String s = null; - try { - s = editor.getText(e.getOffset(), e.getLength()); - for (int i = 0; i < e.getLength(); i++) { - if (s.charAt(i) == c) { - return true; - } - } - } catch (BadLocationException ex) { - ex.printStackTrace(); - } - return false; - } - - private String trimContinuations(String text) { - int i; - while ((i = text.indexOf("\\\n")) >= 0) { - text = text.substring(0, i) + text.substring(i+1, text.length()); - } - return text; - } -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/resources/jconsole.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/resources/jconsole.js deleted file mode 100644 index f39dea30069..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/resources/jconsole.js +++ /dev/null @@ -1,891 +0,0 @@ -/* - * Copyright (c) 2006, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * -Redistribution of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * -Redistribution 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 contributors may - * be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * This software is provided "AS IS," without a warranty of any kind. ALL - * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING - * ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE - * OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN MIDROSYSTEMS, INC. ("SUN") - * AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE - * AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS - * DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST - * REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, - * INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY - * OF LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, - * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - * - * You acknowledge that this software is not designed, licensed or intended - * for use in the design, construction, operation or maintenance of any - * nuclear facility. - */ - -// This function depends on the pre-defined variable -// "plugin" of type com.sun.tools.jconsole.JConsolePlugin - -function jcontext() { - return plugin.getContext(); -} -jcontext.docString = "returns JConsoleContext for the current jconsole plugin"; - -function mbeanConnection() { - return jcontext().getMBeanServerConnection(); -} -mbeanConnection.docString = "returns current MBeanServer connection"; - -// check if there is a build in sync function, define one if missing -if (typeof sync === "undefined") { - var sync = function(func, obj) { - if (arguments.length < 1 || arguments.length > 2 ) { - throw "sync(function [,object]) parameter count mismatch"; - } - - var syncobj = (arguments.length == 2 ? obj : this); - - if (!syncobj._syncLock) { - syncobj._syncLock = new Lock(); - } - - return function() { - syncobj._syncLock.lock(); - try { - func.apply(null, arguments); - } finally { - syncobj._syncLock.unlock(); - } - }; - }; - sync.docString = "synchronize a function, optionally on an object"; -} - -/** - * Prints one liner help message for each function exposed here - * Note that this function depends on docString meta-data for - * each function - */ -function help() { - var i; - for (i in this) { - var func = this[i]; - if (typeof(func) == "function" && - ("docString" in func)) { - echo(i + " - " + func["docString"]); - } - } -} -help.docString = "prints help message for global functions"; - -function connectionState() { - return jcontext().connectionState; -} -connectionState.docString = "return connection state of the current jcontext"; - -/** - * Returns a platform MXBean proxy for given MXBean name and interface class - */ -function newPlatformMXBeanProxy(name, intf) { - var factory = java.lang.management.ManagementFactory; - return factory.newPlatformMXBeanProxy(mbeanConnection(), name, intf); -} -newPlatformMXBeanProxy.docString = "returns a proxy for a platform MXBean"; - -/** - * Wraps a string to ObjectName if needed. - */ -function objectName(objName) { - var ObjectName = Packages.javax.management.ObjectName; - if (objName instanceof ObjectName) { - return objName; - } else { - return new ObjectName(objName); - } -} -objectName.docString = "creates JMX ObjectName for a given String"; - - -/** - * Creates a new (M&M) Attribute object - * - * @param name name of the attribute - * @param value value of the attribute - */ -function attribute(name, value) { - var Attribute = Packages.javax.management.Attribute; - return new Attribute(name, value); -} -attribute.docString = "returns a new JMX Attribute using name and value given"; - -/** - * Returns MBeanInfo for given ObjectName. Strings are accepted. - */ -function mbeanInfo(objName) { - objName = objectName(objName); - return mbeanConnection().getMBeanInfo(objName); -} -mbeanInfo.docString = "returns MBeanInfo of a given ObjectName"; - -/** - * Returns ObjectInstance for a given ObjectName. - */ -function objectInstance(objName) { - objName = objectName(objName); - return mbeanConnection().objectInstance(objectName); -} -objectInstance.docString = "returns ObjectInstance for a given ObjectName"; - -/** - * Queries with given ObjectName and QueryExp. - * QueryExp may be null. - * - * @return set of ObjectNames. - */ -function queryNames(objName, query) { - objName = objectName(objName); - if (query == undefined) query = null; - return mbeanConnection().queryNames(objName, query); -} -queryNames.docString = "returns QueryNames using given ObjectName and optional query"; - - -/** - * Queries with given ObjectName and QueryExp. - * QueryExp may be null. - * - * @return set of ObjectInstances. - */ -function queryMBeans(objName, query) { - objName = objectName(objName); - if (query == undefined) query = null; - return mbeanConnection().queryMBeans(objName, query); -} -queryMBeans.docString = "return MBeans using given ObjectName and optional query"; - -// wraps a script array as java.lang.Object[] -function objectArray(array) { - return Java.to(array, "java.lang.Object[]"); -} - -// wraps a script (string) array as java.lang.String[] -function stringArray(array) { - return Java.to(array, "java.lang.String[]"); -} - -// script array to Java List -function toAttrList(array) { - var AttributeList = Packages.javax.management.AttributeList; - if (array instanceof AttributeList) { - return array; - } - var list = new AttributeList(array.length); - for (var index = 0; index < array.length; index++) { - list.add(array[index]); - } - return list; -} - -// Java Collection (Iterable) to script array -function toArray(collection) { - if (collection instanceof Array) { - return collection; - } - var itr = collection.iterator(); - var array = new Array(); - while (itr.hasNext()) { - array[array.length] = itr.next(); - } - return array; -} - -// gets MBean attributes -function getMBeanAttributes(objName, attributeNames) { - objName = objectName(objName); - return mbeanConnection().getAttributes(objName,stringArray(attributeNames)); -} -getMBeanAttributes.docString = "returns specified Attributes of given ObjectName"; - -// gets MBean attribute -function getMBeanAttribute(objName, attrName) { - objName = objectName(objName); - return mbeanConnection().getAttribute(objName, attrName); -} -getMBeanAttribute.docString = "returns a single Attribute of given ObjectName"; - - -// sets MBean attributes -function setMBeanAttributes(objName, attrList) { - objName = objectName(objName); - attrList = toAttrList(attrList); - return mbeanConnection().setAttributes(objName, attrList); -} -setMBeanAttributes.docString = "sets specified Attributes of given ObjectName"; - -// sets MBean attribute -function setMBeanAttribute(objName, attrName, attrValue) { - var Attribute = Packages.javax.management.Attribute; - objName = objectName(objName); - mbeanConnection().setAttribute(objName, new Attribute(attrName, attrValue)); -} -setMBeanAttribute.docString = "sets a single Attribute of given ObjectName"; - - -// invokes an operation on given MBean -function invokeMBean(objName, operation, params, signature) { - objName = objectName(objName); - params = objectArray(params); - signature = stringArray(signature); - return mbeanConnection().invoke(objName, operation, params, signature); -} -invokeMBean.docString = "invokes MBean operation on given ObjectName"; - -/** - * Wraps a MBean specified by ObjectName as a convenient - * script object -- so that setting/getting MBean attributes - * and invoking MBean method can be done with natural syntax. - * - * @param objName ObjectName of the MBean - * @param async asynchornous mode [optional, default is false] - * @return script wrapper for MBean - * - * With async mode, all field, operation access is async. Results - * will be of type FutureTask. When you need value, call 'get' on it. - */ -function mbean(objName, async) { - var index; - - objName = objectName(objName); - var info = mbeanInfo(objName); - var attrs = info.attributes; - var attrMap = new Object; - for (index in attrs) { - attrMap[attrs[index].name] = attrs[index]; - } - var opers = info.operations; - var operMap = new Object; - for (index in opers) { - operMap[opers[index].name] = opers[index]; - } - - function isAttribute(name) { - return name in attrMap; - } - - function isOperation(name) { - return name in operMap; - } - - return new JSAdapter() { - __has__: function (name) { - return isAttribute(name) || isOperation(name); - }, - __get__: function (name) { - if (isAttribute(name)) { - if (async) { - return getMBeanAttribute.future(objName, name); - } else { - return getMBeanAttribute(objName, name); - } - } else { - return undefined; - } - }, - __call__: function(name) { - if (isOperation(name)) { - var oper = operMap[name]; - - var params = []; - for (var j = 1; j < arguments.length; j++) { - params[j-1]= arguments[j]; - } - - var sigs = oper.signature; - - var sigNames = new Array(sigs.length); - for (var index in sigs) { - sigNames[index] = sigs[index].getType(); - } - - if (async) { - return invokeMBean.future(objName, name, params, sigNames); - } else { - return invokeMBean(objName, name, params, sigNames); - } - } else { - return undefined; - } - }, - __put__: function (name, value) { - if (isAttribute(name)) { - if (async) { - setMBeanAttribute.future(objName, name, value); - } else { - setMBeanAttribute(objName, name, value); - } - } else { - return undefined; - } - } - }; -} -mbean.docString = "returns a conveninent script wrapper for a MBean of given ObjectName"; - -/** - * load and evaluate script file. If no script file is - * specified, file dialog is shown to choose the script. - * - * @param file script file name [optional] - * @return value returned from evaluating script - */ -function load(file) { - if (file == undefined || file == null) { - // file not specified, show file dialog to choose - file = fileDialog(); - } - if (file == null) return; - - var reader = new java.io.FileReader(file); - var oldFilename = engine.get(engine.FILENAME); - engine.put(engine.FILENAME, file); - try { - engine.eval(reader); - } finally { - engine.put(engine.FILENAME, oldFilename); - } - reader.close(); -} -load.docString = "loads a script file and evaluates it"; - -/** - * Concurrency utilities for JavaScript. These are based on - * java.lang and java.util.concurrent API. The following functions - * provide a simpler API for scripts. Instead of directly using java.lang - * and java.util.concurrent classes, scripts can use functions and - * objects exported from here. - */ - -/** - * Wrapper for java.lang.Object.wait - * - * can be called only within a sync method - */ -function wait(object) { - var objClazz = java.lang.Class.forName('java.lang.Object'); - var waitMethod = objClazz.getMethod('wait', null); - waitMethod.invoke(object, null); -} -wait.docString = "convenient wrapper for java.lang.Object.wait method"; - - -/** - * Wrapper for java.lang.Object.notify - * - * can be called only within a sync method - */ -function notify(object) { - var objClazz = java.lang.Class.forName('java.lang.Object'); - var notifyMethod = objClazz.getMethod('notify', null); - notifyMethod.invoke(object, null); -} -notify.docString = "convenient wrapper for java.lang.Object.notify method"; - - -/** - * Wrapper for java.lang.Object.notifyAll - * - * can be called only within a sync method - */ -function notifyAll(object) { - var objClazz = java.lang.Class.forName('java.lang.Object'); - var notifyAllMethod = objClazz.getMethod('notifyAll', null); - notifyAllMethod.invoke(object, null); -} -notifyAll.docString = "convenient wrapper for java.lang.Object.notifyAll method"; - - -/** - * Creates a java.lang.Runnable from a given script - * function. - */ -Function.prototype.runnable = function() { - var args = arguments; - var func = this; - return new java.lang.Runnable() { - run: function() { - func.apply(null, args); - } - } -} - -/** - * Executes the function on a new Java Thread. - */ -Function.prototype.thread = function() { - var t = new java.lang.Thread(this.runnable.apply(this, arguments)); - t.start(); - return t; -} - -/** - * Executes the function on a new Java daemon Thread. - */ -Function.prototype.daemon = function() { - var t = new java.lang.Thread(this.runnable.apply(this, arguments)); - t.setDaemon(true); - t.start(); - return t; -} - -/** - * Creates a java.util.concurrent.Callable from a given script - * function. - */ -Function.prototype.callable = function() { - var args = arguments; - var func = this; - return new java.util.concurrent.Callable() { - call: function() { return func.apply(null, args); } - } -} - -/** - * Registers the script function so that it will be called exit. - */ -Function.prototype.atexit = function () { - var args = arguments; - java.lang.Runtime.getRuntime().addShutdownHook( - new java.lang.Thread(this.runnable.apply(this, args))); -} - -/** - * Executes the function asynchronously. - * - * @return a java.util.concurrent.FutureTask - */ -Function.prototype.future = (function() { - // default executor for future - var juc = java.util.concurrent; - var theExecutor = juc.Executors.newSingleThreadExecutor(); - // clean-up the default executor at exit - (function() { theExecutor.shutdown(); }).atexit(); - return function() { - return theExecutor.submit(this.callable.apply(this, arguments)); - } -})(); - -// shortcut for j.u.c lock classes -var Lock = java.util.concurrent.locks.ReentrantLock; -var RWLock = java.util.concurrent.locks.ReentrantReadWriteLock; - -/** - * Executes a function after acquiring given lock. On return, - * (normal or exceptional), lock is released. - * - * @param lock lock that is locked and unlocked - */ -Function.prototype.sync = function (lock) { - if (arguments.length == 0) { - throw "lock is missing"; - } - var res = new Array(arguments.length - 1); - for (var i = 0; i < res.length; i++) { - res[i] = arguments[i + 1]; - } - lock.lock(); - try { - this.apply(null, res); - } finally { - lock.unlock(); - } -}; - -/** - * Causes current thread to sleep for specified - * number of milliseconds - * - * @param interval in milliseconds - */ -function sleep(interval) { - java.lang.Thread.sleep(interval); -} -sleep.docString = "wrapper for java.lang.Thread.sleep method"; - -/** - * Schedules a task to be executed once in N milliseconds specified. - * - * @param callback function or expression to evaluate - * @param interval in milliseconds to sleep - * @return timeout ID (which is nothing but Thread instance) - */ -function setTimeout(callback, interval) { - if (! (callback instanceof Function)) { - callback = new Function(callback); - } - - // start a new thread that sleeps given time - // and calls callback in an infinite loop - return (function() { - try { - sleep(interval); - } catch (x) { } - callback(); - }).daemon(); -} -setTimeout.docString = "calls given callback once after specified interval"; - -/** - * Cancels a timeout set earlier. - * @param tid timeout ID returned from setTimeout - */ -function clearTimeout(tid) { - // we just interrupt the timer thread - tid.interrupt(); -} -clearTimeout.docString = "interrupt a setTimeout timer"; - -/** - * Schedules a task to be executed once in - * every N milliseconds specified. - * - * @param callback function or expression to evaluate - * @param interval in milliseconds to sleep - * @return timeout ID (which is nothing but Thread instance) - */ -function setInterval(callback, interval) { - if (! (callback instanceof Function)) { - callback = new Function(callback); - } - - // start a new thread that sleeps given time - // and calls callback in an infinite loop - return (function() { - while (true) { - try { - sleep(interval); - } catch (x) { - break; - } - callback(); - } - }).daemon(); -} -setInterval.docString = "calls given callback every specified interval"; - -/** - * Cancels a timeout set earlier. - * @param tid timeout ID returned from setTimeout - */ -function clearInterval(tid) { - // we just interrupt the timer thread - tid.interrupt(); -} -clearInterval.docString = "interrupt a setInterval timer"; - -/** - * Simple access to thread local storage. - * - * Script sample: - * - * __thread.x = 44; - * function f() { - * __thread.x = 'hello'; - * print(__thread.x); - * } - * f.thread(); // prints 'hello' - * print(__thread.x); // prints 44 in main thread - */ -var __thread = (function () { - var map = new Object(); - return new JSAdapter() { - __has__: function(name) { - return map[name] != undefined; - }, - __get__: function(name) { - if (map[name] != undefined) { - return map[name].get(); - } else { - return undefined; - } - }, - __put__: sync(function(name, value) { - if (map[name] == undefined) { - var tmp = new java.lang.ThreadLocal(); - tmp.set(value); - map[name] = tmp; - } else { - map[name].set(value); - } - }), - __delete__: function(name) { - if (map[name] != undefined) { - map[name].set(null); - } - } - } -})(); - -// user interface utilities - -/** - * Swing invokeLater - invokes given function in AWT event thread - */ -Function.prototype.invokeLater = function() { - var SwingUtilities = Packages.javax.swing.SwingUtilities; - SwingUtilities.invokeLater(this.runnable.apply(this, arguments)); -} - -/** - * Swing invokeAndWait - invokes given function in AWT event thread - * and waits for it's completion - */ -Function.prototype.invokeAndWait = function() { - var SwingUtilities = Packages.javax.swing.SwingUtilities; - SwingUtilities.invokeAndWait(this.runnable.apply(this, arguments)); -} - -/** - * Am I running in AWT event dispatcher thread? - */ -function isEventThread() { - var SwingUtilities = Packages.javax.swing.SwingUtilities; - return SwingUtilities.isEventDispatchThread(); -} -isEventThread.docString = "returns whether the current thread is GUI thread"; - -/** - * Opens a file dialog box - * - * @param curDir current directory [optional] - * @return absolute path if file selected or else null - */ -function fileDialog(curDir) { - var result; - function _fileDialog() { - if (curDir == undefined) curDir = undefined; - var JFileChooser = Packages.javax.swing.JFileChooser; - var dialog = new JFileChooser(curDir); - var res = dialog.showOpenDialog(null); - if (res == JFileChooser.APPROVE_OPTION) { - result = dialog.getSelectedFile().getAbsolutePath(); - } else { - result = null; - } - } - - if (isEventThread()) { - _fileDialog(); - } else { - _fileDialog.invokeAndWait(); - } - return result; -} -fileDialog.docString = "show a FileOpen dialog box"; - -/** - * Shows a message box - * - * @param msg message to be shown - * @param title title of message box [optional] - * @param msgType type of message box [constants in JOptionPane] - */ -function msgBox(msg, title, msgType) { - - function _msgBox() { - var JOptionPane = Packages.javax.swing.JOptionPane; - if (msg === undefined) msg = "undefined"; - if (msg === null) msg = "null"; - if (title == undefined) title = msg; - if (msgType == undefined) msgType = JOptionPane.INFORMATION_MESSAGE; - JOptionPane.showMessageDialog(window, msg, title, msgType); - } - if (isEventThread()) { - _msgBox(); - } else { - _msgBox.invokeAndWait(); - } -} -msgBox.docString = "shows MessageBox to the user"; - -/** - * Shows an information alert box - * - * @param msg message to be shown - * @param title title of message box [optional] - */ -function alert(msg, title) { - var JOptionPane = Packages.javax.swing.JOptionPane; - msgBox(msg, title, JOptionPane.INFORMATION_MESSAGE); -} -alert.docString = "shows an alert message box to the user"; - -/** - * Shows an error alert box - * - * @param msg message to be shown - * @param title title of message box [optional] - */ -function error(msg, title) { - var JOptionPane = Packages.javax.swing.JOptionPane; - msgBox(msg, title, JOptionPane.ERROR_MESSAGE); -} -error.docString = "shows an error message box to the user"; - - -/** - * Shows a warning alert box - * - * @param msg message to be shown - * @param title title of message box [optional] - */ -function warn(msg, title) { - var JOptionPane = Packages.javax.swing.JOptionPane; - msgBox(msg, title, JOptionPane.WARNING_MESSAGE); -} -warn.docString = "shows a warning message box to the user"; - - -/** - * Shows a prompt dialog box - * - * @param question question to be asked - * @param answer default answer suggested [optional] - * @return answer given by user - */ -function prompt(question, answer) { - var result; - function _prompt() { - var JOptionPane = Packages.javax.swing.JOptionPane; - if (answer == undefined) answer = ""; - result = JOptionPane.showInputDialog(window, question, answer); - } - if (isEventThread()) { - _prompt(); - } else { - _prompt.invokeAndWait(); - } - return result; -} -prompt.docString = "shows a prompt box to the user and returns the answer"; - -/** - * Shows a confirmation dialog box - * - * @param msg message to be shown - * @param title title of message box [optional] - * @return boolean (yes->true, no->false) - */ -function confirm(msg, title) { - var result; - var JOptionPane = Packages.javax.swing.JOptionPane; - function _confirm() { - if (title == undefined) title = msg; - var optionType = JOptionPane.YES_NO_OPTION; - result = JOptionPane.showConfirmDialog(null, msg, title, optionType); - } - if (isEventThread()) { - _confirm(); - } else { - _confirm.invokeAndWait(); - } - return result == JOptionPane.YES_OPTION; -} -confirm.docString = "shows a confirmation message box to the user"; - -/** - * Echoes zero or more arguments supplied to screen. - * This is print equivalent for GUI. - * - * @param zero or more items to echo. - */ -function echo() { - var args = arguments; - (function() { - var len = args.length; - for (var i = 0; i < len; i++) { - window.print(args[i]); - window.print(" "); - } - window.print("\n"); - }).invokeLater(); -} -echo.docString = "echoes arguments to interactive console screen"; - - -/** - * Clear the screen - */ -function clear() { - (function() { window.clear(false); }).invokeLater(); -} -clear.docString = "clears interactive console screen"; - - -// synonym for clear -var cls = clear; - - -/** - * Exit the process after confirmation from user - * - * @param exitCode return code to OS [optional] - */ -function exit(exitCode) { - if (exitCode == undefined) exitCode = 0; - if (confirm("Do you really want to exit?")) { - java.lang.System.exit(exitCode); - } -} -exit.docString = "exits jconsole"; - -// synonym to exit -var quit = exit; - diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/heapdump.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/heapdump.js deleted file mode 100644 index 7cb53225a11..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/heapdump.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This file defines heapdump function to heap dump - * in binary format. User can call this function - * based on events. For example, a timer thread can - * keep checking heap threshold and depending on - * specific expected threshold value, it can call - * heapdump to dump the keep. File name can contain - * timestamp so that multiple heapdumps can be generated - * for the same process. - */ - -/** - * Function to dump heap in binary format. - * - * @param file heap dump file name [optional] - */ -function heapdump(file) { - // no file specified, show file open dialog - if (file == undefined) { - file = fileDialog(); - // check whether user cancelled the dialog - if (file == null) return; - } - - /* - * Get HotSpotDiagnostic MBean and wrap it as convenient - * script wrapper using 'mbean' function. Instead of using - * MBean proxies 'mbean' function creates a script wrapper - * that provides similar convenience but uses explicit - * invocation behind the scene. This implies that mbean - * wrapper would the same for dynamic MBeans as well. - */ - var diagBean = mbean("com.sun.management:type=HotSpotDiagnostic"); - - // dump the heap in the file - diagBean.dumpHeap(file, true); -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/hello.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/hello.js deleted file mode 100644 index 6c0acd36138..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/hello.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This is sample JavaScript file that can be loaded into script console. - * This file prints "hello, world". - */ - -echo("hello, world"); diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/invoke.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/invoke.js deleted file mode 100644 index 919769bc493..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/invoke.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2006, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This script demonstrates "invokeMBean" function. Instead - * of using MXBean proxy or script wrapper object returned by - * 'mbean' function, this file uses direct invoke on MBean. - * - * To use this particular script, load this script file in - * script console prompt and call resetPeakThreadCount(). - - */ - -/** - * Resets the peak thread count to the current number of live threads. - * - */ -function resetPeakThreadCount() { - return invokeMBean("java.lang:type=Threading", "resetPeakThreadCount", [], {}); -} - diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jstack.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jstack.js deleted file mode 100644 index aff7d7c04e1..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jstack.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2006, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This file defines 'jstack' function to print stack traces of - * threads.'jstack' function which can be called once or periodically - * from a timer thread (calling it periodically would slow down the target - * application). To call this once, just call 'jstack()' in script - * console prompt. To call jstack in a timer thread, you can use - * - * var t = setInterval(function () { jstack(print); }, 5000); - * - * The above call prints threads in sorted order for every 5 seconds. - * The print output goes to OS console window from which jconsole was - * started. The timer can be cancelled later by clearTimeout() function - * as shown below: - * - * clearInterval(t); - */ - - -/** - * print given ThreadInfo using given printFunc - */ -function printThreadInfo(ti, printFunc) { - printFunc(ti.threadId + " - " + ti.threadName + " - " + ti.threadState); - var stackTrace = ti.stackTrace; - for (var i in stackTrace) { - printFunc("\t" + stackTrace[i]); - } -} - -/** - * print stack traces of all threads. - * - * @param printFunc function called to print [optional] - * @param maxFrames maximum number of frames to print [optional] - */ -function jstack(printFunc, maxFrames) { - // by default use 'echo' to print. Other choices could be - // 'print' or custom function that writes in a text file - if (printFunc == undefined) { - printFunc = echo; - } - - // by default print 25 frames - if (maxFrames == undefined) { - maxFrames = 25; - } - - var tmbean = newPlatformMXBeanProxy( - "java.lang:type=Threading", - java.lang.management.ThreadMXBean.class); - - var tids = tmbean.allThreadIds; - var tinfos = tmbean["getThreadInfo(long[],int)"](tids, maxFrames); - - for (var i in tinfos) { - printThreadInfo(tinfos[i], printFunc); - } -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jtop.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jtop.js deleted file mode 100644 index 2733b12a69e..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/jtop.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2006, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This code is "ported" from JTop demo. This file defines - * 'jtop' function. jtop prints threads sorting by CPU time. - * jtop can be called once or periodically from a timer thread. - * To call this once, just call 'jtop()' in script console prompt. - * To call jtop in a timer thread, you can use - * - * var t = setInterval(function () { jtop(print); }, 2000); - * - * The above call prints threads in sorted order for every 2 seconds. - * The print output goes to OS console window from which jconsole was - * started. The timer can be cancelled later by clearTimeout() function - * as shown below: - * - * clearInterval(t); - */ - -/** - * This function returns a List of Map.Entry objects - * in which each entry maps cpu time to ThreadInfo. - */ -function getThreadList() { - var tmbean = newPlatformMXBeanProxy( - "java.lang:type=Threading", - java.lang.management.ThreadMXBean.class); - - if (!tmbean.isThreadCpuTimeSupported()) { - return java.util.Collections.EMPTY_LIST; - } - - tmbean.setThreadCpuTimeEnabled(true); - - var tids = tmbean.allThreadIds; - var tinfos = tmbean["getThreadInfo(long[])"](tids); - - var map = new java.util.TreeMap(); - for (var i in tids) { - var cpuTime = tmbean.getThreadCpuTime(tids[i]); - if (cpuTime != -1 && tinfos[i] != null) { - map.put(cpuTime, tinfos[i]); - } - } - var list = new java.util.ArrayList(map.entrySet()); - java.util.Collections.reverse(list); - return list; -} - -/** - * This function prints threads sorted by CPU time. - * - * @param printFunc function called back to print [optional] - * - * By default, it uses 'echo' function to print in screen. - * Other choices could be 'print' (prints in console), 'alert' - * to show message box. Or you can define a function that writes - * the output to a text file. - */ -function jtop(printFunc) { - if (printFunc == undefined) { - printFunc = echo; - } - var list = getThreadList(); - var itr = list.iterator(); - printFunc("time - state - name"); - while (itr.hasNext()) { - var entry = itr.next(); - // time is in nanoseconds - convert to seconds - var time = entry.key / 1.0e9; - var name = entry.value.threadName; - var state = entry.value.threadState; - printFunc(time + " - " + state + " - " + name); - } -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/sysprops.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/sysprops.js deleted file mode 100644 index 5ff958d836e..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/sysprops.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2006, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This file defines 'sysprops' function to print Java System - * properties.'sysprops' function which can be called once or periodically - * from a timer thread (calling it periodically would slow down the target - * application). To call this once, just call 'sysprops()' in script - * console prompt. To call sysprops in a timer thread, you can use - * - * var t = setInterval(function () { sysprops(print); }, 5000); - * - * The above call prints threads in sorted order for every 5 seconds. - * The print output goes to OS console window from which jconsole was - * started. The timer can be cancelled later by clearTimeout() function - * as shown below: - * - * clearInterval(t); - */ - - -/** - * Returns System properties as a Map - */ -function getSystemProps() { - var runtimeBean = newPlatformMXBeanProxy( - "java.lang:type=Runtime", - java.lang.management.RuntimeMXBean.class); - return runtimeBean.systemProperties; -} - -/** - * print System properties - * - * @param printFunc function called to print [optional] - */ -function sysprops(printFunc) { - // by default use 'echo' to print. Other choices could be - // 'print' or custom function that writes in a text file - if (printFunc == undefined) { - printFunc = echo; - } - - var map = getSystemProps(); - var keys = map.keySet().iterator(); - while (keys.hasNext()) { - var key = keys.next(); - var value = map.get(key); - printFunc(key + "=" + value); - } -} diff --git a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/verbose.js b/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/verbose.js deleted file mode 100644 index a749ce36c65..00000000000 --- a/jdk/src/demo/share/scripting/jconsole-plugin/src/scripts/verbose.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) 2006, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - * This script demonstrates "getMBeanAttribute" - * and "setMBeanAttribute" functions. Instead of using - * MXBean proxy or script wrapper object returned by - * 'mbean' function, this file uses direct get/set MBean - * attribute functions. - * - * To use this particular script, load this script file in - * script console prompt and call verboseGC or verboseClass - * functions. These functions based on events such as - * heap threshold crossing a given limit. i.e., A timer thread - * can keep checking for threshold event and then turn on - * verbose:gc or verbose:class based on expected event. - - */ - -/** - * Get or set verbose GC flag. - * - * @param flag verbose mode flag [optional] - * - * If flag is not passed verboseGC returns current - * flag value. - */ -function verboseGC(flag) { - if (flag == undefined) { - // no argument passed. interpret this as 'get' - return getMBeanAttribute("java.lang:type=Memory", "Verbose"); - } else { - return setMBeanAttribute("java.lang:type=Memory", "Verbose", flag); - } -} - -/** - * Get or set verbose class flag. - * - * @param flag verbose mode flag [optional] - * - * If flag is not passed verboseClass returns current - * flag value. - */ -function verboseClass(flag) { - if (flag == undefined) { - // no argument passed. interpret this as 'get' - return getMBeanAttribute("java.lang:type=ClassLoading", "Verbose"); - } else { - return setMBeanAttribute("java.lang:type=ClassLoading", "Verbose", flag); - } -} diff --git a/jdk/src/demo/solaris/jni/Poller/Client.java b/jdk/src/demo/solaris/jni/Poller/Client.java deleted file mode 100644 index ffa706eabc9..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/Client.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -import java.util.*; -import java.net.*; -import java.io.*; - -public class Client -{ - private final static int BYTESPEROP= PollingServer.BYTESPEROP; - private final static int PORTNUM = PollingServer.PORTNUM; - private final static int MAXCONN = PollingServer.MAXCONN; - - private static Socket[] sockArr = new Socket[MAXCONN]; - private static int totalConn =10; - private static int bytesToSend =1024000; - private static int connections = 0; - private static int sends = 0; - - public static void main (String args[]) { - - String host = "localhost"; - - if (args.length < 1 || args.length > 3) { - System.out.println("Usage : java Client "); - System.out.println(" | java Client "); - System.out.println(" | java Client " + - " "); - System.exit(-1); - } - - if (args.length >= 1) - totalConn = java.lang.Integer.valueOf(args[0]).intValue(); - if (args.length >= 2) - host = args[1]; - if (args.length == 3) - bytesToSend = java.lang.Integer.valueOf(args[2]).intValue() * 1024; - - - if (totalConn <= 0 || totalConn > MAXCONN) { - System.out.println("Connections out of range. Terminating."); - System.exit(-1); - } - - System.out.println("Using " + totalConn + " connections for sending " + - bytesToSend + " bytes to " + host); - - - try { - Socket ctrlSock = new Socket (host, PORTNUM); - PrintStream ctrlStream = - new PrintStream(ctrlSock.getOutputStream()); - ctrlStream.println(bytesToSend); - ctrlStream.println(totalConn); - - while (connections < totalConn ) { - sockArr[connections] = new Socket (host, PORTNUM); - connections ++; - } - System.out.println("Connections made : " + connections); - - byte[] buff = new byte[BYTESPEROP]; - for (int i = 0; i < BYTESPEROP; i++) // just put some junk in! - buff[i] = (byte) i; - - Random rand = new Random(5321L); - while (sends < bytesToSend/BYTESPEROP) { - int idx = java.lang.Math.abs(rand.nextInt()) % totalConn; - sockArr[idx].getOutputStream().write(buff,0,BYTESPEROP); - sends++; - } - // Wait for server to say done. - int bytes = ctrlSock.getInputStream().read(buff, 0, BYTESPEROP); - System.out.println (" Total connections : " + connections + - " Bytes sent : " + sends * BYTESPEROP + - "...Done!"); - } catch (Exception e) { e.printStackTrace(); } - } -} diff --git a/jdk/src/demo/solaris/jni/Poller/LinkedQueue.java b/jdk/src/demo/solaris/jni/Poller/LinkedQueue.java deleted file mode 100644 index bc70554f3e7..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/LinkedQueue.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - File: SLQ.java - Originally: LinkedQueue.java - - Originally written by Doug Lea and released into the public domain. - This may be used for any purposes whatsoever without acknowledgment. - Thanks for the assistance and support of Sun Microsystems Labs, - and everyone contributing, testing, and using this code. - - History: - Date Who What - 11Jun1998 dl Create public version - 25aug1998 dl added peek - 10dec1998 dl added isEmpty - 10jun1999 bc modified for isolated use -*/ - -// Original was in package EDU.oswego.cs.dl.util.concurrent; - -/** - * A linked list based channel implementation, - * adapted from the TwoLockQueue class from CPJ. - * The algorithm avoids contention between puts - * and takes when the queue is not empty. - * Normally a put and a take can proceed simultaneously. - * (Although it does not allow multiple concurrent puts or takes.) - * This class tends to perform more efficently than - * other Channel implementations in producer/consumer - * applications. - *

    [ Introduction to this package. ] - **/ - -public class LinkedQueue { - - - /** - * Dummy header node of list. The first actual node, if it exists, is always - * at head_.next. After each take, the old first node becomes the head. - **/ - protected LinkedNode head_; - protected int count_; - /** - * Helper monitor for managing access to last node, in case it is also first. - * last_ and waitingForTake_ ONLY used with synch on appendMonitor_ - **/ - protected final Object lastMonitor_ = new Object(); - - /** - * The last node of list. Put() appends to list, so modifies last_ - **/ - protected LinkedNode last_; - - /** - * The number of threads waiting for a take. - * Notifications are provided in put only if greater than zero. - * The bookkeeping is worth it here since in reasonably balanced - * usages, the notifications will hardly ever be necessary, so - * the call overhead to notify can be eliminated. - **/ - protected int waitingForTake_ = 0; - - public LinkedQueue() { - head_ = new LinkedNode(null); - last_ = head_; - count_ = 0; - } - - /** Main mechanics for put/offer **/ - protected void insert(Object x) { - synchronized(lastMonitor_) { - LinkedNode p = new LinkedNode(x); - last_.next = p; - last_ = p; - count_++; - if (count_ > 1000 && (count_ % 1000 == 0)) - System.out.println("In Queue : " + count_); - if (waitingForTake_ > 0) - lastMonitor_.notify(); - } - } - - /** Main mechanics for take/poll **/ - protected synchronized Object extract() { - Object x = null; - LinkedNode first = head_.next; - if (first != null) { - x = first.value; - first.value = null; - head_ = first; - count_ --; - } - return x; - } - - - public void put(Object x) throws InterruptedException { - if (x == null) throw new IllegalArgumentException(); - if (Thread.interrupted()) throw new InterruptedException(); - insert(x); - } - - public boolean offer(Object x, long msecs) throws InterruptedException { - if (x == null) throw new IllegalArgumentException(); - if (Thread.interrupted()) throw new InterruptedException(); - insert(x); - return true; - } - - public Object take() throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - // try to extract. If fail, then enter wait-based retry loop - Object x = extract(); - if (x != null) - return x; - else { - synchronized(lastMonitor_) { - try { - ++waitingForTake_; - for (;;) { - x = extract(); - if (x != null) { - --waitingForTake_; - return x; - } - else { - lastMonitor_.wait(); - } - } - } - catch(InterruptedException ex) { - --waitingForTake_; - lastMonitor_.notify(); - throw ex; - } - } - } - } - - public synchronized Object peek() { - LinkedNode first = head_.next; - if (first != null) - return first.value; - else - return null; - } - - - public synchronized boolean isEmpty() { - return head_.next == null; - } - - public Object poll(long msecs) throws InterruptedException { - if (Thread.interrupted()) throw new InterruptedException(); - Object x = extract(); - if (x != null) - return x; - else { - synchronized(lastMonitor_) { - try { - long waitTime = msecs; - long start = (msecs <= 0)? 0 : System.currentTimeMillis(); - ++waitingForTake_; - for (;;) { - x = extract(); - if (x != null || waitTime <= 0) { - --waitingForTake_; - return x; - } - else { - lastMonitor_.wait(waitTime); - waitTime = msecs - (System.currentTimeMillis() - start); - } - } - } - catch(InterruptedException ex) { - --waitingForTake_; - lastMonitor_.notify(); - throw ex; - } - } - } - } - - class LinkedNode { - Object value; - LinkedNode next = null; - LinkedNode(Object x) { value = x; } - LinkedNode(Object x, LinkedNode n) { value = x; next = n; } - } -} diff --git a/jdk/src/demo/solaris/jni/Poller/Poller.c b/jdk/src/demo/solaris/jni/Poller/Poller.c deleted file mode 100644 index 5c627ac57ca..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/Poller.c +++ /dev/null @@ -1,753 +0,0 @@ -/* - * Copyright (c) 1999, 2013, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -/* - ********************************************************************** - * Poller.c : - * JNI code for use with Poller.java, principally to take advantage - * of poll() or /dev/poll multiplexing. - * - * One will need Solaris 8 or Solaris 7 with adequate patches to take - * advantage of the /dev/poll performance enhancements, though any - * version of Solaris 7 will automatically use the kernel poll() - * caching. And poll() will function in 2.5.1 and 2.6 as well, but - * will not perform well for large numbers of file descriptors. - * - * Several assumptions have been made to simplify this code : - * 1> At most MAX_HANDLES (32) separate pollable entities are currently - * supported. - * 2> Global synchronization from Java is assumed for all init, create - * and destroy routines. Per Object (handle passed in) synchronization - * is required for all AddFd, RemoveFd, IsMember, and Wait routines. - * 3> It is currently up to the user to handle waking up an - * existing nativeWait() call to do an addfd or removefd on - * that set...could implement that here with an extra pipe, or - * with a pair of loopback sockets in Poller.java or user code. - * In most cases interruption is not necessary for deletions, - * so long as deletions are queued up outside the Poller class - * and then executed the next time waitMultiple() returns. - * 4> /dev/poll performance could be slightly improved by coalescing - * adds/removes so that a write() is only done before the ioctl - * (DP_POLL), but this complicates exception handling and sees - * only modest performance gains so wasn't done. - * 5> /dev/poll does not report errors on attempts to remove non- - * extant fds, but a future bug fix to the /dev/poll device driver - * should solve this problem. - * 6> Could add simpler code for pre-Solaris 7 releases which will - * perform slightly better on those OSs. But again there - * are only modest gains to be had from these new code paths, - * so they've been omitted here. - * - * Compile "cc -G -o /libpoller.so -I ${JAVA_HOME}/include " \ - * -I ${JAVA_HOME}/include/solaris Poller.c" and place the - * in your LD_LIBRARY_PATH - * - ********************************************************************** - */ - -#include -#include -#include -#include -#include -#include - - -/* - * Remove "_NOT"s to turn on features - * Append "_NOT" to turn off features. - * Use of /dev/poll requires both the include file and kernel driver. - */ -#define DEBUG_NOT -#define DEVPOLL_NOT - -#ifdef DEVPOLL -#include -#endif - -#include "Poller.h" - -#define MAX_HANDLES 32 - - -#ifdef DEBUG -#define DBGMSG(x) printf x -#define ASSERT(x) {if (!(x)) \ - printf("assertion(%s) failed at line : %d\n",#x,__LINE__);} -#define CHECK_HANDLE(x) check_handle(x) -#else -#define DBGMSG(x) -#define ASSERT(x) -#define CHECK_HANDLE(x) -#endif - -/* - * Globals ...protect all with a global synchronization object. - */ - -static int Current_handle = 0; -static int Use_devpoll = 0; -static int Max_index = 0; - -/* - * Per Poller object data. - * Must be synchronized on a per Poller object basis. - */ - -typedef struct ioevent { - int inuse; - int devpollfd; - int last_index; - int total_free; - int left_events; - int max_index; - pollfd_t *pfd; -} ioevent_t; - -static ioevent_t IOE_handles[MAX_HANDLES]; - - /* - * Exceptions to be thrown. - * Note : assuming all illegal argument and NULL pointer checks - * have already been done by the Java calling methods. - */ -static jint throwOutOfMemoryError(JNIEnv *env, const char * cause) -{ - (*env)->ThrowNew(env, (*env)->FindClass(env,"java/lang/OutOfMemoryError"), - cause); - return -1; -} -static jint throwInterruptedIOException(JNIEnv *env, const char * cause) -{ - (*env)->ThrowNew(env, - (*env)->FindClass(env,"java/io/InterruptedIOException"), - cause); - return -1; -} -static jint throwIllegalStateException(JNIEnv *env, const char * cause) -{ - (*env)->ThrowNew(env, - (*env)->FindClass(env,"java/lang/IllegalStateException"), - cause); - return -1; -} - -#define MEMORY_EXCEPTION(str) throwOutOfMemoryError(env, "Poller:" str) -#define STATE_EXCEPTION(str) throwIllegalStateException(env, "Poller:" str) -#define INTERRUPT_EXCEPTION(str) throwInterruptedIOException(env, \ - "Poller:" str) -jint addfd(JNIEnv *, ioevent_t *, jint, jshort); -jint removefd(JNIEnv *, ioevent_t *, jint); - - /* - * Class Poller - * Method: nativeInit - * Signature: ()I - * - * Only to be called once, right after this library is loaded, - * so no need to deal with reentrancy here. - * Could do as a pragma ini, but that isn't as portable. - */ -JNIEXPORT jint JNICALL Java_Poller_nativeInit(JNIEnv *env, jclass cls) -{ - int testdevpollfd; - int i; - -#ifdef DEVPOLL - /* - * See if we can use this much faster method - * Note : must have fix for BUGID # 4223353 or OS can crash! - */ - testdevpollfd = open("/dev/poll",O_RDWR); - if (testdevpollfd >= 0) { - /* - * If Solaris 7, we need a patch - * Until we know what string to search for, we'll play it - * safe and disable this for Solaris 7. - */ - - if (!strcmp(name.release,"5.7")) - { - Use_devpoll = 0; - } - else - { - Use_devpoll = 1; - } - } - - DBGMSG(("Use_devpoll=%d\n" ,Use_devpoll)); - close(testdevpollfd); -#endif - - /* - * For now, we optimize for Solaris 7 if /dev/poll isn't - * available, as it is only a small % hit for Solaris < 7. - * if ( (Use_devpoll == 0) && !strcmp(name.release,"5.6") ) - * Use_sol7opt = 0; - */ - Current_handle = 0; - for (i = 0; i < MAX_HANDLES; i++) { - IOE_handles[i].devpollfd = -1; - IOE_handles[i].pfd = NULL; - } - - /* - * this tells me the max number of open filedescriptors - */ - Max_index = sysconf(_SC_OPEN_MAX); - if (Max_index < 0) { - Max_index = 1024; - } - - DBGMSG(("got sysconf(_SC_OPEN_MAX)=%d file desc\n",Max_index)); - - return 0; -} - -JNIEXPORT jint JNICALL Java_Poller_getNumCPUs(JNIEnv *env, jclass cls) -{ - return sysconf(_SC_NPROCESSORS_ONLN); -} - - /* - * Class: Poller - * Method: nativeCreatePoller - * Signature: (I)I - * Note : in the case where /dev/poll doesn't exist, - * using more than one poll array could hurt - * Solaris 7 performance due to kernel caching. - */ - -JNIEXPORT jint JNICALL Java_Poller_nativeCreatePoller - (JNIEnv *env, jobject obj, jint maximum_fds) -{ - int handle, retval, i; - ioevent_t *ioeh; - - if (maximum_fds == -1) { - maximum_fds = Max_index; - } - handle = Current_handle; - if (Current_handle >= MAX_HANDLES) { - for (i = 0; i < MAX_HANDLES; i++) { - if (IOE_handles[i].inuse == 0) { - handle = i; - break; - } - } - if (handle >= MAX_HANDLES) { - return MEMORY_EXCEPTION("CreatePoller - MAX_HANDLES exceeded"); - } - } else { - Current_handle++; - } - - ioeh = &IOE_handles[handle]; - - ioeh->inuse = 1; - - ioeh->last_index = 0; - ioeh->total_free = 0; - ioeh->left_events = 0; - ioeh->max_index = maximum_fds; - - retval = handle; - if (Use_devpoll) { - ioeh->devpollfd = open("/dev/poll",O_RDWR); - DBGMSG(("Opened /dev/poll, set devpollfd = %d\n",ioeh->devpollfd)); - if (ioeh->devpollfd < 0) { - Current_handle--; - return MEMORY_EXCEPTION("CreatePoller - can\'t open /dev/poll"); - } - } - ioeh->pfd = malloc(maximum_fds * sizeof(pollfd_t)); - if (ioeh->pfd == NULL) { - Current_handle--; - return MEMORY_EXCEPTION("CreatePoller - malloc failure"); - } - - return retval; -} - - /* - * Class: Poller - * Method: nativeDestroyPoller - * Signature: (I)V - */ -JNIEXPORT void JNICALL Java_Poller_nativeDestroyPoller - (JNIEnv *env, jobject obj, jint handle) -{ - - ioevent_t *ioeh; - - if (handle < 0 || handle >= MAX_HANDLES) - { - STATE_EXCEPTION("DestroyPoller - handle out of range"); - return; - } - - ioeh = &IOE_handles[handle]; - ioeh->inuse = 0; - if (Use_devpoll) { - close(ioeh->devpollfd); - } - free(ioeh->pfd); -} - -#ifdef DEBUG -static void check_handle(ioevent_t *ioeh) -{ - int i,used,unused; - - used=unused=0; - for (i = 0; i < ioeh->last_index; i++) - { - if (ioeh->pfd[i].fd == -1) - unused++; - else - used++; - } - if (unused != ioeh->total_free) - printf("WARNING : found %d free, claimed %d. Used : %d\n", - unused, ioeh->total_free, used); -} -#endif - - /* - * Class: Poller - * Method: nativeAddFd - * Signature: (IIS)I - * - * Currently doesn't check to make sure we aren't adding - * an fd already added (no problem for /dev/poll...just - * an array waster for poll()). - */ -JNIEXPORT jint JNICALL Java_Poller_nativeAddFd - (JNIEnv *env, jobject obj, jint handle, jint fd, jshort events) -{ - int retval; - ioevent_t *ioeh; - - if (handle < 0 || handle >= MAX_HANDLES) - return STATE_EXCEPTION("AddFd - handle out of range"); - - ioeh = &IOE_handles[handle]; - - CHECK_HANDLE(ioeh); - - #ifdef DEVPOLL - if (Use_devpoll) - { - int i; - pollfd_t pollelt; - - /* - * use /dev/poll - */ - pollelt.fd = fd; - pollelt.events = events; - if ((i = write(ioeh->devpollfd, &pollelt, sizeof(pollfd_t))) != - sizeof(pollfd_t)) { - DBGMSG(("write to devpollfd=%d showed %d bytes out of %d\n", - ioeh->devpollfd,i,sizeof(pollfd_t))); - return STATE_EXCEPTION("AddFd - /dev/poll add failure"); - } - else - { - retval = fd; - } - } - else - #endif - { /* no /dev/poll available */ - retval = addfd(env, ioeh, fd, events); - } - return retval; -} - -/* - * Addfd to pollfd array...optimized for Solaris 7 - */ -jint addfd(JNIEnv *env, ioevent_t *ioeh, jint fd, jshort events) -{ - int idx; - - if (ioeh->total_free) - { - /* - * Traversing from end because that's where we pad. - */ - ioeh->total_free--; - for (idx = ioeh->last_index - 1; idx >= 0; idx--) { - if (ioeh->pfd[idx].fd == -1) - break; - } - } - else if (ioeh->last_index >= ioeh->max_index) - { - return MEMORY_EXCEPTION("AddFd - too many fds"); - } - else - { - int i; - int new_total; - /* - * For Solaris 7, want to add some growth space - * and fill extras with fd=-1. This allows for - * kernel poll() implementation to perform optimally. - */ - new_total = ioeh->last_index; - new_total += (new_total/10) + 1; /* bump size by 10% */ - if (new_total > ioeh->max_index) - new_total = ioeh->max_index; - for (i = ioeh->last_index; i <= new_total; i++) - { - ioeh->pfd[i].fd = -1; - } - idx = ioeh->last_index; - ioeh->total_free = new_total - ioeh->last_index - 1; - DBGMSG(("Just grew from %d to %d in size\n", - ioeh->last_index, new_total)); - ioeh->last_index = new_total; - } - ASSERT((idx >= 0) && (idx <= ioeh->max_index)); - ASSERT(ioeh->pfd[idx].fd == -1); - ioeh->pfd[idx].fd = fd; - ioeh->pfd[idx].events = events; - ioeh->pfd[idx].revents = 0; - - CHECK_HANDLE(ioeh); - - return fd; -} - -/* - * Class: Poller - * Method: nativeRemoveFd - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_Poller_nativeRemoveFd - (JNIEnv *env, jobject obj, jint handle, jint fd) -{ - ioevent_t *ioeh; - - if (handle < 0 || handle >= MAX_HANDLES) - return STATE_EXCEPTION("RemoveFd - handle out of range"); - - ioeh = &IOE_handles[handle]; - - #ifdef DEVPOLL - if (Use_devpoll) - { - /* - * use /dev/poll - currently no need for locking here. - */ - pollfd_t pollelt; - - pollelt.fd = fd; - pollelt.events = POLLREMOVE; - if (write(ioeh->devpollfd, &pollelt, - sizeof(pollfd_t) ) != sizeof(pollfd_t)) - { - return STATE_EXCEPTION("RemoveFd - /dev/poll failure"); - } - } - else - #endif DEVPOLL - { - return removefd(env, ioeh,fd); - } -} -/* - * remove from pollfd array...optimize for Solaris 7 - */ -jint removefd(JNIEnv *env, ioevent_t *ioeh, jint fd) -{ - int i; - int found = 0; - - { /* !Use_devpoll */ - for (i = 0; i < ioeh->last_index; i++) - { - if (ioeh->pfd[i].fd == fd) - { - ioeh->pfd[i].fd = -1; - found = 1; - break; - } - } - if (!found) - { - return STATE_EXCEPTION("RemoveFd - no such fd"); - } - ioeh->left_events = 0; /* Have to go back to the kernel */ - ioeh->total_free++; - /* - * Shrinking pool if > 33% empty. Just don't do this often! - */ - if ( (ioeh->last_index > 100) && - (ioeh->total_free > (ioeh->last_index / 3)) ) - { - int j; - /* - * we'll just bite the bullet here, since we're > 33% empty. - * walk through and eliminate -1 fd values, shrink total - * size to still have ~ 10 fd==-1 values at end. - * Start at end (since we pad here) and, when we find fd != -1, - * swap with an earlier fd == -1 until we have all -1 values - * at the end. - */ - CHECK_HANDLE(ioeh); - for (i = ioeh->last_index - 1, j = 0; i > j; i--) - { - if (ioeh->pfd[i].fd != -1) - { - while ( (j < i) && (ioeh->pfd[j].fd != -1) ) - j++; - DBGMSG( ("i=%d,j=%d,ioeh->pfd[j].fd=%d\n", - i, j, ioeh->pfd[j].fd) ); - if (j < i) - { - ASSERT(ioeh->pfd[j].fd == -1); - ioeh->pfd[j].fd = ioeh->pfd[i].fd; - ioeh->pfd[j].events = ioeh->pfd[i].events; - ioeh->pfd[i].fd = -1; - } - } - } - DBGMSG(("Just shrunk from %d to %d in size\n", - ioeh->last_index, j+11)); - ioeh->last_index = j + 11; /* last_index always 1 greater */ - ioeh->total_free = 10; - CHECK_HANDLE(ioeh); - } - } /* !Use_devpoll */ - - return 1; -} - - /* - * Class: Poller - * Method: nativeIsMember - * Signature: (II)I - */ -JNIEXPORT jint JNICALL Java_Poller_nativeIsMember - (JNIEnv *env, jobject obj, jint handle, jint fd) -{ - int found = 0; - int i; - ioevent_t *ioeh; - - if (handle < 0 || handle >= MAX_HANDLES) - return STATE_EXCEPTION("IsMember - handle out of range"); - - ioeh = &IOE_handles[handle]; - - #ifdef DEVPOLL - if (Use_devpoll) - { - pollfd_t pfd; - /* - * DEVPOLL ioctl DP_ISPOLLED call to determine if fd is polled. - */ - pfd.fd = fd; - pfd.events = 0; - pfd.revents = 0; - found = ioctl(ioeh->devpollfd, DP_ISPOLLED, &pfd); - if (found == -1) - { - return STATE_EXCEPTION("IsMember - /dev/poll failure"); - } - } - else - #endif - { - for (i = 0; i < ioeh->last_index; i++) - { - if (fd == ioeh->pfd[i].fd) - { - found = 1; - break; - } - } - } - - return found; -} - - /* - * Class: Poller - * Method: nativeWait - * Signature: (II[I[SJ)I - */ -JNIEXPORT jint JNICALL Java_Poller_nativeWait - (JNIEnv *env, jobject obj, jint handle, jint maxEvents, - jintArray jfds, jshortArray jrevents, jlong timeout) -{ - int useEvents, count, idx; - short *reventp; - jint *fdp; - int retval; - ioevent_t *ioeh; - jboolean isCopy1,isCopy2; - - if (handle < 0 || handle >= MAX_HANDLES) - return STATE_EXCEPTION("nativeWait - handle out of range"); - - ioeh = &IOE_handles[handle]; - - if (maxEvents == 0) /* just doing a kernel delay! */ - { - useEvents = poll(NULL,0L,timeout); - return 0; - } - - #ifdef DEVPOLL - if (Use_devpoll) - { - struct dvpoll dopoll; - /* - * DEVPOLL ioctl DP_POLL call, reading - */ - dopoll.dp_timeout = timeout; - dopoll.dp_nfds=maxEvents; - dopoll.dp_fds=ioeh->pfd; - - useEvents = ioctl(ioeh->devpollfd, DP_POLL, &dopoll); - while ((useEvents == -1) && (errno == EAGAIN)) - useEvents = ioctl(ioeh->devpollfd, DP_POLL, &dopoll); - - if (useEvents == -1) - { - if (errno == EINTR) - return INTERRUPT_EXCEPTION("nativeWait - /dev/poll failure EINTR"); - else - return STATE_EXCEPTION("nativeWait - /dev/poll failure"); - } - - reventp =(*env)->GetShortArrayElements(env,jrevents,&isCopy1); - fdp =(*env)->GetIntArrayElements(env,jfds,&isCopy2); - for (idx = 0,count = 0; idx < useEvents; idx++) - { - if (ioeh->pfd[idx].revents) - { - fdp[count] = ioeh->pfd[idx].fd; - reventp[count] = ioeh->pfd[idx].revents; - count++; - } - } - if (count < useEvents) - return STATE_EXCEPTION("Wait - Corrupted internals"); - - if (isCopy1 == JNI_TRUE) - (*env)->ReleaseShortArrayElements(env,jrevents,reventp,0); - if (isCopy2 == JNI_TRUE) - (*env)->ReleaseIntArrayElements(env,jfds,fdp,0); - } - else - #endif - { /* !Use_devpoll */ - - /* no leftovers=>go to kernel */ - if (ioeh->left_events == 0) - { - useEvents = poll(ioeh->pfd,ioeh->last_index, timeout); - while ((useEvents == -1) && (errno == EAGAIN)) - useEvents = poll(ioeh->pfd,ioeh->last_index, timeout); - if (useEvents == -1) - { - if (errno == EINTR) - return INTERRUPT_EXCEPTION("Wait - poll() failure EINTR-" \ - "IO interrupted."); - else if (errno == EINVAL) - return STATE_EXCEPTION("Wait - poll() failure EINVAL-" \ - "invalid args (is fdlim cur < max?)"); - else - return STATE_EXCEPTION("Wait - poll() failure"); - } - ioeh->left_events = useEvents; - DBGMSG(("waitnative : poll returns : %d\n",useEvents)); - } - else - { /* left over from last call */ - useEvents = ioeh->left_events; - } - - if (useEvents > maxEvents) - { - useEvents = maxEvents; - } - - ioeh->left_events -= useEvents; /* left to process */ - - DBGMSG(("waitnative : left %d, use %d, max %d\n",ioeh->left_events, - useEvents,maxEvents)); - - if (useEvents > 0) - { - reventp =(*env)->GetShortArrayElements(env,jrevents,&isCopy1); - fdp =(*env)->GetIntArrayElements(env,jfds,&isCopy2); - for (idx = 0,count = 0; (idx < ioeh->last_index) && - (count < useEvents); idx++) - { - if (ioeh->pfd[idx].revents) - { - fdp[count] = ioeh->pfd[idx].fd; - reventp[count] = ioeh->pfd[idx].revents; - /* in case of leftover for next walk */ - ioeh->pfd[idx].revents = 0; - count++; - } - } - if (count < useEvents) - { - ioeh->left_events = 0; - return STATE_EXCEPTION("Wait - Corrupted internals"); - } - if (isCopy1 == JNI_TRUE) - (*env)->ReleaseShortArrayElements(env,jrevents,reventp,0); - if (isCopy2 == JNI_TRUE) - (*env)->ReleaseIntArrayElements(env,jfds,fdp,0); - } - } /* !Use_devpoll */ - - return useEvents; -} diff --git a/jdk/src/demo/solaris/jni/Poller/Poller.java b/jdk/src/demo/solaris/jni/Poller/Poller.java deleted file mode 100644 index a144dfbcb1f..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/Poller.java +++ /dev/null @@ -1,335 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -import java.lang.reflect.*; -import java.io.*; -import java.net.*; - -/** - * This class is provided for access to the underlying poll(2) - * or /dev/poll kernel interfaces. This may be needed for - * multiplexing IO when an application cannot afford to have - * a thread block on each outstanding IO request. - * - * It currently supports the same basic functionality as the - * C poll(2) API, although for efficiency we needed to avoid - * passing the entire pollfd array for every call. See man - * pages for poll(2) for info on C API and event types. - * - * - * @author Bruce Chapman - * @see java.io.FileDescriptor - * @see java.net.Socket - * @see attached README.txt - * @since 1.2 - */ - -public class Poller { - /** - * Solaris POLL event types. - */ - public final static short POLLERR = 0x08; - public final static short POLLHUP = 0x10; - public final static short POLLNVAL = 0x20; - public final static short POLLIN = 1; - public final static short POLLPRI = 2; - public final static short POLLOUT = 4; - public final static short POLLRDNORM = 0x40; - public final static short POLLWRNORM = POLLOUT ; - public final static short POLLRDBAND = 0x80; - public final static short POLLWRBAND = 0x100; - public final static short POLLNORM = POLLRDNORM; - - /* - * This global synchronization object must be used for all - * creation or destruction of Poller objects. - */ - private final static Object globalSync = new Object(); - - /* - * The handle for a Poller Object...is used in the JNI C code - * where all the associated data is kept. - */ - private int handle; - - /** - * Constructs an instance of a Poller object. - * Native code uses sysconf(_SC_OPEN_MAX) to determine how - * many fd/skt objects this Poller object can contain. - */ - public Poller() throws Exception { - synchronized(globalSync) { - this.handle = nativeCreatePoller(-1); - } - } - - /** - * Constructs an instance of a Poller object. - * @param maxFd the maximum number of FileDescriptors/Sockets - * this Poller object can contain. - */ - public Poller(int maxFd) throws Exception { - synchronized(globalSync) { - this.handle = nativeCreatePoller(maxFd); - } - } - - /** - * Needed to clean up at the JNI C level when object is GCd. - */ - protected void finalize() throws Throwable { - synchronized(globalSync) { - nativeDestroyPoller(handle); - super.finalize(); - } - } - - /** - * Since we can't guarantee WHEN finalize is called, we may - * recycle on our own. - * @param maxFd the maximum number of FileDescriptors/Sockets - * this Poller object can contain. - */ - public void reset(int maxFd) throws Exception { - synchronized(globalSync) { - nativeDestroyPoller(handle); - this.handle = nativeCreatePoller(maxFd); - } - } - /** - * Since we can't guarantee WHEN finalize is called, we may - * recycle on our own. - */ - public void reset() throws Exception { - synchronized(globalSync) { - nativeDestroyPoller(handle); - this.handle = nativeCreatePoller(-1); - } - } - - /** - * Add FileDescriptor to the set handled by this Poller object. - * - * @param fdObj the FileDescriptor, Socket, or ServerSocket to add. - * @param event the bitmask of events we are interested in. - * @return the OS level fd associated with this IO Object - * (which is what waitMultiple() stores in fds[]) - */ - public synchronized int add(Object fdObj, short event) throws Exception { - return nativeAddFd(handle,findfd(fdObj), event); - } - - /** - * Remove FileDescriptor from the set handled by this Poller object. - * - * Must be called before the fd/skt is closed. - * @param fdObj the FileDescriptor, Socket, or ServerSocket to remove. - * @return true if removal succeeded. - */ - public synchronized boolean remove(Object fdObj) throws Exception { - return (nativeRemoveFd(handle,findfd(fdObj)) == 1); - } - /** - * Check if fd or socket is already in the set handled by this Poller object - * - * @param fdObj the FileDescriptor or [Server]Socket to check. - * @return true if fd/skt is in the set for this Poller object. - */ - public synchronized boolean isMember(Object fdObj) throws Exception { - return (nativeIsMember(handle,findfd(fdObj)) == 1); - } - /** - * Wait on Multiple IO Objects. - * - * @param maxRet the maximum number of fds[] and revents[] to return. - * @param fds[] (return) an array of ints in which to store fds with - * available data upon a successful non-timeout return. - * fds.length must be >= maxRet - * @param revents[] (return) the actual events available on the - * same-indexed fds[] (i.e. fds[0] has events revents[0]) - * revents.length must be >= maxRet - * - * Note : both above arrays are "dense," i.e. only fds[] with events - * available are returned. - * - * @param timeout the maximum number of milliseconds to wait for - * events before timing out. - * @return the number of fds with triggered events. - * - * Note : convenience methods exist for skipping the timeout parameter - * or the maxRet parameter (in the case of no maxRet, fds.length - * must equal revents.length) - * - * obj.waitMultiple(null,null,timeout) can be used for pausing the LWP - * (much more reliable and scalable than Thread.sleep() or Object.wait()) - */ - public synchronized int waitMultiple(int maxRet, int[] fds,short[] revents, - long timeout) throws Exception - { - if ((revents == null) || (fds == null)) { - if (maxRet > 0) { - throw new NullPointerException("fds or revents is null"); - } - } else if ( (maxRet < 0) || - (maxRet > revents.length) || (maxRet > fds.length) ) { - throw new IllegalArgumentException("maxRet out of range"); - } - - int ret = nativeWait(handle, maxRet, fds, revents, timeout); - if (ret < 0) { - throw new InterruptedIOException(); - } - return ret; - } - - /** - * Wait on Multiple IO Objects (no timeout). - * A convenience method for waiting indefinitely on IO events - * - * @see Poller#waitMultiple - * - */ - public int waitMultiple(int maxRet, int[] fds, short[] revents) - throws Exception - { - return waitMultiple(maxRet, fds, revents,-1L); // already synchronized - } - - /** - * Wait on Multiple IO Objects (no maxRet). - * A convenience method for waiting on IO events when the fds - * and revents arrays are the same length and that specifies the - * maximum number of return events. - * - * @see Poller#waitMultiple - * - */ - public synchronized int waitMultiple(int[] fds, short[] revents, - long timeout) throws Exception - { - if ((revents == null) && (fds == null)) { - return nativeWait(handle,0,null,null,timeout); - } else if ((revents == null) || (fds == null)) { - throw new NullPointerException("revents or fds is null"); - } else if (fds.length == revents.length) { - return nativeWait(handle, fds.length, fds, revents, timeout); - } - throw new IllegalArgumentException("fds.length != revents.length"); - } - - - /** - * Wait on Multiple IO Objects (no maxRet/timeout). - * A convenience method for waiting on IO events when the fds - * and revents arrays are the same length and that specifies the - * maximum number of return events, and when waiting indefinitely - * for IO events to occur. - * - * @see Poller#waitMultiple - * - */ - public int waitMultiple(int[] fds, short[] revents) - throws Exception - { - if ((revents == null) || (fds == null)) { - throw new NullPointerException("fds or revents is null"); - } else if (fds.length == revents.length) { - return waitMultiple(revents.length,fds,revents,-1L); // already sync - } - throw new IllegalArgumentException("fds.length != revents.length"); - } - - // Utility - get (int) fd from FileDescriptor or [Server]Socket objects. - - private int findfd(Object fdObj) throws Exception { - Class cl; - Field f; - Object val, implVal; - - if ((fdObj instanceof java.net.Socket) || - (fdObj instanceof java.net.ServerSocket)) { - cl = fdObj.getClass(); - f = cl.getDeclaredField("impl"); - f.setAccessible(true); - val = f.get(fdObj); - cl = f.getType(); - f = cl.getDeclaredField("fd"); - f.setAccessible(true); - implVal = f.get(val); - cl = f.getType(); - f = cl.getDeclaredField("fd"); - f.setAccessible(true); - return ((Integer) f.get(implVal)).intValue(); - } else if ( fdObj instanceof java.io.FileDescriptor ) { - cl = fdObj.getClass(); - f = cl.getDeclaredField("fd"); - f.setAccessible(true); - return ((Integer) f.get(fdObj)).intValue(); - } - else { - throw new IllegalArgumentException("Illegal Object type."); - } - } - - // Actual NATIVE calls - - private static native int nativeInit(); - private native int nativeCreatePoller(int maxFd) throws Exception; - private native void nativeDestroyPoller(int handle) throws Exception; - private native int nativeAddFd(int handle, int fd, short events) - throws Exception; - private native int nativeRemoveFd(int handle, int fd) throws Exception; - private native int nativeRemoveIndex(int handle, int index) - throws Exception; - private native int nativeIsMember(int handle, int fd) throws Exception; - private native int nativeWait(int handle, int maxRet, int[] fds, - short[] events, long timeout) - throws Exception; - /** - * Get number of active CPUs in this machine - * to determine proper level of concurrency. - */ - public static native int getNumCPUs(); - - static { - System.loadLibrary("poller"); - nativeInit(); - } -} diff --git a/jdk/src/demo/solaris/jni/Poller/PollingServer.java b/jdk/src/demo/solaris/jni/Poller/PollingServer.java deleted file mode 100644 index 5cb26260398..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/PollingServer.java +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -import java.io.*; -import java.net.*; -import java.lang.Byte; - -/** - * Simple Java "server" using the Poller class - * to multiplex on incoming connections. Note - * that handoff of events, via linked Q is not - * actually be a performance booster here, since - * the processing of events is cheaper than - * the overhead in scheduling/executing them. - * Although this demo does allow for concurrency - * in handling connections, it uses a rather - * primitive "gang scheduling" policy to keep - * the code simpler. - */ - -public class PollingServer -{ - public final static int MAXCONN = 10000; - public final static int PORTNUM = 4444; - public final static int BYTESPEROP = 10; - - /** - * This synchronization object protects access to certain - * data (bytesRead,eventsToProcess) by concurrent Consumer threads. - */ - private final static Object eventSync = new Object(); - - private static InputStream[] instr = new InputStream[MAXCONN]; - private static int[] mapping = new int[65535]; - private static LinkedQueue linkedQ = new LinkedQueue(); - private static int bytesRead = 0; - private static int bytesToRead; - private static int eventsToProcess=0; - - public PollingServer(int concurrency) { - Socket[] sockArr = new Socket[MAXCONN]; - long timestart, timestop; - short[] revents = new short[MAXCONN]; - int[] fds = new int[MAXCONN]; - int bytes; - Poller Mux; - int serverFd; - int totalConn=0; - int connects=0; - - System.out.println ("Serv: Initializing port " + PORTNUM); - try { - - ServerSocket skMain = new ServerSocket (PORTNUM); - /* - * Create the Poller object Mux, allow for up to MAXCONN - * sockets/filedescriptors to be polled. - */ - Mux = new Poller(MAXCONN); - serverFd = Mux.add(skMain, Poller.POLLIN); - - Socket ctrlSock = skMain.accept(); - - BufferedReader ctrlReader = - new BufferedReader(new InputStreamReader(ctrlSock.getInputStream())); - String ctrlString = ctrlReader.readLine(); - bytesToRead = Integer.valueOf(ctrlString).intValue(); - ctrlString = ctrlReader.readLine(); - totalConn = Integer.valueOf(ctrlString).intValue(); - - System.out.println("Receiving " + bytesToRead + " bytes from " + - totalConn + " client connections"); - - timestart = System.currentTimeMillis(); - - /* - * Start the consumer threads to read data. - */ - for (int consumerThread = 0; - consumerThread < concurrency; consumerThread++ ) { - new Consumer(consumerThread).start(); - } - - /* - * Take connections, read Data - */ - int numEvents=0; - - while ( bytesRead < bytesToRead ) { - - int loopWaits=0; - while (eventsToProcess > 0) { - synchronized (eventSync) { - loopWaits++; - if (eventsToProcess <= 0) break; - try { eventSync.wait(); } catch (Exception e) {e.printStackTrace();}; - } - } - if (loopWaits > 1) - System.out.println("Done waiting...loops = " + loopWaits + - " events " + numEvents + - " bytes read : " + bytesRead ); - - if (bytesRead >= bytesToRead) break; // may be done! - - /* - * Wait for events - */ - numEvents = Mux.waitMultiple(100, fds, revents); - synchronized (eventSync) { - eventsToProcess = numEvents; - } - /* - * Process all the events we got from Mux.waitMultiple - */ - int cnt = 0; - while ( (cnt < numEvents) && (bytesRead < bytesToRead) ) { - int fd = fds[cnt]; - - if (revents[cnt] == Poller.POLLIN) { - if (fd == serverFd) { - /* - * New connection coming in on the ServerSocket - * Add the socket to the Mux, keep track of mapping - * the fdval returned by Mux.add to the connection. - */ - sockArr[connects] = skMain.accept(); - instr[connects] = sockArr[connects].getInputStream(); - int fdval = Mux.add(sockArr[connects], Poller.POLLIN); - mapping[fdval] = connects; - synchronized(eventSync) { - eventsToProcess--; // just processed this one! - } - connects++; - } else { - /* - * We've got data from this client connection. - * Put it on the queue for the consumer threads to process. - */ - linkedQ.put(new Integer(fd)); - } - } else { - System.out.println("Got revents[" + cnt + "] == " + revents[cnt]); - } - cnt++; - } - } - timestop = System.currentTimeMillis(); - System.out.println("Time for all reads (" + totalConn + - " sockets) : " + (timestop-timestart)); - - // Tell the client it can now go away - byte[] buff = new byte[BYTESPEROP]; - ctrlSock.getOutputStream().write(buff,0,BYTESPEROP); - - // Tell the cunsumer threads they can exit. - for (int cThread = 0; cThread < concurrency; cThread++ ) { - linkedQ.put(new Integer(-1)); - } - } catch (Exception exc) { exc.printStackTrace(); } - } - - /* - * main ... just check if a concurrency was specified - */ - public static void main (String args[]) - { - int concurrency; - - if (args.length == 1) - concurrency = java.lang.Integer.valueOf(args[0]).intValue(); - else - concurrency = Poller.getNumCPUs() + 1; - PollingServer server = new PollingServer(concurrency); - } - - /* - * This class is for handling the Client data. - * The PollingServer spawns off a number of these based upon - * the number of CPUs (or concurrency argument). - * Each just loops grabbing events off the queue and - * processing them. - */ - class Consumer extends Thread { - private int threadNumber; - public Consumer(int i) { threadNumber = i; } - - public void run() { - byte[] buff = new byte[BYTESPEROP]; - int bytes = 0; - - InputStream instream; - while (bytesRead < bytesToRead) { - try { - Integer Fd = (Integer) linkedQ.take(); - int fd = Fd.intValue(); - if (fd == -1) break; /* got told we could exit */ - - /* - * We have to map the fd value returned from waitMultiple - * to the actual input stream associated with that fd. - * Take a look at how the Mux.add() was done to see how - * we stored that. - */ - int map = mapping[fd]; - instream = instr[map]; - bytes = instream.read(buff,0,BYTESPEROP); - } catch (Exception e) { System.out.println(e.toString()); } - - if (bytes > 0) { - /* - * Any real server would do some synchronized and some - * unsynchronized work on behalf of the client, and - * most likely send some data back...but this is a - * gross oversimplification. - */ - synchronized(eventSync) { - bytesRead += bytes; - eventsToProcess--; - if (eventsToProcess <= 0) { - eventSync.notify(); - } - } - } - } - } - } -} diff --git a/jdk/src/demo/solaris/jni/Poller/README.txt b/jdk/src/demo/solaris/jni/Poller/README.txt deleted file mode 100644 index d665c221e8b..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/README.txt +++ /dev/null @@ -1,174 +0,0 @@ -README.txt - - -This Poller class demonstrates access to poll(2) functionality in Java. - -Requires Solaris production (native threads) JDK 1.2 or later, currently -the C code compiles only on Solaris (SPARC and Intel). - -Poller.java is the class, Poller.c is the supporting JNI code. - -PollingServer.java is a sample application which uses the Poller class -to multiplex sockets. - -SimpleServer.java is the functional equivalent that does not multiplex -but uses a single thread to handle each client connection. - -Client.java is a sample application to drive against either server. - -To build the Poller class and client/server demo : - javac PollingServer.java Client.java - javah Poller - cc -G -o libpoller.so -I ${JAVA_HOME}/include -I ${JAVA_HOME}/include/solaris\ - Poller.c - -You will need to set the environment variable LD_LIBRARY_PATH to search -the directory containing libpoller.so. - -To use client/server, bump up your fd limit to handle the connections you -want (need root access to go beyond 1024). For info on changing your file -descriptor limit, type "man limit". If you are using Solaris 2.6 -or later, a regression in loopback read() performance may hit you at low -numbers of connections, so run the client on another machine. - -BASICs of Poller class usage : - run "javadoc Poller" or see Poller.java for more details. - -{ - Poller Mux = new Poller(65535); // allow it to contain 64K IO objects - - int fd1 = Mux.add(socket1, Poller.POLLIN); - ... - int fdN = Mux.add(socketN, Poller.POLLIN); - - int[] fds = new int[100]; - short[] revents = new revents[100]; - - int numEvents = Mux.waitMultiple(100, fds, revents, timeout); - - for (int i = 0; i < numEvents; i++) { - /* - * Probably need more sophisticated mapping scheme than this! - */ - if (fds[i] == fd1) { - System.out.println("Got data on socket1"); - socket1.getInputStream().read(byteArray); - // Do something based upon state of fd1 connection - } - ... - } -} - -Poller class implementation notes : - - Currently all add(),remove(),isMember(), and waitMultiple() methods -are synchronized for each Poller object. If one thread is blocked in -pObj.waitMultiple(), another thread calling pObj.add(fd) will block -until waitMultiple() returns. There is no provided mechanism to -interrupt waitMultiple(), as one might expect a ServerSocket to be in -the list waited on (see PollingServer.java). - - One might also need to interrupt waitMultiple() to remove() -fds/sockets, in which case one could create a Pipe or loopback localhost -connection (at the level of PollingServer) and use a write() to that -connection to interrupt. Or, better, one could queue up deletions -until the next return of waitMultiple(). Or one could implement an -interrupt mechanism in the JNI C code using a pipe(), and expose that -at the Java level. - - If frequent deletions/re-additions of socks/fds is to be done with -very large sets of monitored fds, the Solaris 7 kernel cache will -likely perform poorly without some tuning. One could differentiate -between deleted (no longer cared for) fds/socks and those that are -merely being disabled while data is processed on their behalf. In -that case, re-enabling a disabled fd/sock could put it in it's -original position in the poll array, thereby increasing the kernel -cache performance. This would best be done in Poller.c. Of course -this is not necessary for optimal /dev/poll performance. - - Caution...the next paragraph gets a little technical for the -benefit of those who already understand poll()ing fairly well. Others -may choose to skip over it to read notes on the demo server. - - An optimal solution for frequent enabling/disabling of socks/fds -could involve a separately synchronized structure of "async" -operations. Using a simple array (0..64k) containing the action -(ADD,ENABLE,DISABLE, NONE), the events, and the index into the poll -array, and having nativeWait() wake up in the poll() call periodically -to process these async operations, I was able to speed up performance -of the PollingServer by a factor of 2x at 8000 connections. Of course -much of that gain was from the fact that I could (with the advent of -an asyncAdd() method) move the accept() loop into a separate thread -from the main poll() loop, and avoid the overhead of calling poll() -with up to 7999 fds just for an accept. In implementing the async -Disable/Enable, a further large optimization was to auto-disable fds -with events available (before return from nativeWait()), so I could -just call asyncEnable(fd) after processing (read()ing) the available -data. This removed the need for inefficient gang-scheduling the -attached PollingServer uses. In order to separately synchronize the -async structure, yet still be able to operate on it from within -nativeWait(), synchronization had to be done at the C level here. Due -to the new complexities this introduced, as well as the fact that it -was tuned specifically for Solaris 7 poll() improvements (not -/dev/poll), this extra logic was left out of this demo. - - -Client/Server Demo Notes : - - Do not run the sample client/server with high numbers of connections -unless you have a lot of free memory on your machine, as it can saturate -CPU and lock you out of CDE just by its very resource intensive nature -(much more so the SimpleServer than PollingServer). - - Different OS versions will behave very differently as far as poll() -performance (or /dev/poll existence) but, generally, real world applications -"hit the wall" much earlier when a separate thread is used to handle -each client connection. Issues of thread synchronization and locking -granularity become performance killers. There is some overhead associated -with multiplexing, such as keeping track of the state of each connection; as -the number of connections gets very large, however, this overhead is more -than made up for by the reduced synchronization overhead. - - As an example, running the servers on a Solaris 7 PC (Pentium II-350 x -2 CPUS) with 1 GB RAM, and the client on an Ultra-2, I got the following -times (shorter is better) : - - 1000 connections : - -PollingServer took 11 seconds -SimpleServer took 12 seconds - - 4000 connections : - -PollingServer took 20 seconds -SimpleServer took 37 seconds - - 8000 connections : - -PollingServer took 39 seconds -SimpleServer took 1:48 seconds - - This demo is not, however, meant to be considered some form of proof -that multiplexing with the Poller class will gain you performance; this -code is actually very heavily biased towards the non-polling server as -very little synchronization is done, and most of the overhead is in the -kernel IO for both servers. Use of multiplexing may be helpful in -many, but certainly not all, circumstances. - - Benchmarking a major Java server application which can run -in a single-thread-per-client mode or using the new Poller class showed -Poller provided a 253% improvement in throughput at a moderate load, as -well as a 300% improvement in peak capacity. It also yielded a 21% -smaller memory footprint at the lower load level. - - Finally, there is code in Poller.c to take advantage of /dev/poll -on OS versions that have that device; however, DEVPOLL must be defined -in compiling Poller.c (and it must be compiled on a machine with -/usr/include/sys/devpoll.h) to use it. Code compiled with DEVPOLL -turned on will work on machines that don't have kernel support for -the device, as it will fall back to using poll() in those cases. -Currently /dev/poll does not correctly return an error if you attempt -to remove() an object that was never added, but this should be fixed -in an upcoming /dev/poll patch. The binary as shipped is not built with -/dev/poll support as our build machine does not have devpoll.h. - diff --git a/jdk/src/demo/solaris/jni/Poller/SimpleServer.java b/jdk/src/demo/solaris/jni/Poller/SimpleServer.java deleted file mode 100644 index 6a099c67071..00000000000 --- a/jdk/src/demo/solaris/jni/Poller/SimpleServer.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 1999, 2011, 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. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - -import java.io.*; -import java.net.*; -import java.lang.Byte; - -/** - * Simple Java "server" using a single thread to handle each connection. - */ - -public class SimpleServer -{ - private final static int BYTESPEROP= PollingServer.BYTESPEROP; - private final static int PORTNUM = PollingServer.PORTNUM; - private final static int MAXCONN = PollingServer.MAXCONN; - - /* - * This synchronization object protects access to certain - * data (bytesRead,eventsToProcess) by concurrent Consumer threads. - */ - private final static Object eventSync = new Object(); - - private static InputStream[] instr = new InputStream[MAXCONN]; - private static int bytesRead; - private static int bytesToRead; - - public SimpleServer() { - Socket[] sockArr = new Socket[MAXCONN]; - long timestart, timestop; - int bytes; - int totalConn=0; - - - System.out.println ("Serv: Initializing port " + PORTNUM); - try { - - ServerSocket skMain = new ServerSocket (PORTNUM); - - bytesRead = 0; - Socket ctrlSock = skMain.accept(); - - BufferedReader ctrlReader = - new BufferedReader(new InputStreamReader(ctrlSock.getInputStream())); - String ctrlString = ctrlReader.readLine(); - bytesToRead = Integer.valueOf(ctrlString).intValue(); - ctrlString = ctrlReader.readLine(); - totalConn = Integer.valueOf(ctrlString).intValue(); - - System.out.println("Receiving " + bytesToRead + " bytes from " + - totalConn + " client connections"); - - timestart = System.currentTimeMillis(); - - /* - * Take connections, spawn off connection handling threads - */ - ConnHandler[] connHA = new ConnHandler[MAXCONN]; - int conn = 0; - while ( conn < totalConn ) { - Socket sock = skMain.accept(); - connHA[conn] = new ConnHandler(sock.getInputStream()); - connHA[conn].start(); - conn++; - } - - while ( bytesRead < bytesToRead ) { - java.lang.Thread.sleep(500); - } - timestop = System.currentTimeMillis(); - System.out.println("Time for all reads (" + totalConn + - " sockets) : " + (timestop-timestart)); - // Tell the client it can now go away - byte[] buff = new byte[BYTESPEROP]; - ctrlSock.getOutputStream().write(buff,0,BYTESPEROP); - } catch (Exception exc) { exc.printStackTrace(); } - } - - /* - * main ... just create invoke the SimpleServer constructor. - */ - public static void main (String args[]) - { - SimpleServer server = new SimpleServer(); - } - - /* - * Connection Handler inner class...one of these per client connection. - */ - class ConnHandler extends Thread { - private InputStream instr; - public ConnHandler(InputStream inputStr) { instr = inputStr; } - - public void run() { - try { - int bytes; - byte[] buff = new byte[BYTESPEROP]; - - while ( bytesRead < bytesToRead ) { - bytes = instr.read (buff, 0, BYTESPEROP); - if (bytes > 0 ) { - synchronized(eventSync) { - bytesRead += bytes; - } - /* - * Any real server would do some synchronized and some - * unsynchronized work on behalf of the client, and - * most likely send some data back...but this is a - * gross oversimplification. - */ - } - else { - if (bytesRead < bytesToRead) - System.out.println("instr.read returned : " + bytes); - } - } - } - catch (Exception e) {e.printStackTrace();} - } - } -} diff --git a/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java new file mode 100644 index 00000000000..1ba654eb28e --- /dev/null +++ b/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.channels.spi.AsynchronousChannelProvider; + +/** + * Creates this platform's default AsynchronousChannelProvider + */ + +public class DefaultAsynchronousChannelProvider { + + /** + * Prevent instantiation. + */ + private DefaultAsynchronousChannelProvider() { } + + /** + * Returns the default AsynchronousChannelProvider. + */ + public static AsynchronousChannelProvider create() { + return new AixAsynchronousChannelProvider(); + } +} diff --git a/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java b/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java index 3f23cc4fa3b..dbc3ab61de8 100644 --- a/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java +++ b/jdk/src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ public class DefaultSelectorProvider { * Returns the default SelectorProvider. */ public static SelectorProvider create() { - return new sun.nio.ch.PollSelectorProvider(); + return new PollSelectorProvider(); } - } diff --git a/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java new file mode 100644 index 00000000000..f2354103264 --- /dev/null +++ b/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.channels.spi.AsynchronousChannelProvider; + +/** + * Creates this platform's default AsynchronousChannelProvider + */ + +public class DefaultAsynchronousChannelProvider { + + /** + * Prevent instantiation. + */ + private DefaultAsynchronousChannelProvider() { } + + /** + * Returns the default AsynchronousChannelProvider. + */ + public static AsynchronousChannelProvider create() { + return new LinuxAsynchronousChannelProvider(); + } +} diff --git a/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java b/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java index 1278f1583ee..77531b283b3 100644 --- a/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java +++ b/jdk/src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ public class DefaultSelectorProvider { * Returns the default SelectorProvider. */ public static SelectorProvider create() { - return new sun.nio.ch.EPollSelectorProvider(); + return new EPollSelectorProvider(); } - } diff --git a/jdk/src/java.base/linux/native/libnio/ch/EPoll.c b/jdk/src/java.base/linux/native/libnio/ch/EPoll.c index ea9cdf4dd03..d6526c5d63a 100644 --- a/jdk/src/java.base/linux/native/libnio/ch/EPoll.c +++ b/jdk/src/java.base/linux/native/libnio/ch/EPoll.c @@ -95,9 +95,3 @@ Java_sun_nio_ch_EPoll_epollWait(JNIEnv *env, jclass c, } return res; } - -JNIEXPORT void JNICALL -Java_sun_nio_ch_EPoll_close0(JNIEnv *env, jclass c, jint epfd) { - int res; - RESTARTABLE(close(epfd), res); -} diff --git a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java index 573de6986f8..b68e3aa0034 100644 --- a/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java +++ b/jdk/src/java.base/macosx/classes/java/net/DefaultInterface.java @@ -50,10 +50,11 @@ class DefaultInterface { } /** - * Choose a default interface. This method returns an interface that is - * both "up" and supports multicast. This method choses an interface in + * Choose a default interface. This method returns the first interface that + * is both "up" and supports multicast. This method chooses an interface in * order of preference: * 1. neither loopback nor point to point + * ( prefer interfaces with dual IP support ) * 2. point to point * 3. loopback * @@ -66,32 +67,56 @@ class DefaultInterface { try { nifs = NetworkInterface.getNetworkInterfaces(); } catch (IOException ignore) { - // unable to enumate network interfaces + // unable to enumerate network interfaces return null; } + NetworkInterface preferred = null; NetworkInterface ppp = null; NetworkInterface loopback = null; while (nifs.hasMoreElements()) { NetworkInterface ni = nifs.nextElement(); try { - if (ni.isUp() && ni.supportsMulticast()) { - boolean isLoopback = ni.isLoopback(); - boolean isPPP = ni.isPointToPoint(); - if (!isLoopback && !isPPP) { - // found an interface that is not the loopback or a - // point-to-point interface + if (!ni.isUp() || !ni.supportsMulticast()) + continue; + + boolean ip4 = false, ip6 = false; + Enumeration addrs = ni.getInetAddresses(); + while (addrs.hasMoreElements()) { + InetAddress addr = addrs.nextElement(); + if (!addr.isAnyLocalAddress()) { + if (addr instanceof Inet4Address) { + ip4 = true; + } else if (addr instanceof Inet6Address) { + ip6 = true; + } + } + } + + boolean isLoopback = ni.isLoopback(); + boolean isPPP = ni.isPointToPoint(); + if (!isLoopback && !isPPP) { + // found an interface that is not the loopback or a + // point-to-point interface + if (preferred == null) { + preferred = ni; + } else if (ip4 && ip6){ return ni; } - if (ppp == null && isPPP) - ppp = ni; - if (loopback == null && isLoopback) - loopback = ni; } + if (ppp == null && isPPP) + ppp = ni; + if (loopback == null && isLoopback) + loopback = ni; + } catch (IOException skip) { } } - return (ppp != null) ? ppp : loopback; + if (preferred != null) { + return preferred; + } else { + return (ppp != null) ? ppp : loopback; + } } } diff --git a/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java new file mode 100644 index 00000000000..8bb368223e4 --- /dev/null +++ b/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultAsynchronousChannelProvider.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.channels.spi.AsynchronousChannelProvider; + +/** + * Creates this platform's default AsynchronousChannelProvider + */ + +public class DefaultAsynchronousChannelProvider { + + /** + * Prevent instantiation. + */ + private DefaultAsynchronousChannelProvider() { } + + /** + * Returns the default AsynchronousChannelProvider. + */ + public static AsynchronousChannelProvider create() { + return new BsdAsynchronousChannelProvider(); + } +} diff --git a/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java b/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java index e55f8e6bf34..c7d67b27ecd 100644 --- a/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java +++ b/jdk/src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ public class DefaultSelectorProvider { * Returns the default SelectorProvider. */ public static SelectorProvider create() { - return new sun.nio.ch.KQueueSelectorProvider(); + return new KQueueSelectorProvider(); } - } diff --git a/jdk/src/java.base/macosx/native/launcher/Info-privileged.plist b/jdk/src/java.base/macosx/native/launcher/Info-privileged.plist index 776967ab384..9b2fc0a32fc 100644 --- a/jdk/src/java.base/macosx/native/launcher/Info-privileged.plist +++ b/jdk/src/java.base/macosx/native/launcher/Info-privileged.plist @@ -7,7 +7,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - OpenJDK 7 Command + OpenJDK Command CFBundleShortVersionString 1.0 CFBundleVersion diff --git a/jdk/src/java.base/macosx/native/launcher/jexec.c b/jdk/src/java.base/macosx/native/launcher/jexec.c deleted file mode 100644 index 24df31f5288..00000000000 --- a/jdk/src/java.base/macosx/native/launcher/jexec.c +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute 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. - */ - -/* - * jexec for J2SE - * - * jexec is used by the system to allow execution of JAR files. - * Essentially jexec needs to run java and - * needs to be a native ISA executable (not a shell script), although - * this native ISA executable requirement was a mistake that will be fixed. - * ( is sparc or i386 or amd64). - * - * When you execute a jar file, jexec is executed by the system as follows: - * /usr/java/jre/lib//jexec -jar JARFILENAME - * so this just needs to be turned into: - * /usr/java/jre/bin/java -jar JARFILENAME - * - * Solaris systems (new 7's and all 8's) will be looking for jexec at: - * /usr/java/jre/lib//jexec - * Older systems may need to add this to their /etc/system file: - * set javaexec:jexec="/usr/java/jre/lib//jexec" - * and reboot the machine for this to work. - * - * This source should be compiled as: - * cc -o jexec jexec.c - * - * And jexec should be placed at the following location of the installation: - * /jre/lib//jexec (for Solaris) - * /lib/jexec (for Linux) - * - * NOTE: Unless is the "default" JDK on the system - * (i.e. /usr/java -> ), this jexec will not be - * found. The 1.2 java is only the default on Solaris 8 and - * on systems where the 1.2 packages were installed and no 1.1 - * java was found. - * - * NOTE: You must use 1.2 jar to build your jar files. The system - * doesn't seem to pick up 1.1 jar files. - * - * NOTE: We don't need to set LD_LIBRARY_PATH here, even though we - * are running the actual java binary because the java binary will - * look for it's libraries through it's own runpath, which uses - * $ORIGIN. - * - * NOTE: This jexec should NOT have any special .so library needs because - * it appears that this executable will NOT get the $ORIGIN of jexec - * but the $ORIGIN of the jar file being executed. Be careful to keep - * this program simple and with no .so dependencies. - */ - -#include -#include -#include -#include -#include -#include - -static const int CRAZY_EXEC = ENOEXEC; -static const int BAD_MAGIC = ENOEXEC; - -static const char * BAD_EXEC_MSG = "jexec failed"; -static const char * CRAZY_EXEC_MSG = "missing args"; -static const char * MISSING_JAVA_MSG = "can't locate java"; -static const char * UNKNOWN_ERROR = "unknown error"; - -/* Define a constant that represents the number of directories to pop off the - * current location to find the java binary */ -static const int RELATIVE_DEPTH = 3; - -/* path to java after popping */ -static const char * BIN_PATH = "/bin/java"; - -/* flag used when running JAR files */ -static const char * JAR_FLAG = "-jar"; - -int main(int argc, const char * argv[]); -void errorExit(int error, const char * message); -int getJavaPath(const char * path, char * buf, int depth); - -/* - * This is the main entry point. This program (jexec) will attempt to execute - * a JAR file by finding the Java program (java), relative to its own location. - * The exact location of the Java program depends on the platform, i.e. - * - * /jre/lib//jexec (for Solaris) - * /lib/jexec (for Linux JDK) - * - * Once the Java program is found, this program copies any remaining arguments - * into another array, which is then used to exec the Java program. - * - * On Linux this program does some additional steps. When copying the array of - * args, it is necessary to insert the "-jar" flag between arg[0], the program - * name, and the original arg[1], which is presumed to be a path to a JAR file. - * It is also necessary to verify that the original arg[1] really is a JAR file. - * (These steps are unnecessary on Solaris because they are taken care of by - * the kernel.) - */ -int main(int argc, const char * argv[]) { - /* We need to exec the original arguments using java, instead of jexec. - * Also, for Linux, it is necessary to add the "-jar" argument between - * the new arg[0], and the old arg[1]. To do this we will create a new - * args array. */ - char java[PATH_MAX + 1]; /* path to java binary */ - const char ** nargv = NULL; /* new args array */ - int nargc = 0; /* new args array count */ - int argi = 0; /* index into old array */ - - /* Make sure we have something to work with */ - if ((argc < 1) || (argv == NULL)) { - /* Shouldn't happen... */ - errorExit(CRAZY_EXEC, CRAZY_EXEC_MSG); - } - - /* Get the path to the java binary, which is in a known position relative - * to our current position, which is in argv[0]. */ - if (getJavaPath(argv[argi++], java, RELATIVE_DEPTH) != 0) { - errorExit(errno, MISSING_JAVA_MSG); - } - - nargv = (const char **) malloc((argc + 2) * (sizeof (const char *))); - nargv[nargc++] = java; - - if (argc >= 2) { - const char * jarfile = argv[argi++]; - const char * message = NULL; - - /* the next argument is the path to the JAR file */ - nargv[nargc++] = jarfile; - } - - /* finally copy any remaining arguments */ - while (argi < argc) { - nargv[nargc++] = argv[argi++]; - } - - /* finally add one last terminating null */ - nargv[nargc++] = NULL; - - /* It's time to exec the java binary with the new arguments. It - * is possible that we've reached this point without actually - * having a JAR file argument (i.e. if argc < 2), but we still - * want to exec the java binary, since that will take care of - * displaying the correct usage. */ - execv(java, (char * const *) nargv); - - /* If the exec worked, this process would have been replaced - * by the new process. So any code reached beyond this point - * implies an error in the exec. */ - free(nargv); - errorExit(errno, BAD_EXEC_MSG); - return 0; // keep the compiler happy -} - - -/* - * Exit the application by setting errno, and writing a message. - * - * Parameters: - * error - errno is set to this value, and it is used to exit. - * message - the message to write. - */ -void errorExit(int error, const char * message) { - if (error != 0) { - errno = error; - perror((message != NULL) ? message : UNKNOWN_ERROR); - } - - exit((error == 0) ? 0 : 1); -} - - -/* - * Get the path to the java binary that should be relative to the current path. - * - * Parameters: - * path - the input path that the java binary that should be relative to. - * buf - a buffer of size PATH_MAX or greater that the java path is - * copied to. - * depth - the number of names to trim off the current path, including the - * name of this program. - * - * Returns: - * This function returns 0 on success; otherwise it returns the value of - * errno. - */ -int getJavaPath(const char * path, char * buf, int depth) { - int result = 0; - - /* Get the full path to this program. Depending on whether this is Solaris - * or Linux, this will be something like, - * - * /jre/lib//jexec (for Solaris) - * /lib/jexec (for Linux) - */ - if (realpath(path, buf) != NULL) { - int count = 0; - - /* Pop off the filename, and then subdirectories for each level of - * depth */ - for (count = 0; count < depth; count++) { - *(strrchr(buf, '/')) = '\0'; - } - - /* Append the relative location of java, creating something like, - * - * /jre/bin/java (for Solaris) - * /bin/java (for Linux) - */ - strcat(buf, BIN_PATH); - } - else { - /* Failed to get the path */ - result = errno; - } - - return (result); -} diff --git a/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c b/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c index b43f290b0a2..b11a4d00143 100644 --- a/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c +++ b/jdk/src/java.base/macosx/native/libjava/java_props_macosx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ char *getPosixLocale(int cat) { #define LOCALEIDLENGTH 128 char *getMacOSXLocale(int cat) { + const char* retVal = NULL; + switch (cat) { case LC_MESSAGES: { @@ -72,33 +74,7 @@ char *getMacOSXLocale(int cat) { } CFRelease(languages); - // Language IDs use the language designators and (optional) region - // and script designators of BCP 47. So possible formats are: - // - // "en" (language designator only) - // "haw" (3-letter lanuage designator) - // "en-GB" (language with alpha-2 region designator) - // "es-419" (language with 3-digit UN M.49 area code) - // "zh-Hans" (language with ISO 15924 script designator) - // - // In the case of region designators (alpha-2 or UN M.49), we convert - // to our locale string format by changing '-' to '_'. That is, if - // the '-' is followed by fewer than 4 chars. - char* scriptOrRegion = strchr(languageString, '-'); - if (scriptOrRegion != NULL && strlen(scriptOrRegion) < 5) { - *scriptOrRegion = '_'; - - assert((strlen(scriptOrRegion) == 3 && - // '-' followed by a 2 character region designator - isalpha(scriptOrRegion[1]) && - isalpha(scriptOrRegion[2])) || - (strlen(scriptOrRegion) == 4 && - // '-' followed by a 3-digit UN M.49 area code - isdigit(scriptOrRegion[1]) && - isdigit(scriptOrRegion[2]) && - isdigit(scriptOrRegion[3]))); - } - const char* retVal = languageString; + retVal = languageString; // Special case for Portuguese in Brazil: // The language code needs the "_BR" region code (to distinguish it @@ -112,20 +88,58 @@ char *getMacOSXLocale(int cat) { strcmp(localeString, "pt_BR") == 0) { retVal = localeString; } - return strdup(retVal); } break; default: { char localeString[LOCALEIDLENGTH]; - if (CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()), - localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) { - return strdup(localeString); + if (!CFStringGetCString(CFLocaleGetIdentifier(CFLocaleCopyCurrent()), + localeString, LOCALEIDLENGTH, CFStringGetSystemEncoding())) { + return NULL; } + retVal = localeString; } break; } + if (retVal != NULL) { + // Language IDs use the language designators and (optional) region + // and script designators of BCP 47. So possible formats are: + // + // "en" (language designator only) + // "haw" (3-letter lanuage designator) + // "en-GB" (language with alpha-2 region designator) + // "es-419" (language with 3-digit UN M.49 area code) + // "zh-Hans" (language with ISO 15924 script designator) + // "zh-Hans-US" (language with ISO 15924 script designator and region) + // "zh-Hans-419" (language with ISO 15924 script designator and UN M.49) + // + // In the case of region designators (alpha-2 and/or UN M.49), we convert + // to our locale string format by changing '-' to '_'. That is, if + // the '-' is followed by fewer than 4 chars. + char* scriptOrRegion = strchr(retVal, '-'); + if (scriptOrRegion != NULL) { + int length = strlen(scriptOrRegion); + if (length > 5) { + // Region and script both exist. Honor the script for now + scriptOrRegion[5] = '\0'; + } else if (length < 5) { + *scriptOrRegion = '_'; + + assert((length == 3 && + // '-' followed by a 2 character region designator + isalpha(scriptOrRegion[1]) && + isalpha(scriptOrRegion[2])) || + (length == 4 && + // '-' followed by a 3-digit UN M.49 area code + isdigit(scriptOrRegion[1]) && + isdigit(scriptOrRegion[2]) && + isdigit(scriptOrRegion[3]))); + } + } + + return strdup(retVal); + } return NULL; } diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java index a1c33ae1593..4503ec0e170 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/CounterMode.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 +42,10 @@ import jdk.internal.HotSpotIntrinsicCandidate; * @author Andreas Sterbenz * @since 1.4.2 */ -final class CounterMode extends FeedbackCipher { +class CounterMode extends FeedbackCipher { // current counter value - private final byte[] counter; + final byte[] counter; // encrypted bytes of the previous counter value private final byte[] encryptedCounter; diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java index d4493808167..d3f1c99df2a 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ final class DESKey implements SecretKey { * Ensures that the bytes of this key are * set to zero when there are no more references to it. */ + @SuppressWarnings("deprecation") protected void finalize() throws Throwable { try { if (this.key != null) { diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java index a0de5dc059c..9695ba39e6f 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/DESedeKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ final class DESedeKey implements SecretKey { * Ensures that the bytes of this key are * set to zero when there are no more references to it. */ + @SuppressWarnings("deprecation") protected void finalize() throws Throwable { try { if (this.key != null) { diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java index f8a3eaa0a4c..6a394e448d1 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017 Oracle and/or its affiliates. All rights reserved. * 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,52 +29,43 @@ package com.sun.crypto.provider; -import java.security.*; -import javax.crypto.*; +import javax.crypto.IllegalBlockSizeException; import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE; /** * This class represents the GCTR function defined in NIST 800-38D - * under section 6.5. It needs to be constructed w/ an initialized - * cipher object, and initial counter block(ICB). Given an input X - * of arbitrary length, it processes and returns an output which has - * the same length as X. The invariants of this class are: - * - * (1) The length of intialCounterBlk (and also of its clones, e.g., - * fields counter and counterSave) is equal to AES_BLOCK_SIZE. - * - * (2) After construction, the field counter never becomes null, it - * always contains a byte array of length AES_BLOCK_SIZE. + * under section 6.5. With a given cipher object and initial counter + * block, a counter mode operation is performed. Blocksize is limited + * to 16 bytes. * * If any invariant is broken, failures can occur because the * AESCrypt.encryptBlock method can be intrinsified on the HotSpot VM * (see JDK-8067648 for details). * + * The counter mode operations can be intrinsified and parallelized + * by using CounterMode.implCrypt() if HotSpot VM supports it on the + * architecture. + * *

    This function is used in the implementation of GCM mode. * * @since 1.8 */ -final class GCTR { +final class GCTR extends CounterMode { - // these fields should not change after the object has been constructed - private final SymmetricCipher aes; - private final byte[] icb; - - // the current counter value - private byte[] counter; - - // needed for save/restore calls - private byte[] counterSave = null; - - // NOTE: cipher should already be initialized GCTR(SymmetricCipher cipher, byte[] initialCounterBlk) { - this.aes = cipher; + super(cipher); if (initialCounterBlk.length != AES_BLOCK_SIZE) { throw new RuntimeException("length of initial counter block (" + initialCounterBlk.length + ") not equal to AES_BLOCK_SIZE (" + AES_BLOCK_SIZE + ")"); } - this.icb = initialCounterBlk; - this.counter = icb.clone(); + + iv = initialCounterBlk; + reset(); + } + + @Override + String getFeedback() { + return "GCTR"; } // input must be multiples of 128-bit blocks when calling update @@ -89,23 +80,11 @@ final class GCTR { throw new RuntimeException("output buffer too small"); } - byte[] encryptedCntr = new byte[AES_BLOCK_SIZE]; - - int numOfCompleteBlocks = inLen / AES_BLOCK_SIZE; - for (int i = 0; i < numOfCompleteBlocks; i++) { - aes.encryptBlock(counter, 0, encryptedCntr, 0); - for (int n = 0; n < AES_BLOCK_SIZE; n++) { - int index = (i * AES_BLOCK_SIZE + n); - out[outOfs + index] = - (byte) ((in[inOfs + index] ^ encryptedCntr[n])); - } - GaloisCounterMode.increment32(counter); - } - return inLen; + return encrypt(in, inOfs, inLen, out, outOfs); } // input can be arbitrary size when calling doFinal - protected int doFinal(byte[] in, int inOfs, int inLen, byte[] out, + int doFinal(byte[] in, int inOfs, int inLen, byte[] out, int outOfs) throws IllegalBlockSizeException { try { if (inLen < 0) { @@ -118,7 +97,7 @@ final class GCTR { if (lastBlockSize != 0) { // do the last partial block byte[] encryptedCntr = new byte[AES_BLOCK_SIZE]; - aes.encryptBlock(counter, 0, encryptedCntr, 0); + embeddedCipher.encryptBlock(counter, 0, encryptedCntr, 0); for (int n = 0; n < lastBlockSize; n++) { out[outOfs + completeBlkLen + n] = (byte) ((in[inOfs + completeBlkLen + n] ^ @@ -131,28 +110,4 @@ final class GCTR { } return inLen; } - - /** - * Resets the content of this object to when it's first constructed. - */ - void reset() { - System.arraycopy(icb, 0, counter, 0, icb.length); - counterSave = null; - } - - /** - * Save the current content of this object. - */ - void save() { - this.counterSave = this.counter.clone(); - } - - /** - * Restores the content of this object to the previous saved one. - */ - void restore() { - if (this.counterSave != null) { - this.counter = this.counterSave; - } - } } diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java index 3331f787429..72e7452ace0 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBEKey.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -145,6 +145,7 @@ final class PBEKey implements SecretKey { * Ensures that the password bytes of this key are * set to zero when there are no more references to it. */ + @SuppressWarnings("deprecation") protected void finalize() throws Throwable { try { if (this.key != null) { diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java index 9d82ebb6ff2..1bf51566165 100644 --- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java +++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/PBKDF2KeyImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -267,6 +267,7 @@ final class PBKDF2KeyImpl implements javax.crypto.interfaces.PBEKey { * Ensures that the password bytes of this key are * erased when there are no more references to it. */ + @SuppressWarnings("deprecation") protected void finalize() throws Throwable { try { if (this.passwd != null) { diff --git a/jdk/src/java.base/share/classes/java/io/BufferedReader.java b/jdk/src/java.base/share/classes/java/io/BufferedReader.java index 1f6a66490cd..8cb4f73e597 100644 --- a/jdk/src/java.base/share/classes/java/io/BufferedReader.java +++ b/jdk/src/java.base/share/classes/java/io/BufferedReader.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -297,14 +297,15 @@ public class BufferedReader extends Reader { /** * Reads a line of text. A line is considered to be terminated by any one - * of a line feed ('\n'), a carriage return ('\r'), or a carriage return - * followed immediately by a linefeed. + * of a line feed ('\n'), a carriage return ('\r'), a carriage return + * followed immediately by a line feed, or by reaching the end-of-file + * (EOF). * * @param ignoreLF If true, the next '\n' will be skipped * * @return A String containing the contents of the line, not including * any line-termination characters, or null if the end of the - * stream has been reached + * stream has been reached without reading any characters * * @see java.io.LineNumberReader#readLine() * @@ -375,12 +376,13 @@ public class BufferedReader extends Reader { /** * Reads a line of text. A line is considered to be terminated by any one - * of a line feed ('\n'), a carriage return ('\r'), or a carriage return - * followed immediately by a linefeed. + * of a line feed ('\n'), a carriage return ('\r'), a carriage return + * followed immediately by a line feed, or by reaching the end-of-file + * (EOF). * * @return A String containing the contents of the line, not including * any line-termination characters, or null if the end of the - * stream has been reached + * stream has been reached without reading any characters * * @exception IOException If an I/O error occurs * diff --git a/jdk/src/java.base/share/classes/java/io/DataInput.java b/jdk/src/java.base/share/classes/java/io/DataInput.java index 60e03c2173c..acc7f996878 100644 --- a/jdk/src/java.base/share/classes/java/io/DataInput.java +++ b/jdk/src/java.base/share/classes/java/io/DataInput.java @@ -48,7 +48,7 @@ package java.io; * may be thrown if the input stream has been * closed. * - *

    Modified UTF-8

    + *

    Modified UTF-8

    *

    * Implementations of the DataInput and DataOutput interfaces represent * Unicode strings in a format that is a slight modification of UTF-8. @@ -72,8 +72,8 @@ package java.io; * * * Byte 1 - *

    0
    - *
    bits 6-0
    + * 0 + * bits 6-0 * * * @@ -87,16 +87,16 @@ package java.io; * * * Byte 1 - *
    1
    - *
    1
    - *
    0
    - *
    bits 10-6
    + * 1 + * 1 + * 0 + * bits 10-6 * * * Byte 2 - *
    1
    - *
    0
    - *
    bits 5-0
    + * 1 + * 0 + * bits 5-0 * * * @@ -109,23 +109,23 @@ package java.io; * * * Byte 1 - *
    1
    - *
    1
    - *
    1
    - *
    0
    - *
    bits 15-12
    + * 1 + * 1 + * 1 + * 0 + * bits 15-12 * * * Byte 2 - *
    1
    - *
    0
    - *
    bits 11-6
    + * 1 + * 0 + * bits 11-6 * * * Byte 3 - *
    1
    - *
    0
    - *
    bits 5-0
    + * 1 + * 0 + * bits 5-0 * * * diff --git a/jdk/src/java.base/share/classes/java/io/File.java b/jdk/src/java.base/share/classes/java/io/File.java index 0bbaf4d5d0b..6e77026c6c1 100644 --- a/jdk/src/java.base/share/classes/java/io/File.java +++ b/jdk/src/java.base/share/classes/java/io/File.java @@ -113,7 +113,7 @@ import sun.security.action.GetPropertyAction; * operating system-specific portion of storage for a file system. A single * storage device (e.g. a physical disk-drive, flash memory, CD-ROM) may * contain multiple partitions. The object, if any, will reside on the - * partition named by some ancestor of the absolute + * partition named by some ancestor of the absolute * form of this pathname. * *

    A file system may implement restrictions to certain operations on the diff --git a/jdk/src/java.base/share/classes/java/io/FileInputStream.java b/jdk/src/java.base/share/classes/java/io/FileInputStream.java index a321c61ae41..0d8401128ff 100644 --- a/jdk/src/java.base/share/classes/java/io/FileInputStream.java +++ b/jdk/src/java.base/share/classes/java/io/FileInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -413,9 +413,19 @@ class FileInputStream extends InputStream * Ensures that the close method of this file input stream is * called when there are no more references to it. * + * @deprecated The {@code finalize} method has been deprecated. + * Subclasses that override {@code finalize} in order to perform cleanup + * should be modified to use alternative cleanup mechanisms and + * to remove the overriding {@code finalize} method. + * When overriding the {@code finalize} method, its implementation must explicitly + * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. + * See the specification for {@link Object#finalize()} for further + * information about migration options. + * * @exception IOException if an I/O error occurs. * @see java.io.FileInputStream#close() */ + @Deprecated(since="9") protected void finalize() throws IOException { if ((fd != null) && (fd != FileDescriptor.in)) { /* if fd is shared, the references in FileDescriptor diff --git a/jdk/src/java.base/share/classes/java/io/FileOutputStream.java b/jdk/src/java.base/share/classes/java/io/FileOutputStream.java index f6bdb1f3b5f..634ca1ed481 100644 --- a/jdk/src/java.base/share/classes/java/io/FileOutputStream.java +++ b/jdk/src/java.base/share/classes/java/io/FileOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -427,9 +427,18 @@ class FileOutputStream extends OutputStream * close method of this file output stream is * called when there are no more references to this stream. * + * @deprecated The {@code finalize} method has been deprecated. + * Subclasses that override {@code finalize} in order to perform cleanup + * should be modified to use alternative cleanup mechanisms and + * to remove the overriding {@code finalize} method. + * When overriding the {@code finalize} method, its implementation must explicitly + * ensure that {@code super.finalize()} is invoked as described in {@link Object#finalize}. + * See the specification for {@link Object#finalize()} for further + * information about migration options. * @exception IOException if an I/O error occurs. * @see java.io.FileInputStream#close() */ + @Deprecated(since="9") protected void finalize() throws IOException { if (fd != null) { if (fd == FileDescriptor.out || fd == FileDescriptor.err) { diff --git a/jdk/src/java.base/share/classes/java/io/FilePermission.java b/jdk/src/java.base/share/classes/java/io/FilePermission.java index 2d56f438cb3..39cded53b27 100644 --- a/jdk/src/java.base/share/classes/java/io/FilePermission.java +++ b/jdk/src/java.base/share/classes/java/io/FilePermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,6 +209,10 @@ public final class FilePermission extends Permission implements Serializable { private static final Path here = builtInFS.getPath( GetPropertyAction.privilegedGetProperty("user.dir")); + private static final Path EMPTY_PATH = builtInFS.getPath(""); + private static final Path DASH_PATH = builtInFS.getPath("-"); + private static final Path DOTDOT_PATH = builtInFS.getPath(".."); + /** * A private constructor that clones some and updates some, * always with a different name. @@ -341,7 +345,7 @@ public final class FilePermission extends Permission implements Serializable { .normalize(); // lastName should always be non-null now Path lastName = npath.getFileName(); - if (lastName != null && lastName.toString().equals("-")) { + if (lastName != null && lastName.equals(DASH_PATH)) { directory = true; recursive = !rememberStar; npath = npath.getParent(); @@ -679,23 +683,76 @@ public final class FilePermission extends Permission implements Serializable { * @return the depth in between */ private static int containsPath(Path p1, Path p2) { - Path p; - try { - p = p2.relativize(p1).normalize(); - if (p.getName(0).toString().isEmpty()) { - return 0; - } else { - for (Path item: p) { - String s = item.toString(); - if (!s.equals("..")) { - return -1; - } - } - return p.getNameCount(); - } - } catch (IllegalArgumentException iae) { + + // Two paths must have the same root. For example, + // there is no contains relation between any two of + // "/x", "x", "C:/x", "C:x", and "//host/share/x". + if (!Objects.equals(p1.getRoot(), p2.getRoot())) { return -1; } + + // Empty path (i.e. "." or "") is a strange beast, + // because its getNameCount()==1 but getName(0) is null. + // It's better to deal with it separately. + if (p1.equals(EMPTY_PATH)) { + if (p2.equals(EMPTY_PATH)) { + return 0; + } else if (p2.getName(0).equals(DOTDOT_PATH)) { + // "." contains p2 iif p2 has no "..". Since a + // a normalized path can only have 0 or more + // ".." at the beginning. We only need to look + // at the head. + return -1; + } else { + // and the distance is p2's name count. i.e. + // 3 between "." and "a/b/c". + return p2.getNameCount(); + } + } else if (p2.equals(EMPTY_PATH)) { + int c1 = p1.getNameCount(); + if (!p1.getName(c1 - 1).equals(DOTDOT_PATH)) { + // "." is inside p1 iif p1 is 1 or more "..". + // For the same reason above, we only need to + // look at the tail. + return -1; + } + // and the distance is the count of ".." + return c1; + } + + // Good. No more empty paths. + + // Common heads are removed + + int c1 = p1.getNameCount(); + int c2 = p2.getNameCount(); + + int n = Math.min(c1, c2); + int i = 0; + while (i < n) { + if (!p1.getName(i).equals(p2.getName(i))) + break; + i++; + } + + // for p1 containing p2, p1 must be 0-or-more "..", + // and p2 cannot have "..". For the same reason, we only + // check tail of p1 and head of p2. + if (i < c1 && !p1.getName(c1 - 1).equals(DOTDOT_PATH)) { + return -1; + } + + if (i < c2 && p2.getName(i).equals(DOTDOT_PATH)) { + return -1; + } + + // and the distance is the name counts added (after removing + // the common heads). + + // For example: p1 = "../../..", p2 = "../a". + // After removing the common heads, they become "../.." and "a", + // and the distance is (3-1)+(2-1) = 3. + return c1 - i + c2 - i; } /** diff --git a/jdk/src/java.base/share/classes/java/io/FilterInputStream.java b/jdk/src/java.base/share/classes/java/io/FilterInputStream.java index 3304a1f2eb8..05ab5fa56cb 100644 --- a/jdk/src/java.base/share/classes/java/io/FilterInputStream.java +++ b/jdk/src/java.base/share/classes/java/io/FilterInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ class FilterInputStream extends InputStream { } /** - * Reads up to byte.length bytes of data from this + * Reads up to b.length bytes of data from this * input stream into an array of bytes. This method blocks until some * input is available. *

    diff --git a/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java b/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java index cb8f122d0b1..8030979cdaa 100644 --- a/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java +++ b/jdk/src/java.base/share/classes/java/io/FilterOutputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,8 +91,8 @@ public class FilterOutputStream extends OutputStream { * b.length. *

    * Note that this method does not call the one-argument - * write method of its underlying stream with the single - * argument b. + * write method of its underlying output stream with + * the single argument b. * * @param b the data to be written. * @exception IOException if an I/O error occurs. @@ -113,7 +113,7 @@ public class FilterOutputStream extends OutputStream { * byte to output. *

    * Note that this method does not call the write method - * of its underlying input stream with the same arguments. Subclasses + * of its underlying output stream with the same arguments. Subclasses * of FilterOutputStream should provide a more efficient * implementation of this method. * diff --git a/jdk/src/java.base/share/classes/java/io/LineNumberReader.java b/jdk/src/java.base/share/classes/java/io/LineNumberReader.java index cc7bb2ae5fa..c9ecbe0734a 100644 --- a/jdk/src/java.base/share/classes/java/io/LineNumberReader.java +++ b/jdk/src/java.base/share/classes/java/io/LineNumberReader.java @@ -39,7 +39,7 @@ package java.io; * the stream; it only changes the value that will be returned by * {@code getLineNumber()}. * - *

    A line is considered to be terminated by any one of a + *

    A line is considered to be terminated by any one of a * line feed ('\n'), a carriage return ('\r'), or a carriage return followed * immediately by a linefeed. * diff --git a/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java index a0e998c7b29..534e1b2b8de 100644 --- a/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java +++ b/jdk/src/java.base/share/classes/java/io/ObjectInputFilter.java @@ -104,7 +104,6 @@ public interface ObjectInputFilter { * @return {@link Status#ALLOWED Status.ALLOWED} if accepted, * {@link Status#REJECTED Status.REJECTED} if rejected, * {@link Status#UNDECIDED Status.UNDECIDED} if undecided. - * @since 9 */ Status checkInput(FilterInfo filterInfo); @@ -323,7 +322,7 @@ public interface ObjectInputFilter { * Other patterns match or reject class or package name * as returned from {@link Class#getName() Class.getName()} and * if an optional module name is present - * {@link java.lang.reflect.Module#getName() class.getModule().getName()}. + * {@link Module#getName() class.getModule().getName()}. * Note that for arrays the element type is used in the pattern, * not the array type. *

      diff --git a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java index ed033d685e9..15d735e88c3 100644 --- a/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java +++ b/jdk/src/java.base/share/classes/java/io/ObjectInputStream.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -812,23 +812,24 @@ public class ObjectInputStream } /** - * Enable the stream to allow objects read from the stream to be replaced. - * When enabled, the resolveObject method is called for every object being + * Enables the stream to do replacement of objects read from the stream. When + * enabled, the {@link #resolveObject} method is called for every object being * deserialized. * - *

      If enable is true, and there is a security manager installed, + *

      If object replacement is currently not enabled, and + * {@code enable} is true, and there is a security manager installed, * this method first calls the security manager's - * checkPermission method with the - * SerializablePermission("enableSubstitution") permission to - * ensure it's ok to enable the stream to allow objects read from the - * stream to be replaced. + * {@code checkPermission} method with the + * {@code SerializablePermission("enableSubstitution")} permission to + * ensure that the caller is permitted to enable the stream to do replacement + * of objects read from the stream. * - * @param enable true for enabling use of resolveObject for + * @param enable true for enabling use of {@code resolveObject} for * every object being deserialized * @return the previous setting before this method was invoked * @throws SecurityException if a security manager exists and its - * checkPermission method denies enabling the stream - * to allow objects read from the stream to be replaced. + * {@code checkPermission} method denies enabling the stream + * to do replacement of objects read from the stream. * @see SecurityManager#checkPermission * @see java.io.SerializablePermission */ @@ -1796,12 +1797,19 @@ public class ObjectInputStream } catch (ClassNotFoundException ex) { resolveEx = ex; } + + // Call filterCheck on the class before reading anything else + filterCheck(cl, -1); + skipCustomData(); - desc.initProxy(cl, resolveEx, readClassDesc(false)); - - // Call filterCheck on the definition - filterCheck(desc.forClass(), -1); + try { + totalObjectRefs++; + depth++; + desc.initProxy(cl, resolveEx, readClassDesc(false)); + } finally { + depth--; + } handles.finish(descHandle); passHandle = descHandle; @@ -1846,12 +1854,19 @@ public class ObjectInputStream } catch (ClassNotFoundException ex) { resolveEx = ex; } + + // Call filterCheck on the class before reading anything else + filterCheck(cl, -1); + skipCustomData(); - desc.initNonProxy(readDesc, cl, resolveEx, readClassDesc(false)); - - // Call filterCheck on the definition - filterCheck(desc.forClass(), -1); + try { + totalObjectRefs++; + depth++; + desc.initNonProxy(readDesc, cl, resolveEx, readClassDesc(false)); + } finally { + depth--; + } handles.finish(descHandle); passHandle = descHandle; diff --git a/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java b/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java index bff6f8311ee..06845442958 100644 --- a/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java +++ b/jdk/src/java.base/share/classes/java/io/ObjectOutputStream.java @@ -589,22 +589,24 @@ public class ObjectOutputStream } /** - * Enable the stream to do replacement of objects in the stream. When - * enabled, the replaceObject method is called for every object being + * Enables the stream to do replacement of objects written to the stream. When + * enabled, the {@link #replaceObject} method is called for every object being * serialized. * - *

      If enable is true, and there is a security manager - * installed, this method first calls the security manager's - * checkPermission method with a - * SerializablePermission("enableSubstitution") permission to - * ensure it's ok to enable the stream to do replacement of objects in the - * stream. + *

      If object replacement is currently not enabled, and + * {@code enable} is true, and there is a security manager installed, + * this method first calls the security manager's + * {@code checkPermission} method with the + * {@code SerializablePermission("enableSubstitution")} permission to + * ensure that the caller is permitted to enable the stream to do replacement + * of objects written to the stream. * - * @param enable boolean parameter to enable replacement of objects + * @param enable true for enabling use of {@code replaceObject} for + * every object being serialized * @return the previous setting before this method was invoked * @throws SecurityException if a security manager exists and its - * checkPermission method denies enabling the stream - * to do replacement of objects in the stream. + * {@code checkPermission} method denies enabling the stream + * to do replacement of objects written to the stream. * @see SecurityManager#checkPermission * @see java.io.SerializablePermission */ diff --git a/jdk/src/java.base/share/classes/java/io/PipedInputStream.java b/jdk/src/java.base/share/classes/java/io/PipedInputStream.java index b55c1b08b75..0a1de74462d 100644 --- a/jdk/src/java.base/share/classes/java/io/PipedInputStream.java +++ b/jdk/src/java.base/share/classes/java/io/PipedInputStream.java @@ -39,7 +39,7 @@ package java.io; * The piped input stream contains a buffer, * decoupling read operations from write operations, * within limits. - * A pipe is said to be broken if a + * A pipe is said to be broken if a * thread that was providing data bytes to the connected * piped output stream is no longer alive. * diff --git a/jdk/src/java.base/share/classes/java/io/PipedOutputStream.java b/jdk/src/java.base/share/classes/java/io/PipedOutputStream.java index d49e05005d5..79ffd38e928 100644 --- a/jdk/src/java.base/share/classes/java/io/PipedOutputStream.java +++ b/jdk/src/java.base/share/classes/java/io/PipedOutputStream.java @@ -35,7 +35,7 @@ import java.io.*; * read from the connected PipedInputStream by some * other thread. Attempting to use both objects from a single thread * is not recommended as it may deadlock the thread. - * The pipe is said to be broken if a + * The pipe is said to be broken if a * thread that was reading data bytes from the connected piped input * stream is no longer alive. * diff --git a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java index 3806675cdca..4fb409ec977 100644 --- a/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java +++ b/jdk/src/java.base/share/classes/java/io/RandomAccessFile.java @@ -132,24 +132,24 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable { * write to, the file specified by the {@link File} argument. A new {@link * FileDescriptor} object is created to represent this file connection. * - *

      The {@code mode} argument specifies the access mode + *

      The {@code mode} argument specifies the access mode * in which the file is to be opened. The permitted values and their * meanings are: * * - * - * + * + * * - * + * * - * + * * - * + * * diff --git a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java index f9c8eea6c89..47c6a4019e7 100644 --- a/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java +++ b/jdk/src/java.base/share/classes/java/lang/AbstractStringBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -307,6 +307,8 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * sequence. */ public int codePointAt(int index) { + int count = this.count; + byte[] value = this.value; checkIndex(index, count); if (isLatin1()) { return value[index] & 0xff; @@ -560,11 +562,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { val[count++] = 'l'; val[count++] = 'l'; } else { - checkOffset(count + 4, val.length >> 1); - StringUTF16.putChar(val, count++, 'n'); - StringUTF16.putChar(val, count++, 'u'); - StringUTF16.putChar(val, count++, 'l'); - StringUTF16.putChar(val, count++, 'l'); + count = StringUTF16.putCharsAt(val, count, 'n', 'u', 'l', 'l'); } this.count = count; return this; @@ -695,18 +693,9 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } } else { if (b) { - checkOffset(count + 4, val.length >> 1); - StringUTF16.putChar(val, count++, 't'); - StringUTF16.putChar(val, count++, 'r'); - StringUTF16.putChar(val, count++, 'u'); - StringUTF16.putChar(val, count++, 'e'); + count = StringUTF16.putCharsAt(val, count, 't', 'r', 'u', 'e'); } else { - checkOffset(count + 5, val.length >> 1); - StringUTF16.putChar(val, count++, 'f'); - StringUTF16.putChar(val, count++, 'a'); - StringUTF16.putChar(val, count++, 'l'); - StringUTF16.putChar(val, count++, 's'); - StringUTF16.putChar(val, count++, 'e'); + count = StringUTF16.putCharsAt(val, count, 'f', 'a', 'l', 's', 'e'); } } this.count = count; @@ -755,16 +744,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @return a reference to this object. */ public AbstractStringBuilder append(int i) { + int count = this.count; int spaceNeeded = count + Integer.stringSize(i); ensureCapacityInternal(spaceNeeded); if (isLatin1()) { Integer.getChars(i, spaceNeeded, value); } else { - byte[] val = this.value; - checkOffset(spaceNeeded, val.length >> 1); - Integer.getCharsUTF16(i, spaceNeeded, val); + StringUTF16.getChars(i, count, spaceNeeded, value); } - count = spaceNeeded; + this.count = spaceNeeded; return this; } @@ -781,16 +769,15 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * @return a reference to this object. */ public AbstractStringBuilder append(long l) { + int count = this.count; int spaceNeeded = count + Long.stringSize(l); ensureCapacityInternal(spaceNeeded); if (isLatin1()) { Long.getChars(l, spaceNeeded, value); } else { - byte[] val = this.value; - checkOffset(spaceNeeded, val.length >> 1); - Long.getCharsUTF16(l, spaceNeeded, val); + StringUTF16.getChars(l, count, spaceNeeded, value); } - count = spaceNeeded; + this.count = spaceNeeded; return this; } @@ -843,6 +830,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * greater than {@code end}. */ public AbstractStringBuilder delete(int start, int end) { + int count = this.count; if (end > count) { end = count; } @@ -850,7 +838,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { int len = end - start; if (len > 0) { shift(end, -len); - count -= len; + this.count = count - len; } return this; } @@ -925,6 +913,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { * greater than {@code end}. */ public AbstractStringBuilder replace(int start, int end, String str) { + int count = this.count; if (end > count) { end = count; } @@ -933,7 +922,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { int newCount = count + len - (end - start); ensureCapacityInternal(newCount); shift(end, newCount - count); - count = newCount; + this.count = newCount; putStringAt(start, str); return this; } @@ -1500,40 +1489,11 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { val[k] = cj; } } else { - checkOffset(count, val.length >> 1); - boolean hasSurrogates = false; - for (int j = (n-1) >> 1; j >= 0; j--) { - int k = n - j; - char cj = StringUTF16.getChar(val, j); - char ck = StringUTF16.getChar(val, k); - StringUTF16.putChar(val, j, ck); - StringUTF16.putChar(val, k, cj); - if (Character.isSurrogate(cj) || - Character.isSurrogate(ck)) { - hasSurrogates = true; - } - } - if (hasSurrogates) { - reverseAllValidSurrogatePairs(val, count); - } + StringUTF16.reverse(val, count); } return this; } - /** Outlined helper method for reverse() */ - private void reverseAllValidSurrogatePairs(byte[] val, int count) { - for (int i = 0; i < count - 1; i++) { - char c2 = StringUTF16.getChar(val, i); - if (Character.isLowSurrogate(c2)) { - char c1 = StringUTF16.getChar(val, i + 1); - if (Character.isHighSurrogate(c1)) { - StringUTF16.putChar(val, i++, c1); - StringUTF16.putChar(val, i, c2); - } - } - } - } - /** * Returns a string representing the data in this sequence. * A new {@code String} object is allocated and initialized to @@ -1682,6 +1642,7 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { } private final void appendChars(char[] s, int off, int end) { + int count = this.count; if (isLatin1()) { byte[] val = this.value; for (int i = off, j = count; i < end; i++) { @@ -1689,17 +1650,17 @@ abstract class AbstractStringBuilder implements Appendable, CharSequence { if (StringLatin1.canEncode(c)) { val[j++] = (byte)c; } else { - count = j; + this.count = count = j; inflate(); StringUTF16.putCharsSB(this.value, j, s, i, end); - count += end - i; + this.count = count + end - i; return; } } } else { StringUTF16.putCharsSB(this.value, count, s, off, end); } - count += end - off; + this.count = count + end - off; } private final void appendChars(CharSequence s, int off, int end) { diff --git a/jdk/src/java.base/share/classes/java/lang/Character.java b/jdk/src/java.base/share/classes/java/lang/Character.java index 9f9e4de1972..028190da55b 100644 --- a/jdk/src/java.base/share/classes/java/lang/Character.java +++ b/jdk/src/java.base/share/classes/java/lang/Character.java @@ -56,7 +56,7 @@ import jdk.internal.HotSpotIntrinsicCandidate; *
    • http://www.unicode.org * * - *

      Unicode Character Representations

      + *

      Unicode Character Representations

      * *

      The {@code char} data type (and therefore the value that a * {@code Character} object encapsulates) are based on the @@ -70,9 +70,9 @@ import jdk.internal.HotSpotIntrinsicCandidate; * definition of the U+n notation in the Unicode * Standard.) * - *

      The set of characters from U+0000 to U+FFFF is + *

      The set of characters from U+0000 to U+FFFF is * sometimes referred to as the Basic Multilingual Plane (BMP). - * Characters whose code points are greater + * Characters whose code points are greater * than U+FFFF are called supplementary characters. The Java * platform uses the UTF-16 representation in {@code char} arrays and * in the {@code String} and {@code StringBuffer} classes. In diff --git a/jdk/src/java.base/share/classes/java/lang/Class.java b/jdk/src/java.base/share/classes/java/lang/Class.java index b0e3d3af0cd..a7f1262c3b5 100644 --- a/jdk/src/java.base/share/classes/java/lang/Class.java +++ b/jdk/src/java.base/share/classes/java/lang/Class.java @@ -43,7 +43,6 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.lang.reflect.Module; import java.lang.reflect.Proxy; import java.lang.reflect.Type; import java.lang.reflect.TypeVariable; @@ -64,9 +63,9 @@ import java.util.StringJoiner; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.loader.BootLoader; import jdk.internal.loader.BuiltinClassLoader; -import jdk.internal.loader.ResourceHelper; import jdk.internal.misc.Unsafe; import jdk.internal.misc.VM; +import jdk.internal.module.Resources; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.ConstantPool; import jdk.internal.reflect.Reflection; @@ -425,6 +424,7 @@ public final class Class implements java.io.Serializable, * * * @since 9 + * @spec JPMS */ @CallerSensitive public static Class forName(Module module, String name) { @@ -726,16 +726,16 @@ public final class Class implements java.io.Serializable, * *

    • ValueMeaning
      {@code "r"}
      ValueMeaning
      {@code "r"} Open for reading only. Invoking any of the {@code write} * methods of the resulting object will cause an * {@link java.io.IOException} to be thrown.
      {@code "rw"}
      {@code "rw"} Open for reading and writing. If the file does not already * exist then an attempt will be made to create it.
      {@code "rws"}
      {@code "rws"} Open for reading and writing, as with {@code "rw"}, and also * require that every update to the file's content or metadata be * written synchronously to the underlying storage device.
      {@code "rwd"}
      {@code "rwd"} Open for reading and writing, as with {@code "rw"}, and also * require that every update to the file's content be written * synchronously to the underlying storage device.
      *
      Element Type     Encoding - *
      boolean     Z - *
      byte     B - *
      char     C + *
      boolean     Z + *
      byte     B + *
      char     C *
      class or interface - *     Lclassname; - *
      double     D - *
      float     F - *
      int     I - *
      long     J - *
      short     S + *     Lclassname; + *
      double     D + *
      float     F + *
      int     I + *
      long     J + *
      short     S *
      * *

      The class or interface name classname is the binary name of @@ -819,6 +819,7 @@ public final class Class implements java.io.Serializable, * @return the module that this class or interface is a member of * * @since 9 + * @spec JPMS */ public Module getModule() { return module; @@ -924,6 +925,8 @@ public final class Class implements java.io.Serializable, * this method returns {@code null}. * * @return the package of this class. + * @revised 9 + * @spec JPMS */ public Package getPackage() { if (isPrimitive() || isArray()) { @@ -951,20 +954,30 @@ public final class Class implements java.io.Serializable, * declaring class} of the {@link #getEnclosingMethod enclosing method} or * {@link #getEnclosingConstructor enclosing constructor}. * - *

      This method returns {@code null} if this class represents an array type, - * a primitive type or void. + *

      If this class represents an array type then this method returns the + * package name of the element type. If this class represents a primitive + * type or void then the package name "{@code java.lang}" is returned. * * @return the fully qualified package name * * @since 9 + * @spec JPMS * @jls 6.7 Fully Qualified Names */ public String getPackageName() { String pn = this.packageName; - if (pn == null && !isArray() && !isPrimitive()) { - String cn = getName(); - int dot = cn.lastIndexOf('.'); - pn = (dot != -1) ? cn.substring(0, dot).intern() : ""; + if (pn == null) { + Class c = this; + while (c.isArray()) { + c = c.getComponentType(); + } + if (c.isPrimitive()) { + pn = "java.lang"; + } else { + String cn = c.getName(); + int dot = cn.lastIndexOf('.'); + pn = (dot != -1) ? cn.substring(0, dot).intern() : ""; + } this.packageName = pn; } return pn; @@ -2491,10 +2504,16 @@ public final class Class implements java.io.Serializable, * Finds a resource with a given name. * *

      If this class is in a named {@link Module Module} then this method - * will attempt to find the resource in the module by means of the absolute - * resource name, subject to the rules for encapsulation specified in the - * {@code Module} {@link Module#getResourceAsStream getResourceAsStream} - * method. + * will attempt to find the resource in the module. This is done by + * delegating to the module's class loader {@link + * ClassLoader#findResource(String,String) findResource(String,String)} + * method, invoking it with the module name and the absolute name of the + * resource. Resources in named modules are subject to the rules for + * encapsulation specified in the {@code Module} {@link + * Module#getResourceAsStream getResourceAsStream} method and so this + * method returns {@code null} when the resource is a + * non-"{@code .class}" resource in a package that is not open to the + * caller's module. * *

      Otherwise, if this class is not in a named module then the rules for * searching resources associated with a given class are implemented by the @@ -2503,9 +2522,8 @@ public final class Class implements java.io.Serializable, * the bootstrap class loader, the method delegates to {@link * ClassLoader#getSystemResourceAsStream}. * - *

      Before finding a resource in the caller's module or delegation to a - * class loader, an absolute resource name is constructed from the given - * resource name using this algorithm: + *

      Before delegation, an absolute resource name is constructed from the + * given resource name using this algorithm: * *

        * @@ -2532,27 +2550,26 @@ public final class Class implements java.io.Serializable, * least the caller module, or access to the resource is denied * by the security manager. * @throws NullPointerException If {@code name} is {@code null} + * + * @see Module#getResourceAsStream(String) * @since 1.1 + * @revised 9 + * @spec JPMS */ @CallerSensitive public InputStream getResourceAsStream(String name) { name = resolveName(name); - Module module = getModule(); - if (module.isNamed()) { - if (!ResourceHelper.isSimpleResource(name)) { - Module caller = Reflection.getCallerClass().getModule(); - if (caller != module) { - Set packages = module.getDescriptor().packages(); - String pn = ResourceHelper.getPackageName(name); - if (packages.contains(pn) && !module.isOpen(pn, caller)) { - // resource is in package not open to caller - return null; - } - } + Module thisModule = getModule(); + if (thisModule.isNamed()) { + // check if resource can be located by caller + if (Resources.canEncapsulate(name) + && !isOpenToCaller(name, Reflection.getCallerClass())) { + return null; } - String mn = module.getName(); + // resource not encapsulated or in package open to caller + String mn = thisModule.getName(); ClassLoader cl = getClassLoader0(); try { @@ -2585,10 +2602,16 @@ public final class Class implements java.io.Serializable, * Finds a resource with a given name. * *

        If this class is in a named {@link Module Module} then this method - * will attempt to find the resource in the module by means of the absolute - * resource name, subject to the rules for encapsulation specified in the - * {@code Module} {@link Module#getResourceAsStream getResourceAsStream} - * method. + * will attempt to find the resource in the module. This is done by + * delegating to the module's class loader {@link + * ClassLoader#findResource(String,String) findResource(String,String)} + * method, invoking it with the module name and the absolute name of the + * resource. Resources in named modules are subject to the rules for + * encapsulation specified in the {@code Module} {@link + * Module#getResourceAsStream getResourceAsStream} method and so this + * method returns {@code null} when the resource is a + * non-"{@code .class}" resource in a package that is not open to the + * caller's module. * *

        Otherwise, if this class is not in a named module then the rules for * searching resources associated with a given class are implemented by the @@ -2627,25 +2650,23 @@ public final class Class implements java.io.Serializable, * manager. * @throws NullPointerException If {@code name} is {@code null} * @since 1.1 + * @revised 9 + * @spec JPMS */ @CallerSensitive public URL getResource(String name) { name = resolveName(name); - Module module = getModule(); - if (module.isNamed()) { - if (!ResourceHelper.isSimpleResource(name)) { - Module caller = Reflection.getCallerClass().getModule(); - if (caller != module) { - Set packages = module.getDescriptor().packages(); - String pn = ResourceHelper.getPackageName(name); - if (packages.contains(pn) && !module.isOpen(pn, caller)) { - // resource is in package not open to caller - return null; - } - } + Module thisModule = getModule(); + if (thisModule.isNamed()) { + // check if resource can be located by caller + if (Resources.canEncapsulate(name) + && !isOpenToCaller(name, Reflection.getCallerClass())) { + return null; } - String mn = getModule().getName(); + + // resource not encapsulated or in package open to caller + String mn = thisModule.getName(); ClassLoader cl = getClassLoader0(); try { if (cl == null) { @@ -2667,10 +2688,36 @@ public final class Class implements java.io.Serializable, } } + /** + * Returns true if a resource with the given name can be located by the + * given caller. All resources in a module can be located by code in + * the module. For other callers, then the package needs to be open to + * the caller. + */ + private boolean isOpenToCaller(String name, Class caller) { + // assert getModule().isNamed(); + Module thisModule = getModule(); + Module callerModule = (caller != null) ? caller.getModule() : null; + if (callerModule != thisModule) { + String pn = Resources.toPackageName(name); + if (thisModule.getDescriptor().packages().contains(pn)) { + if (callerModule == null && !thisModule.isOpen(pn)) { + // no caller, package not open + return false; + } + if (!thisModule.isOpen(pn, callerModule)) { + // package not open to caller + return false; + } + } + } + return true; + } + + /** protection domain returned when the internal domain is null */ private static java.security.ProtectionDomain allPermDomain; - /** * Returns the {@code ProtectionDomain} of this class. If there is a * security manager installed, this method first calls the security @@ -2740,7 +2787,7 @@ public final class Class implements java.io.Serializable, * In all other cases, it requires RuntimePermission("accessDeclaredMembers") * permission. */ - final ClassLoader ccl = caller.getClassLoader0(); + final ClassLoader ccl = ClassLoader.getClassLoader(caller); if (which != Member.PUBLIC) { final ClassLoader cl = getClassLoader0(); if (ccl != cl) { diff --git a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java index fb771c29a10..2f6af4de922 100644 --- a/jdk/src/java.base/share/classes/java/lang/ClassLoader.java +++ b/jdk/src/java.base/share/classes/java/lang/ClassLoader.java @@ -31,7 +31,6 @@ import java.io.UncheckedIOException; import java.io.File; import java.lang.reflect.Constructor; import java.lang.reflect.Field; -import java.lang.reflect.Module; import java.net.URL; import java.security.AccessController; import java.security.AccessControlContext; @@ -115,7 +114,7 @@ import sun.security.util.SecurityConstants; * duration of the class loading process (see {@link #loadClass * loadClass} methods). * - *

        Run-time Built-in Class Loaders

        + *

        Run-time Built-in Class Loaders

        * * The Java run-time has the following built-in class loaders: * @@ -184,7 +183,7 @@ import sun.security.util.SecurityConstants; * } *
    * - *

    Binary names

    + *

    Binary names

    * *

    Any class name provided as a {@code String} parameter to methods in * {@code ClassLoader} must be a binary name as defined by @@ -207,6 +206,8 @@ import sun.security.util.SecurityConstants; * @jls 13.1 The Form of a Binary * @see #resolveClass(Class) * @since 1.0 + * @revised 9 + * @spec JPMS */ public abstract class ClassLoader { @@ -350,9 +351,7 @@ public abstract class ClassLoader { private ClassLoader(Void unused, String name, ClassLoader parent) { this.name = name; this.parent = parent; - this.unnamedModule - = SharedSecrets.getJavaLangReflectModuleAccess() - .defineUnnamedModule(this); + this.unnamedModule = new Module(this); if (ParallelLoaders.isRegistered(this.getClass())) { parallelLockMap = new ConcurrentHashMap<>(); package2certs = new ConcurrentHashMap<>(); @@ -380,12 +379,12 @@ public abstract class ClassLoader { * method doesn't allow creation of a new class loader. * * @since 9 + * @spec JPMS */ protected ClassLoader(String name, ClassLoader parent) { this(checkCreateClassLoader(name), name, parent); } - /** * Creates a new class loader using the specified parent class loader for * delegation. @@ -440,6 +439,7 @@ public abstract class ClassLoader { * this class loader is not named. * * @since 9 + * @spec JPMS */ public String getName() { return name; @@ -710,6 +710,7 @@ public abstract class ClassLoader { * if the class could not be found. * * @since 9 + * @spec JPMS */ protected Class findClass(String moduleName, String name) { if (moduleName == null) { @@ -834,6 +835,8 @@ public abstract class ClassLoader { * @see java.security.SecureClassLoader * * @since 1.1 + * @revised 9 + * @spec JPMS */ protected final Class defineClass(String name, byte[] b, int off, int len) throws ClassFormatError @@ -967,6 +970,9 @@ public abstract class ClassLoader { * certificates than this class, or if {@code name} begins with * "{@code java.}" and this class loader is not the platform * class loader or its ancestor. + * + * @revised 9 + * @spec JPMS */ protected final Class defineClass(String name, byte[] b, int off, int len, ProtectionDomain protectionDomain) @@ -974,7 +980,7 @@ public abstract class ClassLoader { { protectionDomain = preDefineClass(name, protectionDomain); String source = defineClassSourceLocation(protectionDomain); - Class c = defineClass1(name, b, off, len, protectionDomain, source); + Class c = defineClass1(this, name, b, off, len, protectionDomain, source); postDefineClass(c, protectionDomain); return c; } @@ -1041,6 +1047,8 @@ public abstract class ClassLoader { * @see #defineClass(String, byte[], int, int, ProtectionDomain) * * @since 1.5 + * @revised 9 + * @spec JPMS */ protected final Class defineClass(String name, java.nio.ByteBuffer b, ProtectionDomain protectionDomain) @@ -1064,17 +1072,17 @@ public abstract class ClassLoader { protectionDomain = preDefineClass(name, protectionDomain); String source = defineClassSourceLocation(protectionDomain); - Class c = defineClass2(name, b, b.position(), len, protectionDomain, source); + Class c = defineClass2(this, name, b, b.position(), len, protectionDomain, source); postDefineClass(c, protectionDomain); return c; } - private native Class defineClass1(String name, byte[] b, int off, int len, - ProtectionDomain pd, String source); + static native Class defineClass1(ClassLoader loader, String name, byte[] b, int off, int len, + ProtectionDomain pd, String source); - private native Class defineClass2(String name, java.nio.ByteBuffer b, - int off, int len, ProtectionDomain pd, - String source); + static native Class defineClass2(ClassLoader loader, String name, java.nio.ByteBuffer b, + int off, int len, ProtectionDomain pd, + String source); // true if the name is null or has the potential to be a valid binary name private boolean checkName(String name) { @@ -1264,11 +1272,11 @@ public abstract class ClassLoader { * Class loader implementations that support the loading from modules * should override this method. * - * @apiNote This method is the basis for the {@code Class} {@link - * Class#getResource getResource} and {@link Class#getResourceAsStream - * getResourceAsStream} methods. It is not subject to the rules for - * encapsulation specified by {@code Module} {@link - * Module#getResourceAsStream getResourceAsStream}. + * @apiNote This method is the basis for the {@link + * Class#getResource Class.getResource}, {@link Class#getResourceAsStream + * Class.getResourceAsStream}, and {@link Module#getResourceAsStream + * Module.getResourceAsStream} methods. It is not subject to the rules for + * encapsulation specified by {@code Module.getResourceAsStream}. * * @implSpec The default implementation attempts to find the resource by * invoking {@link #findResource(String)} when the {@code moduleName} is @@ -1292,6 +1300,7 @@ public abstract class ClassLoader { * * @see java.lang.module.ModuleReader#find(String) * @since 9 + * @spec JPMS */ protected URL findResource(String moduleName, String name) throws IOException { if (moduleName == null) { @@ -1342,6 +1351,8 @@ public abstract class ClassLoader { * @throws NullPointerException If {@code name} is {@code null} * * @since 1.1 + * @revised 9 + * @spec JPMS */ public URL getResource(String name) { Objects.requireNonNull(name); @@ -1403,6 +1414,8 @@ public abstract class ClassLoader { * @see #findResources(String) * * @since 1.2 + * @revised 9 + * @spec JPMS */ public Enumeration getResources(String name) throws IOException { Objects.requireNonNull(name); @@ -1499,6 +1512,8 @@ public abstract class ClassLoader { * denied by the security manager. * * @since 1.2 + * @revised 9 + * @spec JPMS */ protected URL findResource(String name) { return null; @@ -1531,6 +1546,8 @@ public abstract class ClassLoader { * If I/O errors occur * * @since 1.2 + * @revised 9 + * @spec JPMS */ protected Enumeration findResources(String name) throws IOException { return Collections.emptyEnumeration(); @@ -1601,6 +1618,8 @@ public abstract class ClassLoader { * denied by the security manager. * * @since 1.1 + * @revised 9 + * @spec JPMS */ public static URL getSystemResource(String name) { return getSystemClassLoader().getResource(name); @@ -1636,6 +1655,8 @@ public abstract class ClassLoader { * If I/O errors occur * * @since 1.2 + * @revised 9 + * @spec JPMS */ public static Enumeration getSystemResources(String name) throws IOException @@ -1667,6 +1688,8 @@ public abstract class ClassLoader { * @throws NullPointerException If {@code name} is {@code null} * * @since 1.1 + * @revised 9 + * @spec JPMS */ public InputStream getResourceAsStream(String name) { Objects.requireNonNull(name); @@ -1699,6 +1722,8 @@ public abstract class ClassLoader { * denied by the security manager. * * @since 1.1 + * @revised 9 + * @spec JPMS */ public static InputStream getSystemResourceAsStream(String name) { URL url = getSystemResource(name); @@ -1749,6 +1774,7 @@ public abstract class ClassLoader { * * @see Module#isNamed() * @since 9 + * @spec JPMS */ public final Module getUnnamedModule() { return unnamedModule; @@ -1772,6 +1798,7 @@ public abstract class ClassLoader { * {@link RuntimePermission}{@code ("getClassLoader")} * * @since 9 + * @spec JPMS */ @CallerSensitive public static ClassLoader getPlatformClassLoader() { @@ -1847,6 +1874,8 @@ public abstract class ClassLoader { * {@link Throwable#getCause()} method. * * @revised 1.4 + * @revised 9 + * @spec JPMS */ @CallerSensitive public static ClassLoader getSystemClassLoader() { @@ -2101,6 +2130,8 @@ public abstract class ClassLoader { * defined by this class loader * * @since 1.2 + * @revised 9 + * @spec JPMS * * @see * The JAR File Specification: Package Versioning @@ -2138,6 +2169,7 @@ public abstract class ClassLoader { * if {@code name} is {@code null}. * * @since 9 + * @spec JPMS */ public final Package getDefinedPackage(String name) { Objects.requireNonNull(name, "name cannot be null"); @@ -2160,6 +2192,7 @@ public abstract class ClassLoader { * or an zero length array if no package has been defined by this class loader. * * @since 9 + * @spec JPMS */ public final Package[] getDefinedPackages() { return packages().toArray(Package[]::new); @@ -2196,6 +2229,8 @@ public abstract class ClassLoader { * a {@code Package} for the specified class loader. * * @since 1.2 + * @revised 9 + * @spec JPMS */ @Deprecated(since="9") protected Package getPackage(String name) { @@ -2220,6 +2255,8 @@ public abstract class ClassLoader { * class loader and its ancestors * * @since 1.2 + * @revised 9 + * @spec JPMS */ protected Package[] getPackages() { Stream pkgs = packages(); @@ -2308,6 +2345,7 @@ public abstract class ClassLoader { this.isBuiltin = isBuiltin; } + @SuppressWarnings("deprecation") protected void finalize() { synchronized (loadedLibraryNames) { if (fromClass.getClassLoader() != null && loaded) { diff --git a/jdk/src/java.base/share/classes/java/lang/Comparable.java b/jdk/src/java.base/share/classes/java/lang/Comparable.java index ff8892caacf..f9be4c440ca 100644 --- a/jdk/src/java.base/share/classes/java/lang/Comparable.java +++ b/jdk/src/java.base/share/classes/java/lang/Comparable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ import java.util.*; * {(x, y) such that x.equals(y)}.

    * * This interface is a member of the - * + * * Java Collections Framework. * * @param the type of objects that this object may be compared to @@ -124,7 +124,7 @@ public interface Comparable { * {@code sgn(}expression{@code )} designates the mathematical * signum function, which is defined to return one of {@code -1}, * {@code 0}, or {@code 1} according to whether the value of - * expression is negative, zero or positive. + * expression is negative, zero, or positive, respectively. * * @param o the object to be compared. * @return a negative integer, zero, or a positive integer as this object diff --git a/jdk/src/java.base/share/classes/java/lang/Enum.java b/jdk/src/java.base/share/classes/java/lang/Enum.java index 9a98f30bbbd..ac912f5ca65 100644 --- a/jdk/src/java.base/share/classes/java/lang/Enum.java +++ b/jdk/src/java.base/share/classes/java/lang/Enum.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -243,6 +243,7 @@ public abstract class Enum> /** * enum classes cannot have finalize methods. */ + @SuppressWarnings("deprecation") protected final void finalize() { } /** diff --git a/jdk/src/java.base/share/classes/java/lang/IllegalCallerException.java b/jdk/src/java.base/share/classes/java/lang/IllegalCallerException.java new file mode 100644 index 00000000000..f882fb21591 --- /dev/null +++ b/jdk/src/java.base/share/classes/java/lang/IllegalCallerException.java @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute 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.lang; + +/** + * Thrown to indicate that a method has been called by an inappropriate caller. + * + * @since 9 + * @spec JPMS + * @see StackWalker#getCallerClass + */ +public class IllegalCallerException extends RuntimeException { + /** + * Constructs an IllegalCallerException with no detail message. + */ + public IllegalCallerException() { + super(); + } + + /** + * Constructs an IllegalCallerException with the specified detail + * message. + * + * @param s the String that contains a detailed message (can be null) + */ + public IllegalCallerException(String s) { + super(s); + } + + /** + * Constructs a new exception with the specified detail message and + * cause. + * + * @param message the detail message (can be null) + * @param cause the cause (can be null) + */ + public IllegalCallerException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Constructs a new exception with the specified cause and a detail + * message of {@code (cause==null ? null : cause.toString())} (which + * typically contains the class and detail message of {@code cause}). + * + * @param cause the cause (can be null) + */ + public IllegalCallerException(Throwable cause) { + super(cause); + } + + static final long serialVersionUID = -2349421918363102232L; +} diff --git a/jdk/src/java.base/share/classes/java/lang/Integer.java b/jdk/src/java.base/share/classes/java/lang/Integer.java index 8164b20d77e..685d77c8968 100644 --- a/jdk/src/java.base/share/classes/java/lang/Integer.java +++ b/jdk/src/java.base/share/classes/java/lang/Integer.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -386,7 +386,7 @@ public final class Integer extends Number implements Comparable { } /** byte[]/UTF16 version */ - static void formatUnsignedIntUTF16(int val, int shift, byte[] buf, int offset, int len) { + private static void formatUnsignedIntUTF16(int val, int shift, byte[] buf, int offset, int len) { int charPos = offset + len; int radix = 1 << shift; int mask = radix - 1; @@ -442,7 +442,7 @@ public final class Integer extends Number implements Comparable { return new String(buf, LATIN1); } else { byte[] buf = new byte[size * 2]; - getCharsUTF16(i, size, buf); + StringUTF16.getChars(i, size, buf); return new String(buf, UTF16); } } @@ -516,49 +516,6 @@ public final class Integer extends Number implements Comparable { return charPos; } - /** - * This is a variant of {@link #getChars(int, int, byte[])}, but for - * UTF-16 coder. - * - * @param i value to convert - * @param index next index, after the least significant digit - * @param buf target buffer, UTF16-coded. - * @return index of the most significant digit or minus sign, if present - */ - static int getCharsUTF16(int i, int index, byte[] buf) { - int q, r; - int charPos = index; - - boolean negative = (i < 0); - if (!negative) { - i = -i; - } - - // Get 2 digits/iteration using ints - while (i <= -100) { - q = i / 100; - r = (q * 100) - i; - i = q; - StringUTF16.putChar(buf, --charPos, DigitOnes[r]); - StringUTF16.putChar(buf, --charPos, DigitTens[r]); - } - - // We know there are at most two digits left at this point. - q = i / 10; - r = (q * 10) - i; - StringUTF16.putChar(buf, --charPos, '0' + r); - - // Whatever left is the remaining digit. - if (q < 0) { - StringUTF16.putChar(buf, --charPos, '0' - q); - } - - if (negative) { - StringUTF16.putChar(buf, --charPos, '-'); - } - return charPos; - } - // Left here for compatibility reasons, see JDK-8143900. static final int [] sizeTable = { 9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, Integer.MAX_VALUE }; diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java b/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java similarity index 92% rename from jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java rename to jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java index ff61c41590f..4c64fe071a8 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/LayerInstantiationException.java +++ b/jdk/src/java.base/share/classes/java/lang/LayerInstantiationException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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 java.lang.reflect; +package java.lang; /** - * Thrown when creating a Layer fails. - * - * @see Layer + * Thrown when creating a {@linkplain ModuleLayer module layer} fails. * + * @see ModuleLayer * @since 9 + * @spec JPMS */ public class LayerInstantiationException extends RuntimeException { private static final long serialVersionUID = -906239691613568347L; diff --git a/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java b/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java index 5be48729d5a..13dfa34be8f 100644 --- a/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java +++ b/jdk/src/java.base/share/classes/java/lang/LiveStackFrame.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,14 +55,36 @@ interface LiveStackFrame extends StackFrame { * *

    A single local variable can hold a value of type boolean, byte, char, * short, int, float, reference or returnAddress. A pair of local variables - * can hold a value of type long or double. In other words, - * a value of type long or type double occupies two consecutive local - * variables. For a value of primitive type, the element in the - * local variable array is an {@link PrimitiveValue} object; - * otherwise, the element is an {@code Object}. + * can hold a value of type long or double (JVMS section 2.6.1). Primitive + * locals are represented in the returned array as {@code PrimitiveSlot}s, + * with longs and doubles occupying a pair of consecutive + * {@code PrimitiveSlot}s. * - *

    The returned array may contain null entries if a local variable is not - * live. + *

    The current VM implementation does not provide specific type + * information for primitive locals. This method simply returns the raw + * contents of the VM's primitive locals on a best-effort basis, without + * indicating a specific type. + * + *

    The returned array may contain null entries for local variables that + * are not live. + * + * @implNote + *

    The specific subclass of {@code PrimitiveSlot} will reflect the + * underlying architecture, and will be either {@code PrimitiveSlot32} or + * {@code PrimitiveSlot64}. + * + *

    How a long or double value is stored in the pair of + * {@code PrimitiveSlot}s can vary based on the underlying architecture and + * VM implementation. On 32-bit architectures, long/double values are split + * between the two {@code PrimitiveSlot32}s. + * On 64-bit architectures, the entire value may be stored in one of the + * {@code PrimitiveSlot64}s, with the other {@code PrimitiveSlot64} being + * unused. + * + *

    The contents of the unused, high-order portion of a + * {@code PrimitiveSlot64} (when storing a primitive other than a long or + * double) is unspecified. In particular, the unused bits are not + * necessarily zeroed out. * * @return the local variable array of this stack frame. */ @@ -78,7 +100,7 @@ interface LiveStackFrame extends StackFrame { *

    Each entry on the operand stack can hold a value of any Java Virtual * Machine Type. * For a value of primitive type, the element in the returned array is - * an {@link PrimitiveValue} object; otherwise, the element is the {@code Object} + * a {@link PrimitiveSlot} object; otherwise, the element is the {@code Object} * on the operand stack. * * @return the operand stack of this stack frame. @@ -87,107 +109,37 @@ interface LiveStackFrame extends StackFrame { /** * UNSUPPORTED This interface is intended to be package-private - * or move to an internal package.

    + * or moved to an internal package.

    * - * Represents a local variable or an entry on the operand whose value is + * Represents a local variable or an entry on the operand stack whose value is * of primitive type. */ - public abstract class PrimitiveValue { + public abstract class PrimitiveSlot { /** - * Returns the base type of this primitive value, one of - * {@code B, D, C, F, I, J, S, Z}. - * - * @return Name of a base type - * @jvms table 4.3-A + * Returns the size, in bytes, of the slot. */ - abstract char type(); + public abstract int size(); /** - * Returns the boolean value if this primitive value is of type boolean. - * @return the boolean value if this primitive value is of type boolean. + * Returns the int value if this primitive value is of size 4 + * @return the int value if this primitive value is of size 4 * * @throws UnsupportedOperationException if this primitive value is not - * of type boolean. - */ - public boolean booleanValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); - } - - /** - * Returns the int value if this primitive value is of type int. - * @return the int value if this primitive value is of type int. - * - * @throws UnsupportedOperationException if this primitive value is not - * of type int. + * of size 4. */ public int intValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); + throw new UnsupportedOperationException("this " + size() + "-byte primitive"); } /** - * Returns the long value if this primitive value is of type long. - * @return the long value if this primitive value is of type long. + * Returns the long value if this primitive value is of size 8 + * @return the long value if this primitive value is of size 8 * * @throws UnsupportedOperationException if this primitive value is not - * of type long. + * of size 8. */ public long longValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); - } - - /** - * Returns the char value if this primitive value is of type char. - * @return the char value if this primitive value is of type char. - * - * @throws UnsupportedOperationException if this primitive value is not - * of type char. - */ - public char charValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); - } - - /** - * Returns the byte value if this primitive value is of type byte. - * @return the byte value if this primitive value is of type byte. - * - * @throws UnsupportedOperationException if this primitive value is not - * of type byte. - */ - public byte byteValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); - } - - /** - * Returns the short value if this primitive value is of type short. - * @return the short value if this primitive value is of type short. - * - * @throws UnsupportedOperationException if this primitive value is not - * of type short. - */ - public short shortValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); - } - - /** - * Returns the float value if this primitive value is of type float. - * @return the float value if this primitive value is of type float. - * - * @throws UnsupportedOperationException if this primitive value is not - * of type float. - */ - public float floatValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); - } - - /** - * Returns the double value if this primitive value is of type double. - * @return the double value if this primitive value is of type double. - * - * @throws UnsupportedOperationException if this primitive value is not - * of type double. - */ - public double doubleValue() { - throw new UnsupportedOperationException("this primitive of type " + type()); + throw new UnsupportedOperationException("this " + size() + "-byte primitive"); } } @@ -217,7 +169,7 @@ interface LiveStackFrame extends StackFrame { * it denies access to {@code RuntimePermission("liveStackFrames")}; or * or if the given {@code options} contains * {@link StackWalker.Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE} - * and it denies access to {@code StackFramePermission("retainClassReference")}. + * and it denies access to {@code RuntimePermission("getStackWalkerWithClassReference")}. */ public static StackWalker getStackWalker(Set options) { SecurityManager sm = System.getSecurityManager(); diff --git a/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java b/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java index db8901ea731..b6583adf559 100644 --- a/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java +++ b/jdk/src/java.base/share/classes/java/lang/LiveStackFrameInfo.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,15 +24,13 @@ */ package java.lang; -import java.lang.StackWalker.Option; -import java.util.EnumSet; -import java.util.Set; - -import static java.lang.StackWalker.ExtendedOption.*; - final class LiveStackFrameInfo extends StackFrameInfo implements LiveStackFrame { private static Object[] EMPTY_ARRAY = new Object[0]; + // These flags must match the values maintained in the VM + private static final int MODE_INTERPRETED = 0x01; + private static final int MODE_COMPILED = 0x02; + LiveStackFrameInfo(StackWalker walker) { super(walker); } @@ -41,6 +39,7 @@ final class LiveStackFrameInfo extends StackFrameInfo implements LiveStackFrame private Object[] monitors = EMPTY_ARRAY; private Object[] locals = EMPTY_ARRAY; private Object[] operands = EMPTY_ARRAY; + private int mode = 0; @Override public Object[] getMonitors() { @@ -57,51 +56,44 @@ final class LiveStackFrameInfo extends StackFrameInfo implements LiveStackFrame return operands; } + @Override + public String toString() { + StringBuilder retVal = new StringBuilder(super.toString()); + if (mode != 0) { + retVal.append("("); + if ((mode & MODE_INTERPRETED) == MODE_INTERPRETED) { + retVal.append(" interpreted "); + } + if ((mode & MODE_COMPILED) == MODE_COMPILED) { + retVal.append(" compiled "); + } + retVal.append(")"); + } + return retVal.toString(); + } + /* - * Convert primitive value to {@code Primitive} object to represent + * Convert primitive value to {@code PrimitiveSlot} object to represent * a local variable or an element on the operand stack of primitive type. */ - static PrimitiveValue asPrimitive(boolean value) { - return new BooleanPrimitive(value); + + static PrimitiveSlot asPrimitive(int value) { + return new PrimitiveSlot32(value); } - static PrimitiveValue asPrimitive(int value) { - return new IntPrimitive(value); + static PrimitiveSlot asPrimitive(long value) { + return new PrimitiveSlot64(value); } - static PrimitiveValue asPrimitive(short value) { - return new ShortPrimitive(value); - } - - static PrimitiveValue asPrimitive(char value) { - return new CharPrimitive(value); - } - - static PrimitiveValue asPrimitive(byte value) { - return new BytePrimitive(value); - } - - static PrimitiveValue asPrimitive(long value) { - return new LongPrimitive(value); - } - - static PrimitiveValue asPrimitive(float value) { - return new FloatPrimitive(value); - } - - static PrimitiveValue asPrimitive(double value) { - return new DoublePrimitive(value); - } - - private static class IntPrimitive extends PrimitiveValue { + private static class PrimitiveSlot32 extends PrimitiveSlot { final int value; - IntPrimitive(int value) { + PrimitiveSlot32(int value) { this.value = value; } @Override - public char type() { - return 'I'; + public int size() { + return 4; } @Override @@ -115,103 +107,15 @@ final class LiveStackFrameInfo extends StackFrameInfo implements LiveStackFrame } } - private static class ShortPrimitive extends PrimitiveValue { - final short value; - ShortPrimitive(short value) { - this.value = value; - } - - @Override - public char type() { - return 'S'; - } - - @Override - public short shortValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - private static class BooleanPrimitive extends PrimitiveValue { - final boolean value; - BooleanPrimitive(boolean value) { - this.value = value; - } - - @Override - public char type() { - return 'Z'; - } - - @Override - public boolean booleanValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - private static class CharPrimitive extends PrimitiveValue { - final char value; - CharPrimitive(char value) { - this.value = value; - } - - @Override - public char type() { - return 'C'; - } - - @Override - public char charValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - private static class BytePrimitive extends PrimitiveValue { - final byte value; - BytePrimitive(byte value) { - this.value = value; - } - - @Override - public char type() { - return 'B'; - } - - @Override - public byte byteValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - private static class LongPrimitive extends PrimitiveValue { + private static class PrimitiveSlot64 extends PrimitiveSlot { final long value; - LongPrimitive(long value) { + PrimitiveSlot64(long value) { this.value = value; } @Override - public char type() { - return 'J'; + public int size() { + return 8; } @Override @@ -224,48 +128,4 @@ final class LiveStackFrameInfo extends StackFrameInfo implements LiveStackFrame return String.valueOf(value); } } - - private static class FloatPrimitive extends PrimitiveValue { - final float value; - FloatPrimitive(float value) { - this.value = value; - } - - @Override - public char type() { - return 'F'; - } - - @Override - public float floatValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } - - private static class DoublePrimitive extends PrimitiveValue { - final double value; - DoublePrimitive(double value) { - this.value = value; - } - - @Override - public char type() { - return 'D'; - } - - @Override - public double doubleValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - } } diff --git a/jdk/src/java.base/share/classes/java/lang/Long.java b/jdk/src/java.base/share/classes/java/lang/Long.java index 103389c99fe..9d298cae439 100644 --- a/jdk/src/java.base/share/classes/java/lang/Long.java +++ b/jdk/src/java.base/share/classes/java/lang/Long.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -414,7 +414,7 @@ public final class Long extends Number implements Comparable { } /** byte[]/UTF16 version */ - static void formatUnsignedLong0UTF16(long val, int shift, byte[] buf, int offset, int len) { + private static void formatUnsignedLong0UTF16(long val, int shift, byte[] buf, int offset, int len) { int charPos = offset + len; int radix = 1 << shift; int mask = radix - 1; @@ -475,7 +475,7 @@ public final class Long extends Number implements Comparable { return new String(buf, LATIN1); } else { byte[] buf = new byte[size * 2]; - getCharsUTF16(i, size, buf); + StringUTF16.getChars(i, size, buf); return new String(buf, UTF16); } } @@ -561,61 +561,6 @@ public final class Long extends Number implements Comparable { return charPos; } - /** - * This is a variant of {@link #getChars(long, int, byte[])}, but for - * UTF-16 coder. - * - * @param i value to convert - * @param index next index, after the least significant digit - * @param buf target buffer, UTF16-coded. - * @return index of the most significant digit or minus sign, if present - */ - static int getCharsUTF16(long i, int index, byte[] buf) { - long q; - int r; - int charPos = index; - - boolean negative = (i < 0); - if (!negative) { - i = -i; - } - - // Get 2 digits/iteration using longs until quotient fits into an int - while (i <= Integer.MIN_VALUE) { - q = i / 100; - r = (int)((q * 100) - i); - i = q; - StringUTF16.putChar(buf, --charPos, Integer.DigitOnes[r]); - StringUTF16.putChar(buf, --charPos, Integer.DigitTens[r]); - } - - // Get 2 digits/iteration using ints - int q2; - int i2 = (int)i; - while (i2 <= -100) { - q2 = i2 / 100; - r = (q2 * 100) - i2; - i2 = q2; - StringUTF16.putChar(buf, --charPos, Integer.DigitOnes[r]); - StringUTF16.putChar(buf, --charPos, Integer.DigitTens[r]); - } - - // We know there are at most two digits left at this point. - q2 = i2 / 10; - r = (q2 * 10) - i2; - StringUTF16.putChar(buf, --charPos, '0' + r); - - // Whatever left is the remaining digit. - if (q2 < 0) { - StringUTF16.putChar(buf, --charPos, '0' - q2); - } - - if (negative) { - StringUTF16.putChar(buf, --charPos, '-'); - } - return charPos; - } - /** * Returns the string representation size for a given long value. * diff --git a/jdk/src/java.base/share/classes/java/lang/Math.java b/jdk/src/java.base/share/classes/java/lang/Math.java index 911267d5956..14093908c6e 100644 --- a/jdk/src/java.base/share/classes/java/lang/Math.java +++ b/jdk/src/java.base/share/classes/java/lang/Math.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1079,6 +1079,7 @@ public final class Math { * @param x the first value * @param y the second value * @return the result + * @since 9 */ public static long multiplyFull(int x, int y) { return (long)x * (long)y; @@ -1091,6 +1092,7 @@ public final class Math { * @param x the first value * @param y the second value * @return the result + * @since 9 */ public static long multiplyHigh(long x, long y) { if (x < 0 || y < 0) { @@ -1275,7 +1277,7 @@ public final class Math { } /** - * Returns the floor modulus of the {@code long} and {@int} arguments. + * Returns the floor modulus of the {@code long} and {@code int} arguments. *

    * The floor modulus is {@code x - (floorDiv(x, y) * y)}, * has the same sign as the divisor {@code y}, and @@ -1440,8 +1442,8 @@ public final class Math { } // Use raw bit-wise conversions on guaranteed non-NaN arguments. - private static long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f); - private static long negativeZeroDoubleBits = Double.doubleToRawLongBits(-0.0d); + private static final long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f); + private static final long negativeZeroDoubleBits = Double.doubleToRawLongBits(-0.0d); /** * Returns the greater of two {@code float} values. That is, diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java b/jdk/src/java.base/share/classes/java/lang/Module.java similarity index 76% rename from jdk/src/java.base/share/classes/java/lang/reflect/Module.java rename to jdk/src/java.base/share/classes/java/lang/Module.java index 5134b64caf8..26337d86beb 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Module.java +++ b/jdk/src/java.base/share/classes/java/lang/Module.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ * questions. */ -package java.lang.reflect; +package java.lang; import java.io.IOException; import java.io.InputStream; @@ -35,6 +35,7 @@ import java.lang.module.ModuleDescriptor.Exports; import java.lang.module.ModuleDescriptor.Opens; import java.lang.module.ModuleDescriptor.Version; import java.lang.module.ResolvedModule; +import java.lang.reflect.AnnotatedElement; import java.net.URI; import java.net.URL; import java.security.AccessController; @@ -42,21 +43,22 @@ import java.security.PrivilegedAction; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Objects; import java.util.Optional; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; +import java.util.stream.Collectors; import java.util.stream.Stream; import jdk.internal.loader.BuiltinClassLoader; import jdk.internal.loader.BootLoader; -import jdk.internal.loader.ResourceHelper; import jdk.internal.misc.JavaLangAccess; -import jdk.internal.misc.JavaLangReflectModuleAccess; import jdk.internal.misc.SharedSecrets; import jdk.internal.module.ServicesCatalog; +import jdk.internal.module.Resources; import jdk.internal.org.objectweb.asm.AnnotationVisitor; import jdk.internal.org.objectweb.asm.Attribute; import jdk.internal.org.objectweb.asm.ClassReader; @@ -72,18 +74,17 @@ import sun.security.util.SecurityConstants; * *

    Named modules have a {@link #getName() name} and are constructed by the * Java Virtual Machine when a graph of modules is defined to the Java virtual - * machine to create a module {@link Layer Layer}.

    + * machine to create a {@linkplain ModuleLayer module layer}.

    * - *

    An unnamed module does not have a name. There is an unnamed module - * per {@link ClassLoader ClassLoader} that is obtained by invoking the class - * loader's {@link ClassLoader#getUnnamedModule() getUnnamedModule} method. The - * {@link Class#getModule() getModule} method of all types defined by a class - * loader that are not in a named module return the class loader's unnamed + *

    An unnamed module does not have a name. There is an unnamed module for + * each {@link ClassLoader ClassLoader}, obtained by invoking its {@link + * ClassLoader#getUnnamedModule() getUnnamedModule} method. All types that are + * not in a named module are members of their defining class loader's unnamed * module.

    * *

    The package names that are parameters or returned by methods defined in * this class are the fully-qualified names of the packages as defined in - * section 6.5.3 of The Java™ Language Specification , for + * section 6.5.3 of The Java™ Language Specification, for * example, {@code "java.lang"}.

    * *

    Unless otherwise specified, passing a {@code null} argument to a method @@ -91,13 +92,14 @@ import sun.security.util.SecurityConstants; * be thrown.

    * * @since 9 - * @see java.lang.Class#getModule + * @spec JPMS + * @see Class#getModule() */ public final class Module implements AnnotatedElement { // the layer that contains this module, can be null - private final Layer layer; + private final ModuleLayer layer; // module name and loader, these fields are read by VM private final String name; @@ -112,10 +114,10 @@ public final class Module implements AnnotatedElement { * VM but will not read any other modules, will not have any exports setup * and will not be registered in the service catalog. */ - private Module(Layer layer, - ClassLoader loader, - ModuleDescriptor descriptor, - URI uri) + Module(ModuleLayer layer, + ClassLoader loader, + ModuleDescriptor descriptor, + URI uri) { this.layer = layer; this.name = descriptor.name(); @@ -138,7 +140,7 @@ public final class Module implements AnnotatedElement { * * @see ClassLoader#getUnnamedModule */ - private Module(ClassLoader loader) { + Module(ClassLoader loader) { this.layer = null; this.name = null; this.loader = loader; @@ -216,29 +218,28 @@ public final class Module implements AnnotatedElement { * Returns the layer that contains this module or {@code null} if this * module is not in a layer. * - * A module {@code Layer} contains named modules and therefore this - * method always returns {@code null} when invoked on an unnamed module. + * A module layer contains named modules and therefore this method always + * returns {@code null} when invoked on an unnamed module. * - *

    Dynamic modules are named - * modules that are generated at runtime. A dynamic module may or may - * not be in a module Layer.

    + *

    Dynamic modules are + * named modules that are generated at runtime. A dynamic module may or may + * not be in a module layer.

    * - * @return The layer that contains this module + * @return The module layer that contains this module * - * @see Proxy + * @see java.lang.reflect.Proxy */ - public Layer getLayer() { + public ModuleLayer getLayer() { if (isNamed()) { - Layer layer = this.layer; + ModuleLayer layer = this.layer; if (layer != null) return layer; - // special-case java.base as it is created before the boot Layer + // special-case java.base as it is created before the boot layer if (loader == null && name.equals("java.base")) { - return SharedSecrets.getJavaLangAccess().getBootLayer(); + return ModuleLayer.boot(); } } - return null; } @@ -327,8 +328,9 @@ public final class Module implements AnnotatedElement { * * @return this module * - * @throws IllegalStateException - * If this is a named module and the caller is not this module + * @throws IllegalCallerException + * If this is a named module and the caller's module is not this + * module * * @see #canRead */ @@ -336,9 +338,9 @@ public final class Module implements AnnotatedElement { public Module addReads(Module other) { Objects.requireNonNull(other); if (this.isNamed()) { - Module caller = Reflection.getCallerClass().getModule(); + Module caller = getCallerModule(Reflection.getCallerClass()); if (caller != this) { - throw new IllegalStateException(caller + " != " + this); + throw new IllegalCallerException(caller + " != " + this); } implAddReads(other, true); } @@ -348,12 +350,21 @@ public final class Module implements AnnotatedElement { /** * Updates this module to read another module. * - * @apiNote This method is for Proxy use and white-box testing. + * @apiNote Used by the --add-reads command line option. */ void implAddReads(Module other) { implAddReads(other, true); } + /** + * Updates this module to read all unnamed modules. + * + * @apiNote Used by the --add-reads command line option. + */ + void implAddReadsAllUnnamed() { + implAddReads(Module.ALL_UNNAMED_MODULE, true); + } + /** * Updates this module to read another module without notifying the VM. * @@ -370,27 +381,19 @@ public final class Module implements AnnotatedElement { */ private void implAddReads(Module other, boolean syncVM) { Objects.requireNonNull(other); - - // nothing to do - if (other == this || !this.isNamed()) - return; - - // check if we already read this module - Set reads = this.reads; - if (reads != null && reads.contains(other)) - return; - - // update VM first, just in case it fails - if (syncVM) { - if (other == ALL_UNNAMED_MODULE) { - addReads0(this, null); - } else { - addReads0(this, other); + if (!canRead(other)) { + // update VM first, just in case it fails + if (syncVM) { + if (other == ALL_UNNAMED_MODULE) { + addReads0(this, null); + } else { + addReads0(this, other); + } } - } - // add reflective read - reflectivelyReads.putIfAbsent(this, other, Boolean.TRUE); + // add reflective read + reflectivelyReads.putIfAbsent(this, other, Boolean.TRUE); + } } @@ -533,8 +536,8 @@ public final class Module implements AnnotatedElement { if (other == this && containsPackage(pn)) return true; - // all packages in open modules are open - if (descriptor.isOpen()) + // all packages in open and automatic modules are open + if (descriptor.isOpen() || descriptor.isAutomatic()) return containsPackage(pn); // exported/opened via module declaration/descriptor @@ -553,7 +556,7 @@ public final class Module implements AnnotatedElement { * Returns {@code true} if this module exports or opens a package to * the given module via its module declaration. */ - boolean isStaticallyExportedOrOpen(String pn, Module other, boolean open) { + private boolean isStaticallyExportedOrOpen(String pn, Module other, boolean open) { // package is open to everyone or Map> openPackages = this.openPackages; if (openPackages != null) { @@ -634,8 +637,7 @@ public final class Module implements AnnotatedElement { * the given package to the given module. * *

    This method has no effect if the package is already exported (or - * open) to the given module. It also has no effect if - * invoked on an {@link ModuleDescriptor#isOpen open} module.

    + * open) to the given module.

    * * @apiNote As specified in section 5.4.3 of the The Java™ * Virtual Machine Specification , if an attempt to resolve a @@ -653,8 +655,9 @@ public final class Module implements AnnotatedElement { * @throws IllegalArgumentException * If {@code pn} is {@code null}, or this is a named module and the * package {@code pn} is not a package in this module - * @throws IllegalStateException - * If this is a named module and the caller is not this module + * @throws IllegalCallerException + * If this is a named module and the caller's module is not this + * module * * @jvms 5.4.3 Resolution * @see #isExported(String,Module) @@ -665,10 +668,10 @@ public final class Module implements AnnotatedElement { throw new IllegalArgumentException("package is null"); Objects.requireNonNull(other); - if (isNamed() && !descriptor.isOpen()) { - Module caller = Reflection.getCallerClass().getModule(); + if (isNamed()) { + Module caller = getCallerModule(Reflection.getCallerClass()); if (caller != this) { - throw new IllegalStateException(caller + " != " + this); + throw new IllegalCallerException(caller + " != " + this); } implAddExportsOrOpens(pn, other, /*open*/false, /*syncVM*/true); } @@ -686,8 +689,7 @@ public final class Module implements AnnotatedElement { * access control checks. * *

    This method has no effect if the package is already open - * to the given module. It also has no effect if invoked on an {@link - * ModuleDescriptor#isOpen open} module.

    + * to the given module.

    * * @param pn * The package name @@ -699,9 +701,9 @@ public final class Module implements AnnotatedElement { * @throws IllegalArgumentException * If {@code pn} is {@code null}, or this is a named module and the * package {@code pn} is not a package in this module - * @throws IllegalStateException + * @throws IllegalCallerException * If this is a named module and this module has not opened the - * package to at least the caller + * package to at least the caller's module * * @see #isOpen(String,Module) * @see AccessibleObject#setAccessible(boolean) @@ -713,10 +715,10 @@ public final class Module implements AnnotatedElement { throw new IllegalArgumentException("package is null"); Objects.requireNonNull(other); - if (isNamed() && !descriptor.isOpen()) { - Module caller = Reflection.getCallerClass().getModule(); - if (caller != this && !isOpen(pn, caller)) - throw new IllegalStateException(pn + " is not open to " + caller); + if (isNamed()) { + Module caller = getCallerModule(Reflection.getCallerClass()); + if (caller != this && (caller == null || !isOpen(pn, caller))) + throw new IllegalCallerException(pn + " is not open to " + caller); implAddExportsOrOpens(pn, other, /*open*/true, /*syncVM*/true); } @@ -725,36 +727,80 @@ public final class Module implements AnnotatedElement { /** - * Updates the exports so that package {@code pn} is exported to module - * {@code other} but without notifying the VM. + * Updates this module to export a package unconditionally. * - * @apiNote This method is for VM white-box testing. + * @apiNote This method is for JDK tests only. */ - void implAddExportsNoSync(String pn, Module other) { - if (other == null) - other = EVERYONE_MODULE; - implAddExportsOrOpens(pn.replace('/', '.'), other, false, false); + void implAddExports(String pn) { + implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, false, true); } /** - * Updates the exports so that package {@code pn} is exported to module - * {@code other}. + * Updates this module to export a package to another module. * - * @apiNote This method is for white-box testing. + * @apiNote Used by Instrumentation::redefineModule and --add-exports */ void implAddExports(String pn, Module other) { implAddExportsOrOpens(pn, other, false, true); } /** - * Updates the module to open package {@code pn} to module {@code other}. + * Updates this module to export a package to all unnamed modules. * - * @apiNote This method is for white-box tests and jtreg + * @apiNote Used by the --add-exports command line option. + */ + void implAddExportsToAllUnnamed(String pn) { + implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, false, true); + } + + /** + * Updates this export to export a package unconditionally without + * notifying the VM. + * + * @apiNote This method is for VM white-box testing. + */ + void implAddExportsNoSync(String pn) { + implAddExportsOrOpens(pn.replace('/', '.'), Module.EVERYONE_MODULE, false, false); + } + + /** + * Updates a module to export a package to another module without + * notifying the VM. + * + * @apiNote This method is for VM white-box testing. + */ + void implAddExportsNoSync(String pn, Module other) { + implAddExportsOrOpens(pn.replace('/', '.'), other, false, false); + } + + /** + * Updates this module to open a package unconditionally. + * + * @apiNote This method is for JDK tests only. + */ + void implAddOpens(String pn) { + implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, true, true); + } + + /** + * Updates this module to open a package to another module. + * + * @apiNote Used by Instrumentation::redefineModule and --add-opens */ void implAddOpens(String pn, Module other) { implAddExportsOrOpens(pn, other, true, true); } + /** + * Updates this module to export a package to all unnamed modules. + * + * @apiNote Used by the --add-opens command line option. + */ + void implAddOpensToAllUnnamed(String pn) { + implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, true, true); + } + + /** * Updates a module to export or open a module to another module. * @@ -767,8 +813,8 @@ public final class Module implements AnnotatedElement { Objects.requireNonNull(other); Objects.requireNonNull(pn); - // all packages are open in unnamed and open modules - if (!isNamed() || descriptor.isOpen()) + // all packages are open in unnamed, open, and automatic modules + if (!isNamed() || descriptor.isOpen() || descriptor.isAutomatic()) return; // nothing to do if already exported/open to other @@ -819,17 +865,17 @@ public final class Module implements AnnotatedElement { * passed a reference to the service type by other code. This method is * a no-op when invoked on an unnamed module or an automatic module. * - *

    This method does not cause {@link - * Configuration#resolveRequiresAndUses resolveRequiresAndUses} to be - * re-run.

    + *

    This method does not cause {@link Configuration#resolveAndBind + * resolveAndBind} to be re-run.

    * * @param service * The service type * * @return this module * - * @throws IllegalStateException - * If this is a named module and the caller is not this module + * @throws IllegalCallerException + * If this is a named module and the caller's module is not this + * module * * @see #canUse(Class) * @see ModuleDescriptor#uses() @@ -839,9 +885,9 @@ public final class Module implements AnnotatedElement { Objects.requireNonNull(service); if (isNamed() && !descriptor.isAutomatic()) { - Module caller = Reflection.getCallerClass().getModule(); + Module caller = getCallerModule(Reflection.getCallerClass()); if (caller != this) { - throw new IllegalStateException(caller + " != " + this); + throw new IllegalCallerException(caller + " != " + this); } implAddUses(service); } @@ -894,49 +940,41 @@ public final class Module implements AnnotatedElement { // -- packages -- // Additional packages that are added to the module at run-time. - // The field is volatile as it may be replaced at run-time - private volatile Set extraPackages; + private volatile Map extraPackages; private boolean containsPackage(String pn) { if (descriptor.packages().contains(pn)) return true; - Set extraPackages = this.extraPackages; - if (extraPackages != null && extraPackages.contains(pn)) + Map extraPackages = this.extraPackages; + if (extraPackages != null && extraPackages.containsKey(pn)) return true; return false; } /** - * Returns an array of the package names of the packages in this module. + * Returns the set of package names for the packages in this module. * - *

    For named modules, the returned array contains an element for each - * package in the module. It may contain elements corresponding to packages - * added to the module, dynamic modules - * for example, after it was loaded. + *

    For named modules, the returned set contains an element for each + * package in the module.

    * - *

    For unnamed modules, this method is the equivalent of invoking the + *

    For unnamed modules, this method is the equivalent to invoking the * {@link ClassLoader#getDefinedPackages() getDefinedPackages} method of - * this module's class loader and returning the array of package names.

    + * this module's class loader and returning the set of package names.

    * - *

    A package name appears at most once in the returned array.

    - * - * @apiNote This method returns an array rather than a {@code Set} for - * consistency with other {@code java.lang.reflect} types. - * - * @return an array of the package names of the packages in this module + * @return the set of the package names of the packages in this module */ - public String[] getPackages() { + public Set getPackages() { if (isNamed()) { Set packages = descriptor.packages(); - Set extraPackages = this.extraPackages; + Map extraPackages = this.extraPackages; if (extraPackages == null) { - return packages.toArray(new String[0]); + return packages; } else { return Stream.concat(packages.stream(), - extraPackages.stream()) - .toArray(String[]::new); + extraPackages.keySet().stream()) + .collect(Collectors.toSet()); } } else { @@ -947,23 +985,10 @@ public final class Module implements AnnotatedElement { } else { packages = SharedSecrets.getJavaLangAccess().packages(loader); } - return packages.map(Package::getName).toArray(String[]::new); + return packages.map(Package::getName).collect(Collectors.toSet()); } } - /** - * Add a package to this module. - * - * @apiNote This method is for Proxy use. - * - * @apiNote This is an expensive operation, not expected to be used often. - * At this time then it does not validate that the package name is a - * valid java identifier. - */ - void addPackage(String pn) { - implAddPackage(pn, true); - } - /** * Add a package to this module without notifying the VM. * @@ -976,49 +1001,52 @@ public final class Module implements AnnotatedElement { /** * Add a package to this module. * - * If {@code syncVM} is {@code true} then the VM is notified. + * If {@code syncVM} is {@code true} then the VM is notified. This method is + * a no-op if this is an unnamed module or the module already contains the + * package. + * + * @throws IllegalArgumentException if the package name is not legal + * @throws IllegalStateException if the package is defined to another module */ private void implAddPackage(String pn, boolean syncVM) { + // no-op if unnamed module if (!isNamed()) - throw new InternalError("adding package to unnamed module?"); - if (descriptor.isOpen()) - throw new InternalError("adding package to open module?"); + return; + + // no-op if module contains the package + if (containsPackage(pn)) + return; + + // check package name is legal for named modules if (pn.isEmpty()) - throw new InternalError("adding package to module?"); - - if (descriptor.packages().contains(pn)) { - // already in module - return; - } - - Set extraPackages = this.extraPackages; - if (extraPackages != null && extraPackages.contains(pn)) { - // already added - return; - } - synchronized (this) { - // recheck under lock - extraPackages = this.extraPackages; - if (extraPackages != null) { - if (extraPackages.contains(pn)) { - // already added - return; - } - - // copy the set - extraPackages = new HashSet<>(extraPackages); - extraPackages.add(pn); - } else { - extraPackages = Collections.singleton(pn); + throw new IllegalArgumentException("Cannot add package"); + for (int i=0; i extraPackages = this.extraPackages; + if (extraPackages == null) { + synchronized (this) { + extraPackages = this.extraPackages; + if (extraPackages == null) + this.extraPackages = extraPackages = new ConcurrentHashMap<>(); + } + } + + // update VM first in case it fails. This is a no-op if another thread + // beats us to add the package first + if (syncVM) { + // throws IllegalStateException if defined to another module + addPackage0(this, pn); + if (descriptor.isOpen() || descriptor.isAutomatic()) { + addExportsToAll0(this, pn); + } + } + extraPackages.putIfAbsent(pn, Boolean.TRUE); } @@ -1034,12 +1062,12 @@ public final class Module implements AnnotatedElement { */ static Map defineModules(Configuration cf, Function clf, - Layer layer) + ModuleLayer layer) { Map nameToModule = new HashMap<>(); Map moduleToLoader = new HashMap<>(); - boolean isBootLayer = (Layer.boot() == null); + boolean isBootLayer = (ModuleLayer.boot() == null); Set loaders = new HashSet<>(); // map each module to a class loader @@ -1083,20 +1111,28 @@ public final class Module implements AnnotatedElement { // reads Set reads = new HashSet<>(); + + // name -> source Module when in parent layer + Map nameToSource = Collections.emptyMap(); + for (ResolvedModule other : resolvedModule.reads()) { Module m2 = null; if (other.configuration() == cf) { - String dn = other.reference().descriptor().name(); - m2 = nameToModule.get(dn); + // this configuration + m2 = nameToModule.get(other.name()); + assert m2 != null; } else { - for (Layer parent: layer.parents()) { + // parent layer + for (ModuleLayer parent: layer.parents()) { m2 = findModule(parent, other); if (m2 != null) break; } + assert m2 != null; + if (nameToSource.isEmpty()) + nameToSource = new HashMap<>(); + nameToSource.put(other.name(), m2); } - assert m2 != null; - reads.add(m2); // update VM view @@ -1110,7 +1146,7 @@ public final class Module implements AnnotatedElement { } // exports and opens - initExportsAndOpens(descriptor, nameToModule, m); + initExportsAndOpens(m, nameToSource, nameToModule, layer.parents()); } // register the modules in the boot layer @@ -1146,7 +1182,8 @@ public final class Module implements AnnotatedElement { * Find the runtime Module corresponding to the given ResolvedModule * in the given parent layer (or its parents). */ - private static Module findModule(Layer parent, ResolvedModule resolvedModule) { + private static Module findModule(ModuleLayer parent, + ResolvedModule resolvedModule) { Configuration cf = resolvedModule.configuration(); String dn = resolvedModule.name(); return parent.layers() @@ -1162,15 +1199,18 @@ public final class Module implements AnnotatedElement { .orElse(null); } + /** * Initialize the maps of exported and open packages for module m. */ - private static void initExportsAndOpens(ModuleDescriptor descriptor, + private static void initExportsAndOpens(Module m, + Map nameToSource, Map nameToModule, - Module m) - { - // The VM doesn't know about open modules so need to export all packages - if (descriptor.isOpen()) { + List parents) { + // The VM doesn't special case open or automatic modules so need to + // export all packages + ModuleDescriptor descriptor = m.getDescriptor(); + if (descriptor.isOpen() || descriptor.isAutomatic()) { assert descriptor.opens().isEmpty(); for (String source : descriptor.packages()) { addExportsToAll0(m, source); @@ -1189,8 +1229,7 @@ public final class Module implements AnnotatedElement { // qualified opens Set targets = new HashSet<>(); for (String target : opens.targets()) { - // only open to modules that are in this configuration - Module m2 = nameToModule.get(target); + Module m2 = findModule(target, nameToSource, nameToModule, parents); if (m2 != null) { addExports0(m, source, m2); targets.add(m2); @@ -1219,8 +1258,7 @@ public final class Module implements AnnotatedElement { // qualified exports Set targets = new HashSet<>(); for (String target : exports.targets()) { - // only export to modules that are in this configuration - Module m2 = nameToModule.get(target); + Module m2 = findModule(target, nameToSource, nameToModule, parents); if (m2 != null) { // skip qualified export if already open to m2 if (openToTargets == null || !openToTargets.contains(m2)) { @@ -1246,6 +1284,32 @@ public final class Module implements AnnotatedElement { m.exportedPackages = exportedPackages; } + /** + * Find the runtime Module with the given name. The module name is the + * name of a target module in a qualified exports or opens directive. + * + * @param target The target module to find + * @param nameToSource The modules in parent layers that are read + * @param nameToModule The modules in the layer under construction + * @param parents The parent layers + */ + private static Module findModule(String target, + Map nameToSource, + Map nameToModule, + List parents) { + Module m = nameToSource.get(target); + if (m == null) { + m = nameToModule.get(target); + if (m == null) { + for (ModuleLayer parent : parents) { + m = parent.findModule(target).orElse(null); + if (m != null) break; + } + } + } + return m; + } + // -- annotations -- @@ -1375,35 +1439,44 @@ public final class Module implements AnnotatedElement { /** - * Returns an input stream for reading a resource in this module. The - * {@code name} parameter is a {@code '/'}-separated path name that - * identifies the resource. + * Returns an input stream for reading a resource in this module. + * The {@code name} parameter is a {@code '/'}-separated path name that + * identifies the resource. As with {@link Class#getResourceAsStream + * Class.getResourceAsStream}, this method delegates to the module's class + * loader {@link ClassLoader#findResource(String,String) + * findResource(String,String)} method, invoking it with the module name + * (or {@code null} when the module is unnamed) and the name of the + * resource. If the resource name has a leading slash then it is dropped + * before delegation. * - *

    A resource in a named modules may be encapsulated so that + *

    A resource in a named module may be encapsulated so that * it cannot be located by code in other modules. Whether a resource can be - * located or not is determined as follows: + * located or not is determined as follows:

    * *
      - *
    • The package name of the resource is derived from the - * subsequence of characters that precedes the last {@code '/'} and then - * replacing each {@code '/'} character in the subsequence with - * {@code '.'}. For example, the package name derived for a resource - * named "{@code a/b/c/foo.properties}" is "{@code a.b.c}".
    • + *
    • If the resource name ends with "{@code .class}" then it is not + * encapsulated.
    • * - *
    • If the package name is a package in the module then the package - * must be {@link #isOpen open} the module of the caller of this method. - * If the package is not in the module then the resource is not - * encapsulated. Resources in the unnamed package or "{@code META-INF}", - * for example, are never encapsulated because they can never be - * packages in a named module.
    • - * - *
    • As a special case, resources ending with "{@code .class}" are - * never encapsulated.
    • + *
    • A package name is derived from the resource name. If + * the package name is a {@link #getPackages() package} in the module + * then the resource can only be located by the caller of this method + * when the package is {@link #isOpen(String,Module) open} to at least + * the caller's module. If the resource is not in a package in the module + * then the resource is not encapsulated.
    • *
    * + *

    In the above, the package name for a resource is derived + * from the subsequence of characters that precedes the last {@code '/'} in + * the name and then replacing each {@code '/'} character in the subsequence + * with {@code '.'}. A leading slash is ignored when deriving the package + * name. As an example, the package name derived for a resource named + * "{@code a/b/c/foo.properties}" is "{@code a.b.c}". A resource name + * with the name "{@code META-INF/MANIFEST.MF}" is never encapsulated + * because "{@code META-INF}" is not a legal package name.

    + * *

    This method returns {@code null} if the resource is not in this * module, the resource is encapsulated and cannot be located by the caller, - * or access to the resource is denied by the security manager. + * or access to the resource is denied by the security manager.

    * * @param name * The resource name @@ -1413,21 +1486,27 @@ public final class Module implements AnnotatedElement { * @throws IOException * If an I/O error occurs * - * @see java.lang.module.ModuleReader#open(String) + * @see Class#getResourceAsStream(String) */ @CallerSensitive public InputStream getResourceAsStream(String name) throws IOException { - Objects.requireNonNull(name); + if (name.startsWith("/")) { + name = name.substring(1); + } - if (isNamed() && !ResourceHelper.isSimpleResource(name)) { - Module caller = Reflection.getCallerClass().getModule(); + if (isNamed() && Resources.canEncapsulate(name)) { + Module caller = getCallerModule(Reflection.getCallerClass()); if (caller != this && caller != Object.class.getModule()) { - // ignore packages added for proxies via addPackage - Set packages = getDescriptor().packages(); - String pn = ResourceHelper.getPackageName(name); - if (packages.contains(pn) && !isOpen(pn, caller)) { - // resource is in package not open to caller - return null; + String pn = Resources.toPackageName(name); + if (getPackages().contains(pn)) { + if (caller == null && !isOpen(pn)) { + // no caller, package not open + return null; + } + if (!isOpen(pn, caller)) { + // package not open to caller + return null; + } } } } @@ -1472,6 +1551,14 @@ public final class Module implements AnnotatedElement { } } + /** + * Returns the module that a given caller class is a member of. Returns + * {@code null} if the caller is {@code null}. + */ + private Module getCallerModule(Class caller) { + return (caller != null) ? caller.getModule() : null; + } + // -- native methods -- @@ -1496,79 +1583,4 @@ public final class Module implements AnnotatedElement { // JVM_AddModulePackage private static native void addPackage0(Module m, String pn); - - /** - * Register shared secret to provide access to package-private methods - */ - static { - SharedSecrets.setJavaLangReflectModuleAccess( - new JavaLangReflectModuleAccess() { - @Override - public Module defineUnnamedModule(ClassLoader loader) { - return new Module(loader); - } - @Override - public Module defineModule(ClassLoader loader, - ModuleDescriptor descriptor, - URI uri) { - return new Module(null, loader, descriptor, uri); - } - @Override - public void addReads(Module m1, Module m2) { - m1.implAddReads(m2, true); - } - @Override - public void addReadsAllUnnamed(Module m) { - m.implAddReads(Module.ALL_UNNAMED_MODULE); - } - @Override - public void addExports(Module m, String pn, Module other) { - m.implAddExportsOrOpens(pn, other, false, true); - } - @Override - public void addOpens(Module m, String pn, Module other) { - m.implAddExportsOrOpens(pn, other, true, true); - } - @Override - public void addExportsToAll(Module m, String pn) { - m.implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, false, true); - } - @Override - public void addOpensToAll(Module m, String pn) { - m.implAddExportsOrOpens(pn, Module.EVERYONE_MODULE, true, true); - } - @Override - public void addExportsToAllUnnamed(Module m, String pn) { - m.implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, false, true); - } - @Override - public void addOpensToAllUnnamed(Module m, String pn) { - m.implAddExportsOrOpens(pn, Module.ALL_UNNAMED_MODULE, true, true); - } - @Override - public void addUses(Module m, Class service) { - m.implAddUses(service); - } - @Override - public void addPackage(Module m, String pn) { - m.implAddPackage(pn, true); - } - @Override - public ServicesCatalog getServicesCatalog(Layer layer) { - return layer.getServicesCatalog(); - } - @Override - public Stream layers(Layer layer) { - return layer.layers(); - } - @Override - public Stream layers(ClassLoader loader) { - return Layer.layers(loader); - } - @Override - public boolean isStaticallyExported(Module module, String pn, Module other) { - return module.isStaticallyExportedOrOpen(pn, other, false); - } - }); - } } diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java similarity index 76% rename from jdk/src/java.base/share/classes/java/lang/reflect/Layer.java rename to jdk/src/java.base/share/classes/java/lang/ModuleLayer.java index 9eaf90d0ca8..549662ff9c0 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Layer.java +++ b/jdk/src/java.base/share/classes/java/lang/ModuleLayer.java @@ -23,7 +23,7 @@ * questions. */ -package java.lang.reflect; +package java.lang; import java.lang.module.Configuration; import java.lang.module.ModuleDescriptor; @@ -47,8 +47,6 @@ import java.util.stream.Stream; import jdk.internal.loader.ClassLoaderValue; import jdk.internal.loader.Loader; import jdk.internal.loader.LoaderPool; -import jdk.internal.misc.SharedSecrets; -import jdk.internal.module.Modules; import jdk.internal.module.ServicesCatalog; import sun.security.util.SecurityConstants; @@ -56,32 +54,30 @@ import sun.security.util.SecurityConstants; /** * A layer of modules in the Java virtual machine. * - *

    A layer is created from a graph of modules that is the {@link - * Configuration} and a function that maps each module to a {@link ClassLoader}. + *

    A layer is created from a graph of modules in a {@link Configuration} + * and a function that maps each module to a {@link ClassLoader}. * Creating a layer informs the Java virtual machine about the classes that - * may be loaded from modules so that the Java virtual machine knows which - * module that each class is a member of. Each layer, except the {@link - * #empty() empty} layer, has at least one {@link #parents() parent}.

    + * may be loaded from the modules so that the Java virtual machine knows which + * module that each class is a member of.

    * *

    Creating a layer creates a {@link Module} object for each {@link * ResolvedModule} in the configuration. For each resolved module that is * {@link ResolvedModule#reads() read}, the {@code Module} {@link * Module#canRead reads} the corresponding run-time {@code Module}, which may - * be in the same layer or a parent layer. The {@code Module} {@link - * Module#isExported(String) exports} the packages described by its {@link - * ModuleDescriptor}.

    + * be in the same layer or a {@link #parents() parent} layer.

    * *

    The {@link #defineModulesWithOneLoader defineModulesWithOneLoader} and * {@link #defineModulesWithManyLoaders defineModulesWithManyLoaders} methods - * provide convenient ways to create a {@code Layer} where all modules are + * provide convenient ways to create a module layer where all modules are * mapped to a single class loader or where each module is mapped to its own * class loader. The {@link #defineModules defineModules} method is for more * advanced cases where modules are mapped to custom class loaders by means of * a function specified to the method. Each of these methods has an instance * and static variant. The instance methods create a layer with the receiver * as the parent layer. The static methods are for more advanced cases where - * there can be more than one parent layer or a {@link Layer.Controller - * Controller} is needed to control modules in the layer.

    + * there can be more than one parent layer or where a {@link + * ModuleLayer.Controller Controller} is needed to control modules in the layer + *

    * *

    A Java virtual machine has at least one non-empty layer, the {@link * #boot() boot} layer, that is created when the Java virtual machine is @@ -92,10 +88,31 @@ import sun.security.util.SecurityConstants; * built-in into the Java virtual machine. The boot layer will often be * the {@link #parents() parent} when creating additional layers.

    * + *

    Each {@code Module} in a layer is created so that it {@link + * Module#isExported(String) exports} and {@link Module#isOpen(String) opens} + * the packages described by its {@link ModuleDescriptor}. Qualified exports + * (where a package is exported to a set of target modules rather than all + * modules) are reified when creating the layer as follows:

    + *
      + *
    • If module {@code X} exports a package to {@code Y}, and if the + * runtime {@code Module} {@code X} reads {@code Module} {@code Y}, then + * the package is exported to {@code Module} {@code Y} (which may be in + * the same layer as {@code X} or a parent layer).
    • + * + *
    • If module {@code X} exports a package to {@code Y}, and if the + * runtime {@code Module} {@code X} does not read {@code Y} then target + * {@code Y} is located as if by invoking {@link #findModule(String) + * findModule} to find the module in the layer or its parent layers. If + * {@code Y} is found then the package is exported to the instance of + * {@code Y} that was found. If {@code Y} is not found then the qualified + * export is ignored.
    • + *
    + * + *

    Qualified opens are handled in same way as qualified exports.

    + * *

    As when creating a {@code Configuration}, - * {@link ModuleDescriptor#isAutomatic() automatic} modules receive - * special - * treatment when creating a layer. An automatic module is created in the + * {@link ModuleDescriptor#isAutomatic() automatic} modules receive special + * treatment when creating a layer. An automatic module is created in the * Java virtual machine as a {@code Module} that reads every unnamed {@code * Module} in the Java virtual machine.

    * @@ -113,43 +130,43 @@ import sun.security.util.SecurityConstants; *
    {@code
      *     ModuleFinder finder = ModuleFinder.of(dir1, dir2, dir3);
      *
    - *     Layer parent = Layer.boot();
    + *     ModuleLayer parent = ModuleLayer.boot();
      *
    - *     Configuration cf = parent.configuration()
    - *         .resolveRequires(finder, ModuleFinder.of(), Set.of("myapp"));
    + *     Configuration cf = parent.configuration().resolve(finder, ModuleFinder.of(), Set.of("myapp"));
      *
      *     ClassLoader scl = ClassLoader.getSystemClassLoader();
      *
    - *     Layer layer = parent.defineModulesWithOneLoader(cf, scl);
    + *     ModuleLayer layer = parent.defineModulesWithOneLoader(cf, scl);
      *
      *     Class c = layer.findLoader("myapp").loadClass("app.Main");
      * }
    * * @since 9 + * @spec JPMS * @see Module#getLayer() */ -public final class Layer { +public final class ModuleLayer { - // the empty Layer - private static final Layer EMPTY_LAYER - = new Layer(Configuration.empty(), List.of(), null); + // the empty layer + private static final ModuleLayer EMPTY_LAYER + = new ModuleLayer(Configuration.empty(), List.of(), null); - // the configuration from which this Layer was created + // the configuration from which this ;ayer was created private final Configuration cf; // parent layers, empty in the case of the empty layer - private final List parents; + private final List parents; // maps module name to jlr.Module private final Map nameToModule; /** - * Creates a new Layer from the modules in the given configuration. + * Creates a new module layer from the modules in the given configuration. */ - private Layer(Configuration cf, - List parents, - Function clf) + private ModuleLayer(Configuration cf, + List parents, + Function clf) { this.cf = cf; this.parents = parents; // no need to do defensive copy @@ -164,33 +181,38 @@ public final class Layer { } /** - * Controls a layer. The static methods defined by {@link Layer} to create - * module layers return a {@code Controller} that can be used to control - * modules in the layer. + * Controls a module layer. The static methods defined by {@link ModuleLayer} + * to create module layers return a {@code Controller} that can be used to + * control modules in the layer. + * + *

    Unless otherwise specified, passing a {@code null} argument to a + * method in this class causes a {@link NullPointerException + * NullPointerException} to be thrown.

    * * @apiNote Care should be taken with {@code Controller} objects, they * should never be shared with untrusted code. * * @since 9 + * @spec JPMS */ public static final class Controller { - private final Layer layer; + private final ModuleLayer layer; - Controller(Layer layer) { + Controller(ModuleLayer layer) { this.layer = layer; } /** * Returns the layer that this object controls. * - * @return the layer + * @return the module layer */ - public Layer layer() { + public ModuleLayer layer() { return layer; } private void ensureInLayer(Module source) { - if (!layer.modules().contains(source)) + if (source.getLayer() != layer) throw new IllegalArgumentException(source + " not in layer"); } @@ -212,15 +234,13 @@ public final class Layer { * @return This controller * * @throws IllegalArgumentException - * If {@code source} is not in the layer + * If {@code source} is not in the module layer * * @see Module#addReads */ public Controller addReads(Module source, Module target) { - Objects.requireNonNull(source); - Objects.requireNonNull(target); ensureInLayer(source); - Modules.addReads(source, target); + source.implAddReads(target); return this; } @@ -239,23 +259,21 @@ public final class Layer { * @return This controller * * @throws IllegalArgumentException - * If {@code source} is not in the layer or the package is not - * in the source module + * If {@code source} is not in the module layer or the package + * is not in the source module * * @see Module#addOpens */ public Controller addOpens(Module source, String pn, Module target) { - Objects.requireNonNull(source); - Objects.requireNonNull(target); ensureInLayer(source); - Modules.addOpens(source, pn, target); + source.implAddOpens(pn, target); return this; } } /** - * Creates a new layer, with this layer as its parent, by defining the + * Creates a new module layer, with this layer as its parent, by defining the * modules in the given {@code Configuration} to the Java virtual machine. * This method creates one class loader and defines all modules to that * class loader. The {@link ClassLoader#getParent() parent} of each class @@ -266,7 +284,7 @@ public final class Layer { * parent. In other words, if this layer is {@code thisLayer} then this * method is equivalent to invoking: *
     {@code
    -     *     Layer.defineModulesWithOneLoader(cf, List.of(thisLayer), parentLoader).layer();
    +     *     ModuleLayer.defineModulesWithOneLoader(cf, List.of(thisLayer), parentLoader).layer();
          * }
    * * @param cf @@ -281,10 +299,8 @@ public final class Layer { * If the parent of the given configuration is not the configuration * for this layer * @throws LayerInstantiationException - * If all modules cannot be defined to the same class loader for any - * of the reasons listed above or the layer cannot be created because - * the configuration contains a module named "{@code java.base}" or - * a module with a package name starting with "{@code java.}" + * If the layer cannot be created for any of the reasons specified + * by the static {@code defineModulesWithOneLoader} method * @throws SecurityException * If {@code RuntimePermission("createClassLoader")} or * {@code RuntimePermission("getClassLoader")} is denied by @@ -292,14 +308,14 @@ public final class Layer { * * @see #findLoader */ - public Layer defineModulesWithOneLoader(Configuration cf, - ClassLoader parentLoader) { + public ModuleLayer defineModulesWithOneLoader(Configuration cf, + ClassLoader parentLoader) { return defineModulesWithOneLoader(cf, List.of(this), parentLoader).layer(); } /** - * Creates a new layer, with this layer as its parent, by defining the + * Creates a new module layer, with this layer as its parent, by defining the * modules in the given {@code Configuration} to the Java virtual machine. * Each module is defined to its own {@link ClassLoader} created by this * method. The {@link ClassLoader#getParent() parent} of each class loader @@ -310,7 +326,7 @@ public final class Layer { * parent. In other words, if this layer is {@code thisLayer} then this * method is equivalent to invoking: *
     {@code
    -     *     Layer.defineModulesWithManyLoaders(cf, List.of(thisLayer), parentLoader).layer();
    +     *     ModuleLayer.defineModulesWithManyLoaders(cf, List.of(thisLayer), parentLoader).layer();
          * }
    * * @param cf @@ -325,9 +341,8 @@ public final class Layer { * If the parent of the given configuration is not the configuration * for this layer * @throws LayerInstantiationException - * If the layer cannot be created because the configuration contains - * a module named "{@code java.base}" or a module with a package - * name starting with "{@code java.}" + * If the layer cannot be created for any of the reasons specified + * by the static {@code defineModulesWithManyLoaders} method * @throws SecurityException * If {@code RuntimePermission("createClassLoader")} or * {@code RuntimePermission("getClassLoader")} is denied by @@ -335,14 +350,14 @@ public final class Layer { * * @see #findLoader */ - public Layer defineModulesWithManyLoaders(Configuration cf, - ClassLoader parentLoader) { + public ModuleLayer defineModulesWithManyLoaders(Configuration cf, + ClassLoader parentLoader) { return defineModulesWithManyLoaders(cf, List.of(this), parentLoader).layer(); } /** - * Creates a new layer, with this layer as its parent, by defining the + * Creates a new module layer, with this layer as its parent, by defining the * modules in the given {@code Configuration} to the Java virtual machine. * Each module is mapped, by name, to its class loader by means of the * given function. This method works exactly as specified by the static @@ -351,7 +366,7 @@ public final class Layer { * this layer is {@code thisLayer} then this method is equivalent to * invoking: *
     {@code
    -     *     Layer.defineModules(cf, List.of(thisLayer), clf).layer();
    +     *     ModuleLayer.defineModules(cf, List.of(thisLayer), clf).layer();
          * }
    * * @param cf @@ -365,25 +380,19 @@ public final class Layer { * If the parent of the given configuration is not the configuration * for this layer * @throws LayerInstantiationException - * If creating the {@code Layer} fails for any of the reasons - * listed above, the layer cannot be created because the - * configuration contains a module named "{@code java.base}", - * a module with a package name starting with "{@code java.}" is - * mapped to a class loader other than the {@link - * ClassLoader#getPlatformClassLoader() platform class loader}, - * or the function to map a module name to a class loader returns - * {@code null} + * If the layer cannot be created for any of the reasons specified + * by the static {@code defineModules} method * @throws SecurityException * If {@code RuntimePermission("getClassLoader")} is denied by * the security manager */ - public Layer defineModules(Configuration cf, - Function clf) { + public ModuleLayer defineModules(Configuration cf, + Function clf) { return defineModules(cf, List.of(this), clf).layer(); } /** - * Creates a new layer by defining the modules in the given {@code + * Creates a new module layer by defining the modules in the given {@code * Configuration} to the Java virtual machine. This method creates one * class loader and defines all modules to that class loader. * @@ -396,7 +405,6 @@ public final class Layer { * exported to one or more of the modules in this layer. The class * loader delegates to the class loader of the module, throwing {@code * ClassNotFoundException} if not found by that class loader. - * * When {@code loadClass} is invoked to load classes that do not map to a * module then it delegates to the parent class loader.

    * @@ -414,6 +422,10 @@ public final class Layer { * * * + *

    In addition, a layer cannot be created if the configuration contains + * a module named "{@code java.base}", or a module contains a package named + * "{@code java}" or a package with a name starting with "{@code java.}".

    + * *

    If there is a security manager then the class loader created by * this method will load classes and resources with privileges that are * restricted by the calling context of this method.

    @@ -421,7 +433,7 @@ public final class Layer { * @param cf * The configuration for the layer * @param parentLayers - * The list parent layers in search order + * The list of parent layers in search order * @param parentLoader * The parent class loader for the class loader created by this * method; may be {@code null} for the bootstrap class loader @@ -433,9 +445,7 @@ public final class Layer { * the parent layers, including order * @throws LayerInstantiationException * If all modules cannot be defined to the same class loader for any - * of the reasons listed above or the layer cannot be created because - * the configuration contains a module named "{@code java.base}" or - * a module with a package name starting with "{@code java.}" + * of the reasons listed above * @throws SecurityException * If {@code RuntimePermission("createClassLoader")} or * {@code RuntimePermission("getClassLoader")} is denied by @@ -444,10 +454,10 @@ public final class Layer { * @see #findLoader */ public static Controller defineModulesWithOneLoader(Configuration cf, - List parentLayers, + List parentLayers, ClassLoader parentLoader) { - List parents = new ArrayList<>(parentLayers); + List parents = new ArrayList<>(parentLayers); checkConfiguration(cf, parents); checkCreateClassLoaderPermission(); @@ -456,7 +466,7 @@ public final class Layer { try { Loader loader = new Loader(cf.modules(), parentLoader); loader.initRemotePackageMap(cf, parents); - Layer layer = new Layer(cf, parents, mn -> loader); + ModuleLayer layer = new ModuleLayer(cf, parents, mn -> loader); return new Controller(layer); } catch (IllegalArgumentException | IllegalStateException e) { throw new LayerInstantiationException(e.getMessage()); @@ -464,7 +474,7 @@ public final class Layer { } /** - * Creates a new layer by defining the modules in the given {@code + * Creates a new module layer by defining the modules in the given {@code * Configuration} to the Java virtual machine. Each module is defined to * its own {@link ClassLoader} created by this method. The {@link * ClassLoader#getParent() parent} of each class loader is the given parent @@ -480,7 +490,6 @@ public final class Layer { * module in a parent layer. The class loader delegates to the class loader * of the module, throwing {@code ClassNotFoundException} if not found by * that class loader. - * * When {@code loadClass} is invoked to load classes that do not map to a * module then it delegates to the parent class loader.

    * @@ -491,7 +500,7 @@ public final class Layer { * @param cf * The configuration for the layer * @param parentLayers - * The list parent layers in search order + * The list of parent layers in search order * @param parentLoader * The parent class loader for each of the class loaders created by * this method; may be {@code null} for the bootstrap class loader @@ -503,8 +512,10 @@ public final class Layer { * the parent layers, including order * @throws LayerInstantiationException * If the layer cannot be created because the configuration contains - * a module named "{@code java.base}" or a module with a package - * name starting with "{@code java.}" + * a module named "{@code java.base}" or a module contains a package + * named "{@code java}" or a package with a name starting with + * "{@code java.}" + * * @throws SecurityException * If {@code RuntimePermission("createClassLoader")} or * {@code RuntimePermission("getClassLoader")} is denied by @@ -513,10 +524,10 @@ public final class Layer { * @see #findLoader */ public static Controller defineModulesWithManyLoaders(Configuration cf, - List parentLayers, + List parentLayers, ClassLoader parentLoader) { - List parents = new ArrayList<>(parentLayers); + List parents = new ArrayList<>(parentLayers); checkConfiguration(cf, parents); checkCreateClassLoaderPermission(); @@ -524,7 +535,7 @@ public final class Layer { LoaderPool pool = new LoaderPool(cf, parents, parentLoader); try { - Layer layer = new Layer(cf, parents, pool::loaderFor); + ModuleLayer layer = new ModuleLayer(cf, parents, pool::loaderFor); return new Controller(layer); } catch (IllegalArgumentException | IllegalStateException e) { throw new LayerInstantiationException(e.getMessage()); @@ -532,18 +543,22 @@ public final class Layer { } /** - * Creates a new layer by defining the modules in the given {@code - * Configuration} to the Java virtual machine. - * Each module is mapped, by name, to its class loader by means of the - * given function. The class loader delegation implemented by these class - * loaders must respect module readability. The class loaders should be + * Creates a new module layer by defining the modules in the given {@code + * Configuration} to the Java virtual machine. The given function maps each + * module in the configuration, by name, to a class loader. Creating the + * layer informs the Java virtual machine about the classes that may be + * loaded so that the Java virtual machine knows which module that each + * class is a member of. + * + *

    The class loader delegation implemented by the class loaders must + * respect module readability. The class loaders should be * {@link ClassLoader#registerAsParallelCapable parallel-capable} so as to * avoid deadlocks during class loading. In addition, the entity creating - * a new layer with this method should arrange that the class loaders are + * a new layer with this method should arrange that the class loaders be * ready to load from these modules before there are any attempts to load - * classes or resources. + * classes or resources.

    * - *

    Creating a {@code Layer} can fail for the following reasons:

    + *

    Creating a layer can fail for the following reasons:

    * *
      * @@ -558,19 +573,27 @@ public final class Layer { * *
    * + *

    In addition, a layer cannot be created if the configuration contains + * a module named "{@code java.base}", a configuration contains a module + * with a package named "{@code java}" or a package name starting with + * "{@code java.}" and the module is mapped to a class loader other than + * the {@link ClassLoader#getPlatformClassLoader() platform class loader}, + * or the function to map a module name to a class loader returns + * {@code null}.

    + * *

    If the function to map a module name to class loader throws an error * or runtime exception then it is propagated to the caller of this method. *

    * - * @apiNote It is implementation specific as to whether creating a Layer + * @apiNote It is implementation specific as to whether creating a layer * with this method is an atomic operation or not. Consequentially it is * possible for this method to fail with some modules, but not all, defined - * to Java virtual machine. + * to the Java virtual machine. * * @param cf * The configuration for the layer * @param parentLayers - * The list parent layers in search order + * The list of parent layers in search order * @param clf * The function to map a module name to a class loader * @@ -580,23 +603,16 @@ public final class Layer { * If the parent configurations do not match the configuration of * the parent layers, including order * @throws LayerInstantiationException - * If creating the {@code Layer} fails for any of the reasons - * listed above, the layer cannot be created because the - * configuration contains a module named "{@code java.base}", - * a module with a package name starting with "{@code java.}" is - * mapped to a class loader other than the {@link - * ClassLoader#getPlatformClassLoader() platform class loader}, - * or the function to map a module name to a class loader returns - * {@code null} + * If creating the layer fails for any of the reasons listed above * @throws SecurityException * If {@code RuntimePermission("getClassLoader")} is denied by * the security manager */ public static Controller defineModules(Configuration cf, - List parentLayers, + List parentLayers, Function clf) { - List parents = new ArrayList<>(parentLayers); + List parents = new ArrayList<>(parentLayers); checkConfiguration(cf, parents); Objects.requireNonNull(clf); @@ -608,7 +624,7 @@ public final class Layer { } try { - Layer layer = new Layer(cf, parents, clf); + ModuleLayer layer = new ModuleLayer(cf, parents, clf); return new Controller(layer); } catch (IllegalArgumentException | IllegalStateException e) { throw new LayerInstantiationException(e.getMessage()); @@ -621,7 +637,7 @@ public final class Layer { * the parent layers. */ private static void checkConfiguration(Configuration cf, - List parentLayers) + List parentLayers) { Objects.requireNonNull(cf); @@ -630,7 +646,7 @@ public final class Layer { throw new IllegalArgumentException("wrong number of parents"); int index = 0; - for (Layer parent : parentLayers) { + for (ModuleLayer parent : parentLayers) { if (parent.configuration() != parentConfigurations.get(index)) { throw new IllegalArgumentException( "Parent of configuration != configuration of this Layer"); @@ -707,7 +723,7 @@ public final class Layer { * * @return The list of this layer's parents */ - public List parents() { + public List parents() { return parents; } @@ -719,24 +735,24 @@ public final class Layer { * @implNote For now, the assumption is that the number of elements will * be very low and so this method does not use a specialized spliterator. */ - Stream layers() { - List allLayers = this.allLayers; + Stream layers() { + List allLayers = this.allLayers; if (allLayers != null) return allLayers.stream(); allLayers = new ArrayList<>(); - Set visited = new HashSet<>(); - Deque stack = new ArrayDeque<>(); + Set visited = new HashSet<>(); + Deque stack = new ArrayDeque<>(); visited.add(this); stack.push(this); while (!stack.isEmpty()) { - Layer layer = stack.pop(); + ModuleLayer layer = stack.pop(); allLayers.add(layer); // push in reverse order for (int i = layer.parents.size() - 1; i >= 0; i--) { - Layer parent = layer.parents.get(i); + ModuleLayer parent = layer.parents.get(i); if (!visited.contains(parent)) { visited.add(parent); stack.push(parent); @@ -748,7 +764,7 @@ public final class Layer { return allLayers.stream(); } - private volatile List allLayers; + private volatile List allLayers; /** * Returns the set of the modules in this layer. @@ -756,14 +772,20 @@ public final class Layer { * @return A possibly-empty unmodifiable set of the modules in this layer */ public Set modules() { - return Collections.unmodifiableSet( - nameToModule.values().stream().collect(Collectors.toSet())); + Set modules = this.modules; + if (modules == null) { + this.modules = modules = + Collections.unmodifiableSet(new HashSet<>(nameToModule.values())); + } + return modules; } + private volatile Set modules; + /** * Returns the module with the given name in this layer, or if not in this - * layer, the {@linkplain #parents parents} layers. Finding a module in + * layer, the {@linkplain #parents parent} layers. Finding a module in * parent layers is equivalent to invoking {@code findModule} on each * parent, in search order, until the module is found or all parents have * been searched. In a tree of layers then this is equivalent to @@ -778,6 +800,8 @@ public final class Layer { */ public Optional findModule(String name) { Objects.requireNonNull(name); + if (this == EMPTY_LAYER) + return Optional.empty(); Module m = nameToModule.get(name); if (m != null) return Optional.of(m); @@ -828,9 +852,9 @@ public final class Layer { } /** - * Returns a string describing this layer. + * Returns a string describing this module layer. * - * @return A possibly empty string describing this layer + * @return A possibly empty string describing this module layer */ @Override public String toString() { @@ -845,7 +869,7 @@ public final class Layer { * * @return The empty layer */ - public static Layer empty() { + public static ModuleLayer empty() { return EMPTY_LAYER; } @@ -859,11 +883,10 @@ public final class Layer { * * @return The boot layer */ - public static Layer boot() { - return SharedSecrets.getJavaLangAccess().getBootLayer(); + public static ModuleLayer boot() { + return System.bootLayer; } - /** * Returns the ServicesCatalog for this Layer, creating it if not * already created. @@ -894,10 +917,10 @@ public final class Layer { */ void bindToLoader(ClassLoader loader) { // CLV.computeIfAbsent(loader, (cl, clv) -> new CopyOnWriteArrayList<>()) - List list = CLV.get(loader); + List list = CLV.get(loader); if (list == null) { list = new CopyOnWriteArrayList<>(); - List previous = CLV.putIfAbsent(loader, list); + List previous = CLV.putIfAbsent(loader, list); if (previous != null) list = previous; } list.add(this); @@ -907,8 +930,8 @@ public final class Layer { * Returns a stream of the layers that have at least one module defined to * the given class loader. */ - static Stream layers(ClassLoader loader) { - List list = CLV.get(loader); + static Stream layers(ClassLoader loader) { + List list = CLV.get(loader); if (list != null) { return list.stream(); } else { @@ -917,5 +940,5 @@ public final class Layer { } // the list of layers with modules defined to a class loader - private static final ClassLoaderValue> CLV = new ClassLoaderValue<>(); + private static final ClassLoaderValue> CLV = new ClassLoaderValue<>(); } diff --git a/jdk/src/java.base/share/classes/java/lang/NamedPackage.java b/jdk/src/java.base/share/classes/java/lang/NamedPackage.java index 5d86cc7fd9c..6234b949e65 100644 --- a/jdk/src/java.base/share/classes/java/lang/NamedPackage.java +++ b/jdk/src/java.base/share/classes/java/lang/NamedPackage.java @@ -26,7 +26,6 @@ package java.lang; import java.lang.module.Configuration; import java.lang.module.ModuleReference; -import java.lang.reflect.Module; import java.net.URI; /** diff --git a/jdk/src/java.base/share/classes/java/lang/Object.java b/jdk/src/java.base/share/classes/java/lang/Object.java index 0677aa5d234..e1cb6e0246d 100644 --- a/jdk/src/java.base/share/classes/java/lang/Object.java +++ b/jdk/src/java.base/share/classes/java/lang/Object.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -561,10 +561,53 @@ public class Object { * the finalization of this object to be halted, but is otherwise * ignored. * + * @apiNote + * Classes that embed non-heap resources have many options + * for cleanup of those resources. The class must ensure that the + * lifetime of each instance is longer than that of any resource it embeds. + * {@link java.lang.ref.Reference#reachabilityFence} can be used to ensure that + * objects remain reachable while resources embedded in the object are in use. + *

    + * A subclass should avoid overriding the {@code finalize} method + * unless the subclass embeds non-heap resources that must be cleaned up + * before the instance is collected. + * Finalizer invocations are not automatically chained, unlike constructors. + * If a subclass overrides {@code finalize} it must invoke the superclass + * finalizer explicitly. + * To guard against exceptions prematurely terminating the finalize chain, + * the subclass should use a {@code try-finally} block to ensure + * {@code super.finalize()} is always invoked. For example, + *

    {@code      @Override
    +     *     protected void finalize() throws Throwable {
    +     *         try {
    +     *             ... // cleanup subclass state
    +     *         } finally {
    +     *             super.finalize();
    +     *         }
    +     *     }
    +     * }
    + * + * @deprecated The finalization mechanism is inherently problematic. + * Finalization can lead to performance issues, deadlocks, and hangs. + * Errors in finalizers can lead to resource leaks; there is no way to cancel + * finalization if it is no longer necessary; and no ordering is specified + * among calls to {@code finalize} methods of different objects. + * Furthermore, there are no guarantees regarding the timing of finalization. + * The {@code finalize} method might be called on a finalizable object + * only after an indefinite delay, if at all. + * + * Classes whose instances hold non-heap resources should provide a method + * to enable explicit release of those resources, and they should also + * implement {@link AutoCloseable} if appropriate. + * The {@link java.lang.ref.Cleaner} and {@link java.lang.ref.PhantomReference} + * provide more flexible and efficient ways to release resources when an object + * becomes unreachable. + * * @throws Throwable the {@code Exception} raised by this method * @see java.lang.ref.WeakReference * @see java.lang.ref.PhantomReference * @jls 12.6 Finalization of Class Instances */ + @Deprecated(since="9") protected void finalize() throws Throwable { } } diff --git a/jdk/src/java.base/share/classes/java/lang/Package.java b/jdk/src/java.base/share/classes/java/lang/Package.java index 5a19f9771f1..25bf4a751fd 100644 --- a/jdk/src/java.base/share/classes/java/lang/Package.java +++ b/jdk/src/java.base/share/classes/java/lang/Package.java @@ -27,7 +27,6 @@ package java.lang; import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; -import java.lang.reflect.Module; import java.net.MalformedURLException; import java.net.URI; import java.net.URL; @@ -111,6 +110,8 @@ import jdk.internal.reflect.Reflection; * @see ClassLoader#definePackage(String, String, String, String, String, String, String, URL) * * @since 1.2 + * @revised 9 + * @spec JPMS */ public class Package extends NamedPackage implements java.lang.reflect.AnnotatedElement { /** @@ -207,6 +208,9 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated * is returned if it is not known. * @return the vendor that implemented this package, {@code null} * is returned if it is not known. + * + * @revised 9 + * @spec JPMS */ public String getImplementationVendor() { return versionInfo.implVendor; @@ -334,6 +338,9 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated * a {@code Package} for the specified class loader. * * @see ClassLoader#getDefinedPackage + * + * @revised 9 + * @spec JPMS */ @CallerSensitive @Deprecated(since="9") @@ -356,6 +363,9 @@ public class Package extends NamedPackage implements java.lang.reflect.Annotated * class loader and its ancestors * * @see ClassLoader#getDefinedPackages + * + * @revised 9 + * @spec JPMS */ @CallerSensitive public static Package[] getPackages() { diff --git a/jdk/src/java.base/share/classes/java/lang/Process.java b/jdk/src/java.base/share/classes/java/lang/Process.java index c4c5612e674..90ca41d0375 100644 --- a/jdk/src/java.base/share/classes/java/lang/Process.java +++ b/jdk/src/java.base/share/classes/java/lang/Process.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * 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,10 +80,10 @@ import java.util.stream.Stream; * *

    Subclasses of Process should override the {@link #onExit()} and * {@link #toHandle()} methods to provide a fully functional Process including the - * {@link #getPid() process id}, - * {@link #info() information about the process}, - * {@link #children() direct children}, and - * {@link #descendants() direct children plus descendants of those children} of the process. + * {@linkplain #pid() process id}, + * {@linkplain #info() information about the process}, + * {@linkplain #children() direct children}, and + * {@linkplain #descendants() direct children plus descendants of those children} of the process. * Delegating to the underlying Process or ProcessHandle is typically * easiest and most efficient. * @@ -237,14 +237,14 @@ public abstract class Process { /** * Kills the process. * Whether the process represented by this {@code Process} object is - * {@link #supportsNormalTermination normally terminated} or not is + * {@linkplain #supportsNormalTermination normally terminated} or not is * implementation dependent. * Forcible process destruction is defined as the immediate termination of a * process, whereas normal termination allows the process to shut down cleanly. * If the process is not alive, no action is taken. *

    * The {@link java.util.concurrent.CompletableFuture} from {@link #onExit} is - * {@link java.util.concurrent.CompletableFuture#complete completed} + * {@linkplain java.util.concurrent.CompletableFuture#complete completed} * when the process has terminated. */ public abstract void destroy(); @@ -257,7 +257,7 @@ public abstract class Process { * If the process is not alive, no action is taken. *

    * The {@link java.util.concurrent.CompletableFuture} from {@link #onExit} is - * {@link java.util.concurrent.CompletableFuture#complete completed} + * {@linkplain java.util.concurrent.CompletableFuture#complete completed} * when the process has terminated. *

    * Invoking this method on {@code Process} objects returned by @@ -335,15 +335,15 @@ public abstract class Process { * * @implSpec * The implementation of this method returns the process id as: - * {@link #toHandle toHandle().getPid()}. + * {@link #toHandle toHandle().pid()}. * * @return the native process id of the process * @throws UnsupportedOperationException if the Process implementation * does not support this operation * @since 9 */ - public long getPid() { - return toHandle().getPid(); + public long pid() { + return toHandle().pid(); } /** @@ -357,9 +357,9 @@ public abstract class Process { *

    * Calling {@code onExit().get()} waits for the process to terminate and returns * the Process. The future can be used to check if the process is - * {@link java.util.concurrent.CompletableFuture#isDone done} or to - * {@link java.util.concurrent.CompletableFuture#get() wait} for it to terminate. - * {@link java.util.concurrent.CompletableFuture#cancel(boolean) Cancelling} + * {@linkplain java.util.concurrent.CompletableFuture#isDone done} or to + * {@linkplain java.util.concurrent.CompletableFuture#get() wait} for it to terminate. + * {@linkplain java.util.concurrent.CompletableFuture#cancel(boolean) Cancelling} * the CompletableFuture does not affect the Process. *

    * Processes returned from {@link ProcessBuilder#start} override the @@ -389,7 +389,7 @@ public abstract class Process { * {@code waitFor} is interrupted, the thread's interrupt status is preserved. *

    * When {@link #waitFor()} returns successfully the CompletableFuture is - * {@link java.util.concurrent.CompletableFuture#complete completed} regardless + * {@linkplain java.util.concurrent.CompletableFuture#complete completed} regardless * of the exit status of the process. * * This implementation may consume a lot of memory for thread stacks if a @@ -463,7 +463,7 @@ public abstract class Process { * This implementation throws an instance of * {@link java.lang.UnsupportedOperationException} and performs no other action. * Subclasses should override this method to provide a ProcessHandle for the - * process. The methods {@link #getPid}, {@link #info}, {@link #children}, + * process. The methods {@link #pid}, {@link #info}, {@link #children}, * and {@link #descendants}, unless overridden, operate on the ProcessHandle. * * @return Returns a ProcessHandle for the Process @@ -500,10 +500,10 @@ public abstract class Process { /** * Returns a snapshot of the direct children of the process. * The parent of a direct child process is the process. - * Typically, a process that is {@link #isAlive not alive} has no children. + * Typically, a process that is {@linkplain #isAlive not alive} has no children. *

    * Note that processes are created and terminate asynchronously. - * There is no guarantee that a process is {@link #isAlive alive}. + * There is no guarantee that a process is {@linkplain #isAlive alive}. * * * @implSpec @@ -526,10 +526,10 @@ public abstract class Process { * Returns a snapshot of the descendants of the process. * The descendants of a process are the children of the process * plus the descendants of those children, recursively. - * Typically, a process that is {@link #isAlive not alive} has no children. + * Typically, a process that is {@linkplain #isAlive not alive} has no children. *

    * Note that processes are created and terminate asynchronously. - * There is no guarantee that a process is {@link #isAlive alive}. + * There is no guarantee that a process is {@linkplain #isAlive alive}. * * * @implSpec diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java index 31406459d93..7adee534b81 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java @@ -71,7 +71,7 @@ import sun.security.action.GetPropertyAction; * working directory of the current process, usually the directory * named by the system property {@code user.dir}. * - *

  • a source of standard input. + *
  • a source of standard input. * By default, the subprocess reads input from a pipe. Java code * can access this pipe via the output stream returned by * {@link Process#getOutputStream()}. However, standard input may @@ -86,7 +86,7 @@ import sun.security.action.GetPropertyAction; *
  • the {@link OutputStream#close() close} method does nothing * * - *
  • a destination for standard output + *
  • a destination for standard output * and standard error. By default, the subprocess writes standard * output and standard error to pipes. Java code can access these pipes * via the input streams returned by {@link Process#getOutputStream()} and @@ -1251,6 +1251,7 @@ public final class ProcessBuilder * If the operating system does not support the creation of processes * * @throws IOException if an I/O error occurs + * @since 9 */ public static List startPipeline(List builders) throws IOException { // Accumulate and check the builders diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java b/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java index fbf5cfba252..7cd3b5dd96c 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandle.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 +104,7 @@ public interface ProcessHandle extends Comparable { * @throws UnsupportedOperationException if the implementation * does not support this operation */ - long getPid(); + long pid(); /** * Returns an {@code Optional} for an existing native process. @@ -383,7 +383,7 @@ public interface ProcessHandle extends Comparable { /** * Returns a hash code value for this ProcessHandle. * The hashcode value follows the general contract for {@link Object#hashCode()}. - * The value is a function of the {@link #getPid getPid()} value and + * The value is a function of the {@link #pid pid()} value and * may be a function of additional information to uniquely identify the process. * If two ProcessHandles are equal according to the {@link #equals(Object) equals} * method, then calling the hashCode method on each of the two objects diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java index 15a2bd4c029..d634166a30a 100644 --- a/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java +++ b/jdk/src/java.base/share/classes/java/lang/ProcessHandleImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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 @@ */ package java.lang; +import java.lang.annotation.Native; import java.security.PrivilegedAction; import java.time.Duration; import java.time.Instant; @@ -34,11 +35,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executor; import java.util.concurrent.Executors; -import java.util.concurrent.ForkJoinPool; -import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadFactory; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; import java.util.stream.IntStream; import java.util.stream.Stream; @@ -56,6 +53,12 @@ final class ProcessHandleImpl implements ProcessHandle { */ private static long REAPER_DEFAULT_STACKSIZE = 128 * 1024; + /** + * Return value from waitForProcessExit0 indicating the process is not a child. + */ + @Native + private static final int NOT_A_CHILD = -2; + /** * Cache the ProcessHandle of this process. */ @@ -131,6 +134,29 @@ final class ProcessHandleImpl implements ProcessHandle { // spawn a thread to wait for and deliver the exit value processReaperExecutor.execute(() -> { int exitValue = waitForProcessExit0(pid, shouldReap); + if (exitValue == NOT_A_CHILD) { + // pid not alive or not a child of this process + // If it is alive wait for it to terminate + long sleep = 300; // initial milliseconds to sleep + int incr = 30; // increment to the sleep time + + long startTime = isAlive0(pid); + long origStart = startTime; + while (startTime >= 0) { + try { + Thread.sleep(Math.min(sleep, 5000L)); // no more than 5 sec + sleep += incr; + } catch (InterruptedException ie) { + // ignore and retry + } + startTime = isAlive0(pid); // recheck if is alive + if (origStart > 0 && startTime != origStart) { + // start time changed, pid is not the same process + break; + } + } + exitValue = 0; + } newCompletion.complete(exitValue); // remove from cache afterwards completions.remove(pid, newCompletion); @@ -146,7 +172,7 @@ final class ProcessHandleImpl implements ProcessHandle { throw new IllegalStateException("onExit for current process not allowed"); } - return ProcessHandleImpl.completion(getPid(), false) + return ProcessHandleImpl.completion(pid(), false) .handleAsync((exitStatus, unusedThrowable) -> this); } @@ -229,7 +255,7 @@ final class ProcessHandleImpl implements ProcessHandle { * @return the native process ID */ @Override - public long getPid() { + public long pid() { return pid; } diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java index 84a599a4285..230d75a412d 100644 --- a/jdk/src/java.base/share/classes/java/lang/Runtime.java +++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -930,10 +930,9 @@ public class Runtime { } /** - * Returns the version of the Java Runtime Environment as a {@link - * Runtime.Version}. + * Returns the version of the Java Runtime Environment as a {@link Version}. * - * @return the {@link Runtime.Version} of the Java Runtime Environment + * @return the {@link Version} of the Java Runtime Environment * * @since 9 */ @@ -948,19 +947,19 @@ public class Runtime { /** * A representation of a version string for an implementation of the - * Java SE Platform. A version string contains a version number + * Java SE Platform. A version string consists of a version number * optionally followed by pre-release and build information. * - *

    Version numbers

    + *

    Version numbers

    * *

    A version number, {@code $VNUM}, is a non-empty sequence * of elements separated by period characters (U+002E). An element is - * either zero, or a unsigned integer numeral without leading zeros. The + * either zero, or an unsigned integer numeral without leading zeros. The * final element in a version number must not be zero. The format is: *

    * *
    -     *     ^[1-9][0-9]*(((\.0)*\.[1-9][0-9]*)*)*$
    +     *     [1-9][0-9]*((\.0)*\.[1-9][0-9]*)*
          * 
    * *

    The sequence may be of arbitrary length but the first three @@ -972,7 +971,7 @@ public class Runtime { * *

      * - *
    • {@code $MAJOR} --- The major version + *

    • {@code $MAJOR} --- The major version * number, incremented for a major release that contains significant new * features as specified in a new edition of the Java SE Platform * Specification, e.g.,

    • * - *
    • {@code $MINOR} --- The minor version + *

    • {@code $MINOR} --- The minor version * number, incremented for a minor update release that may contain * compatible bug fixes, revisions to standard APIs mandated by a * Maintenance Release @@ -993,7 +992,7 @@ public class Runtime { * additional service providers, new garbage collectors, and ports to new * hardware architectures.

    • * - *
    • {@code $SECURITY} --- The security + *

    • {@code $SECURITY} --- The security * level, incremented for a security update release that contains critical * fixes including those necessary to improve security. {@code $SECURITY} * is not reset when {@code $MINOR} is incremented. A @@ -1022,39 +1021,42 @@ public class Runtime { * sequence; e.g., {@code 9.1.2} is less than {@code 9.1.2.1}. *

      * - *

      Version strings

      + *

      Version strings

      * *

      A version string, {@code $VSTR}, consists of a version * number {@code $VNUM}, as described above, optionally followed by - * pre-release and build information, in the format

      + * pre-release and build information, in one of the following formats: + *

      * *
      -     *     $VNUM(-$PRE)?(\+($BUILD)?(-$OPT)?)?
      +     *     $VNUM(-$PRE)?\+$BUILD(-$OPT)?
      +     *     $VNUM-$PRE(-$OPT)?
      +     *     $VNUM(+-$OPT)?
            * 
      * *

      where:

      * *
        * - *
      • {@code $PRE}, matching {@code ([a-zA-Z0-9]+)} + *

      • {@code $PRE}, matching {@code ([a-zA-Z0-9]+)} * --- A pre-release identifier. Typically {@code ea}, for a * potentially unstable early-access release under active development, - * or {@code internal}, for an internal developer build. + * or {@code internal}, for an internal developer build.

      • * - *
      • {@code $BUILD}, matching {@code + *

      • {@code $BUILD}, matching {@code * (0|[1-9][0-9]*)} --- The build number, incremented for each promoted * build. {@code $BUILD} is reset to {@code 1} when any portion of {@code - * $VNUM} is incremented.

        + * $VNUM} is incremented.

      • * - *
      • {@code $OPT}, matching {@code - * ([-a-zA-Z0-9\.]+)} --- Additional build information, if desired. In + *

      • {@code $OPT}, matching {@code + * ([-a-zA-Z0-9.]+)} --- Additional build information, if desired. In * the case of an {@code internal} build this will often contain the date - * and time of the build.

        + * and time of the build.

      • * *
      * - *

      A version number {@code 10-ea} matches {@code $VNUM = "10"} and - * {@code $PRE = "ea"}. The version number {@code 10+-ea} matches + *

      A version string {@code 10-ea} matches {@code $VNUM = "10"} and + * {@code $PRE = "ea"}. The version string {@code 10+-ea} matches * {@code $VNUM = "10"} and {@code $OPT = "ea"}.

      * *

      When comparing two version strings, the value of {@code $OPT}, if @@ -1067,15 +1069,21 @@ public class Runtime { * *

      A short version string, {@code $SVSTR}, often useful in * less formal contexts, is a version number optionally followed by a - * pre-release identifier: + * pre-release identifier:

      * *
            *     $VNUM(-$PRE)?
            * 
      * + *

      This is a value-based + * class; use of identity-sensitive operations (including reference equality + * ({@code ==}), identity hash code, or synchronization) on instances of + * {@code Version} may have unpredictable results and should be avoided. + *

      + * * @since 9 */ - public static class Version + public static final class Version implements Comparable { private final List version; @@ -1083,9 +1091,18 @@ public class Runtime { private final Optional build; private final Optional optional; - Version(List version, Optional pre, - Optional build, Optional optional) { - this.version = Collections.unmodifiableList(version); + /* + * List of version number components passed to this constructor MUST + * be at least unmodifiable (ideally immutable). In the case on an + * unmodifiable list, the caller MUST hand the list over to this + * constructor and never change the underlying list. + */ + private Version(List unmodifiableListOfVersions, + Optional pre, + Optional build, + Optional optional) + { + this.version = unmodifiableListOfVersions; this.pre = pre; this.build = build; this.optional = optional; @@ -1129,9 +1146,11 @@ public class Runtime { + s + "'"); // $VNUM is a dot-separated list of integers of arbitrary length - List version = new ArrayList<>(); - for (String i : m.group(VersionPattern.VNUM_GROUP).split("\\.")) - version.add(Integer.parseInt(i)); + String[] split = m.group(VersionPattern.VNUM_GROUP).split("\\."); + Integer[] version = new Integer[split.length]; + for (int i = 0; i < split.length; i++) { + version[i] = Integer.parseInt(split[i]); + } Optional pre = Optional.ofNullable( m.group(VersionPattern.PRE_GROUP)); @@ -1158,7 +1177,7 @@ public class Runtime { + " build or optional components: '" + s + "'"); } } - return new Version(version, pre, build, optional); + return new Version(List.of(version), pre, build, optional); } private static boolean isSimpleNumber(String s) { @@ -1247,7 +1266,7 @@ public class Runtime { * Compares this version to another. * *

      Each of the components in the version is - * compared in the follow order of precedence: version numbers, + * compared in the following order of precedence: version numbers, * pre-release identifiers, build numbers, optional build information. *

      * @@ -1269,9 +1288,7 @@ public class Runtime { * During this comparison, a version with optional build information is * considered to be greater than a version without one.

      * - *

      A version is not comparable to any other type of object. - * - * @param ob + * @param obj * The object to be compared * * @return A negative integer, zero, or a positive integer if this @@ -1282,8 +1299,8 @@ public class Runtime { * If the given object is {@code null} */ @Override - public int compareTo(Version ob) { - return compare(ob, false); + public int compareTo(Version obj) { + return compare(obj, false); } /** @@ -1294,9 +1311,10 @@ public class Runtime { * described in {@link #compareTo(Version)} with the exception that the * optional build information is always ignored.

      * - *

      A version is not comparable to any other type of object. + *

      This method provides ordering which is consistent with + * {@code equalsIgnoreOptional()}.

      * - * @param ob + * @param obj * The object to be compared * * @return A negative integer, zero, or a positive integer if this @@ -1306,49 +1324,47 @@ public class Runtime { * @throws NullPointerException * If the given object is {@code null} */ - public int compareToIgnoreOptional(Version ob) { - return compare(ob, true); + public int compareToIgnoreOptional(Version obj) { + return compare(obj, true); } - private int compare(Version ob, boolean ignoreOpt) { - if (ob == null) - throw new NullPointerException("Invalid argument"); + private int compare(Version obj, boolean ignoreOpt) { + if (obj == null) + throw new NullPointerException(); - int ret = compareVersion(ob); + int ret = compareVersion(obj); if (ret != 0) return ret; - ret = comparePre(ob); + ret = comparePre(obj); if (ret != 0) return ret; - ret = compareBuild(ob); + ret = compareBuild(obj); if (ret != 0) return ret; if (!ignoreOpt) - return compareOptional(ob); + return compareOptional(obj); return 0; } - private int compareVersion(Version ob) { + private int compareVersion(Version obj) { int size = version.size(); - int oSize = ob.version().size(); + int oSize = obj.version().size(); int min = Math.min(size, oSize); for (int i = 0; i < min; i++) { - Integer val = version.get(i); - Integer oVal = ob.version().get(i); + int val = version.get(i); + int oVal = obj.version().get(i); if (val != oVal) return val - oVal; } - if (size != oSize) - return size - oSize; - return 0; + return size - oSize; } - private int comparePre(Version ob) { - Optional oPre = ob.pre(); + private int comparePre(Version obj) { + Optional oPre = obj.pre(); if (!pre.isPresent()) { if (oPre.isPresent()) return 1; @@ -1370,20 +1386,20 @@ public class Runtime { return 0; } - private int compareBuild(Version ob) { - Optional oBuild = ob.build(); + private int compareBuild(Version obj) { + Optional oBuild = obj.build(); if (oBuild.isPresent()) { return (build.isPresent() ? build.get().compareTo(oBuild.get()) - : 1); + : -1); } else if (build.isPresent()) { - return -1; + return 1; } return 0; } - private int compareOptional(Version ob) { - Optional oOpt = ob.optional(); + private int compareOptional(Version obj) { + Optional oOpt = obj.optional(); if (!optional.isPresent()) { if (oOpt.isPresent()) return -1; @@ -1429,10 +1445,7 @@ public class Runtime { *

      Two {@code Version}s are equal if and only if they represent the * same version string. * - *

      This method satisfies the general contract of the {@link - * Object#equals(Object) Object.equals} method.

      - * - * @param ob + * @param obj * The object to which this {@code Version} is to be compared * * @return {@code true} if, and only if, the given object is a {@code @@ -1440,12 +1453,12 @@ public class Runtime { * */ @Override - public boolean equals(Object ob) { - boolean ret = equalsIgnoreOptional(ob); + public boolean equals(Object obj) { + boolean ret = equalsIgnoreOptional(obj); if (!ret) return false; - Version that = (Version)ob; + Version that = (Version)obj; return (this.optional().equals(that.optional())); } @@ -1456,21 +1469,21 @@ public class Runtime { *

      Two {@code Version}s are equal if and only if they represent the * same version string disregarding the optional build information. * - * @param ob + * @param obj * The object to which this {@code Version} is to be compared * * @return {@code true} if, and only if, the given object is a {@code * Version} that is identical to this {@code Version} - * ignoring the optinal build information + * ignoring the optional build information * */ - public boolean equalsIgnoreOptional(Object ob) { - if (this == ob) + public boolean equalsIgnoreOptional(Object obj) { + if (this == obj) return true; - if (!(ob instanceof Version)) + if (!(obj instanceof Version)) return false; - Version that = (Version)ob; + Version that = (Version)obj; return (this.version().equals(that.version()) && this.pre().equals(that.pre()) && this.build().equals(that.build())); @@ -1479,9 +1492,6 @@ public class Runtime { /** * Returns the hash code of this version. * - *

      This method satisfies the general contract of the {@link - * Object#hashCode Object.hashCode} method. - * * @return The hashcode of this version */ @Override @@ -1509,8 +1519,7 @@ public class Runtime { private static final String BUILD = "(?:(?\\+)(?0|[1-9][0-9]*)?)?"; private static final String OPT = "(?:-(?[-a-zA-Z0-9.]+))?"; - private static final String VSTR_FORMAT - = "^" + VNUM + PRE + BUILD + OPT + "$"; + private static final String VSTR_FORMAT = VNUM + PRE + BUILD + OPT; static final Pattern VSTR_PATTERN = Pattern.compile(VSTR_FORMAT); diff --git a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java index 46d8ef23c08..489bcf64375 100644 --- a/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java +++ b/jdk/src/java.base/share/classes/java/lang/RuntimePermission.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,9 +26,7 @@ package java.lang; import java.security.*; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.StringTokenizer; +import java.lang.module.ModuleFinder; /** * This class is for runtime permissions. A {@code RuntimePermission} @@ -265,6 +263,16 @@ import java.util.StringTokenizer; * * * + * defineClass + * Define a class with + * {@link java.lang.invoke.MethodHandles.Lookup#defineClass(byte[]) + * Lookup.defineClass}. + * This grants code with a suitably privileged {@code Lookup} object + * permission to define classes in the same package as the {@code Lookup}'s + * lookup class. + * + * + * * accessDeclaredMembers * Access to the declared members of a class * This grants code permission to query a class for its public, @@ -298,6 +306,14 @@ import java.util.StringTokenizer; * * * + * getStackWalkerWithClassReference + * Get a stack walker that can retrieve stack frames with class reference. + * This allows retrieval of Class objects from stack walking. + * This might allow malicious code to access Class objects on the stack + * outside its own context. + * + * + * * setDefaultUncaughtExceptionHandler * Setting the default handler to be used when a thread * terminates abruptly due to an uncaught exception @@ -359,6 +375,14 @@ import java.util.StringTokenizer; * See {@link java.lang.System.LoggerFinder java.lang.System.LoggerFinder} * for more information. * + * + * + * accessSystemModules + * Access system modules in the runtime image. + * This grants the permission to access resources in the + * {@linkplain ModuleFinder#ofSystem system modules} in the runtime image. + * + * * * * @implNote diff --git a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java index 8a819ee6db7..098e8626525 100644 --- a/jdk/src/java.base/share/classes/java/lang/SecurityManager.java +++ b/jdk/src/java.base/share/classes/java/lang/SecurityManager.java @@ -29,9 +29,7 @@ import java.lang.RuntimePermission; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Exports; import java.lang.module.ModuleDescriptor.Opens; -import java.lang.reflect.Layer; import java.lang.reflect.Member; -import java.lang.reflect.Module; import java.io.FileDescriptor; import java.io.File; import java.io.FilePermission; @@ -1441,7 +1439,7 @@ class SecurityManager { static { // Get the modules in the boot layer - Stream bootLayerModules = Layer.boot().modules().stream(); + Stream bootLayerModules = ModuleLayer.boot().modules().stream(); // Filter out the modules loaded by the boot or platform loader PrivilegedAction> pa = () -> @@ -1457,6 +1455,18 @@ class SecurityManager { .collect(Collectors.toSet()); } + /** + * Called by java.security.Security + */ + static void invalidatePackageAccessCache() { + synchronized (packageAccessLock) { + packageAccessValid = false; + } + synchronized (packageDefinitionLock) { + packageDefinitionValid = false; + } + } + /** * Returns true if the module's loader is the boot or platform loader. */ diff --git a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java index 55976485d4f..00cec33e2a2 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java +++ b/jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java @@ -25,11 +25,13 @@ package java.lang; import jdk.internal.reflect.MethodAccessor; +import jdk.internal.reflect.ConstructorAccessor; import java.lang.StackWalker.Option; import java.lang.StackWalker.StackFrame; import java.lang.annotation.Native; import java.lang.reflect.Method; +import java.lang.reflect.Constructor; import java.util.HashSet; import java.util.NoSuchElementException; import java.util.Objects; @@ -684,7 +686,7 @@ final class StackStreamFactory { frames[n++] = caller; } if (frames[1] == null) { - throw new IllegalStateException("no caller frame"); + throw new IllegalCallerException("no caller frame"); } return n; } @@ -922,7 +924,8 @@ final class StackStreamFactory { */ final void setBatch(int depth, int startIndex, int endIndex) { if (startIndex <= 0 || endIndex <= 0) - throw new IllegalArgumentException("startIndex=" + startIndex + " endIndex=" + endIndex); + throw new IllegalArgumentException("startIndex=" + startIndex + + " endIndex=" + endIndex); this.origin = startIndex; this.fence = endIndex; @@ -979,14 +982,12 @@ final class StackStreamFactory { } private static boolean isReflectionFrame(Class c) { - if (c.getName().startsWith("jdk.internal.reflect") && - !MethodAccessor.class.isAssignableFrom(c)) { - throw new InternalError("Not jdk.internal.reflect.MethodAccessor: " + c.toString()); - } // ## should filter all @Hidden frames? return c == Method.class || - MethodAccessor.class.isAssignableFrom(c) || - c.getName().startsWith("java.lang.invoke.LambdaForm"); + c == Constructor.class || + MethodAccessor.class.isAssignableFrom(c) || + ConstructorAccessor.class.isAssignableFrom(c) || + c.getName().startsWith("java.lang.invoke.LambdaForm"); } } diff --git a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java index d95ea5ef826..b96fb363559 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java +++ b/jdk/src/java.base/share/classes/java/lang/StackTraceElement.java @@ -33,8 +33,6 @@ import jdk.internal.module.ModuleReferenceImpl; import java.lang.module.ModuleDescriptor.Version; import java.lang.module.ModuleReference; import java.lang.module.ResolvedModule; -import java.lang.reflect.Layer; -import java.lang.reflect.Module; import java.util.HashSet; import java.util.Objects; import java.util.Optional; @@ -92,6 +90,8 @@ public final class StackTraceElement implements java.io.Serializable { * @throws NullPointerException if {@code declaringClass} or * {@code methodName} is null * @since 1.5 + * @revised 9 + * @spec JPMS */ public StackTraceElement(String declaringClass, String methodName, String fileName, int lineNumber) { @@ -128,6 +128,7 @@ public final class StackTraceElement implements java.io.Serializable { * or {@code methodName} is {@code null} * * @since 9 + * @spec JPMS */ public StackTraceElement(String classLoaderName, String moduleName, String moduleVersion, @@ -187,7 +188,8 @@ public final class StackTraceElement implements java.io.Serializable { * point represented by this stack trace element; {@code null} * if the module name is not available. * @since 9 - * @see java.lang.reflect.Module#getName() + * @spec JPMS + * @see Module#getName() */ public String getModuleName() { return moduleName; @@ -201,6 +203,7 @@ public final class StackTraceElement implements java.io.Serializable { * point represented by this stack trace element; {@code null} * if the module version is not available. * @since 9 + * @spec JPMS * @see java.lang.module.ModuleDescriptor.Version */ public String getModuleVersion() { @@ -216,6 +219,7 @@ public final class StackTraceElement implements java.io.Serializable { * if the class loader is not named. * * @since 9 + * @spec JPMS * @see java.lang.ClassLoader#getName() */ public String getClassLoaderName() { @@ -329,6 +333,8 @@ public final class StackTraceElement implements java.io.Serializable { * {@link java.lang.StackWalker.StackFrame}, where an implementation may * choose to omit some element in the returned string. * + * @revised 9 + * @spec JPMS * @see Throwable#printStackTrace() */ public String toString() { @@ -376,6 +382,9 @@ public final class StackTraceElement implements java.io.Serializable { * @return true if the specified object is another * {@code StackTraceElement} instance representing the same * execution point as this instance. + * + * @revised 9 + * @spec JPMS */ public boolean equals(Object obj) { if (obj==this) @@ -469,7 +478,7 @@ public final class StackTraceElement implements java.io.Serializable { if (!VM.isModuleSystemInited()) return true; - return Layer.boot() == m.getLayer() && HashedModules.contains(m); + return ModuleLayer.boot() == m.getLayer() && HashedModules.contains(m); } /* @@ -481,7 +490,7 @@ public final class StackTraceElement implements java.io.Serializable { static Set hashedModules() { - Optional resolvedModule = Layer.boot() + Optional resolvedModule = ModuleLayer.boot() .configuration() .findModule("java.base"); assert resolvedModule.isPresent(); diff --git a/jdk/src/java.base/share/classes/java/lang/StackWalker.java b/jdk/src/java.base/share/classes/java/lang/StackWalker.java index b5c43fd2d67..7e4bc1ebf88 100644 --- a/jdk/src/java.base/share/classes/java/lang/StackWalker.java +++ b/jdk/src/java.base/share/classes/java/lang/StackWalker.java @@ -29,6 +29,7 @@ import jdk.internal.reflect.CallerSensitive; import java.util.*; import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.Predicate; import java.util.stream.Stream; /** @@ -207,13 +208,23 @@ public final class StackWalker { /** * Shows all reflection frames. * - *

      By default, reflection frames are hidden. This includes the - * {@link java.lang.reflect.Method#invoke} method - * and the reflection implementation classes. A {@code StackWalker} with - * this {@code SHOW_REFLECT_FRAMES} option will show all reflection frames. - * The {@link #SHOW_HIDDEN_FRAMES} option can also be used to show all + *

      By default, reflection frames are hidden. A {@code StackWalker} + * configured with this {@code SHOW_REFLECT_FRAMES} option + * will show all reflection frames that + * include {@link java.lang.reflect.Method#invoke} and + * {@link java.lang.reflect.Constructor#newInstance(Object...)} + * and their reflection implementation classes. + * + *

      The {@link #SHOW_HIDDEN_FRAMES} option can also be used to show all * reflection frames and it will also show other hidden frames that * are implementation-specific. + * + * @apiNote + * This option includes the stack frames representing the invocation of + * {@code Method} and {@code Constructor}. Any utility methods that + * are equivalent to calling {@code Method.invoke} or + * {@code Constructor.newInstance} such as {@code Class.newInstance} + * are not filtered or controlled by any stack walking option. */ SHOW_REFLECT_FRAMES, /** @@ -268,7 +279,7 @@ public final class StackWalker { * If a security manager is present and the given {@code option} is * {@link Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE}, * it calls its {@link SecurityManager#checkPermission checkPermission} - * method for {@code StackFramePermission("retainClassReference")}. + * method for {@code RuntimePermission("getStackWalkerWithClassReference")}. * * @param option {@link Option stack walking option} * @@ -292,7 +303,7 @@ public final class StackWalker { * If a security manager is present and the given {@code options} contains * {@link Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE}, * it calls its {@link SecurityManager#checkPermission checkPermission} - * method for {@code StackFramePermission("retainClassReference")}. + * method for {@code RuntimePermission("getStackWalkerWithClassReference")}. * * @param options {@link Option stack walking option} * @@ -322,7 +333,7 @@ public final class StackWalker { * If a security manager is present and the given {@code options} contains * {@link Option#RETAIN_CLASS_REFERENCE Option.RETAIN_CLASS_REFERENCE}, * it calls its {@link SecurityManager#checkPermission checkPermission} - * method for {@code StackFramePermission("retainClassReference")}. + * method for {@code RuntimePermission("getStackWalkerWithClassReference")}. * *

      * The {@code estimateDepth} specifies the estimate number of stack frames @@ -365,7 +376,7 @@ public final class StackWalker { SecurityManager sm = System.getSecurityManager(); if (sm != null) { if (options.contains(Option.RETAIN_CLASS_REFERENCE)) { - sm.checkPermission(new StackFramePermission("retainClassReference")); + sm.checkPermission(new RuntimePermission("getStackWalkerWithClassReference")); } } } @@ -465,28 +476,31 @@ public final class StackWalker { } /** - * Gets the {@code Class} object of the caller invoking the method - * that calls this {@code getCallerClass} method. + * Gets the {@code Class} object of the caller who invoked the method + * that invoked {@code getCallerClass}. * - *

      Reflection frames, {@link java.lang.invoke.MethodHandle}, and - * hidden frames are filtered regardless of the + *

      This method filters {@linkplain Option#SHOW_REFLECT_FRAMES reflection + * frames}, {@link java.lang.invoke.MethodHandle}, and + * {@linkplain Option#SHOW_HIDDEN_FRAMES hidden frames} regardless of the * {@link Option#SHOW_REFLECT_FRAMES SHOW_REFLECT_FRAMES} * and {@link Option#SHOW_HIDDEN_FRAMES SHOW_HIDDEN_FRAMES} options * this {@code StackWalker} has been configured with. * + *

      This method should be called when a caller frame is present. If + * it is called from the bottom most frame on the stack, + * {@code IllegalCallerException} will be thrown. + * *

      This method throws {@code UnsupportedOperationException} * if this {@code StackWalker} is not configured with the * {@link Option#RETAIN_CLASS_REFERENCE RETAIN_CLASS_REFERENCE} option. - * This method should be called when a caller frame is present. If - * it is called from the last frame on the stack, - * {@code IllegalStateException} will be thrown. * * @apiNote * For example, {@code Util::getResourceBundle} loads a resource bundle - * on behalf of the caller. It calls this {@code getCallerClass} method - * to find the method calling {@code Util::getResourceBundle} and uses the caller's - * class loader to load the resource bundle. The caller class in this example - * is the {@code MyTool} class. + * on behalf of the caller. It invokes {@code getCallerClass} to identify + * the class whose method called {@code Util::getResourceBundle}. + * Then, it obtains the class loader of that class, and uses + * the class loader to load the resource bundle. The caller class + * in this example is {@code MyTool}. * *

      {@code
            * class Util {
      @@ -517,17 +531,17 @@ public final class StackWalker {
            * }
      * * When the {@code getCallerClass} method is called from a method that - * is the last frame on the stack, + * is the bottom most frame on the stack, * for example, {@code static public void main} method launched by the * {@code java} launcher, or a method invoked from a JNI attached thread, - * {@code IllegalStateException} is thrown. + * {@code IllegalCallerException} is thrown. * * @return {@code Class} object of the caller's caller invoking this method. * * @throws UnsupportedOperationException if this {@code StackWalker} * is not configured with {@link Option#RETAIN_CLASS_REFERENCE * Option.RETAIN_CLASS_REFERENCE}. - * @throws IllegalStateException if there is no caller frame, i.e. + * @throws IllegalCallerException if there is no caller frame, i.e. * when this {@code getCallerClass} method is called from a method * which is the last frame on the stack. */ diff --git a/jdk/src/java.base/share/classes/java/lang/StrictMath.java b/jdk/src/java.base/share/classes/java/lang/StrictMath.java index 63d895fa13c..400b3b25f34 100644 --- a/jdk/src/java.base/share/classes/java/lang/StrictMath.java +++ b/jdk/src/java.base/share/classes/java/lang/StrictMath.java @@ -975,7 +975,7 @@ public final class StrictMath { } /** - * Returns the floor modulus of the {@code long} and {@int} arguments. + * Returns the floor modulus of the {@code long} and {@code int} arguments. *

      * The floor modulus is {@code x - (floorDiv(x, y) * y)}, * has the same sign as the divisor {@code y}, and diff --git a/jdk/src/java.base/share/classes/java/lang/String.java b/jdk/src/java.base/share/classes/java/lang/String.java index 9bcc69963c7..1bd125dae54 100644 --- a/jdk/src/java.base/share/classes/java/lang/String.java +++ b/jdk/src/java.base/share/classes/java/lang/String.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1064,11 +1064,7 @@ public final class String if (!isLatin1()) { // utf16 str and latin1 abs can never be "equal" return false; } - for (int i = 0; i < len; i++) { - if ((char)(v1[i] & 0xff) != StringUTF16.getChar(v2, i)) { - return false; - } - } + return StringUTF16.contentEquals(v1, v2, len); } return true; } @@ -1120,10 +1116,8 @@ public final class String } } } else { - for (int i = 0; i < n; i++) { - if (StringUTF16.getChar(val, i) != cs.charAt(i)) { - return false; - } + if (!StringUTF16.contentEquals(val, cs, n)) { + return false; } } return true; @@ -1734,6 +1728,9 @@ public final class String if (tgtCount == 0) { return fromIndex; } + if (tgtCount > srcCount) { + return -1; + } if (srcCoder == tgtCoder) { return srcCoder == LATIN1 ? StringLatin1.indexOf(src, srcCount, tgt, tgtCount, fromIndex) @@ -1792,7 +1789,7 @@ public final class String * is the string being searched for. * * @param src the characters being searched. - * @param srcCoder coder handles the mapping between bytes/chars + * @param srcCoder coder handles the mapping between bytes/chars * @param srcCount count of the source string. * @param tgt the characters being searched for. * @param fromIndex the index to begin searching from. @@ -1807,12 +1804,12 @@ public final class String * consistency, don't check for null str. */ int rightIndex = srcCount - tgtCount; - if (fromIndex < 0) { - return -1; - } if (fromIndex > rightIndex) { fromIndex = rightIndex; } + if (fromIndex < 0) { + return -1; + } /* Empty string always matches. */ if (tgtCount == 0) { return fromIndex; @@ -1825,31 +1822,8 @@ public final class String if (srcCoder == LATIN1) { // && tgtCoder == UTF16 return -1; } - // srcCoder == UTF16 && tgtCoder == LATIN1 - int min = tgtCount - 1; - int i = min + fromIndex; - int strLastIndex = tgtCount - 1; - - char strLastChar = (char)(tgt[strLastIndex] & 0xff); - startSearchForLastChar: - while (true) { - while (i >= min && StringUTF16.getChar(src, i) != strLastChar) { - i--; - } - if (i < min) { - return -1; - } - int j = i - 1; - int start = j - strLastIndex; - int k = strLastIndex - 1; - while (j > start) { - if (StringUTF16.getChar(src, j--) != (tgt[k--] & 0xff)) { - i--; - continue startSearchForLastChar; - } - } - return start + 1; - } + // srcCoder == UTF16 && tgtCoder == LATIN1 + return StringUTF16.lastIndexOfLatin1(src, srcCount, tgt, tgtCount, fromIndex); } /** @@ -2235,23 +2209,23 @@ public final class String * Limit * Result * - * : - * 2 + * : + * 2 * {@code { "boo", "and:foo" }} - * : - * 5 + * : + * 5 * {@code { "boo", "and", "foo" }} - * : - * -2 + * : + * -2 * {@code { "boo", "and", "foo" }} - * o - * 5 + * o + * 5 * {@code { "b", "", ":and:f", "", "" }} - * o - * -2 + * o + * -2 * {@code { "b", "", ":and:f", "", "" }} - * o - * 0 + * o + * 0 * {@code { "b", "", ":and:f" }} * * @@ -2357,9 +2331,9 @@ public final class String * Regex * Result * - * : + * : * {@code { "boo", "and", "foo" }} - * o + * o * {@code { "b", "", ":and:f" }} * * @@ -2672,7 +2646,6 @@ public final class String * point is passed through uninterpreted. * * @return an IntStream of char values from this sequence - * @since 9 */ @Override public IntStream chars() { @@ -2692,7 +2665,6 @@ public final class String * {@code int} values which are then passed to the stream. * * @return an IntStream of Unicode code points from this sequence - * @since 9 */ @Override public IntStream codePoints() { @@ -3080,7 +3052,8 @@ public final class String */ static void checkIndex(int index, int length) { if (index < 0 || index >= length) { - throw new StringIndexOutOfBoundsException("index " + index); + throw new StringIndexOutOfBoundsException("index " + index + + ",length " + length); } } @@ -3118,7 +3091,7 @@ public final class String * If {@code begin} is negative, {@code begin} is greater than * {@code end}, or {@code end} is greater than {@code length}. */ - private static void checkBoundsBeginEnd(int begin, int end, int length) { + static void checkBoundsBeginEnd(int begin, int end, int length) { if (begin < 0 || begin > end || end > length) { throw new StringIndexOutOfBoundsException( "begin " + begin + ", end " + end + ", length " + length); diff --git a/jdk/src/java.base/share/classes/java/lang/StringCoding.java b/jdk/src/java.base/share/classes/java/lang/StringCoding.java index ccbe6f24b43..065dcd794b4 100644 --- a/jdk/src/java.base/share/classes/java/lang/StringCoding.java +++ b/jdk/src/java.base/share/classes/java/lang/StringCoding.java @@ -46,9 +46,6 @@ import sun.nio.cs.ArrayEncoder; import static java.lang.String.LATIN1; import static java.lang.String.UTF16; import static java.lang.String.COMPACT_STRINGS; -import static java.nio.charset.StandardCharsets.ISO_8859_1; -import static java.nio.charset.StandardCharsets.US_ASCII; -import static java.nio.charset.StandardCharsets.UTF_8; /** * Utility class for string encoding and decoding. @@ -64,6 +61,10 @@ class StringCoding { private static final ThreadLocal> encoder = new ThreadLocal<>(); + private static final Charset ISO_8859_1 = Charset.forName("iso-8859-1"); + private static final Charset US_ASCII = Charset.forName("us-ascii"); + private static final Charset UTF_8 = Charset.forName("utf-8"); + private static boolean warnUnsupportedCharset = true; private static T deref(ThreadLocal> tl) { @@ -271,8 +272,7 @@ class StringCoding { // (2)The defensive copy of the input byte/char[] has a big performance // impact, as well as the outgoing result byte/char[]. Need to do the // optimization check of (sm==null && classLoader0==null) for both. - // (3)getClass().getClassLoader0() is expensive - // (4)There might be a timing gap in isTrusted setting. getClassLoader0() + // (3)There might be a timing gap in isTrusted setting. getClassLoader0() // is only checked (and then isTrusted gets set) when (SM==null). It is // possible that the SM==null for now but then SM is NOT null later // when safeTrim() is invoked...the "safe" way to do is to redundant @@ -298,8 +298,8 @@ class StringCoding { if (len == 0) { return new Result().with(); } - if (System.getSecurityManager() != null && - cs.getClass().getClassLoader0() != null) { + if (cs.getClass().getClassLoader0() != null && + System.getSecurityManager() != null) { ba = Arrays.copyOfRange(ba, off, off + len); off = 0; } @@ -608,8 +608,8 @@ class StringCoding { if (len == 0) { return ba; } - boolean isTrusted = System.getSecurityManager() == null || - cs.getClass().getClassLoader0() == null; + boolean isTrusted = cs.getClass().getClassLoader0() == null || + System.getSecurityManager() == null; ce.onMalformedInput(CodingErrorAction.REPLACE) .onUnmappableCharacter(CodingErrorAction.REPLACE) .reset(); diff --git a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java index f3f16088f7a..809fab8eed5 100644 --- a/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java +++ b/jdk/src/java.base/share/classes/java/lang/StringConcatHelper.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -293,7 +293,7 @@ final class StringConcatHelper { if (coder == String.LATIN1) { return Integer.getChars(value, index, buf); } else { - return Integer.getCharsUTF16(value, index, buf); + return StringUTF16.getChars(value, index, buf); } } @@ -311,7 +311,7 @@ final class StringConcatHelper { if (coder == String.LATIN1) { return Long.getChars(value, index, buf); } else { - return Long.getCharsUTF16(value, index, buf); + return StringUTF16.getChars(value, index, buf); } } diff --git a/jdk/src/java.base/share/classes/java/lang/StringLatin1.java b/jdk/src/java.base/share/classes/java/lang/StringLatin1.java index b307bee6d46..73a84eb91ce 100644 --- a/jdk/src/java.base/share/classes/java/lang/StringLatin1.java +++ b/jdk/src/java.base/share/classes/java/lang/StringLatin1.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,7 +36,6 @@ import jdk.internal.HotSpotIntrinsicCandidate; import static java.lang.String.LATIN1; import static java.lang.String.UTF16; import static java.lang.String.checkOffset; -import static java.lang.String.checkBoundsOffCount; final class StringLatin1 { @@ -566,11 +565,7 @@ final class StringLatin1 { // inflatedCopy byte[] -> byte[] @HotSpotIntrinsicCandidate public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { - // We need a range check here because 'putChar' has no checks - checkBoundsOffCount(dstOff << 1, len << 1, dst.length); - for (int i = 0; i < len; i++) { - StringUTF16.putChar(dst, dstOff++, src[srcOff++] & 0xff); - } + StringUTF16.inflate(src, srcOff, dst, dstOff, len); } static class CharsSpliterator implements Spliterator.OfInt { diff --git a/jdk/src/java.base/share/classes/java/lang/StringUTF16.java b/jdk/src/java.base/share/classes/java/lang/StringUTF16.java index 2c0dd917a8f..e4a94d1bdf8 100644 --- a/jdk/src/java.base/share/classes/java/lang/StringUTF16.java +++ b/jdk/src/java.base/share/classes/java/lang/StringUTF16.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * 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,11 @@ import java.util.Locale; import java.util.Spliterator; import java.util.function.IntConsumer; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.vm.annotation.ForceInline; +import jdk.internal.vm.annotation.DontInline; import static java.lang.String.UTF16; import static java.lang.String.LATIN1; -import static java.lang.String.checkIndex; -import static java.lang.String.checkOffset; -import static java.lang.String.checkBoundsOffCount; final class StringUTF16 { @@ -51,33 +50,37 @@ final class StringUTF16 { } @HotSpotIntrinsicCandidate - public static void putChar(byte[] val, int index, int c) { + // intrinsic performs no bounds checks + static void putChar(byte[] val, int index, int c) { + assert index >= 0 && index < length(val) : "Trusted caller missed bounds check"; index <<= 1; val[index++] = (byte)(c >> HI_BYTE_SHIFT); val[index] = (byte)(c >> LO_BYTE_SHIFT); } @HotSpotIntrinsicCandidate - public static char getChar(byte[] val, int index) { + // intrinsic performs no bounds checks + static char getChar(byte[] val, int index) { + assert index >= 0 && index < length(val) : "Trusted caller missed bounds check"; index <<= 1; return (char)(((val[index++] & 0xff) << HI_BYTE_SHIFT) | ((val[index] & 0xff) << LO_BYTE_SHIFT)); } - public static char charAt(byte[] value, int index) { - if (index < 0 || index >= value.length >> 1) { - throw new StringIndexOutOfBoundsException(index); - } - return getChar(value, index); - } - public static int length(byte[] value) { return value.length >> 1; } - public static int codePointAt(byte[] value, int index, int end) { + private static int codePointAt(byte[] value, int index, int end, boolean checked) { + assert index < end; + if (checked) { + checkIndex(index, value); + } char c1 = getChar(value, index); if (Character.isHighSurrogate(c1) && ++index < end) { + if (checked) { + checkIndex(index, value); + } char c2 = getChar(value, index); if (Character.isLowSurrogate(c2)) { return Character.toCodePoint(c1, c2); @@ -86,10 +89,22 @@ final class StringUTF16 { return c1; } - public static int codePointBefore(byte[] value, int index) { - char c2 = getChar(value, --index); + public static int codePointAt(byte[] value, int index, int end) { + return codePointAt(value, index, end, false /* unchecked */); + } + + private static int codePointBefore(byte[] value, int index, boolean checked) { + --index; + if (checked) { + checkIndex(index, value); + } + char c2 = getChar(value, index); if (Character.isLowSurrogate(c2) && index > 0) { - char c1 = getChar(value, --index); + --index; + if (checked) { + checkIndex(index, value); + } + char c1 = getChar(value, index); if (Character.isHighSurrogate(c1)) { return Character.toCodePoint(c1, c2); } @@ -97,11 +112,19 @@ final class StringUTF16 { return c2; } - public static int codePointCount(byte[] value, int beginIndex, int endIndex) { + public static int codePointBefore(byte[] value, int index) { + return codePointBefore(value, index, false /* unchecked */); + } + + private static int codePointCount(byte[] value, int beginIndex, int endIndex, boolean checked) { + assert beginIndex <= endIndex; int count = endIndex - beginIndex; - for (int i = beginIndex; i < endIndex; ) { + int i = beginIndex; + if (checked && i < endIndex) { + checkBoundsBeginEnd(i, endIndex, value); + } + for (; i < endIndex - 1; ) { if (Character.isHighSurrogate(getChar(value, i++)) && - i < endIndex && Character.isLowSurrogate(getChar(value, i))) { count--; i++; @@ -110,6 +133,10 @@ final class StringUTF16 { return count; } + public static int codePointCount(byte[] value, int beginIndex, int endIndex) { + return codePointCount(value, beginIndex, endIndex, false /* unchecked */); + } + public static char[] toChars(byte[] value) { char[] dst = new char[value.length >> 1]; getChars(value, 0, dst.length, dst, 0); @@ -162,7 +189,7 @@ final class StringUTF16 { @HotSpotIntrinsicCandidate public static int compress(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { // We need a range check here because 'getChar' has no checks - checkBoundsOffCount(srcOff << 1, len << 1, src.length); + checkBoundsOffCount(srcOff, len, src); for (int i = 0; i < len; i++) { char c = getChar(src, srcOff); if (c > 0xFF) { @@ -212,7 +239,7 @@ final class StringUTF16 { public static void getChars(byte[] value, int srcBegin, int srcEnd, char dst[], int dstBegin) { // We need a range check here because 'getChar' has no checks if (srcBegin < srcEnd) { - checkBoundsOffCount(srcBegin << 1, (srcEnd - srcBegin) << 1, value.length); + checkBoundsOffCount(srcBegin, srcEnd - srcBegin, value); } for (int i = srcBegin; i < srcEnd; i++) { dst[dstBegin++] = getChar(value, i); @@ -319,14 +346,25 @@ final class StringUTF16 { if (str.length == 0) { return 0; } - if (value.length == 0) { + if (value.length < str.length) { return -1; } - return indexOf(value, length(value), str, length(str), 0); + return indexOfUnsafe(value, length(value), str, length(str), 0); } @HotSpotIntrinsicCandidate public static int indexOf(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) { + checkBoundsBeginEnd(fromIndex, valueCount, value); + checkBoundsBeginEnd(0, strCount, str); + return indexOfUnsafe(value, valueCount, str, strCount, fromIndex); + } + + + private static int indexOfUnsafe(byte[] value, int valueCount, byte[] str, int strCount, int fromIndex) { + assert fromIndex >= 0; + assert strCount > 0; + assert strCount <= length(str); + assert valueCount >= strCount; char first = getChar(str, 0); int max = (valueCount - strCount); for (int i = fromIndex; i <= max; i++) { @@ -348,6 +386,7 @@ final class StringUTF16 { return -1; } + /** * Handles indexOf Latin1 substring in UTF16 string. */ @@ -356,14 +395,24 @@ final class StringUTF16 { if (str.length == 0) { return 0; } - if (value.length == 0) { + if (length(value) < str.length) { return -1; } - return indexOfLatin1(value, length(value), str, str.length, 0); + return indexOfLatin1Unsafe(value, length(value), str, str.length, 0); } @HotSpotIntrinsicCandidate public static int indexOfLatin1(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { + checkBoundsBeginEnd(fromIndex, srcCount, src); + String.checkBoundsBeginEnd(0, tgtCount, tgt.length); + return indexOfLatin1Unsafe(src, srcCount, tgt, tgtCount, fromIndex); + } + + public static int indexOfLatin1Unsafe(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { + assert fromIndex >= 0; + assert tgtCount > 0; + assert tgtCount <= tgt.length; + assert srcCount >= tgtCount; char first = (char)(tgt[0] & 0xff); int max = (srcCount - tgtCount); for (int i = fromIndex; i <= max; i++) { @@ -389,6 +438,11 @@ final class StringUTF16 { @HotSpotIntrinsicCandidate private static int indexOfChar(byte[] value, int ch, int fromIndex, int max) { + checkBoundsBeginEnd(fromIndex, max, value); + return indexOfCharUnsafe(value, ch, fromIndex, max); + } + + private static int indexOfCharUnsafe(byte[] value, int ch, int fromIndex, int max) { for (int i = fromIndex; i < max; i++) { if (getChar(value, i) == ch) { return i; @@ -404,6 +458,7 @@ final class StringUTF16 { if (Character.isValidCodePoint(ch)) { final char hi = Character.highSurrogate(ch); final char lo = Character.lowSurrogate(ch); + checkBoundsBeginEnd(fromIndex, max, value); for (int i = fromIndex; i < max - 1; i++) { if (getChar(value, i) == hi && getChar(value, i + 1 ) == lo) { return i; @@ -413,13 +468,21 @@ final class StringUTF16 { return -1; } + // srcCoder == UTF16 && tgtCoder == UTF16 public static int lastIndexOf(byte[] src, int srcCount, byte[] tgt, int tgtCount, int fromIndex) { + assert fromIndex >= 0; + assert tgtCount > 0; + assert tgtCount <= length(tgt); int min = tgtCount - 1; int i = min + fromIndex; int strLastIndex = tgtCount - 1; + + checkIndex(strLastIndex, tgt); char strLastChar = getChar(tgt, strLastIndex); + checkIndex(i, src); + startSearchForLastChar: while (true) { while (i >= min && getChar(src, i) != strLastChar) { @@ -509,6 +572,9 @@ final class StringUTF16 { public static boolean regionMatchesCI(byte[] value, int toffset, byte[] other, int ooffset, int len) { int last = toffset + len; + assert toffset >= 0 && ooffset >= 0; + assert ooffset + len <= length(other); + assert last <= length(value); while (toffset < last) { char c1 = getChar(value, toffset++); char c2 = getChar(other, ooffset++); @@ -599,6 +665,8 @@ final class StringUTF16 { private static String toLowerCaseEx(String str, byte[] value, byte[] result, int first, Locale locale, boolean localeDependent) { + assert(result.length == value.length); + assert(first >= 0); int resultOffset = first; int length = value.length >> 1; int srcCount; @@ -633,6 +701,8 @@ final class StringUTF16 { System.arraycopy(result, 0, result2, 0, resultOffset << 1); result = result2; } + assert resultOffset >= 0; + assert resultOffset + mapLen <= length(result); for (int x = 0; x < mapLen; ++x) { putChar(result, resultOffset++, lowerCharArray[x]); } @@ -697,6 +767,8 @@ final class StringUTF16 { byte[] result, int first, Locale locale, boolean localeDependent) { + assert(result.length == value.length); + assert(first >= 0); int resultOffset = first; int length = value.length >> 1; int srcCount; @@ -733,10 +805,12 @@ final class StringUTF16 { byte[] result2 = newBytesFor((result.length >> 1) + mapLen - srcCount); System.arraycopy(result, 0, result2, 0, resultOffset << 1); result = result2; - } - for (int x = 0; x < mapLen; ++x) { + } + assert resultOffset >= 0; + assert resultOffset + mapLen <= length(result); + for (int x = 0; x < mapLen; ++x) { putChar(result, resultOffset++, upperCharArray[x]); - } + } } } return newString(result, 0, resultOffset); @@ -757,7 +831,7 @@ final class StringUTF16 { null; } - public static void putChars(byte[] val, int index, char[] str, int off, int end) { + private static void putChars(byte[] val, int index, char[] str, int off, int end) { while (off < end) { putChar(val, index++, str[off++]); } @@ -927,35 +1001,172 @@ final class StringUTF16 { //////////////////////////////////////////////////////////////// public static void putCharSB(byte[] val, int index, int c) { - checkIndex(index, val.length >> 1); + checkIndex(index, val); putChar(val, index, c); } public static void putCharsSB(byte[] val, int index, char[] ca, int off, int end) { - checkOffset(index + end - off, val.length >> 1); + checkBoundsBeginEnd(index, index + end - off, val); putChars(val, index, ca, off, end); } public static void putCharsSB(byte[] val, int index, CharSequence s, int off, int end) { - checkOffset(index + end - off, val.length >> 1); + checkBoundsBeginEnd(index, index + end - off, val); for (int i = off; i < end; i++) { putChar(val, index++, s.charAt(i)); } } public static int codePointAtSB(byte[] val, int index, int end) { - checkOffset(end, val.length >> 1); - return codePointAt(val, index, end); + return codePointAt(val, index, end, true /* checked */); } public static int codePointBeforeSB(byte[] val, int index) { - checkOffset(index, val.length >> 1); - return codePointBefore(val, index); + return codePointBefore(val, index, true /* checked */); } public static int codePointCountSB(byte[] val, int beginIndex, int endIndex) { - checkOffset(endIndex, val.length >> 1); - return codePointCount(val, beginIndex, endIndex); + return codePointCount(val, beginIndex, endIndex, true /* checked */); + } + + public static int getChars(int i, int begin, int end, byte[] value) { + checkBoundsBeginEnd(begin, end, value); + int pos = getChars(i, end, value); + assert begin == pos; + return pos; + } + + public static int getChars(long l, int begin, int end, byte[] value) { + checkBoundsBeginEnd(begin, end, value); + int pos = getChars(l, end, value); + assert begin == pos; + return pos; + } + + public static boolean contentEquals(byte[] v1, byte[] v2, int len) { + checkBoundsOffCount(0, len, v2); + for (int i = 0; i < len; i++) { + if ((char)(v1[i] & 0xff) != getChar(v2, i)) { + return false; + } + } + return true; + } + + public static boolean contentEquals(byte[] value, CharSequence cs, int len) { + checkOffset(len, value); + for (int i = 0; i < len; i++) { + if (getChar(value, i) != cs.charAt(i)) { + return false; + } + } + return true; + } + + public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4) { + int end = i + 4; + checkBoundsBeginEnd(i, end, value); + putChar(value, i++, c1); + putChar(value, i++, c2); + putChar(value, i++, c3); + putChar(value, i++, c4); + assert(i == end); + return end; + } + + public static int putCharsAt(byte[] value, int i, char c1, char c2, char c3, char c4, char c5) { + int end = i + 5; + checkBoundsBeginEnd(i, end, value); + putChar(value, i++, c1); + putChar(value, i++, c2); + putChar(value, i++, c3); + putChar(value, i++, c4); + putChar(value, i++, c5); + assert(i == end); + return end; + } + + public static char charAt(byte[] value, int index) { + checkIndex(index, value); + return getChar(value, index); + } + + public static void reverse(byte[] val, int count) { + checkOffset(count, val); + int n = count - 1; + boolean hasSurrogates = false; + for (int j = (n-1) >> 1; j >= 0; j--) { + int k = n - j; + char cj = getChar(val, j); + char ck = getChar(val, k); + putChar(val, j, ck); + putChar(val, k, cj); + if (Character.isSurrogate(cj) || + Character.isSurrogate(ck)) { + hasSurrogates = true; + } + } + if (hasSurrogates) { + reverseAllValidSurrogatePairs(val, count); + } + } + + /** Outlined helper method for reverse() */ + private static void reverseAllValidSurrogatePairs(byte[] val, int count) { + for (int i = 0; i < count - 1; i++) { + char c2 = getChar(val, i); + if (Character.isLowSurrogate(c2)) { + char c1 = getChar(val, i + 1); + if (Character.isHighSurrogate(c1)) { + putChar(val, i++, c1); + putChar(val, i, c2); + } + } + } + } + + // inflatedCopy byte[] -> byte[] + public static void inflate(byte[] src, int srcOff, byte[] dst, int dstOff, int len) { + // We need a range check here because 'putChar' has no checks + checkBoundsOffCount(dstOff, len, dst); + for (int i = 0; i < len; i++) { + putChar(dst, dstOff++, src[srcOff++] & 0xff); + } + } + + // srcCoder == UTF16 && tgtCoder == LATIN1 + public static int lastIndexOfLatin1(byte[] src, int srcCount, + byte[] tgt, int tgtCount, int fromIndex) { + assert fromIndex >= 0; + assert tgtCount > 0; + assert tgtCount <= tgt.length; + int min = tgtCount - 1; + int i = min + fromIndex; + int strLastIndex = tgtCount - 1; + + char strLastChar = (char)(tgt[strLastIndex] & 0xff); + + checkIndex(i, src); + + startSearchForLastChar: + while (true) { + while (i >= min && getChar(src, i) != strLastChar) { + i--; + } + if (i < min) { + return -1; + } + int j = i - 1; + int start = j - strLastIndex; + int k = strLastIndex - 1; + while (j > start) { + if (getChar(src, j--) != (tgt[k--] & 0xff)) { + i--; + continue startSearchForLastChar; + } + } + return start + 1; + } } //////////////////////////////////////////////////////////////// @@ -975,4 +1186,123 @@ final class StringUTF16 { } static final int MAX_LENGTH = Integer.MAX_VALUE >> 1; + + // Used by trusted callers. Assumes all necessary bounds checks have + // been done by the caller. + + /** + * This is a variant of {@link Integer#getChars(int, int, byte[])}, but for + * UTF-16 coder. + * + * @param i value to convert + * @param index next index, after the least significant digit + * @param buf target buffer, UTF16-coded. + * @return index of the most significant digit or minus sign, if present + */ + static int getChars(int i, int index, byte[] buf) { + int q, r; + int charPos = index; + + boolean negative = (i < 0); + if (!negative) { + i = -i; + } + + // Get 2 digits/iteration using ints + while (i <= -100) { + q = i / 100; + r = (q * 100) - i; + i = q; + putChar(buf, --charPos, Integer.DigitOnes[r]); + putChar(buf, --charPos, Integer.DigitTens[r]); + } + + // We know there are at most two digits left at this point. + q = i / 10; + r = (q * 10) - i; + putChar(buf, --charPos, '0' + r); + + // Whatever left is the remaining digit. + if (q < 0) { + putChar(buf, --charPos, '0' - q); + } + + if (negative) { + putChar(buf, --charPos, '-'); + } + return charPos; + } + + /** + * This is a variant of {@link Long#getChars(long, int, byte[])}, but for + * UTF-16 coder. + * + * @param i value to convert + * @param index next index, after the least significant digit + * @param buf target buffer, UTF16-coded. + * @return index of the most significant digit or minus sign, if present + */ + static int getChars(long i, int index, byte[] buf) { + long q; + int r; + int charPos = index; + + boolean negative = (i < 0); + if (!negative) { + i = -i; + } + + // Get 2 digits/iteration using longs until quotient fits into an int + while (i <= Integer.MIN_VALUE) { + q = i / 100; + r = (int)((q * 100) - i); + i = q; + putChar(buf, --charPos, Integer.DigitOnes[r]); + putChar(buf, --charPos, Integer.DigitTens[r]); + } + + // Get 2 digits/iteration using ints + int q2; + int i2 = (int)i; + while (i2 <= -100) { + q2 = i2 / 100; + r = (q2 * 100) - i2; + i2 = q2; + putChar(buf, --charPos, Integer.DigitOnes[r]); + putChar(buf, --charPos, Integer.DigitTens[r]); + } + + // We know there are at most two digits left at this point. + q2 = i2 / 10; + r = (q2 * 10) - i2; + putChar(buf, --charPos, '0' + r); + + // Whatever left is the remaining digit. + if (q2 < 0) { + putChar(buf, --charPos, '0' - q2); + } + + if (negative) { + putChar(buf, --charPos, '-'); + } + return charPos; + } + // End of trusted methods. + + public static void checkIndex(int off, byte[] val) { + String.checkIndex(off, length(val)); + } + + public static void checkOffset(int off, byte[] val) { + String.checkOffset(off, length(val)); + } + + public static void checkBoundsBeginEnd(int begin, int end, byte[] val) { + String.checkBoundsBeginEnd(begin, end, length(val)); + } + + public static void checkBoundsOffCount(int offset, int count, byte[] val) { + String.checkBoundsOffCount(offset, count, length(val)); + } + } diff --git a/jdk/src/java.base/share/classes/java/lang/System.java b/jdk/src/java.base/share/classes/java/lang/System.java index 1577e215e35..9b3e3cf6c66 100644 --- a/jdk/src/java.base/share/classes/java/lang/System.java +++ b/jdk/src/java.base/share/classes/java/lang/System.java @@ -35,32 +35,32 @@ import java.io.InputStream; import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.lang.annotation.Annotation; +import java.lang.module.ModuleDescriptor; import java.lang.reflect.Constructor; import java.lang.reflect.Executable; -import java.lang.reflect.Layer; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.lang.reflect.Module; +import java.net.URI; import java.net.URL; import java.security.AccessControlContext; -import java.util.Properties; -import java.util.PropertyPermission; -import java.util.Map; +import java.security.ProtectionDomain; import java.security.AccessController; import java.security.PrivilegedAction; import java.nio.channels.Channel; import java.nio.channels.spi.SelectorProvider; +import java.util.Map; +import java.util.Objects; +import java.util.Properties; +import java.util.PropertyPermission; +import java.util.ResourceBundle; +import java.util.function.Supplier; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; -import java.util.Objects; -import java.util.ResourceBundle; -import java.util.function.Supplier; -import sun.nio.ch.Interruptible; +import jdk.internal.module.ModuleBootstrap; +import jdk.internal.module.ServicesCatalog; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; -import sun.security.util.SecurityConstants; -import sun.reflect.annotation.AnnotationType; import jdk.internal.HotSpotIntrinsicCandidate; import jdk.internal.misc.JavaLangAccess;; import jdk.internal.misc.SharedSecrets;; @@ -68,8 +68,9 @@ import jdk.internal.misc.VM; import jdk.internal.logger.LoggerFinderLoader; import jdk.internal.logger.LazyLoggers; import jdk.internal.logger.LocalizedLoggerWrapper; - -import jdk.internal.module.ModuleBootstrap; +import sun.reflect.annotation.AnnotationType; +import sun.nio.ch.Interruptible; +import sun.security.util.SecurityConstants; /** * The System class contains several useful class fields @@ -534,6 +535,8 @@ public final class System { * @param x object for which the hashCode is to be calculated * @return the hashCode * @since 1.1 + * @see Object#hashCode + * @see java.util.Objects#hashCode(Object) */ @HotSpotIntrinsicCandidate public static native int identityHashCode(Object x); @@ -898,7 +901,7 @@ public final class System { * being thrown. If no exception is thrown the value of the * variable name is returned. * - *

      System + *

      System * properties and environment variables are both * conceptually mappings between names and values. Both * mechanisms can be used to pass user-defined information to a @@ -1159,7 +1162,7 @@ public final class System { * @param msg the string message (or a key in the message catalog, if * this logger is a {@link * LoggerFinder#getLocalizedLogger(java.lang.String, - * java.util.ResourceBundle, java.lang.reflect.Module) localized logger}); + * java.util.ResourceBundle, java.lang.Module) localized logger}); * can be {@code null}. * * @throws NullPointerException if {@code level} is {@code null}. @@ -1227,7 +1230,7 @@ public final class System { * @param msg the string message (or a key in the message catalog, if * this logger is a {@link * LoggerFinder#getLocalizedLogger(java.lang.String, - * java.util.ResourceBundle, java.lang.reflect.Module) localized logger}); + * java.util.ResourceBundle, java.lang.Module) localized logger}); * can be {@code null}. * @param thrown a {@code Throwable} associated with the log message; * can be {@code null}. @@ -1276,7 +1279,7 @@ public final class System { * java.text.MessageFormat} format, (or a key in the message * catalog, if this logger is a {@link * LoggerFinder#getLocalizedLogger(java.lang.String, - * java.util.ResourceBundle, java.lang.reflect.Module) localized logger}); + * java.util.ResourceBundle, java.lang.Module) localized logger}); * can be {@code null}. * @param params an optional list of parameters to the message (may be * none). @@ -1481,7 +1484,7 @@ public final class System { * message localization. * * @implSpec By default, this method calls {@link - * #getLogger(java.lang.String, java.lang.reflect.Module) + * #getLogger(java.lang.String, java.lang.Module) * this.getLogger(name, module)} to obtain a logger, then wraps that * logger in a {@link Logger} instance where all methods that do not * take a {@link ResourceBundle} as parameter are redirected to one @@ -1565,12 +1568,20 @@ public final class System { * @implSpec * Instances returned by this method route messages to loggers * obtained by calling {@link LoggerFinder#getLogger(java.lang.String, - * java.lang.reflect.Module) LoggerFinder.getLogger(name, module)}, where + * java.lang.Module) LoggerFinder.getLogger(name, module)}, where * {@code module} is the caller's module. + * In cases where {@code System.getLogger} is called from a context where + * there is no caller frame on the stack (e.g when called directly + * from a JNI attached thread), {@code IllegalCallerException} is thrown. + * To obtain a logger in such a context, use an auxiliary class that will + * implicitly be identified as the caller, or use the system {@link + * LoggerFinder#getLoggerFinder() LoggerFinder} to obtain a logger instead. + * Note that doing the latter may eagerly initialize the underlying + * logging system. * * @apiNote * This method may defer calling the {@link - * LoggerFinder#getLogger(java.lang.String, java.lang.reflect.Module) + * LoggerFinder#getLogger(java.lang.String, java.lang.Module) * LoggerFinder.getLogger} method to create an actual logger supplied by * the logging backend, for instance, to allow loggers to be obtained during * the system initialization time. @@ -1579,6 +1590,8 @@ public final class System { * @return an instance of {@link Logger} that can be used by the calling * class. * @throws NullPointerException if {@code name} is {@code null}. + * @throws IllegalCallerException if there is no Java caller frame on the + * stack. * * @since 9 */ @@ -1586,6 +1599,9 @@ public final class System { public static Logger getLogger(String name) { Objects.requireNonNull(name); final Class caller = Reflection.getCallerClass(); + if (caller == null) { + throw new IllegalCallerException("no caller frame"); + } return LazyLoggers.getLogger(name, caller.getModule()); } @@ -1598,9 +1614,17 @@ public final class System { * @implSpec * The returned logger will perform message localization as specified * by {@link LoggerFinder#getLocalizedLogger(java.lang.String, - * java.util.ResourceBundle, java.lang.reflect.Module) - * LoggerFinder.getLocalizedLogger(name, bundle, module}, where + * java.util.ResourceBundle, java.lang.Module) + * LoggerFinder.getLocalizedLogger(name, bundle, module)}, where * {@code module} is the caller's module. + * In cases where {@code System.getLogger} is called from a context where + * there is no caller frame on the stack (e.g when called directly + * from a JNI attached thread), {@code IllegalCallerException} is thrown. + * To obtain a logger in such a context, use an auxiliary class that + * will implicitly be identified as the caller, or use the system {@link + * LoggerFinder#getLoggerFinder() LoggerFinder} to obtain a logger instead. + * Note that doing the latter may eagerly initialize the underlying + * logging system. * * @apiNote * This method is intended to be used after the system is fully initialized. @@ -1619,6 +1643,8 @@ public final class System { * resource bundle for message localization. * @throws NullPointerException if {@code name} is {@code null} or * {@code bundle} is {@code null}. + * @throws IllegalCallerException if there is no Java caller frame on the + * stack. * * @since 9 */ @@ -1627,6 +1653,9 @@ public final class System { final ResourceBundle rb = Objects.requireNonNull(bundle); Objects.requireNonNull(name); final Class caller = Reflection.getCallerClass(); + if (caller == null) { + throw new IllegalCallerException("no caller frame"); + } final SecurityManager sm = System.getSecurityManager(); // We don't use LazyLoggers if a resource bundle is specified. // Bootstrap sensitive classes in the JDK do not use resource bundles @@ -1737,6 +1766,7 @@ public final class System { * @since 1.1 */ @Deprecated(since="1.2", forRemoval=true) + @SuppressWarnings("removal") public static void runFinalizersOnExit(boolean value) { Runtime.runFinalizersOnExit(value); } @@ -1844,6 +1874,39 @@ public final class System { return new PrintStream(new BufferedOutputStream(fos, 128), true); } + /** + * Logs an exception/error at initialization time to stdout or stderr. + * + * @param printToStderr to print to stderr rather than stdout + * @param printStackTrace to print the stack trace + * @param msg the message to print before the exception, can be {@code null} + * @param e the exception or error + */ + private static void logInitException(boolean printToStderr, + boolean printStackTrace, + String msg, + Throwable e) { + if (VM.initLevel() < 1) { + throw new InternalError("system classes not initialized"); + } + PrintStream log = (printToStderr) ? err : out; + if (msg != null) { + log.println(msg); + } + if (printStackTrace) { + e.printStackTrace(log); + } else { + log.println(e); + for (Throwable suppressed : e.getSuppressed()) { + log.println("Suppressed: " + suppressed); + } + Throwable cause = e.getCause(); + if (cause != null) { + log.println("Caused by: " + cause); + } + } + } + /** * Initialize the system class. Called after thread initialization. */ @@ -1917,18 +1980,30 @@ public final class System { } // @see #initPhase2() - private static Layer bootLayer; + static ModuleLayer bootLayer; /* * Invoked by VM. Phase 2 module system initialization. * Only classes in java.base can be loaded in this phase. + * + * @param printToStderr print exceptions to stderr rather than stdout + * @param printStackTrace print stack trace when exception occurs + * + * @return JNI_OK for success, JNI_ERR for failure */ - private static void initPhase2() { - // initialize the module system - System.bootLayer = ModuleBootstrap.boot(); + private static int initPhase2(boolean printToStderr, boolean printStackTrace) { + try { + bootLayer = ModuleBootstrap.boot(); + } catch (Exception | Error e) { + logInitException(printToStderr, printStackTrace, + "Error occurred during initialization of boot layer", e); + return -1; // JNI_ERR + } // module system initialized VM.initLevel(2); + + return 0; // JNI_OK } /* @@ -1942,10 +2017,6 @@ public final class System { * the application classpath or modulepath. */ private static void initPhase3() { - // Initialize publicLookup early, to avoid bootstrapping circularities - // with security manager using java.lang.invoke infrastructure. - java.lang.invoke.MethodHandles.publicLookup(); - // set security manager String cn = System.getProperty("java.security.manager"); if (cn != null) { @@ -2029,15 +2100,16 @@ public final class System { public Thread newThreadWithAcc(Runnable target, AccessControlContext acc) { return new Thread(target, acc); } + @SuppressWarnings("deprecation") public void invokeFinalize(Object o) throws Throwable { o.finalize(); } - public Layer getBootLayer() { - return bootLayer; - } public ConcurrentHashMap createOrGetClassLoaderValueMap(ClassLoader cl) { return cl.createOrGetClassLoaderValueMap(); } + public Class defineClass(ClassLoader loader, String name, byte[] b, ProtectionDomain pd, String source) { + return ClassLoader.defineClass1(loader, name, b, 0, b.length, pd, source); + } public Class findBootstrapClassOrNull(ClassLoader cl, String name) { return cl.findBootstrapClassOrNull(name); } @@ -2053,6 +2125,47 @@ public final class System { public String fastUUID(long lsb, long msb) { return Long.fastUUID(lsb, msb); } + public void invalidatePackageAccessCache() { + SecurityManager.invalidatePackageAccessCache(); + } + public Module defineModule(ClassLoader loader, + ModuleDescriptor descriptor, + URI uri) { + return new Module(null, loader, descriptor, uri); + } + public Module defineUnnamedModule(ClassLoader loader) { + return new Module(loader); + } + public void addReads(Module m1, Module m2) { + m1.implAddReads(m2); + } + public void addReadsAllUnnamed(Module m) { + m.implAddReadsAllUnnamed(); + } + public void addExports(Module m, String pn, Module other) { + m.implAddExports(pn, other); + } + public void addExportsToAllUnnamed(Module m, String pn) { + m.implAddExportsToAllUnnamed(pn); + } + public void addOpens(Module m, String pn, Module other) { + m.implAddOpens(pn, other); + } + public void addOpensToAllUnnamed(Module m, String pn) { + m.implAddOpensToAllUnnamed(pn); + } + public void addUses(Module m, Class service) { + m.implAddUses(service); + } + public ServicesCatalog getServicesCatalog(ModuleLayer layer) { + return layer.getServicesCatalog(); + } + public Stream layers(ModuleLayer layer) { + return layer.layers(); + } + public Stream layers(ClassLoader loader) { + return ModuleLayer.layers(loader); + } }); } } diff --git a/jdk/src/java.base/share/classes/java/lang/Thread.java b/jdk/src/java.base/share/classes/java/lang/Thread.java index a7fc391d540..8ecc90dd964 100644 --- a/jdk/src/java.base/share/classes/java/lang/Thread.java +++ b/jdk/src/java.base/share/classes/java/lang/Thread.java @@ -927,7 +927,7 @@ class Thread implements Runnable { * for example), the interrupt method should be used to * interrupt the wait. * For more information, see - * Why + * Why * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. */ @Deprecated(since="1.2") @@ -960,7 +960,7 @@ class Thread implements Runnable { * could be used to generate exceptions that the target thread was * not prepared to handle. * For more information, see - * Why + * Why * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. * This method is subject to removal in a future version of Java SE. */ @@ -1082,7 +1082,7 @@ class Thread implements Runnable { * If another thread ever attempted to lock this resource, deadlock * would result. Such deadlocks typically manifest themselves as * "frozen" processes. For more information, see - * + * * Why are Thread.stop, Thread.suspend and Thread.resume Deprecated?. * This method is subject to removal in a future version of Java SE. * @throws NoSuchMethodError always @@ -1122,7 +1122,7 @@ class Thread implements Runnable { * monitor prior to calling resume, deadlock results. Such * deadlocks typically manifest themselves as "frozen" processes. * For more information, see - * Why + * Why * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. */ @Deprecated(since="1.2") @@ -1148,7 +1148,7 @@ class Thread implements Runnable { * @deprecated This method exists solely for use with {@link #suspend}, * which has been deprecated because it is deadlock-prone. * For more information, see - * Why + * Why * are Thread.stop, Thread.suspend and Thread.resume Deprecated?. */ @Deprecated(since="1.2") diff --git a/jdk/src/java.base/share/classes/java/lang/UnsupportedOperationException.java b/jdk/src/java.base/share/classes/java/lang/UnsupportedOperationException.java index 2d9c7a00cbf..eebc580e6f1 100644 --- a/jdk/src/java.base/share/classes/java/lang/UnsupportedOperationException.java +++ b/jdk/src/java.base/share/classes/java/lang/UnsupportedOperationException.java @@ -29,7 +29,7 @@ package java.lang; * Thrown to indicate that the requested operation is not supported.

      * * This class is a member of the - * + * * Java Collections Framework. * * @author Josh Bloch diff --git a/jdk/src/java.base/share/classes/java/lang/VersionProps.java.template b/jdk/src/java.base/share/classes/java/lang/VersionProps.java.template index 367103a13fc..53a9160c8ce 100644 --- a/jdk/src/java.base/share/classes/java/lang/VersionProps.java.template +++ b/jdk/src/java.base/share/classes/java/lang/VersionProps.java.template @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ package java.lang; import java.io.PrintStream; -import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Optional; @@ -77,21 +77,32 @@ class VersionProps { // This method is reflectively used by regression tests. static List parseVersionNumbers(String version) { - List verNumbers = new ArrayList<>(4); + // Let's find the size of an array required to hold $VNUM components + int size = 0; int prevIndex = 0; + do { + prevIndex = version.indexOf('.', prevIndex) + 1; + size++; + } while (prevIndex > 0); + Integer[] verNumbers = new Integer[size]; + + // Fill in the array with $VNUM components + int n = 0; + prevIndex = 0; int index = version.indexOf('.'); - while (index > 0) { - verNumbers.add(parseVersionNumber(version, prevIndex, index)); + while (index > -1) { + verNumbers[n] = parseVersionNumber(version, prevIndex, index); prevIndex = index + 1; // Skip the period index = version.indexOf('.', prevIndex); + n++; } - verNumbers.add(parseVersionNumber(version, prevIndex, version.length())); + verNumbers[n] = parseVersionNumber(version, prevIndex, version.length()); - if (verNumbers.get(0) == 0 || verNumbers.get(verNumbers.size() - 1) == 0) - throw new IllegalArgumentException("Leading/trailing zeros not supported (" + - verNumbers + ")"); + if (verNumbers[0] == 0 || verNumbers[n] == 0) + throw new IllegalArgumentException("Leading/trailing zeros not allowed (" + + Arrays.toString(verNumbers) + ")"); - return verNumbers; + return List.of(verNumbers); } static List versionNumbers() { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java b/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java similarity index 99% rename from jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java rename to jdk/src/java.base/share/classes/java/lang/WeakPairMap.java index 39a623a4704..1e4e12767b3 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/WeakPairMap.java +++ b/jdk/src/java.base/share/classes/java/lang/WeakPairMap.java @@ -22,7 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package java.lang.reflect; +package java.lang; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; diff --git a/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java b/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java index 14780fe6827..bbab9cdacc2 100644 --- a/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java +++ b/jdk/src/java.base/share/classes/java/lang/annotation/ElementType.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. * 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,7 @@ package java.lang.annotation; /** * The constants of this enumerated type provide a simple classification of the * syntactic locations where annotations may appear in a Java program. These - * constants are used in {@link Target java.lang.annotation.Target} + * constants are used in {@link java.lang.annotation.Target Target} * meta-annotations to specify where it is legal to write annotations of a * given type. * diff --git a/jdk/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html b/jdk/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html new file mode 100644 index 00000000000..aa6ba4981f4 --- /dev/null +++ b/jdk/src/java.base/share/classes/java/lang/doc-files/threadPrimitiveDeprecation.html @@ -0,0 +1,364 @@ + + + + + Java Thread Primitive Deprecation + + + +

      Java Thread Primitive Deprecation

      +
      +

      Why is Thread.stop deprecated?

      +

      Because it is inherently unsafe. Stopping a thread causes it to +unlock all the monitors that it has locked. (The monitors are +unlocked as the ThreadDeath exception propagates up +the stack.) If any of the objects previously protected by these +monitors were in an inconsistent state, other threads may now view +these objects in an inconsistent state. Such objects are said to be +damaged. When threads operate on damaged objects, arbitrary +behavior can result. This behavior may be subtle and difficult to +detect, or it may be pronounced. Unlike other unchecked exceptions, +ThreadDeath kills threads silently; thus, the user has +no warning that his program may be corrupted. The corruption can +manifest itself at any time after the actual damage occurs, even +hours or days in the future.

      +
      +

      Couldn't I just catch the ThreadDeath exception +and fix the damaged object?

      +

      In theory, perhaps, but it would vastly complicate the +task of writing correct multithreaded code. The task would be +nearly insurmountable for two reasons:

      +
        +
      1. A thread can throw a ThreadDeath exception +almost anywhere. All synchronized methods and blocks would +have to be studied in great detail, with this in mind.
      2. +
      3. A thread can throw a second ThreadDeath exception +while cleaning up from the first (in the catch or +finally clause). Cleanup would have to be repeated till +it succeeded. The code to ensure this would be quite complex.
      4. +
      +In sum, it just isn't practical. +
      +

      What about Thread.stop(Throwable)?

      +

      In addition to all of the problems noted above, this method may +be used to generate exceptions that its target thread is unprepared +to handle (including checked exceptions that the thread could not +possibly throw, were it not for this method). For example, the +following method is behaviorally identical to Java's +throw operation, but circumvents the compiler's +attempts to guarantee that the calling method has declared all of +the checked exceptions that it may throw:

      +
      +    static void sneakyThrow(Throwable t) {
      +        Thread.currentThread().stop(t);
      +    }
      +
      +
      +

      What should I use instead of Thread.stop?

      +

      Most uses of stop should be replaced by code that +simply modifies some variable to indicate that the target thread +should stop running. The target thread should check this variable +regularly, and return from its run method in an orderly fashion if +the variable indicates that it is to stop running. To ensure prompt +communication of the stop-request, the variable must be +volatile (or access to the variable must be +synchronized).

      +

      For example, suppose your applet contains the following +start, stop and run +methods:

      +
      +    private Thread blinker;
      +
      +    public void start() {
      +        blinker = new Thread(this);
      +        blinker.start();
      +    }
      +
      +    public void stop() {
      +        blinker.stop();  // UNSAFE!
      +    }
      +
      +    public void run() {
      +        while (true) {
      +            try {
      +                Thread.sleep(interval);
      +            } catch (InterruptedException e){
      +            }
      +            repaint();
      +        }
      +    }
      +
      +You can avoid the use of Thread.stop by replacing the +applet's stop and run methods with: +
      +    private volatile Thread blinker;
      +
      +    public void stop() {
      +        blinker = null;
      +    }
      +
      +    public void run() {
      +        Thread thisThread = Thread.currentThread();
      +        while (blinker == thisThread) {
      +            try {
      +                Thread.sleep(interval);
      +            } catch (InterruptedException e){
      +            }
      +            repaint();
      +        }
      +    }
      +
      +
      +

      How do I stop a thread that waits for long periods (e.g., for +input)?

      +

      That's what the Thread.interrupt method is for. The +same "state based" signaling mechanism shown above can be used, but +the state change (blinker = null, in the previous +example) can be followed by a call to +Thread.interrupt, to interrupt the wait:

      +
      +    public void stop() {
      +        Thread moribund = waiter;
      +        waiter = null;
      +        moribund.interrupt();
      +    }
      +
      +For this technique to work, it's critical that any method that +catches an interrupt exception and is not prepared to deal with it +immediately reasserts the exception. We say reasserts +rather than rethrows, because it is not always possible to +rethrow the exception. If the method that catches the +InterruptedException is not declared to throw this +(checked) exception, then it should "reinterrupt itself" with the +following incantation: +
      +    Thread.currentThread().interrupt();
      +
      +This ensures that the Thread will reraise the +InterruptedException as soon as it is able. +
      +

      What if a thread doesn't respond to +Thread.interrupt?

      +

      In some cases, you can use application specific tricks. For +example, if a thread is waiting on a known socket, you can close +the socket to cause the thread to return immediately. +Unfortunately, there really isn't any technique that works in +general. It should be noted that in all situations where a +waiting thread doesn't respond to Thread.interrupt, it +wouldn't respond to Thread.stop either. Such +cases include deliberate denial-of-service attacks, and I/O +operations for which thread.stop and thread.interrupt do not work +properly.

      +
      +

      Why are Thread.suspend and +Thread.resume deprecated?

      +

      Thread.suspend is inherently deadlock-prone. If the +target thread holds a lock on the monitor protecting a critical +system resource when it is suspended, no thread can access this +resource until the target thread is resumed. If the thread that +would resume the target thread attempts to lock this monitor prior +to calling resume, deadlock results. Such deadlocks +typically manifest themselves as "frozen" processes.

      +
      +

      What should I use instead of Thread.suspend and +Thread.resume?

      +

      As with Thread.stop, the prudent approach is to +have the "target thread" poll a variable indicating the desired +state of the thread (active or suspended). When the desired state +is suspended, the thread waits using Object.wait. When +the thread is resumed, the target thread is notified using +Object.notify.

      +

      For example, suppose your applet contains the following +mousePressed event handler, which toggles the state of a thread +called blinker:

      +
      +    private boolean threadSuspended;
      +
      +    Public void mousePressed(MouseEvent e) {
      +        e.consume();
      +
      +        if (threadSuspended)
      +            blinker.resume();
      +        else
      +            blinker.suspend();  // DEADLOCK-PRONE!
      +
      +        threadSuspended = !threadSuspended;
      +    }
      +
      +You can avoid the use of Thread.suspend and +Thread.resume by replacing the event handler above +with: +
      +    public synchronized void mousePressed(MouseEvent e) {
      +        e.consume();
      +
      +        threadSuspended = !threadSuspended;
      +
      +        if (!threadSuspended)
      +            notify();
      +    }
      +
      +and adding the following code to the "run loop": +
      +                synchronized(this) {
      +                    while (threadSuspended)
      +                        wait();
      +                }
      +
      +The wait method throws the +InterruptedException, so it must be inside a try +... catch clause. It's fine to put it in the same clause as +the sleep. The check should follow (rather than +precede) the sleep so the window is immediately +repainted when the thread is "resumed." The resulting +run method follows: +
      +    public void run() {
      +        while (true) {
      +            try {
      +                Thread.sleep(interval);
      +
      +                synchronized(this) {
      +                    while (threadSuspended)
      +                        wait();
      +                }
      +            } catch (InterruptedException e){
      +            }
      +            repaint();
      +        }
      +    }
      +
      +Note that the notify in the mousePressed +method and the wait in the run method are +inside synchronized blocks. This is required by the +language, and ensures that wait and +notify are properly serialized. In practical terms, +this eliminates race conditions that could cause the "suspended" +thread to miss a notify and remain suspended +indefinitely. +

      While the cost of synchronization in Java is decreasing as the +platform matures, it will never be free. A simple trick can be used +to remove the synchronization that we've added to each iteration of +the "run loop." The synchronized block that was added is replaced +by a slightly more complex piece of code that enters a synchronized +block only if the thread has actually been suspended:

      +
      +                if (threadSuspended) {
      +                    synchronized(this) {
      +                        while (threadSuspended)
      +                            wait();
      +                    }
      +                }
      +
      +

      In the absence of explicit synchronization, +threadSuspended must be made volatile to ensure +prompt communication of the suspend-request.

      +The resulting run method is: +
      +    private volatile boolean threadSuspended;
      +
      +    public void run() {
      +        while (true) {
      +            try {
      +                Thread.sleep(interval);
      +
      +                if (threadSuspended) {
      +                    synchronized(this) {
      +                        while (threadSuspended)
      +                            wait();
      +                    }
      +                }
      +            } catch (InterruptedException e){
      +            }
      +            repaint();
      +        }
      +    }
      +
      +
      +

      Can I combine the two techniques to produce a thread that may +be safely "stopped" or "suspended"?

      +Yes, it's reasonably straightforward. The one subtlety is that the +target thread may already be suspended at the time that another +thread tries to stop it. If the stop method merely sets +the state variable (blinker) to null, the target thread +will remain suspended (waiting on the monitor), rather than exiting +gracefully as it should. If the applet is restarted, multiple +threads could end up waiting on the monitor at the same time, +resulting in erratic behavior. +

      To rectify this situation, the stop method must ensure +that the target thread resumes immediately if it is suspended. Once +the target thread resumes, it must recognize immediately that it +has been stopped, and exit gracefully. Here's how the resulting +run and stop methods look:

      +
      +    public void run() {
      +        Thread thisThread = Thread.currentThread();
      +        while (blinker == thisThread) {
      +            try {
      +                Thread.sleep(interval);
      +
      +                synchronized(this) {
      +                    while (threadSuspended && blinker==thisThread)
      +                        wait();
      +                }
      +            } catch (InterruptedException e){
      +            }
      +            repaint();
      +        }
      +    }
      +
      +    public synchronized void stop() {
      +        blinker = null;
      +        notify();
      +    }
      +
      +If the stop method calls Thread.interrupt, as +described above, it needn't call notify as well, but it +still must be synchronized. This ensures that the target thread +won't miss an interrupt due to a race condition. +
      +

      What about Thread.destroy?

      +Thread.destroy was never implemented and has been +deprecated. If it were implemented, it would be deadlock-prone in +the manner of Thread.suspend. (In fact, it is roughly +equivalent to Thread.suspend without the possibility +of a subsequent Thread.resume.) +
      +

      Why is Runtime.runFinalizersOnExit +deprecated?

      +Because it is inherently unsafe. It may result in finalizers being +called on live objects while other threads are concurrently +manipulating those objects, resulting in erratic behavior or +deadlock. While this problem could be prevented if the class whose +objects are being finalized were coded to "defend against" this +call, most programmers do not defend against it. They assume +that an object is dead at the time that its finalizer is called. +

      Further, the call is not "thread-safe" in the sense that it sets +a VM-global flag. This forces every class with a finalizer +to defend against the finalization of live objects!

      +

      + + diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java index 3f91060ccc8..a7172138ae8 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/AbstractValidatingLambdaMetafactory.java @@ -26,6 +26,7 @@ package java.lang.invoke; import sun.invoke.util.Wrapper; +import static java.lang.invoke.MethodHandleInfo.*; import static sun.invoke.util.Wrapper.forPrimitiveType; import static sun.invoke.util.Wrapper.forWrapperType; import static sun.invoke.util.Wrapper.isWrapperType; @@ -56,11 +57,11 @@ import static sun.invoke.util.Wrapper.isWrapperType; final String samMethodName; // Name of the SAM method "foo" final MethodType samMethodType; // Type of the SAM method "(Object)Object" final MethodHandle implMethod; // Raw method handle for the implementation method + final MethodType implMethodType; // Type of the implMethod MethodHandle "(CC,int)String" final MethodHandleInfo implInfo; // Info about the implementation method handle "MethodHandleInfo[5 CC.impl(int)String]" final int implKind; // Invocation kind for implementation "5"=invokevirtual final boolean implIsInstanceMethod; // Is the implementation an instance method "true" - final Class implDefiningClass; // Type defining the implementation "class CC" - final MethodType implMethodType; // Type of the implementation method "(int)String" + final Class implClass; // Class for referencing the implementation method "class CC" final MethodType instantiatedMethodType; // Instantiated erased functional interface method type "(Integer)Object" final boolean isSerializable; // Should the returned instance be serializable final Class[] markerInterfaces; // Additional marker interfaces to be implemented @@ -128,19 +129,51 @@ import static sun.invoke.util.Wrapper.isWrapperType; this.samMethodType = samMethodType; this.implMethod = implMethod; + this.implMethodType = implMethod.type(); this.implInfo = caller.revealDirect(implMethod); - this.implKind = implInfo.getReferenceKind(); - this.implIsInstanceMethod = - implKind == MethodHandleInfo.REF_invokeVirtual || - implKind == MethodHandleInfo.REF_invokeSpecial || - implKind == MethodHandleInfo.REF_invokeInterface; - this.implDefiningClass = implInfo.getDeclaringClass(); - this.implMethodType = implInfo.getMethodType(); + switch (implInfo.getReferenceKind()) { + case REF_invokeVirtual: + case REF_invokeInterface: + this.implClass = implMethodType.parameterType(0); + // reference kind reported by implInfo may not match implMethodType's first param + // Example: implMethodType is (Cloneable)String, implInfo is for Object.toString + this.implKind = implClass.isInterface() ? REF_invokeInterface : REF_invokeVirtual; + this.implIsInstanceMethod = true; + break; + case REF_invokeSpecial: + // JDK-8172817: should use referenced class here, but we don't know what it was + this.implClass = implInfo.getDeclaringClass(); + this.implKind = REF_invokeSpecial; + this.implIsInstanceMethod = true; + break; + case REF_invokeStatic: + case REF_newInvokeSpecial: + // JDK-8172817: should use referenced class here for invokestatic, but we don't know what it was + this.implClass = implInfo.getDeclaringClass(); + this.implKind = implInfo.getReferenceKind(); + this.implIsInstanceMethod = false; + break; + default: + throw new LambdaConversionException(String.format("Unsupported MethodHandle kind: %s", implInfo)); + } + this.instantiatedMethodType = instantiatedMethodType; this.isSerializable = isSerializable; this.markerInterfaces = markerInterfaces; this.additionalBridges = additionalBridges; + if (samMethodName.isEmpty() || + samMethodName.indexOf('.') >= 0 || + samMethodName.indexOf(';') >= 0 || + samMethodName.indexOf('[') >= 0 || + samMethodName.indexOf('/') >= 0 || + samMethodName.indexOf('<') >= 0 || + samMethodName.indexOf('>') >= 0) { + throw new LambdaConversionException(String.format( + "Method name '%s' is not legal", + samMethodName)); + } + if (!samBase.isInterface()) { throw new LambdaConversionException(String.format( "Functional interface %s is not an interface", @@ -171,24 +204,12 @@ import static sun.invoke.util.Wrapper.isWrapperType; * @throws LambdaConversionException if there are improper conversions */ void validateMetafactoryArgs() throws LambdaConversionException { - switch (implKind) { - case MethodHandleInfo.REF_invokeInterface: - case MethodHandleInfo.REF_invokeVirtual: - case MethodHandleInfo.REF_invokeStatic: - case MethodHandleInfo.REF_newInvokeSpecial: - case MethodHandleInfo.REF_invokeSpecial: - break; - default: - throw new LambdaConversionException(String.format("Unsupported MethodHandle kind: %s", implInfo)); - } - - // Check arity: optional-receiver + captured + SAM == impl + // Check arity: captured + SAM == impl final int implArity = implMethodType.parameterCount(); - final int receiverArity = implIsInstanceMethod ? 1 : 0; final int capturedArity = invokedType.parameterCount(); final int samArity = samMethodType.parameterCount(); final int instantiatedArity = instantiatedMethodType.parameterCount(); - if (implArity + receiverArity != capturedArity + samArity) { + if (implArity != capturedArity + samArity) { throw new LambdaConversionException( String.format("Incorrect number of parameters for %s method %s; %d captured parameters, %d functional interface method parameters, %d implementation parameters", implIsInstanceMethod ? "instance" : "static", implInfo, @@ -209,8 +230,8 @@ import static sun.invoke.util.Wrapper.isWrapperType; } // If instance: first captured arg (receiver) must be subtype of class where impl method is defined - final int capturedStart; - final int samStart; + final int capturedStart; // index of first non-receiver capture parameter in implMethodType + final int samStart; // index of first non-receiver sam parameter in implMethodType if (implIsInstanceMethod) { final Class receiverClass; @@ -223,45 +244,36 @@ import static sun.invoke.util.Wrapper.isWrapperType; } else { // receiver is a captured variable capturedStart = 1; - samStart = 0; + samStart = capturedArity; receiverClass = invokedType.parameterType(0); } // check receiver type - if (!implDefiningClass.isAssignableFrom(receiverClass)) { + if (!implClass.isAssignableFrom(receiverClass)) { throw new LambdaConversionException( String.format("Invalid receiver type %s; not a subtype of implementation type %s", - receiverClass, implDefiningClass)); - } - - Class implReceiverClass = implMethod.type().parameterType(0); - if (implReceiverClass != implDefiningClass && !implReceiverClass.isAssignableFrom(receiverClass)) { - throw new LambdaConversionException( - String.format("Invalid receiver type %s; not a subtype of implementation receiver type %s", - receiverClass, implReceiverClass)); + receiverClass, implClass)); } } else { // no receiver capturedStart = 0; - samStart = 0; + samStart = capturedArity; } // Check for exact match on non-receiver captured arguments - final int implFromCaptured = capturedArity - capturedStart; - for (int i=0; i implParamType = implMethodType.parameterType(i); - Class capturedParamType = invokedType.parameterType(i + capturedStart); + Class capturedParamType = invokedType.parameterType(i); if (!capturedParamType.equals(implParamType)) { throw new LambdaConversionException( String.format("Type mismatch in captured lambda parameter %d: expecting %s, found %s", i, capturedParamType, implParamType)); } } - // Check for adaptation match on SAM arguments - final int samOffset = samStart - implFromCaptured; - for (int i=implFromCaptured; i implParamType = implMethodType.parameterType(i); - Class instantiatedParamType = instantiatedMethodType.parameterType(i + samOffset); + Class instantiatedParamType = instantiatedMethodType.parameterType(i - capturedArity); if (!isAdaptableTo(instantiatedParamType, implParamType, true)) { throw new LambdaConversionException( String.format("Type mismatch for lambda argument %d: %s is not convertible to %s", @@ -271,29 +283,40 @@ import static sun.invoke.util.Wrapper.isWrapperType; // Adaptation match: return type Class expectedType = instantiatedMethodType.returnType(); - Class actualReturnType = - (implKind == MethodHandleInfo.REF_newInvokeSpecial) - ? implDefiningClass - : implMethodType.returnType(); - Class samReturnType = samMethodType.returnType(); + Class actualReturnType = implMethodType.returnType(); if (!isAdaptableToAsReturn(actualReturnType, expectedType)) { throw new LambdaConversionException( String.format("Type mismatch for lambda return: %s is not convertible to %s", actualReturnType, expectedType)); } - if (!isAdaptableToAsReturnStrict(expectedType, samReturnType)) { - throw new LambdaConversionException( - String.format("Type mismatch for lambda expected return: %s is not convertible to %s", - expectedType, samReturnType)); - } + + // Check descriptors of generated methods + checkDescriptor(samMethodType); for (MethodType bridgeMT : additionalBridges) { - if (!isAdaptableToAsReturnStrict(expectedType, bridgeMT.returnType())) { - throw new LambdaConversionException( - String.format("Type mismatch for lambda expected return: %s is not convertible to %s", - expectedType, bridgeMT.returnType())); + checkDescriptor(bridgeMT); + } + } + + /** Validate that the given descriptor's types are compatible with {@code instantiatedMethodType} **/ + private void checkDescriptor(MethodType descriptor) throws LambdaConversionException { + for (int i = 0; i < instantiatedMethodType.parameterCount(); i++) { + Class instantiatedParamType = instantiatedMethodType.parameterType(i); + Class descriptorParamType = descriptor.parameterType(i); + if (!descriptorParamType.isAssignableFrom(instantiatedParamType)) { + String msg = String.format("Type mismatch for instantiated parameter %d: %s is not a subtype of %s", + i, instantiatedParamType, descriptorParamType); + throw new LambdaConversionException(msg); } } - } + + Class instantiatedReturnType = instantiatedMethodType.returnType(); + Class descriptorReturnType = descriptor.returnType(); + if (!isAdaptableToAsReturnStrict(instantiatedReturnType, descriptorReturnType)) { + String msg = String.format("Type mismatch for lambda expected return: %s is not convertible to %s", + instantiatedReturnType, descriptorReturnType); + throw new LambdaConversionException(msg); + } + } /** * Check type adaptability for parameter types. @@ -345,8 +368,8 @@ import static sun.invoke.util.Wrapper.isWrapperType; || !fromType.equals(void.class) && isAdaptableTo(fromType, toType, false); } private boolean isAdaptableToAsReturnStrict(Class fromType, Class toType) { - if (fromType.equals(void.class)) return toType.equals(void.class); - return isAdaptableTo(fromType, toType, true); + if (fromType.equals(void.class) || toType.equals(void.class)) return fromType.equals(toType); + else return isAdaptableTo(fromType, toType, true); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java index cec436690b9..f4675e15905 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/BoundMethodHandle.java @@ -450,32 +450,29 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; */ static class Factory { - static final String JLO_SIG = "Ljava/lang/Object;"; - static final String JLS_SIG = "Ljava/lang/String;"; - static final String JLC_SIG = "Ljava/lang/Class;"; - static final String MH = "java/lang/invoke/MethodHandle"; - static final String MH_SIG = "L"+MH+";"; - static final String BMH = "java/lang/invoke/BoundMethodHandle"; - static final String BMH_SIG = "L"+BMH+";"; - static final String SPECIES_DATA = "java/lang/invoke/BoundMethodHandle$SpeciesData"; - static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";"; - static final String STABLE_SIG = "Ljdk/internal/vm/annotation/Stable;"; + private static final String JLO_SIG = "Ljava/lang/Object;"; + private static final String MH = "java/lang/invoke/MethodHandle"; + private static final String MH_SIG = "L"+MH+";"; + private static final String BMH = "java/lang/invoke/BoundMethodHandle"; + private static final String BMH_NAME = "java.lang.invoke.BoundMethodHandle"; + private static final String BMH_SIG = "L"+BMH+";"; + private static final String SPECIES_DATA = "java/lang/invoke/BoundMethodHandle$SpeciesData"; + private static final String SPECIES_DATA_SIG = "L"+SPECIES_DATA+";"; + private static final String STABLE_SIG = "Ljdk/internal/vm/annotation/Stable;"; - static final String SPECIES_PREFIX_NAME = "Species_"; - static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME; - static final String SPECIES_CLASS_PREFIX = SPECIES_PREFIX_PATH.replace('/', '.'); + private static final String SPECIES_PREFIX_NAME = "Species_"; + private static final String SPECIES_PREFIX_PATH = BMH + "$" + SPECIES_PREFIX_NAME; + private static final String SPECIES_CLASS_PREFIX = BMH_NAME + "$" + SPECIES_PREFIX_NAME; - static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + SPECIES_DATA_SIG; - static final String BMHSPECIES_DATA_GFC_SIG = "(" + JLS_SIG + JLC_SIG + ")" + SPECIES_DATA_SIG; - static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG; - static final String VOID_SIG = "()V"; - static final String INT_SIG = "()I"; + private static final String BMHSPECIES_DATA_EWI_SIG = "(B)" + SPECIES_DATA_SIG; + private static final String MYSPECIES_DATA_SIG = "()" + SPECIES_DATA_SIG; + private static final String INT_SIG = "()I"; - static final String SIG_INCIPIT = "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;"; + private static final String SIG_INCIPIT = "(Ljava/lang/invoke/MethodType;Ljava/lang/invoke/LambdaForm;"; - static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" }; + private static final String[] E_THROWABLE = new String[] { "java/lang/Throwable" }; - static final ConcurrentMap> CLASS_CACHE = new ConcurrentHashMap<>(); + private static final ConcurrentMap> CLASS_CACHE = new ConcurrentHashMap<>(); /** * Get a concrete subclass of BMH for a given combination of bound types. @@ -830,15 +827,27 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; private static String makeSignature(String types, boolean ctor) { StringBuilder buf = new StringBuilder(SIG_INCIPIT); - for (char c : types.toCharArray()) { - buf.append(typeSig(c)); + int len = types.length(); + for (int i = 0; i < len; i++) { + buf.append(typeSig(types.charAt(i))); } return buf.append(')').append(ctor ? "V" : BMH_SIG).toString(); } + private static MethodType makeConstructorType(String types) { + int length = types.length(); + Class ptypes[] = new Class[length + 2]; + ptypes[0] = MethodType.class; + ptypes[1] = LambdaForm.class; + for (int i = 0; i < length; i++) { + ptypes[i + 2] = BasicType.basicType(types.charAt(i)).basicTypeClass(); + } + return MethodType.makeImpl(BoundMethodHandle.class, ptypes, true); + } + static MethodHandle makeCbmhCtor(Class cbmh, String types) { try { - return LOOKUP.findStatic(cbmh, "make", MethodType.fromDescriptor(makeSignature(types, false), null)); + return LOOKUP.findStatic(cbmh, "make", makeConstructorType(types)); } catch (NoSuchMethodException | IllegalAccessException | IllegalArgumentException | TypeNotPresentException e) { throw newInternalError(e); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java index 53899611f59..031e18a759a 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/CallSite.java @@ -82,6 +82,7 @@ private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String nam } } * @author John Rose, JSR 292 EG + * @since 1.7 */ abstract public class CallSite { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java index f27d0e7bbd2..f7d87ba45ac 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/ConstantCallSite.java @@ -30,6 +30,7 @@ package java.lang.invoke; * An {@code invokedynamic} instruction linked to a {@code ConstantCallSite} is permanently * bound to the call site's target. * @author John Rose, JSR 292 EG + * @since 1.7 */ public class ConstantCallSite extends CallSite { private final boolean isFrozen; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java index d11012e6487..cecfe5efc34 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/DelegatingMethodHandle.java @@ -98,21 +98,17 @@ abstract class DelegatingMethodHandle extends MethodHandle { Object constraint, NamedFunction getTargetFn) { // No pre-action needed. - return makeReinvokerForm(target, whichCache, constraint, null, true, getTargetFn, null); + return makeReinvokerForm(target, whichCache, constraint, true, getTargetFn, null); } /** Create a LF which simply reinvokes a target of the given basic type. */ static LambdaForm makeReinvokerForm(MethodHandle target, int whichCache, Object constraint, - String debugString, boolean forceInline, NamedFunction getTargetFn, NamedFunction preActionFn) { MethodType mtype = target.type().basicType(); Kind kind = whichKind(whichCache); - if (debugString == null) { - debugString = kind.defaultLambdaName; - } boolean customized = (whichCache < 0 || mtype.parameterSlotCount() > MethodType.MAX_MH_INVOKER_ARITY); boolean hasPreAction = (preActionFn != null); @@ -144,7 +140,7 @@ abstract class DelegatingMethodHandle extends MethodHandle { targetArgs[0] = names[NEXT_MH]; // overwrite this MH with next MH names[REINVOKE] = new LambdaForm.Name(mtype, targetArgs); } - form = new LambdaForm(debugString, ARG_LIMIT, names, forceInline, kind); + form = new LambdaForm(ARG_LIMIT, names, forceInline, kind); if (!customized) { form = mtype.form().setCachedLambdaForm(whichCache, form); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java index ce1f938583f..bd06ffa5348 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java @@ -224,12 +224,12 @@ class DirectMethodHandle extends MethodHandle { assert(names.length == nameCursor); if (doesAlloc) { // names = { argx,y,z,... new C, init method } - names[NEW_OBJ] = new Name(NF_allocateInstance, names[DMH_THIS]); - names[GET_MEMBER] = new Name(NF_constructorMethod, names[DMH_THIS]); + names[NEW_OBJ] = new Name(getFunction(NF_allocateInstance), names[DMH_THIS]); + names[GET_MEMBER] = new Name(getFunction(NF_constructorMethod), names[DMH_THIS]); } else if (needsInit) { - names[GET_MEMBER] = new Name(NF_internalMemberNameEnsureInit, names[DMH_THIS]); + names[GET_MEMBER] = new Name(getFunction(NF_internalMemberNameEnsureInit), names[DMH_THIS]); } else { - names[GET_MEMBER] = new Name(NF_internalMemberName, names[DMH_THIS]); + names[GET_MEMBER] = new Name(getFunction(NF_internalMemberName), names[DMH_THIS]); } assert(findDirectMethodHandle(names[GET_MEMBER]) == names[DMH_THIS]); Object[] outArgs = Arrays.copyOfRange(names, ARG_BASE, GET_MEMBER+1, Object[].class); @@ -242,18 +242,17 @@ class DirectMethodHandle extends MethodHandle { result = NEW_OBJ; } names[LINKER_CALL] = new Name(linker, outArgs); - String lambdaName = kind.defaultLambdaName + "_" + shortenSignature(basicTypeSignature(mtype)); - LambdaForm lform = new LambdaForm(lambdaName, ARG_LIMIT, names, result, kind); + LambdaForm lform = new LambdaForm(ARG_LIMIT, names, result, kind); // This is a tricky bit of code. Don't send it through the LF interpreter. lform.compileToBytecode(); return lform; } - static Object findDirectMethodHandle(Name name) { - if (name.function == NF_internalMemberName || - name.function == NF_internalMemberNameEnsureInit || - name.function == NF_constructorMethod) { + /* assert */ static Object findDirectMethodHandle(Name name) { + if (name.function.equals(getFunction(NF_internalMemberName)) || + name.function.equals(getFunction(NF_internalMemberNameEnsureInit)) || + name.function.equals(getFunction(NF_constructorMethod))) { assert(name.arguments.length == 1); return name.arguments[0]; } @@ -675,18 +674,18 @@ class DirectMethodHandle extends MethodHandle { final int RESULT = nameCursor-1; // either the call or the cast Name[] names = arguments(nameCursor - ARG_LIMIT, mtype.invokerType()); if (needsInit) - names[INIT_BAR] = new Name(NF_ensureInitialized, names[DMH_THIS]); + names[INIT_BAR] = new Name(getFunction(NF_ensureInitialized), names[DMH_THIS]); if (needsCast && !isGetter) - names[PRE_CAST] = new Name(NF_checkCast, names[DMH_THIS], names[SET_VALUE]); + names[PRE_CAST] = new Name(getFunction(NF_checkCast), names[DMH_THIS], names[SET_VALUE]); Object[] outArgs = new Object[1 + linkerType.parameterCount()]; assert(outArgs.length == (isGetter ? 3 : 4)); - outArgs[0] = names[U_HOLDER] = new Name(NF_UNSAFE); + outArgs[0] = names[U_HOLDER] = new Name(getFunction(NF_UNSAFE)); if (isStatic) { - outArgs[1] = names[F_HOLDER] = new Name(NF_staticBase, names[DMH_THIS]); - outArgs[2] = names[F_OFFSET] = new Name(NF_staticOffset, names[DMH_THIS]); + outArgs[1] = names[F_HOLDER] = new Name(getFunction(NF_staticBase), names[DMH_THIS]); + outArgs[2] = names[F_OFFSET] = new Name(getFunction(NF_staticOffset), names[DMH_THIS]); } else { - outArgs[1] = names[OBJ_CHECK] = new Name(NF_checkBase, names[OBJ_BASE]); - outArgs[2] = names[F_OFFSET] = new Name(NF_fieldOffset, names[DMH_THIS]); + outArgs[1] = names[OBJ_CHECK] = new Name(getFunction(NF_checkBase), names[OBJ_BASE]); + outArgs[2] = names[F_OFFSET] = new Name(getFunction(NF_fieldOffset), names[DMH_THIS]); } if (!isGetter) { outArgs[3] = (needsCast ? names[PRE_CAST] : names[SET_VALUE]); @@ -694,70 +693,105 @@ class DirectMethodHandle extends MethodHandle { for (Object a : outArgs) assert(a != null); names[LINKER_CALL] = new Name(linker, outArgs); if (needsCast && isGetter) - names[POST_CAST] = new Name(NF_checkCast, names[DMH_THIS], names[LINKER_CALL]); + names[POST_CAST] = new Name(getFunction(NF_checkCast), names[DMH_THIS], names[LINKER_CALL]); for (Name n : names) assert(n != null); - // add some detail to the lambdaForm debugname, - // significant only for debugging - StringBuilder nameBuilder = new StringBuilder(kind.methodName); - if (isStatic) { - nameBuilder.append("Static"); - } else { - nameBuilder.append("Field"); - } - if (needsCast) nameBuilder.append("Cast"); - if (needsInit) nameBuilder.append("Init"); + + LambdaForm form; if (needsCast || needsInit) { // can't use the pre-generated form when casting and/or initializing - return new LambdaForm(nameBuilder.toString(), ARG_LIMIT, names, RESULT); + form = new LambdaForm(ARG_LIMIT, names, RESULT); } else { - return new LambdaForm(nameBuilder.toString(), ARG_LIMIT, names, RESULT, kind); + form = new LambdaForm(ARG_LIMIT, names, RESULT, kind); } + + if (LambdaForm.debugNames()) { + // add some detail to the lambdaForm debugname, + // significant only for debugging + StringBuilder nameBuilder = new StringBuilder(kind.methodName); + if (isStatic) { + nameBuilder.append("Static"); + } else { + nameBuilder.append("Field"); + } + if (needsCast) { + nameBuilder.append("Cast"); + } + if (needsInit) { + nameBuilder.append("Init"); + } + LambdaForm.associateWithDebugName(form, nameBuilder.toString()); + } + return form; } /** * Pre-initialized NamedFunctions for bootstrapping purposes. - * Factored in an inner class to delay initialization until first usage. */ - static final NamedFunction - NF_internalMemberName, - NF_internalMemberNameEnsureInit, - NF_ensureInitialized, - NF_fieldOffset, - NF_checkBase, - NF_staticBase, - NF_staticOffset, - NF_checkCast, - NF_allocateInstance, - NF_constructorMethod, - NF_UNSAFE; - static { + static final byte NF_internalMemberName = 0, + NF_internalMemberNameEnsureInit = 1, + NF_ensureInitialized = 2, + NF_fieldOffset = 3, + NF_checkBase = 4, + NF_staticBase = 5, + NF_staticOffset = 6, + NF_checkCast = 7, + NF_allocateInstance = 8, + NF_constructorMethod = 9, + NF_UNSAFE = 10, + NF_LIMIT = 11; + + private static final @Stable NamedFunction[] NFS = new NamedFunction[NF_LIMIT]; + + private static NamedFunction getFunction(byte func) { + NamedFunction nf = NFS[func]; + if (nf != null) { + return nf; + } + // Each nf must be statically invocable or we get tied up in our bootstraps. + nf = NFS[func] = createFunction(func); + assert(InvokerBytecodeGenerator.isStaticallyInvocable(nf)); + return nf; + } + + private static NamedFunction createFunction(byte func) { try { - NamedFunction nfs[] = { - NF_internalMemberName = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("internalMemberName", Object.class)), - NF_internalMemberNameEnsureInit = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("internalMemberNameEnsureInit", Object.class)), - NF_ensureInitialized = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("ensureInitialized", Object.class)), - NF_fieldOffset = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("fieldOffset", Object.class)), - NF_checkBase = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("checkBase", Object.class)), - NF_staticBase = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("staticBase", Object.class)), - NF_staticOffset = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("staticOffset", Object.class)), - NF_checkCast = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("checkCast", Object.class, Object.class)), - NF_allocateInstance = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("allocateInstance", Object.class)), - NF_constructorMethod = new NamedFunction(DirectMethodHandle.class - .getDeclaredMethod("constructorMethod", Object.class)), - NF_UNSAFE = new NamedFunction(new MemberName(MethodHandleStatics.class - .getDeclaredField("UNSAFE"))) - }; - // Each nf must be statically invocable or we get tied up in our bootstraps. - assert(InvokerBytecodeGenerator.isStaticallyInvocable(nfs)); + switch (func) { + case NF_internalMemberName: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("internalMemberName", Object.class)); + case NF_internalMemberNameEnsureInit: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("internalMemberNameEnsureInit", Object.class)); + case NF_ensureInitialized: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("ensureInitialized", Object.class)); + case NF_fieldOffset: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("fieldOffset", Object.class)); + case NF_checkBase: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("checkBase", Object.class)); + case NF_staticBase: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("staticBase", Object.class)); + case NF_staticOffset: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("staticOffset", Object.class)); + case NF_checkCast: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("checkCast", Object.class, Object.class)); + case NF_allocateInstance: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("allocateInstance", Object.class)); + case NF_constructorMethod: + return new NamedFunction(DirectMethodHandle.class + .getDeclaredMethod("constructorMethod", Object.class)); + case NF_UNSAFE: + return new NamedFunction(new MemberName(MethodHandleStatics.class + .getDeclaredField("UNSAFE"))); + default: + throw newInternalError("Unknown function: " + func); + } } catch (ReflectiveOperationException ex) { throw newInternalError(ex); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java index 0c814bdd470..35f91cc243b 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java @@ -96,7 +96,6 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; private final String implMethodClassName; // Name of type containing implementation "CC" private final String implMethodName; // Name of implementation method "impl" private final String implMethodDesc; // Type descriptor for implementation methods "(I)Ljava/lang/String;" - private final Class implMethodReturnClass; // class for implementation method return type "Ljava/lang/String;" private final MethodType constructorType; // Generated class constructor type "(CC)void" private final ClassWriter cw; // ASM class writer private final String[] argNames; // Generated names for the constructor arguments @@ -153,12 +152,9 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; super(caller, invokedType, samMethodName, samMethodType, implMethod, instantiatedMethodType, isSerializable, markerInterfaces, additionalBridges); - implMethodClassName = implDefiningClass.getName().replace('.', '/'); + implMethodClassName = implClass.getName().replace('.', '/'); implMethodName = implInfo.getName(); - implMethodDesc = implMethodType.toMethodDescriptorString(); - implMethodReturnClass = (implKind == MethodHandleInfo.REF_newInvokeSpecial) - ? implDefiningClass - : implMethodType.returnType(); + implMethodDesc = implInfo.getMethodType().toMethodDescriptorString(); constructorType = invokedType.changeReturnType(Void.TYPE); lambdaClassName = targetClass.getName().replace('.', '/') + "$$Lambda$" + counter.incrementAndGet(); cw = new ClassWriter(ClassWriter.COMPUTE_MAXS); @@ -467,13 +463,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // Invoke the method we want to forward to visitMethodInsn(invocationOpcode(), implMethodClassName, implMethodName, implMethodDesc, - implDefiningClass.isInterface()); + implClass.isInterface()); // Convert the return value (if any) and return it // Note: if adapting from non-void to void, the 'return' // instruction will pop the unneeded result + Class implReturnClass = implMethodType.returnType(); Class samReturnClass = methodType.returnType(); - convertType(implMethodReturnClass, samReturnClass, samReturnClass); + convertType(implReturnClass, samReturnClass, samReturnClass); visitInsn(getReturnOpcode(samReturnClass)); // Maxs computed by ClassWriter.COMPUTE_MAXS,these arguments ignored visitMaxs(-1, -1); @@ -482,23 +479,13 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; private void convertArgumentTypes(MethodType samType) { int lvIndex = 0; - boolean samIncludesReceiver = implIsInstanceMethod && - invokedType.parameterCount() == 0; - int samReceiverLength = samIncludesReceiver ? 1 : 0; - if (samIncludesReceiver) { - // push receiver - Class rcvrType = samType.parameterType(0); - visitVarInsn(getLoadOpcode(rcvrType), lvIndex + 1); - lvIndex += getParameterSize(rcvrType); - convertType(rcvrType, implDefiningClass, instantiatedMethodType.parameterType(0)); - } int samParametersLength = samType.parameterCount(); - int argOffset = implMethodType.parameterCount() - samParametersLength; - for (int i = samReceiverLength; i < samParametersLength; i++) { + int captureArity = invokedType.parameterCount(); + for (int i = 0; i < samParametersLength; i++) { Class argType = samType.parameterType(i); visitVarInsn(getLoadOpcode(argType), lvIndex + 1); lvIndex += getParameterSize(argType); - convertType(argType, implMethodType.parameterType(argOffset + i), instantiatedMethodType.parameterType(i)); + convertType(argType, implMethodType.parameterType(captureArity + i), instantiatedMethodType.parameterType(i)); } } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java index d903d488211..7349ea2bec4 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java @@ -73,6 +73,7 @@ class InvokerBytecodeGenerator { private static final String LL_SIG = "(L" + OBJ + ";)L" + OBJ + ";"; private static final String LLV_SIG = "(L" + OBJ + ";L" + OBJ + ";)V"; private static final String CLASS_PREFIX = LF + "$"; + private static final String SOURCE_PREFIX = "LambdaForm$"; /** Name of its super class*/ static final String INVOKER_SUPER_NAME = OBJ; @@ -80,9 +81,6 @@ class InvokerBytecodeGenerator { /** Name of new class */ private final String className; - /** Name of the source file (for stack trace printing). */ - private final String sourceFile; - private final LambdaForm lambdaForm; private final String invokerName; private final MethodType invokerType; @@ -109,8 +107,7 @@ class InvokerBytecodeGenerator { if (DUMP_CLASS_FILES) { className = makeDumpableClassName(className); } - this.className = CLASS_PREFIX + className; - this.sourceFile = "LambdaForm$" + className; + this.className = className; this.lambdaForm = lambdaForm; this.invokerName = invokerName; this.invokerType = invokerType; @@ -130,7 +127,7 @@ class InvokerBytecodeGenerator { /** For generating customized code for a single LambdaForm. */ private InvokerBytecodeGenerator(String className, LambdaForm form, MethodType invokerType) { - this(className, form.debugName, form, invokerType); + this(className, form.lambdaName(), form, invokerType); } /** For generating customized code for a single LambdaForm. */ @@ -173,6 +170,13 @@ class InvokerBytecodeGenerator { } } + private void maybeDump(final byte[] classFile) { + if (DUMP_CLASS_FILES) { + maybeDump(CLASS_PREFIX + className, classFile); + } + } + + // Also used from BoundMethodHandle static void maybeDump(final String className, final byte[] classFile) { if (DUMP_CLASS_FILES) { java.security.AccessController.doPrivileged( @@ -306,8 +310,9 @@ class InvokerBytecodeGenerator { private ClassWriter classFilePrologue() { final int NOT_ACC_PUBLIC = 0; // not ACC_PUBLIC cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES); - cw.visit(Opcodes.V1_8, NOT_ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, className, null, INVOKER_SUPER_NAME, null); - cw.visitSource(sourceFile, null); + cw.visit(Opcodes.V1_8, NOT_ACC_PUBLIC + Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, + CLASS_PREFIX + className, null, INVOKER_SUPER_NAME, null); + cw.visitSource(SOURCE_PREFIX + className, null); return cw; } @@ -617,12 +622,11 @@ class InvokerBytecodeGenerator { return resolvedMember; } - private static MemberName lookupPregenerated(LambdaForm form) { + private static MemberName lookupPregenerated(LambdaForm form, MethodType invokerType) { if (form.customized != null) { // No pre-generated version for customized LF return null; } - MethodType invokerType = form.methodType(); String name = form.kind.methodName; switch (form.kind) { case BOUND_REINVOKER: { @@ -670,7 +674,7 @@ class InvokerBytecodeGenerator { * Generate customized bytecode for a given LambdaForm. */ static MemberName generateCustomizedCode(LambdaForm form, MethodType invokerType) { - MemberName pregenerated = lookupPregenerated(form); + MemberName pregenerated = lookupPregenerated(form, invokerType); if (pregenerated != null) return pregenerated; // pre-generated bytecode InvokerBytecodeGenerator g = new InvokerBytecodeGenerator("MH", form, invokerType); @@ -720,7 +724,7 @@ class InvokerBytecodeGenerator { bogusMethod(lambdaForm); final byte[] classFile = toByteArray(); - maybeDump(className, classFile); + maybeDump(classFile); return classFile; } @@ -908,7 +912,7 @@ class InvokerBytecodeGenerator { //MethodHandle.class already covered }; - static boolean isStaticallyInvocable(NamedFunction[] functions) { + static boolean isStaticallyInvocable(NamedFunction ... functions) { for (NamedFunction nf : functions) { if (!isStaticallyInvocable(nf.member())) { return false; @@ -1761,7 +1765,7 @@ class InvokerBytecodeGenerator { bogusMethod(invokerType); final byte[] classFile = cw.toByteArray(); - maybeDump(className, classFile); + maybeDump(classFile); return classFile; } @@ -1829,7 +1833,7 @@ class InvokerBytecodeGenerator { bogusMethod(dstType); final byte[] classFile = cw.toByteArray(); - maybeDump(className, classFile); + maybeDump(classFile); return classFile; } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java index 0a97622fe84..8eeb4c3954e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java @@ -132,7 +132,7 @@ class Invokers { MethodType mtype = targetType; MethodType invokerType = mtype.insertParameterTypes(0, VarHandle.class); - LambdaForm lform = varHandleMethodInvokerHandleForm(ak.methodName(), mtype, isExact); + LambdaForm lform = varHandleMethodInvokerHandleForm(ak, mtype, isExact); VarHandle.AccessDescriptor ad = new VarHandle.AccessDescriptor(mtype, ak.at.ordinal(), ak.ordinal()); MethodHandle invoker = BoundMethodHandle.bindSingle(invokerType, lform, ad); @@ -313,21 +313,21 @@ class Invokers { Object[] outArgs = Arrays.copyOfRange(names, CALL_MH, OUTARG_LIMIT, Object[].class); Object mtypeArg = (customized ? mtype : names[MTYPE_ARG]); if (!isGeneric) { - names[CHECK_TYPE] = new Name(NF_checkExactType, names[CALL_MH], mtypeArg); + names[CHECK_TYPE] = new Name(getFunction(NF_checkExactType), names[CALL_MH], mtypeArg); // mh.invokeExact(a*):R => checkExactType(mh, TYPEOF(a*:R)); mh.invokeBasic(a*) } else { - names[CHECK_TYPE] = new Name(NF_checkGenericType, names[CALL_MH], mtypeArg); + names[CHECK_TYPE] = new Name(getFunction(NF_checkGenericType), names[CALL_MH], mtypeArg); // mh.invokeGeneric(a*):R => checkGenericType(mh, TYPEOF(a*:R)).invokeBasic(a*) outArgs[0] = names[CHECK_TYPE]; } if (CHECK_CUSTOM != -1) { - names[CHECK_CUSTOM] = new Name(NF_checkCustomized, outArgs[0]); + names[CHECK_CUSTOM] = new Name(getFunction(NF_checkCustomized), outArgs[0]); } names[LINKER_CALL] = new Name(outCallType, outArgs); if (customized) { - lform = new LambdaForm(kind.defaultLambdaName, INARG_LIMIT, names); + lform = new LambdaForm(INARG_LIMIT, names); } else { - lform = new LambdaForm(kind.defaultLambdaName, INARG_LIMIT, names, kind); + lform = new LambdaForm(INARG_LIMIT, names, kind); } if (isLinker) lform.compileToBytecode(); // JVM needs a real methodOop @@ -337,11 +337,10 @@ class Invokers { } - static MemberName varHandleInvokeLinkerMethod(String name, - MethodType mtype) { + static MemberName varHandleInvokeLinkerMethod(VarHandle.AccessMode ak, MethodType mtype) { LambdaForm lform; if (mtype.parameterSlotCount() <= MethodType.MAX_MH_ARITY - MH_LINKER_ARG_APPENDED) { - lform = varHandleMethodGenericLinkerHandleForm(name, mtype); + lform = varHandleMethodGenericLinkerHandleForm(ak, mtype); } else { // TODO throw newInternalError("Unsupported parameter slot count " + mtype.parameterSlotCount()); @@ -349,7 +348,8 @@ class Invokers { return lform.vmentry; } - private static LambdaForm varHandleMethodGenericLinkerHandleForm(String name, MethodType mtype) { + private static LambdaForm varHandleMethodGenericLinkerHandleForm(VarHandle.AccessMode ak, + MethodType mtype) { // TODO Cache form? final int THIS_VH = 0; @@ -368,7 +368,7 @@ class Invokers { } names[VAD_ARG] = new Name(ARG_LIMIT, BasicType.basicType(Object.class)); - names[CHECK_TYPE] = new Name(NF_checkVarHandleGenericType, names[THIS_VH], names[VAD_ARG]); + names[CHECK_TYPE] = new Name(getFunction(NF_checkVarHandleGenericType), names[THIS_VH], names[VAD_ARG]); Object[] outArgs = new Object[ARG_LIMIT + 1]; outArgs[0] = names[CHECK_TYPE]; @@ -377,20 +377,24 @@ class Invokers { } if (CHECK_CUSTOM != -1) { - names[CHECK_CUSTOM] = new Name(NF_checkCustomized, outArgs[0]); + names[CHECK_CUSTOM] = new Name(getFunction(NF_checkCustomized), outArgs[0]); } MethodType outCallType = mtype.insertParameterTypes(0, VarHandle.class) .basicType(); names[LINKER_CALL] = new Name(outCallType, outArgs); - LambdaForm lform = new LambdaForm(name + ":VarHandle_invoke_MT_" + shortenSignature(basicTypeSignature(mtype)), - ARG_LIMIT + 1, names); - + LambdaForm lform = new LambdaForm(ARG_LIMIT + 1, names, VARHANDLE_LINKER); + if (LambdaForm.debugNames()) { + String name = ak.methodName() + ":VarHandle_invoke_MT_" + + shortenSignature(basicTypeSignature(mtype)); + LambdaForm.associateWithDebugName(lform, name); + } lform.compileToBytecode(); return lform; } - private static LambdaForm varHandleMethodInvokerHandleForm(String name, MethodType mtype, boolean isExact) { + private static LambdaForm varHandleMethodInvokerHandleForm(VarHandle.AccessMode ak, + MethodType mtype, boolean isExact) { // TODO Cache form? final int THIS_MH = 0; @@ -416,9 +420,9 @@ class Invokers { names[VAD_ARG] = new Name(getter, names[THIS_MH]); if (isExact) { - names[CHECK_TYPE] = new Name(NF_checkVarHandleExactType, names[CALL_VH], names[VAD_ARG]); + names[CHECK_TYPE] = new Name(getFunction(NF_checkVarHandleExactType), names[CALL_VH], names[VAD_ARG]); } else { - names[CHECK_TYPE] = new Name(NF_checkVarHandleGenericType, names[CALL_VH], names[VAD_ARG]); + names[CHECK_TYPE] = new Name(getFunction(NF_checkVarHandleGenericType), names[CALL_VH], names[VAD_ARG]); } Object[] outArgs = new Object[ARG_LIMIT]; outArgs[0] = names[CHECK_TYPE]; @@ -429,10 +433,14 @@ class Invokers { MethodType outCallType = mtype.insertParameterTypes(0, VarHandle.class) .basicType(); names[LINKER_CALL] = new Name(outCallType, outArgs); - String debugName = isExact ? ":VarHandle_exactInvoker" : ":VarHandle_invoker"; - LambdaForm lform = new LambdaForm(name + debugName + shortenSignature(basicTypeSignature(mtype)), - ARG_LIMIT, names); - + Kind kind = isExact ? VARHANDLE_EXACT_INVOKER : VARHANDLE_INVOKER; + LambdaForm lform = new LambdaForm(ARG_LIMIT, names, kind); + if (LambdaForm.debugNames()) { + String name = ak.methodName() + + (isExact ? ":VarHandle_exactInvoker_" : ":VarHandle_invoker_") + + shortenSignature(basicTypeSignature(mtype)); + LambdaForm.associateWithDebugName(lform, name); + } lform.prepare(); return lform; } @@ -535,7 +543,7 @@ class Invokers { assert(names.length == nameCursor); assert(names[APPENDIX_ARG] != null); if (!skipCallSite) - names[CALL_MH] = new Name(NF_getCallSiteTarget, names[CSITE_ARG]); + names[CALL_MH] = new Name(getFunction(NF_getCallSiteTarget), names[CSITE_ARG]); // (site.)invokedynamic(a*):R => mh = site.getTarget(); mh.invokeBasic(a*) final int PREPEND_MH = 0, PREPEND_COUNT = 1; Object[] outArgs = Arrays.copyOfRange(names, ARG_BASE, OUTARG_LIMIT + PREPEND_COUNT, Object[].class); @@ -543,7 +551,8 @@ class Invokers { System.arraycopy(outArgs, 0, outArgs, PREPEND_COUNT, outArgs.length - PREPEND_COUNT); outArgs[PREPEND_MH] = names[CALL_MH]; names[LINKER_CALL] = new Name(mtype, outArgs); - lform = new LambdaForm((skipCallSite ? "linkToTargetMethod" : "linkToCallSite"), INARG_LIMIT, names); + lform = new LambdaForm(INARG_LIMIT, names, + (skipCallSite ? LINK_TO_TARGET_METHOD : LINK_TO_CALL_SITE)); lform.compileToBytecode(); // JVM needs a real methodOop lform = mtype.form().setCachedLambdaForm(which, lform); return lform; @@ -577,31 +586,51 @@ class Invokers { } // Local constant functions: - private static final NamedFunction - NF_checkExactType, - NF_checkGenericType, - NF_getCallSiteTarget, - NF_checkCustomized, - NF_checkVarHandleGenericType, - NF_checkVarHandleExactType; - static { + private static final byte NF_checkExactType = 0, + NF_checkGenericType = 1, + NF_getCallSiteTarget = 2, + NF_checkCustomized = 3, + NF_checkVarHandleGenericType = 4, + NF_checkVarHandleExactType = 5, + NF_LIMIT = 6; + + private static final @Stable NamedFunction[] NFS = new NamedFunction[NF_LIMIT]; + + private static NamedFunction getFunction(byte func) { + NamedFunction nf = NFS[func]; + if (nf != null) { + return nf; + } + NFS[func] = nf = createFunction(func); + // Each nf must be statically invocable or we get tied up in our bootstraps. + assert(InvokerBytecodeGenerator.isStaticallyInvocable(nf)); + return nf; + } + + private static NamedFunction createFunction(byte func) { try { - NamedFunction nfs[] = { - NF_checkExactType = new NamedFunction(Invokers.class - .getDeclaredMethod("checkExactType", MethodHandle.class, MethodType.class)), - NF_checkGenericType = new NamedFunction(Invokers.class - .getDeclaredMethod("checkGenericType", MethodHandle.class, MethodType.class)), - NF_getCallSiteTarget = new NamedFunction(Invokers.class - .getDeclaredMethod("getCallSiteTarget", CallSite.class)), - NF_checkCustomized = new NamedFunction(Invokers.class - .getDeclaredMethod("checkCustomized", MethodHandle.class)), - NF_checkVarHandleGenericType = new NamedFunction(Invokers.class - .getDeclaredMethod("checkVarHandleGenericType", VarHandle.class, VarHandle.AccessDescriptor.class)), - NF_checkVarHandleExactType = new NamedFunction(Invokers.class - .getDeclaredMethod("checkVarHandleExactType", VarHandle.class, VarHandle.AccessDescriptor.class)), - }; - // Each nf must be statically invocable or we get tied up in our bootstraps. - assert(InvokerBytecodeGenerator.isStaticallyInvocable(nfs)); + switch (func) { + case NF_checkExactType: + return new NamedFunction(Invokers.class + .getDeclaredMethod("checkExactType", MethodHandle.class, MethodType.class)); + case NF_checkGenericType: + return new NamedFunction(Invokers.class + .getDeclaredMethod("checkGenericType", MethodHandle.class, MethodType.class)); + case NF_getCallSiteTarget: + return new NamedFunction(Invokers.class + .getDeclaredMethod("getCallSiteTarget", CallSite.class)); + case NF_checkCustomized: + return new NamedFunction(Invokers.class + .getDeclaredMethod("checkCustomized", MethodHandle.class)); + case NF_checkVarHandleGenericType: + return new NamedFunction(Invokers.class + .getDeclaredMethod("checkVarHandleGenericType", VarHandle.class, VarHandle.AccessDescriptor.class)); + case NF_checkVarHandleExactType: + return new NamedFunction(Invokers.class + .getDeclaredMethod("checkVarHandleExactType", VarHandle.class, VarHandle.AccessDescriptor.class)); + default: + throw newInternalError("Unknown function: " + func); + } } catch (ReflectiveOperationException ex) { throw newInternalError(ex); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java index e1123da59d8..2dc8f22c01d 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaConversionException.java @@ -27,6 +27,8 @@ package java.lang.invoke; /** * LambdaConversionException + * + * @since 1.8 */ public class LambdaConversionException extends Exception { private static final long serialVersionUID = 292L + 8L; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java index 96b0a944800..bde94381ddc 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,7 +126,6 @@ class LambdaForm { final boolean forceInline; final MethodHandle customized; @Stable final Name[] names; - final String debugName; final Kind kind; MemberName vmentry; // low-level behavior, or null if not yet prepared private boolean isCompiled; @@ -268,22 +267,24 @@ class LambdaForm { } enum Kind { - GENERIC(""), + GENERIC("invoke"), ZERO("zero"), IDENTITY("identity"), - BOUND_REINVOKER("BMH.reinvoke"), - REINVOKER("MH.reinvoke"), - DELEGATE("MH.delegate"), - EXACT_LINKER("MH.invokeExact_MT"), - EXACT_INVOKER("MH.exactInvoker"), - GENERIC_LINKER("MH.invoke_MT"), - GENERIC_INVOKER("MH.invoker"), - DIRECT_INVOKE_VIRTUAL("DMH.invokeVirtual"), - DIRECT_INVOKE_SPECIAL("DMH.invokeSpecial"), - DIRECT_INVOKE_STATIC("DMH.invokeStatic"), - DIRECT_NEW_INVOKE_SPECIAL("DMH.newInvokeSpecial"), - DIRECT_INVOKE_INTERFACE("DMH.invokeInterface"), - DIRECT_INVOKE_STATIC_INIT("DMH.invokeStaticInit"), + BOUND_REINVOKER("BMH.reinvoke", "reinvoke"), + REINVOKER("MH.reinvoke", "reinvoke"), + DELEGATE("MH.delegate", "delegate"), + EXACT_LINKER("MH.invokeExact_MT", "invokeExact_MT"), + EXACT_INVOKER("MH.exactInvoker", "exactInvoker"), + GENERIC_LINKER("MH.invoke_MT", "invoke_MT"), + GENERIC_INVOKER("MH.invoker", "invoker"), + LINK_TO_TARGET_METHOD("linkToTargetMethod"), + LINK_TO_CALL_SITE("linkToCallSite"), + DIRECT_INVOKE_VIRTUAL("DMH.invokeVirtual", "invokeVirtual"), + DIRECT_INVOKE_SPECIAL("DMH.invokeSpecial", "invokeSpecial"), + DIRECT_INVOKE_STATIC("DMH.invokeStatic", "invokeStatic"), + DIRECT_NEW_INVOKE_SPECIAL("DMH.newInvokeSpecial", "newInvokeSpecial"), + DIRECT_INVOKE_INTERFACE("DMH.invokeInterface", "invokeInterface"), + DIRECT_INVOKE_STATIC_INIT("DMH.invokeStaticInit", "invokeStaticInit"), GET_OBJECT("getObject"), PUT_OBJECT("putObject"), GET_OBJECT_VOLATILE("getObjectVolatile"), @@ -319,41 +320,46 @@ class LambdaForm { GET_DOUBLE("getDouble"), PUT_DOUBLE("putDouble"), GET_DOUBLE_VOLATILE("getDoubleVolatile"), - PUT_DOUBLE_VOLATILE("putDoubleVolatile"); + PUT_DOUBLE_VOLATILE("putDoubleVolatile"), + TRY_FINALLY("tryFinally"), + COLLECT("collect"), + CONVERT("convert"), + SPREAD("spread"), + LOOP("loop"), + FIELD("field"), + GUARD("guard"), + GUARD_WITH_CATCH("guardWithCatch"), + VARHANDLE_EXACT_INVOKER("VH.exactInvoker"), + VARHANDLE_INVOKER("VH.invoker", "invoker"), + VARHANDLE_LINKER("VH.invoke_MT", "invoke_MT"); final String defaultLambdaName; final String methodName; private Kind(String defaultLambdaName) { + this(defaultLambdaName, defaultLambdaName); + } + + private Kind(String defaultLambdaName, String methodName) { this.defaultLambdaName = defaultLambdaName; - int p = defaultLambdaName.indexOf('.'); - if (p > -1) { - this.methodName = defaultLambdaName.substring(p + 1); - } else { - this.methodName = defaultLambdaName; - } + this.methodName = methodName; } } - LambdaForm(String debugName, - int arity, Name[] names, int result) { - this(debugName, arity, names, result, /*forceInline=*/true, /*customized=*/null, Kind.GENERIC); + LambdaForm(int arity, Name[] names, int result) { + this(arity, names, result, /*forceInline=*/true, /*customized=*/null, Kind.GENERIC); } - LambdaForm(String debugName, - int arity, Name[] names, int result, Kind kind) { - this(debugName, arity, names, result, /*forceInline=*/true, /*customized=*/null, kind); + LambdaForm(int arity, Name[] names, int result, Kind kind) { + this(arity, names, result, /*forceInline=*/true, /*customized=*/null, kind); } - LambdaForm(String debugName, - int arity, Name[] names, int result, boolean forceInline, MethodHandle customized) { - this(debugName, arity, names, result, forceInline, customized, Kind.GENERIC); + LambdaForm(int arity, Name[] names, int result, boolean forceInline, MethodHandle customized) { + this(arity, names, result, forceInline, customized, Kind.GENERIC); } - LambdaForm(String debugName, - int arity, Name[] names, int result, boolean forceInline, MethodHandle customized, Kind kind) { + LambdaForm(int arity, Name[] names, int result, boolean forceInline, MethodHandle customized, Kind kind) { assert(namesOK(arity, names)); this.arity = arity; this.result = fixResult(result, names); this.names = names.clone(); - this.debugName = fixDebugName(debugName); this.forceInline = forceInline; this.customized = customized; this.kind = kind; @@ -364,31 +370,23 @@ class LambdaForm { compileToBytecode(); } } - LambdaForm(String debugName, - int arity, Name[] names) { - this(debugName, arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null, Kind.GENERIC); + LambdaForm(int arity, Name[] names) { + this(arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null, Kind.GENERIC); } - LambdaForm(String debugName, - int arity, Name[] names, Kind kind) { - this(debugName, arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null, kind); + LambdaForm(int arity, Name[] names, Kind kind) { + this(arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null, kind); } - LambdaForm(String debugName, - int arity, Name[] names, boolean forceInline) { - this(debugName, arity, names, LAST_RESULT, forceInline, /*customized=*/null, Kind.GENERIC); + LambdaForm(int arity, Name[] names, boolean forceInline) { + this(arity, names, LAST_RESULT, forceInline, /*customized=*/null, Kind.GENERIC); } - LambdaForm(String debugName, - int arity, Name[] names, boolean forceInline, Kind kind) { - this(debugName, arity, names, LAST_RESULT, forceInline, /*customized=*/null, kind); + LambdaForm(int arity, Name[] names, boolean forceInline, Kind kind) { + this(arity, names, LAST_RESULT, forceInline, /*customized=*/null, kind); } - LambdaForm(String debugName, - Name[] formals, Name[] temps, Name result) { - this(debugName, - formals.length, buildNames(formals, temps, result), LAST_RESULT, /*forceInline=*/true, /*customized=*/null); + LambdaForm(Name[] formals, Name[] temps, Name result) { + this(formals.length, buildNames(formals, temps, result), LAST_RESULT, /*forceInline=*/true, /*customized=*/null); } - LambdaForm(String debugName, - Name[] formals, Name[] temps, Name result, boolean forceInline) { - this(debugName, - formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline, /*customized=*/null); + LambdaForm(Name[] formals, Name[] temps, Name result, boolean forceInline) { + this(formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline, /*customized=*/null); } private static Name[] buildNames(Name[] formals, Name[] temps, Name result) { @@ -408,10 +406,9 @@ class LambdaForm { this.arity = mt.parameterCount(); this.result = (mt.returnType() == void.class || mt.returnType() == Void.class) ? -1 : arity; this.names = buildEmptyNames(arity, mt, result == -1); - this.debugName = "LF.zero"; this.forceInline = true; this.customized = null; - this.kind = Kind.GENERIC; + this.kind = Kind.ZERO; assert(nameRefsAreLegal()); assert(isEmpty()); String sig = null; @@ -436,36 +433,46 @@ class LambdaForm { return result; } - private static String fixDebugName(String debugName) { - if (DEBUG_NAME_COUNTERS != null) { - int under = debugName.indexOf('_'); - int length = debugName.length(); - if (under < 0) under = length; - String debugNameStem = debugName.substring(0, under); - Integer ctr; - synchronized (DEBUG_NAME_COUNTERS) { - ctr = DEBUG_NAME_COUNTERS.get(debugNameStem); - if (ctr == null) ctr = 0; - DEBUG_NAME_COUNTERS.put(debugNameStem, ctr+1); - } - StringBuilder buf = new StringBuilder(debugNameStem); - buf.append('_'); - int leadingZero = buf.length(); - buf.append((int) ctr); - for (int i = buf.length() - leadingZero; i < 3; i++) - buf.insert(leadingZero, '0'); - if (under < length) { - ++under; // skip "_" - while (under < length && Character.isDigit(debugName.charAt(under))) { - ++under; - } - if (under < length && debugName.charAt(under) == '_') ++under; - if (under < length) - buf.append('_').append(debugName, under, length); - } - return buf.toString(); + static boolean debugNames() { + return DEBUG_NAME_COUNTERS != null; + } + + static void associateWithDebugName(LambdaForm form, String name) { + assert (debugNames()); + synchronized (DEBUG_NAMES) { + DEBUG_NAMES.put(form, name); } - return debugName; + } + + String lambdaName() { + if (DEBUG_NAMES != null) { + synchronized (DEBUG_NAMES) { + String name = DEBUG_NAMES.get(this); + if (name == null) { + name = generateDebugName(); + } + return name; + } + } + return kind.defaultLambdaName; + } + + private String generateDebugName() { + assert (debugNames()); + String debugNameStem = kind.defaultLambdaName; + Integer ctr = DEBUG_NAME_COUNTERS.getOrDefault(debugNameStem, 0); + DEBUG_NAME_COUNTERS.put(debugNameStem, ctr + 1); + StringBuilder buf = new StringBuilder(debugNameStem); + int leadingZero = buf.length(); + buf.append((int) ctr); + for (int i = buf.length() - leadingZero; i < 3; i++) { + buf.insert(leadingZero, '0'); + } + buf.append('_'); + buf.append(basicTypeSignature()); + String name = buf.toString(); + associateWithDebugName(this, name); + return name; } private static boolean namesOK(int arity, Name[] names) { @@ -482,7 +489,7 @@ class LambdaForm { /** Customize LambdaForm for a particular MethodHandle */ LambdaForm customize(MethodHandle mh) { - LambdaForm customForm = new LambdaForm(debugName, arity, names, result, forceInline, mh, kind); + LambdaForm customForm = new LambdaForm(arity, names, result, forceInline, mh, kind); if (COMPILE_THRESHOLD >= 0 && isCompiled) { // If shared LambdaForm has been compiled, compile customized version as well. customForm.compileToBytecode(); @@ -634,7 +641,7 @@ class LambdaForm { for (int i = 0; i < arity; ++i) { ptypes[i] = parameterType(i).btClass; } - return MethodType.methodType(returnType().btClass, ptypes); + return MethodType.makeImpl(returnType().btClass, ptypes, true); } /** Return ABC_Z, where the ABC are parameter type characters, and Z is the return type character. */ @@ -670,7 +677,7 @@ class LambdaForm { for (int i = 0; i < ptypes.length; i++) ptypes[i] = basicType(sig.charAt(i)).btClass; Class rtype = signatureReturn(sig).btClass; - return MethodType.methodType(rtype, ptypes); + return MethodType.makeImpl(rtype, ptypes, true); } /** @@ -840,6 +847,10 @@ class LambdaForm { if (vmentry != null && isCompiled) { return; // already compiled somehow } + + // Obtain the invoker MethodType outside of the following try block. + // This ensures that an IllegalArgumentException is directly thrown if the + // type would have 256 or more parameters MethodType invokerType = methodType(); assert(vmentry == null || vmentry.getMethodType().basicType().equals(invokerType)); try { @@ -894,10 +905,6 @@ class LambdaForm { } return true; } - private static boolean returnTypesMatch(String sig, Object[] av, Object res) { - MethodHandle mh = (MethodHandle) av[0]; - return valueMatches(signatureReturn(sig), mh.type().returnType(), res); - } private static boolean checkInt(Class type, Object x) { assert(x instanceof Integer); if (type == int.class) return true; @@ -1030,7 +1037,8 @@ class LambdaForm { } public String toString() { - StringBuilder buf = new StringBuilder(debugName+"=Lambda("); + String lambdaName = lambdaName(); + StringBuilder buf = new StringBuilder(lambdaName + "=Lambda("); for (int i = 0; i < names.length; i++) { if (i == arity) buf.append(")=>{"); Name n = names[i]; @@ -1171,7 +1179,6 @@ class LambdaForm { // If we have a cached invoker, call it right away. // NOTE: The invoker always returns a reference value. if (TRACE_INTERPRETER) return invokeWithArgumentsTracing(arguments); - assert(checkArgumentTypes(arguments, methodType())); return invoker().invokeBasic(resolvedHandle(), arguments); } @@ -1189,7 +1196,6 @@ class LambdaForm { traceInterpreter("| resolve", this); resolvedHandle(); } - assert(checkArgumentTypes(arguments, methodType())); rval = invoker().invokeBasic(resolvedHandle(), arguments); } catch (Throwable ex) { traceInterpreter("] throw =>", ex); @@ -1205,23 +1211,6 @@ class LambdaForm { return invoker = computeInvoker(methodType().form()); } - private static boolean checkArgumentTypes(Object[] arguments, MethodType methodType) { - if (true) return true; // FIXME - MethodType dstType = methodType.form().erasedType(); - MethodType srcType = dstType.basicType().wrap(); - Class[] ptypes = new Class[arguments.length]; - for (int i = 0; i < arguments.length; i++) { - Object arg = arguments[i]; - Class ptype = arg == null ? Object.class : arg.getClass(); - // If the dest. type is a primitive we keep the - // argument type. - ptypes[i] = dstType.parameterType(i).isPrimitive() ? ptype : Object.class; - } - MethodType argType = MethodType.methodType(srcType.returnType(), ptypes).wrap(); - assert(argType.isConvertibleTo(srcType)) : "wrong argument types: cannot convert " + argType + " to " + srcType; - return true; - } - MethodType methodType() { if (resolvedHandle != null) return resolvedHandle.type(); @@ -1717,7 +1706,7 @@ class LambdaForm { boolean isVoid = (type == V_TYPE); Class btClass = type.btClass; MethodType zeType = MethodType.methodType(btClass); - MethodType idType = (isVoid) ? zeType : zeType.appendParameterTypes(btClass); + MethodType idType = (isVoid) ? zeType : MethodType.methodType(btClass, btClass); // Look up symbolic names. It might not be necessary to have these, // but if we need to emit direct references to bytecodes, it helps. @@ -1742,7 +1731,7 @@ class LambdaForm { // bootstrap dependency on this method in case we're interpreting LFs if (isVoid) { Name[] idNames = new Name[] { argument(0, L_TYPE) }; - idForm = new LambdaForm(idMem.getName(), 1, idNames, VOID_RESULT, Kind.IDENTITY); + idForm = new LambdaForm(1, idNames, VOID_RESULT, Kind.IDENTITY); idForm.compileToBytecode(); idFun = new NamedFunction(idMem, SimpleMethodHandle.make(idMem.getInvocationType(), idForm)); @@ -1750,14 +1739,14 @@ class LambdaForm { zeFun = idFun; } else { Name[] idNames = new Name[] { argument(0, L_TYPE), argument(1, type) }; - idForm = new LambdaForm(idMem.getName(), 2, idNames, 1, Kind.IDENTITY); + idForm = new LambdaForm(2, idNames, 1, Kind.IDENTITY); idForm.compileToBytecode(); idFun = new NamedFunction(idMem, MethodHandleImpl.makeIntrinsic( idMem.getInvocationType(), idForm, MethodHandleImpl.Intrinsic.IDENTITY)); Object zeValue = Wrapper.forBasicType(btChar).zero(); Name[] zeNames = new Name[] { argument(0, L_TYPE), new Name(idFun, zeValue) }; - zeForm = new LambdaForm(zeMem.getName(), 1, zeNames, 1, Kind.ZERO); + zeForm = new LambdaForm(1, zeNames, 1, Kind.ZERO); zeForm.compileToBytecode(); zeFun = new NamedFunction(zeMem, MethodHandleImpl.makeIntrinsic( zeMem.getInvocationType(), zeForm, MethodHandleImpl.Intrinsic.ZERO)); @@ -1805,11 +1794,15 @@ class LambdaForm { } private static final HashMap DEBUG_NAME_COUNTERS; + private static final HashMap DEBUG_NAMES; static { - if (debugEnabled()) + if (debugEnabled()) { DEBUG_NAME_COUNTERS = new HashMap<>(); - else + DEBUG_NAMES = new HashMap<>(); + } else { DEBUG_NAME_COUNTERS = null; + DEBUG_NAMES = null; + } } static { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java index cc4b97b5479..bcf1733461b 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormBuffer.java @@ -40,7 +40,6 @@ final class LambdaFormBuffer { private byte flags; private int firstChange; private Name resultName; - private String debugName; private ArrayList dups; private static final int F_TRANS = 0x10, F_OWNED = 0x03; @@ -50,15 +49,15 @@ final class LambdaFormBuffer { setNames(lf.names); int result = lf.result; if (result == LAST_RESULT) result = length - 1; - if (result >= 0 && lf.names[result].type != V_TYPE) + if (result >= 0 && lf.names[result].type != V_TYPE) { resultName = lf.names[result]; - debugName = lf.debugName; + } assert(lf.nameRefsAreLegal()); } private LambdaForm lambdaForm() { assert(!inTrans()); // need endEdit call to tidy things up - return new LambdaForm(debugName, arity, nameArray(), resultIndex()); + return new LambdaForm(arity, nameArray(), resultIndex()); } Name name(int i) { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java index ddd60ca082f..e066a60838c 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java @@ -532,7 +532,8 @@ class LambdaFormEditor { assert(pos > 0); // cannot spread the MH arg itself Name spreadParam = new Name(L_TYPE); - Name checkSpread = new Name(MethodHandleImpl.NF_checkSpreadArgument, spreadParam, arrayLength); + Name checkSpread = new Name(MethodHandleImpl.getFunction(MethodHandleImpl.NF_checkSpreadArgument), + spreadParam, arrayLength); // insert the new expressions int exprPos = lambdaForm.arity(); @@ -915,7 +916,7 @@ class LambdaFormEditor { } } - form = new LambdaForm(lambdaForm.debugName, arity2, names2, result2); + form = new LambdaForm(arity2, names2, result2); return putInCache(key, form); } @@ -932,14 +933,14 @@ class LambdaFormEditor { // replace the null entry in the MHImpl.loop invocation with localTypes Name invokeLoop = lambdaForm.names[pos + 1]; - assert(invokeLoop.function == NF_loop); + assert(invokeLoop.function.equals(MethodHandleImpl.getFunction(NF_loop))); Object[] args = Arrays.copyOf(invokeLoop.arguments, invokeLoop.arguments.length); assert(args[0] == null); args[0] = localTypes; LambdaFormBuffer buf = buffer(); buf.startEdit(); - buf.changeName(pos + 1, new Name(NF_loop, args)); + buf.changeName(pos + 1, new Name(MethodHandleImpl.getFunction(NF_loop), args)); form = buf.endEdit(); return putInCache(key, form); diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java index b6ef976c515..b09744cba7d 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java @@ -211,6 +211,7 @@ import java.util.Arrays; * theory, any method handle could be used. Currently supported are direct method * handles representing invocation of virtual, interface, constructor and static * methods. + * @since 1.8 */ public class LambdaMetafactory { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java index 97efa4f1066..41a4545d6bb 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MemberName.java @@ -33,7 +33,6 @@ import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.lang.reflect.Module; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; @@ -149,7 +148,7 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; Object[] typeInfo = (Object[]) type; Class[] ptypes = (Class[]) typeInfo[1]; Class rtype = (Class) typeInfo[0]; - MethodType res = MethodType.methodType(rtype, ptypes); + MethodType res = MethodType.makeImpl(rtype, ptypes, true); type = res; } // Make sure type is a MethodType for racing threads. diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java index 6265b874175..6e913a84fd9 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java @@ -310,7 +310,7 @@ mh.invokeExact(System.out, "Hello, world."); * throwables locally, rethrowing only those which are legal in the context, * and wrapping ones which are illegal. * - *

      Signature polymorphism

      + *

      Signature polymorphism

      * The unusual compilation and linkage behavior of * {@code invokeExact} and plain {@code invoke} * is referenced by the term signature polymorphism. @@ -404,7 +404,7 @@ mh.invokeExact(System.out, "Hello, world."); * genericity with a Java type parameter.
    • *
    * - *

    Arity limits

    + *

    Arity limits

    * The JVM imposes on all methods and constructors of any kind an absolute * limit of 255 stacked arguments. This limit can appear more restrictive * in certain cases: @@ -423,6 +423,7 @@ mh.invokeExact(System.out, "Hello, world."); * @see MethodType * @see MethodHandles * @author John Rose, JSR 292 EG + * @since 1.7 */ public abstract class MethodHandle { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java index 010b61809ee..a12fa138252 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java @@ -399,7 +399,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; assert(RETURN_CONV == names.length-1); } - LambdaForm form = new LambdaForm("convert", lambdaType.parameterCount(), names, RESULT); + LambdaForm form = new LambdaForm(lambdaType.parameterCount(), names, RESULT, Kind.CONVERT); return SimpleMethodHandle.make(srcType, form); } @@ -589,7 +589,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // Spread the array. MethodHandle aload = MethodHandles.arrayElementGetter(spreadArgType); Name array = names[argIndex]; - names[nameCursor++] = new Name(NF_checkSpreadArgument, array, spreadArgCount); + names[nameCursor++] = new Name(getFunction(NF_checkSpreadArgument), array, spreadArgCount); for (int j = 0; j < spreadArgCount; i++, j++) { indexes[i] = nameCursor; names[nameCursor++] = new Name(aload, array, j); @@ -608,7 +608,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; } names[names.length - 1] = new Name(target, (Object[]) targetArgs); - LambdaForm form = new LambdaForm("spread", lambdaType.parameterCount(), names); + LambdaForm form = new LambdaForm(lambdaType.parameterCount(), names, Kind.SPREAD); return SimpleMethodHandle.make(srcType, form); } @@ -676,7 +676,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; assert(inputArgPos + chunk == collectNamePos); // use of rest of input args also names[targetNamePos] = new Name(target, (Object[]) targetArgs); - LambdaForm form = new LambdaForm("collect", lambdaType.parameterCount(), names); + LambdaForm form = new LambdaForm(lambdaType.parameterCount(), names, Kind.COLLECT); return SimpleMethodHandle.make(srcType, form); } @@ -774,7 +774,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; @Override public LambdaForm apply(MethodHandle target) { return DelegatingMethodHandle.makeReinvokerForm(target, - MethodTypeForm.LF_DELEGATE_BLOCK_INLINING, CountingWrapper.class, "reinvoker.dontInline", false, + MethodTypeForm.LF_DELEGATE_BLOCK_INLINING, CountingWrapper.class, false, DelegatingMethodHandle.NF_getTarget, CountingWrapper.NF_maybeStopCounting); } }; @@ -934,7 +934,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // profile branch if (PROFILE != -1) { - names[PROFILE] = new Name(NF_profileBoolean, names[CALL_TEST], names[GET_COUNTERS]); + names[PROFILE] = new Name(getFunction(NF_profileBoolean), names[CALL_TEST], names[GET_COUNTERS]); } // call selectAlternative names[SELECT_ALT] = new Name(getConstantHandle(MH_selectAlternative), names[TEST], names[GET_TARGET], names[GET_FALLBACK]); @@ -943,7 +943,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; invokeArgs[0] = names[SELECT_ALT]; names[CALL_TARGET] = new Name(basicType, invokeArgs); - lform = new LambdaForm("guard", lambdaType.parameterCount(), names, /*forceInline=*/true); + lform = new LambdaForm(lambdaType.parameterCount(), names, /*forceInline=*/true, Kind.GUARD); return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWT, lform); } @@ -1012,14 +1012,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // t_{i+1}:L=MethodHandleImpl.guardWithCatch(target:L,exType:L,catcher:L,t_{i}:L); Object[] gwcArgs = new Object[] {names[GET_TARGET], names[GET_CLASS], names[GET_CATCHER], names[BOXED_ARGS]}; - names[TRY_CATCH] = new Name(NF_guardWithCatch, gwcArgs); + names[TRY_CATCH] = new Name(getFunction(NF_guardWithCatch), gwcArgs); // t_{i+2}:I=MethodHandle.invokeBasic(unbox:L,t_{i+1}:L); MethodHandle invokeBasicUnbox = MethodHandles.basicInvoker(MethodType.methodType(basicType.rtype(), Object.class)); Object[] unboxArgs = new Object[] {names[GET_UNBOX_RESULT], names[TRY_CATCH]}; names[UNBOX_RESULT] = new Name(invokeBasicUnbox, unboxArgs); - lform = new LambdaForm("guardWithCatch", lambdaType.parameterCount(), names); + lform = new LambdaForm(lambdaType.parameterCount(), names, Kind.GUARD_WITH_CATCH); return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWC, lform); } @@ -1085,7 +1085,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; mh = MethodHandles.dropArguments(mh, 1, Arrays.copyOfRange(type.parameterArray(), 1, arity)); return mh; } - return makePairwiseConvert(NF_throwException.resolvedHandle(), type, false, true); + return makePairwiseConvert(getFunction(NF_throwException).resolvedHandle(), type, false, true); } static Empty throwException(T t) throws T { throw t; } @@ -1673,33 +1673,57 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; } // Local constant functions: - /*non-public*/ static final NamedFunction - NF_checkSpreadArgument, - NF_guardWithCatch, - NF_throwException, - NF_tryFinally, - NF_loop, - NF_profileBoolean; - static { + /* non-public */ + static final byte NF_checkSpreadArgument = 0, + NF_guardWithCatch = 1, + NF_throwException = 2, + NF_tryFinally = 3, + NF_loop = 4, + NF_profileBoolean = 5, + NF_LIMIT = 6; + + private static final @Stable NamedFunction[] NFS = new NamedFunction[NF_LIMIT]; + + static NamedFunction getFunction(byte func) { + NamedFunction nf = NFS[func]; + if (nf != null) { + return nf; + } + return NFS[func] = createFunction(func); + } + + private static NamedFunction createFunction(byte func) { try { - NF_checkSpreadArgument = new NamedFunction(MethodHandleImpl.class - .getDeclaredMethod("checkSpreadArgument", Object.class, int.class)); - NF_guardWithCatch = new NamedFunction(MethodHandleImpl.class - .getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class, - MethodHandle.class, Object[].class)); - NF_tryFinally = new NamedFunction(MethodHandleImpl.class - .getDeclaredMethod("tryFinally", MethodHandle.class, MethodHandle.class, Object[].class)); - NF_loop = new NamedFunction(MethodHandleImpl.class - .getDeclaredMethod("loop", BasicType[].class, LoopClauses.class, Object[].class)); - NF_throwException = new NamedFunction(MethodHandleImpl.class - .getDeclaredMethod("throwException", Throwable.class)); - NF_profileBoolean = new NamedFunction(MethodHandleImpl.class - .getDeclaredMethod("profileBoolean", boolean.class, int[].class)); + switch (func) { + case NF_checkSpreadArgument: + return new NamedFunction(MethodHandleImpl.class + .getDeclaredMethod("checkSpreadArgument", Object.class, int.class)); + case NF_guardWithCatch: + return new NamedFunction(MethodHandleImpl.class + .getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class, + MethodHandle.class, Object[].class)); + case NF_tryFinally: + return new NamedFunction(MethodHandleImpl.class + .getDeclaredMethod("tryFinally", MethodHandle.class, MethodHandle.class, Object[].class)); + case NF_loop: + return new NamedFunction(MethodHandleImpl.class + .getDeclaredMethod("loop", BasicType[].class, LoopClauses.class, Object[].class)); + case NF_throwException: + return new NamedFunction(MethodHandleImpl.class + .getDeclaredMethod("throwException", Throwable.class)); + case NF_profileBoolean: + return new NamedFunction(MethodHandleImpl.class + .getDeclaredMethod("profileBoolean", boolean.class, int[].class)); + default: + throw new InternalError("Undefined function: " + func); + } } catch (ReflectiveOperationException ex) { throw newInternalError(ex); } + } + static { SharedSecrets.setJavaLangInvokeAccess(new JavaLangInvokeAccess() { @Override public Object newMemberName() { @@ -1878,7 +1902,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; Object[] lArgs = new Object[]{null, // placeholder for BasicType[] localTypes - will be added by LambdaFormEditor names[GET_CLAUSE_DATA], names[BOXED_ARGS]}; - names[LOOP] = new Name(NF_loop, lArgs); + names[LOOP] = new Name(getFunction(NF_loop), lArgs); // t_{i+2}:I=MethodHandle.invokeBasic(unbox:L,t_{i+1}:L); MethodHandle invokeBasicUnbox = MethodHandles.basicInvoker(MethodType.methodType(basicType.rtype(), Object.class)); @@ -1886,7 +1910,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; names[UNBOX_RESULT] = new Name(invokeBasicUnbox, unboxArgs); lform = basicType.form().setCachedLambdaForm(MethodTypeForm.LF_LOOP, - new LambdaForm("loop", lambdaType.parameterCount(), names)); + new LambdaForm(lambdaType.parameterCount(), names, Kind.LOOP)); } // BOXED_ARGS is the index into the names array where the loop idiom starts @@ -2113,14 +2137,14 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*; // t_{i+1}:L=MethodHandleImpl.tryFinally(target:L,exType:L,catcher:L,t_{i}:L); Object[] tfArgs = new Object[] {names[GET_TARGET], names[GET_CLEANUP], names[BOXED_ARGS]}; - names[TRY_FINALLY] = new Name(NF_tryFinally, tfArgs); + names[TRY_FINALLY] = new Name(getFunction(NF_tryFinally), tfArgs); // t_{i+2}:I=MethodHandle.invokeBasic(unbox:L,t_{i+1}:L); MethodHandle invokeBasicUnbox = MethodHandles.basicInvoker(MethodType.methodType(basicType.rtype(), Object.class)); Object[] unboxArgs = new Object[] {names[GET_UNBOX_RESULT], names[TRY_FINALLY]}; names[UNBOX_RESULT] = new Name(invokeBasicUnbox, unboxArgs); - lform = new LambdaForm("tryFinally", lambdaType.parameterCount(), names); + lform = new LambdaForm(lambdaType.parameterCount(), names, Kind.TRY_FINALLY); return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_TF, lform); } diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java index ad6799acfc9..a53e0076756 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleInfo.java @@ -35,7 +35,7 @@ import static java.lang.invoke.MethodHandleStatics.*; * A symbolic reference obtained by cracking a direct method handle * into its consitutent symbolic parts. * To crack a direct method handle, call {@link Lookup#revealDirect Lookup.revealDirect}. - *

    Direct Method Handles

    + *

    Direct Method Handles

    * A direct method handle represents a method, constructor, or field without * any intervening argument bindings or other transformations. * The method, constructor, or field referred to by a direct method handle is called @@ -77,7 +77,7 @@ import static java.lang.invoke.MethodHandleStatics.*; * handle with symbolic information (or caller binding) from an unexpected scope. * Use {@link java.lang.invoke.MethodHandles#reflectAs} to override this limitation. * - *

    Reference kinds

    + *

    Reference kinds

    * The Lookup Factory Methods * correspond to all major use cases for methods, constructors, and fields. * These use cases may be distinguished using small integers as follows: diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java index 1065b8d1482..110369fb13e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleNatives.java @@ -420,7 +420,7 @@ class MethodHandleNatives { MethodType mtype, Object[] appendixResult) { // Get the signature method type - MethodType sigType = mtype.basicType(); + final MethodType sigType = mtype.basicType(); // Get the access kind from the method name VarHandle.AccessMode ak; @@ -430,32 +430,37 @@ class MethodHandleNatives { throw MethodHandleStatics.newInternalError(e); } - // If not polymorphic in the return type, such as the compareAndSet - // methods that return boolean - if (ak.at.isMonomorphicInReturnType) { - if (ak.at.returnType != mtype.returnType()) { - // The caller contains a different return type than that - // defined by the method - throw newNoSuchMethodErrorOnVarHandle(name, mtype); - } - // Adjust the return type of the signature method type - sigType = sigType.changeReturnType(ak.at.returnType); - } - - // Get the guard method type for linking - MethodType guardType = sigType - // VarHandle at start - .insertParameterTypes(0, VarHandle.class) - // Access descriptor at end - .appendParameterTypes(VarHandle.AccessDescriptor.class); - // Create the appendix descriptor constant VarHandle.AccessDescriptor ad = new VarHandle.AccessDescriptor(mtype, ak.at.ordinal(), ak.ordinal()); appendixResult[0] = ad; if (MethodHandleStatics.VAR_HANDLE_GUARDS) { + // If not polymorphic in the return type, such as the compareAndSet + // methods that return boolean + Class guardReturnType = sigType.returnType(); + if (ak.at.isMonomorphicInReturnType) { + if (ak.at.returnType != mtype.returnType()) { + // The caller contains a different return type than that + // defined by the method + throw newNoSuchMethodErrorOnVarHandle(name, mtype); + } + // Adjust the return type of the signature method type + guardReturnType = ak.at.returnType; + } + + // Get the guard method type for linking + final Class[] guardParams = new Class[sigType.parameterCount() + 2]; + // VarHandle at start + guardParams[0] = VarHandle.class; + for (int i = 0; i < sigType.parameterCount(); i++) { + guardParams[i + 1] = sigType.parameterType(i); + } + // Access descriptor at end + guardParams[guardParams.length - 1] = VarHandle.AccessDescriptor.class; + MethodType guardType = MethodType.makeImpl(guardReturnType, guardParams, true); + MemberName linker = new MemberName( - VarHandleGuards.class, "guard_" + getVarHandleMethodSignature(sigType), + VarHandleGuards.class, getVarHandleGuardMethodName(guardType), guardType, REF_invokeStatic); linker = MemberName.getFactory().resolveOrNull(REF_invokeStatic, linker, @@ -466,16 +471,18 @@ class MethodHandleNatives { // Fall back to lambda form linkage if guard method is not available // TODO Optionally log fallback ? } - return Invokers.varHandleInvokeLinkerMethod(name, mtype); + return Invokers.varHandleInvokeLinkerMethod(ak, mtype); } - static String getVarHandleMethodSignature(MethodType mt) { - StringBuilder sb = new StringBuilder(mt.parameterCount() + 2); + static String getVarHandleGuardMethodName(MethodType guardType) { + String prefix = "guard_"; + StringBuilder sb = new StringBuilder(prefix.length() + guardType.parameterCount()); - for (int i = 0; i < mt.parameterCount(); i++) { - Class pt = mt.parameterType(i); + sb.append(prefix); + for (int i = 1; i < guardType.parameterCount() - 1; i++) { + Class pt = guardType.parameterType(i); sb.append(getCharType(pt)); } - sb.append('_').append(getCharType(mt.returnType())); + sb.append('_').append(getCharType(guardType.returnType())); return sb.toString(); } static char getCharType(Class pt) { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java index 09db4f93512..fce6e0fef01 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleProxies.java @@ -38,6 +38,8 @@ import static java.lang.invoke.MethodHandleStatics.*; /** * This class consists exclusively of static methods that help adapt * method handles to other JVM types, such as interfaces. + * + * @since 1.7 */ public class MethodHandleProxies { diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java index 16a9e8a941d..eceba166e24 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandles.java @@ -25,8 +25,9 @@ package java.lang.invoke; -import jdk.internal.org.objectweb.asm.ClassWriter; -import jdk.internal.org.objectweb.asm.Opcodes; +import jdk.internal.misc.SharedSecrets; +import jdk.internal.module.IllegalAccessLogger; +import jdk.internal.org.objectweb.asm.ClassReader; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; import jdk.internal.vm.annotation.ForceInline; @@ -42,9 +43,11 @@ import java.lang.reflect.Field; import java.lang.reflect.Member; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.lang.reflect.Module; import java.lang.reflect.ReflectPermission; import java.nio.ByteOrder; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.ProtectionDomain; import java.util.ArrayList; import java.util.Arrays; import java.util.BitSet; @@ -111,13 +114,17 @@ public class MethodHandles { /** * Returns a {@link Lookup lookup object} which is trusted minimally. - * It can only be used to create method handles to public members in + * The lookup has the {@code PUBLIC} and {@code UNCONDITIONAL} modes. + * It can only be used to create method handles to public members of * public classes in packages that are exported unconditionally. *

    - * For now, the {@linkplain Lookup#lookupClass lookup class} of this lookup - * object is in an unnamed module. - * Consequently, the lookup context of this lookup object will be the bootstrap - * class loader, which means it cannot find user classes. + * As a matter of pure convention, the {@linkplain Lookup#lookupClass lookup class} + * of this lookup object will be {@link java.lang.Object}. + * + * @apiNote The use of Object is conventional, and because the lookup modes are + * limited, there is no special access provided to the internals of Object, its package + * or its module. Consequently, the lookup context of this lookup object will be the + * bootstrap class loader, which means it cannot find user classes. * *

    * Discussion: @@ -129,17 +136,12 @@ public class MethodHandles { * Also, it cannot access * caller sensitive methods. * @return a lookup object which is trusted minimally + * + * @revised 9 + * @spec JPMS */ public static Lookup publicLookup() { - // During VM startup then only classes in the java.base module can be - // loaded and linked. This is because java.base exports aren't setup until - // the module system is initialized, hence types in the unnamed module - // (or any named module) can't link to java/lang/Object. - if (!jdk.internal.misc.VM.isModuleSystemInited()) { - return new Lookup(Object.class, Lookup.PUBLIC); - } else { - return LookupHelper.PUBLIC_LOOKUP; - } + return Lookup.PUBLIC_LOOKUP; } /** @@ -172,6 +174,7 @@ public class MethodHandles { * @throws IllegalAccessException if the access check specified above fails * @throws SecurityException if denied by the security manager * @since 9 + * @spec JPMS * @see Lookup#dropLookupMode */ public static Lookup privateLookupIn(Class targetClass, Lookup lookup) throws IllegalAccessException { @@ -183,16 +186,22 @@ public class MethodHandles { throw new IllegalArgumentException(targetClass + " is an array class"); Module targetModule = targetClass.getModule(); Module callerModule = lookup.lookupClass().getModule(); - if (callerModule != targetModule && targetModule.isNamed()) { - if (!callerModule.canRead(targetModule)) - throw new IllegalAccessException(callerModule + " does not read " + targetModule); + if (!callerModule.canRead(targetModule)) + throw new IllegalAccessException(callerModule + " does not read " + targetModule); + if (targetModule.isNamed()) { String pn = targetClass.getPackageName(); - assert pn != null && pn.length() > 0 : "unnamed package cannot be in named module"; + assert pn.length() > 0 : "unnamed package cannot be in named module"; if (!targetModule.isOpen(pn, callerModule)) throw new IllegalAccessException(targetModule + " does not open " + pn + " to " + callerModule); } if ((lookup.lookupModes() & Lookup.MODULE) == 0) throw new IllegalAccessException("lookup does not have MODULE lookup mode"); + if (!callerModule.isNamed() && targetModule.isNamed()) { + IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger(); + if (logger != null) { + logger.logIfOpenedByBackdoor(lookup, targetClass); + } + } return new Lookup(targetClass); } @@ -248,7 +257,7 @@ public class MethodHandles { * This includes all methods, constructors, and fields which are allowed to the lookup class, * even private ones. * - *

    Lookup Factory Methods

    + *

    Lookup Factory Methods

    * The factory methods on a {@code Lookup} object correspond to all major * use cases for methods, constructors, and fields. * Each method handle created by a factory method is the functional @@ -258,7 +267,7 @@ public class MethodHandles { * the behavior of the resulting method handles: * * - * + * * * * @@ -369,7 +378,7 @@ public class MethodHandles { * type having too many parameters. * * - *

    Access checking

    + *

    Access checking

    * Access checks are applied in the factory methods of {@code Lookup}, * when a method handle is created. * This is a key difference from the Core Reflection API, since @@ -474,7 +483,7 @@ public class MethodHandles { * with fewer access modes than the original lookup object. * *

    - * + * * Discussion of private access: * We say that a lookup has private access * if its {@linkplain #lookupModes lookup modes} @@ -497,7 +506,7 @@ public class MethodHandles { * whose bytecode behaviors and Java language access permissions * can be reliably determined and emulated by method handles. * - *

    Security manager interactions

    + *

    Security manager interactions

    * Although bytecode instructions can only refer to classes in * a related class loader, this API can search for methods in any * class, as long as a reference to its {@code Class} object is @@ -556,7 +565,7 @@ public class MethodHandles { * or else that is being accessed from a lookup class that has * rights to access the member or class. * - *

    Caller sensitive methods

    + *

    Caller sensitive methods

    * A small number of Java methods have a special property called caller sensitivity. * A caller-sensitive method can behave differently depending on the * identity of its immediate caller. @@ -601,6 +610,8 @@ public class MethodHandles { * so that there can be a secure foundation for lookups. * Nearly all other methods in the JSR 292 API rely on lookup * objects to check access requests. + * + * @revised 9 */ public static final class Lookup { @@ -647,15 +658,33 @@ public class MethodHandles { * lookup class and public types in packages exported by other modules * to the module of the lookup class. * @since 9 + * @spec JPMS */ public static final int MODULE = PACKAGE << 1; - private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE | MODULE); + /** A single-bit mask representing {@code unconditional} access + * which may contribute to the result of {@link #lookupModes lookupModes}. + * The value is {@code 0x20}, which does not correspond meaningfully to + * any particular {@linkplain java.lang.reflect.Modifier modifier bit}. + * A {@code Lookup} with this lookup mode assumes {@linkplain + * java.lang.Module#canRead(java.lang.Module) readability}. + * In conjunction with the {@code PUBLIC} modifier bit, a {@code Lookup} + * with this lookup mode can access all public members of public types + * of all modules where the type is in a package that is {@link + * java.lang.Module#isExported(String) exported unconditionally}. + * @since 9 + * @spec JPMS + * @see #publicLookup() + */ + public static final int UNCONDITIONAL = PACKAGE << 2; + + private static final int ALL_MODES = (PUBLIC | PRIVATE | PROTECTED | PACKAGE | MODULE | UNCONDITIONAL); + private static final int FULL_POWER_MODES = (ALL_MODES & ~UNCONDITIONAL); private static final int TRUSTED = -1; private static int fixmods(int mods) { - mods &= (ALL_MODES - PACKAGE - MODULE); - return (mods != 0) ? mods : (PACKAGE | MODULE); + mods &= (ALL_MODES - PACKAGE - MODULE - UNCONDITIONAL); + return (mods != 0) ? mods : (PACKAGE | MODULE | UNCONDITIONAL); } /** Tells which class is performing the lookup. It is this class against @@ -682,13 +711,14 @@ public class MethodHandles { * {@linkplain #PRIVATE PRIVATE (0x02)}, * {@linkplain #PROTECTED PROTECTED (0x04)}, * {@linkplain #PACKAGE PACKAGE (0x08)}, - * and {@linkplain #MODULE MODULE (0x10)}. + * {@linkplain #MODULE MODULE (0x10)}, + * and {@linkplain #UNCONDITIONAL UNCONDITIONAL (0x20)}. *

    * A freshly-created lookup object - * on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class} - * has all possible bits set, since the caller class can access all its own members, - * all public types in the caller's module, and all public types in packages exported - * by other modules to the caller's module. + * on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class} has + * all possible bits set, except {@code UNCONDITIONAL}. The lookup can be used to + * access all members of the caller's class, all public types in the caller's module, + * and all public types in packages exported by other modules to the caller's module. * A lookup object on a new lookup class * {@linkplain java.lang.invoke.MethodHandles.Lookup#in created from a previous lookup object} * may have some mode bits set to zero. @@ -701,6 +731,9 @@ public class MethodHandles { * @return the lookup modes, which limit the kinds of access performed by this lookup object * @see #in * @see #dropLookupMode + * + * @revised 9 + * @spec JPMS */ public int lookupModes() { return allowedModes & ALL_MODES; @@ -712,9 +745,9 @@ public class MethodHandles { * which in turn is called by a method not in this package. */ Lookup(Class lookupClass) { - this(lookupClass, ALL_MODES); + this(lookupClass, FULL_POWER_MODES); // make sure we haven't accidentally picked up a privileged class: - checkUnprivilegedlookupClass(lookupClass, ALL_MODES); + checkUnprivilegedlookupClass(lookupClass, FULL_POWER_MODES); } private Lookup(Class lookupClass, int allowedModes) { @@ -730,19 +763,20 @@ public class MethodHandles { * However, the resulting {@code Lookup} object is guaranteed * to have no more access capabilities than the original. * In particular, access capabilities can be lost as follows:

      - *
    • If the lookup class for this {@code Lookup} is not in a named module, - * and the new lookup class is in a named module {@code M}, then no members in - * {@code M}'s non-exported packages will be accessible. - *
    • If the lookup for this {@code Lookup} is in a named module, and the - * new lookup class is in a different module {@code M}, then no members, not even - * public members in {@code M}'s exported packages, will be accessible. - *
    • 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 old lookup class is in a {@link Module#isNamed() named} module, and + * the new lookup class is in a different module {@code M}, then no members, not + * even public members in {@code M}'s exported packages, will be accessible. + * The exception to this is when this lookup is {@link #publicLookup() + * publicLookup}, in which case {@code PUBLIC} access is not lost. + *
    • If the old lookup class is in an unnamed module, and the new lookup class + * is a different module then {@link #MODULE MODULE} access is lost. + *
    • If the new lookup class differs from the old one then {@code UNCONDITIONAL} is lost. *
    • 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. + * as the old one, private members will not be accessible, and 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 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.) @@ -757,32 +791,34 @@ public class MethodHandles { * @return a lookup object which reports the desired lookup class, or the same object * if there is no change * @throws NullPointerException if the argument is null + * + * @revised 9 + * @spec JPMS */ public Lookup in(Class requestedLookupClass) { Objects.requireNonNull(requestedLookupClass); if (allowedModes == TRUSTED) // IMPL_LOOKUP can make any lookup at all - return new Lookup(requestedLookupClass, ALL_MODES); + return new Lookup(requestedLookupClass, FULL_POWER_MODES); if (requestedLookupClass == this.lookupClass) return this; // keep same capabilities - - int newModes = (allowedModes & (ALL_MODES & ~PROTECTED)); + int newModes = (allowedModes & FULL_POWER_MODES); if (!VerifyAccess.isSameModule(this.lookupClass, requestedLookupClass)) { - // Allowed to teleport from an unnamed to a named module but resulting - // Lookup has no access to module private members - if (this.lookupClass.getModule().isNamed()) { + // Need to drop all access when teleporting from a named module to another + // module. The exception is publicLookup where PUBLIC is not lost. + if (this.lookupClass.getModule().isNamed() + && (this.allowedModes & UNCONDITIONAL) == 0) newModes = 0; - } else { - newModes &= ~MODULE; - } + else + newModes &= ~(MODULE|PACKAGE|PRIVATE|PROTECTED); } if ((newModes & PACKAGE) != 0 && !VerifyAccess.isSamePackage(this.lookupClass, requestedLookupClass)) { - newModes &= ~(PACKAGE|PRIVATE); + newModes &= ~(PACKAGE|PRIVATE|PROTECTED); } // Allow nestmate lookups to be created without special privilege: if ((newModes & PRIVATE) != 0 && !VerifyAccess.isSamePackageMember(this.lookupClass, requestedLookupClass)) { - newModes &= ~PRIVATE; + newModes &= ~(PRIVATE|PROTECTED); } if ((newModes & PUBLIC) != 0 && !VerifyAccess.isClassAccessible(requestedLookupClass, this.lookupClass, allowedModes)) { @@ -801,40 +837,153 @@ public class MethodHandles { * finds members, but with a lookup mode that has lost the given lookup mode. * The lookup mode to drop is one of {@link #PUBLIC PUBLIC}, {@link #MODULE * MODULE}, {@link #PACKAGE PACKAGE}, {@link #PROTECTED PROTECTED} or {@link #PRIVATE PRIVATE}. - * {@link #PROTECTED PROTECTED} is always dropped and so the resulting lookup - * mode will never have this access capability. When dropping {@code PACKAGE} - * then the resulting lookup will not have {@code PACKAGE} or {@code PRIVATE} - * access. When dropping {@code MODULE} then the resulting lookup will not - * have {@code MODULE}, {@code PACKAGE}, or {@code PRIVATE} access. If {@code - * PUBLIC} is dropped then the resulting lookup has no access. + * {@link #PROTECTED PROTECTED} and {@link #UNCONDITIONAL UNCONDITIONAL} are always + * dropped and so the resulting lookup mode will never have these access capabilities. + * When dropping {@code PACKAGE} then the resulting lookup will not have {@code PACKAGE} + * or {@code PRIVATE} access. When dropping {@code MODULE} then the resulting lookup will + * not have {@code MODULE}, {@code PACKAGE}, or {@code PRIVATE} access. If {@code PUBLIC} + * is dropped then the resulting lookup has no access. * @param modeToDrop the lookup mode to drop * @return a lookup object which lacks the indicated mode, or the same object if there is no change * @throws IllegalArgumentException if {@code modeToDrop} is not one of {@code PUBLIC}, - * {@code MODULE}, {@code PACKAGE}, {@code PROTECTED} or {@code PRIVATE} - * @since 9 + * {@code MODULE}, {@code PACKAGE}, {@code PROTECTED}, {@code PRIVATE} or {@code UNCONDITIONAL} * @see MethodHandles#privateLookupIn + * @since 9 */ public Lookup dropLookupMode(int modeToDrop) { int oldModes = lookupModes(); - int newModes = oldModes & ~(modeToDrop | PROTECTED); + int newModes = oldModes & ~(modeToDrop | PROTECTED | UNCONDITIONAL); switch (modeToDrop) { case PUBLIC: newModes &= ~(ALL_MODES); break; case MODULE: newModes &= ~(PACKAGE | PRIVATE); break; case PACKAGE: newModes &= ~(PRIVATE); break; case PROTECTED: - case PRIVATE: break; + case PRIVATE: + case UNCONDITIONAL: break; default: throw new IllegalArgumentException(modeToDrop + " is not a valid mode to drop"); } if (newModes == oldModes) return this; // return self if no change return new Lookup(lookupClass(), newModes); } + /** + * Defines a class to the same class loader and in the same runtime package and + * {@linkplain java.security.ProtectionDomain protection domain} as this lookup's + * {@linkplain #lookupClass() lookup class}. + * + *

      The {@linkplain #lookupModes() lookup modes} for this lookup must include + * {@link #PACKAGE PACKAGE} access as default (package) members will be + * accessible to the class. The {@code PACKAGE} lookup mode serves to authenticate + * that the lookup object was created by a caller in the runtime package (or derived + * from a lookup originally created by suitably privileged code to a target class in + * the runtime package). The lookup modes cannot include {@link #PRIVATE PRIVATE} + * access. A lookup with {@code PRIVATE} access can be downgraded to drop this lookup + * mode with the {@linkplain #dropLookupMode(int) dropLookupMode} method.

      + * + *

      The {@code bytes} parameter is the class bytes of a valid class file (as defined + * by the The Java Virtual Machine Specification) with a class name in the + * same package as the lookup class.

      + * + *

      This method does not run the class initializer. The class initializer may + * run at a later time, as detailed in section 12.4 of the The Java Language + * Specification.

      + * + *

      If there is a security manager, its {@code checkPermission} method is first called + * to check {@code RuntimePermission("defineClass")}.

      + * + * @param bytes the class bytes + * @return the {@code Class} object for the class + * @throws IllegalArgumentException the bytes are for a class in a different package + * to the lookup class + * @throws IllegalAccessException if this lookup does not have {@code PACKAGE} access + * @throws UnsupportedOperationException if the lookup class has {@code PRIVATE} access + * @throws LinkageError if the class is malformed ({@code ClassFormatError}), cannot be + * verified ({@code VerifyError}), is already defined, or another linkage error occurs + * @throws SecurityException if denied by the security manager + * @throws NullPointerException if {@code bytes} is {@code null} + * @since 9 + * @spec JPMS + * @see Lookup#privateLookupIn + * @see Lookup#dropLookupMode + * @see ClassLoader#defineClass(String,byte[],int,int,ProtectionDomain) + */ + public Class defineClass(byte[] bytes) throws IllegalAccessException { + SecurityManager sm = System.getSecurityManager(); + if (sm != null) + sm.checkPermission(new RuntimePermission("defineClass")); + if (hasPrivateAccess()) + throw new UnsupportedOperationException("PRIVATE access not supported"); + if ((lookupModes() & PACKAGE) == 0) + throw new IllegalAccessException("Lookup does not have PACKAGE access"); + assert (lookupModes() & (MODULE|PUBLIC)) != 0; + + // parse class bytes to get class name (in internal form) + bytes = bytes.clone(); + String name; + try { + ClassReader reader = new ClassReader(bytes); + name = reader.getClassName(); + } catch (RuntimeException e) { + // ASM exceptions are poorly specified + ClassFormatError cfe = new ClassFormatError(); + cfe.initCause(e); + throw cfe; + } + + // get package and class name in binary form + String cn, pn; + int index = name.lastIndexOf('/'); + if (index == -1) { + cn = name; + pn = ""; + } else { + cn = name.replace('/', '.'); + pn = cn.substring(0, index); + } + if (!pn.equals(lookupClass.getPackageName())) { + throw new IllegalArgumentException("Class not in same package as lookup class"); + } + + // invoke the class loader's defineClass method + ClassLoader loader = lookupClass.getClassLoader(); + ProtectionDomain pd = (loader != null) ? lookupClassProtectionDomain() : null; + String source = "__Lookup_defineClass__"; + Class clazz = SharedSecrets.getJavaLangAccess().defineClass(loader, cn, bytes, pd, source); + assert clazz.getClassLoader() == lookupClass.getClassLoader() + && clazz.getPackageName().equals(lookupClass.getPackageName()) + && protectionDomain(clazz) == lookupClassProtectionDomain(); + return clazz; + } + + private ProtectionDomain lookupClassProtectionDomain() { + ProtectionDomain pd = cachedProtectionDomain; + if (pd == null) { + cachedProtectionDomain = pd = protectionDomain(lookupClass); + } + return pd; + } + + private ProtectionDomain protectionDomain(Class clazz) { + PrivilegedAction pa = clazz::getProtectionDomain; + return AccessController.doPrivileged(pa); + } + + // cached protection domain + private volatile ProtectionDomain cachedProtectionDomain; + + // Make sure outer class is initialized first. static { IMPL_NAMES.getClass(); } /** Package-private version of lookup which is trusted. */ static final Lookup IMPL_LOOKUP = new Lookup(Object.class, TRUSTED); + /** Version of lookup which is trusted minimally. + * It can only be used to create method handles to publicly accessible + * members in packages that are exported unconditionally. + */ + static final Lookup PUBLIC_LOOKUP = new Lookup(Object.class, (PUBLIC|UNCONDITIONAL)); + private static void checkUnprivilegedlookupClass(Class lookupClass, int allowedModes) { String name = lookupClass.getName(); if (name.startsWith("java.lang.invoke.")) @@ -845,7 +994,7 @@ public class MethodHandles { // TODO replace with a more formal and less fragile mechanism // that does not bluntly restrict classes under packages within // java.base from looking up MethodHandles or VarHandles. - if (allowedModes == ALL_MODES && lookupClass.getClassLoader() == null) { + if (allowedModes == FULL_POWER_MODES && lookupClass.getClassLoader() == null) { if ((name.startsWith("java.") && !name.equals("java.lang.Thread") && !name.startsWith("java.util.concurrent.")) || @@ -866,6 +1015,7 @@ public class MethodHandles { *
        *
      • If no access is allowed, the suffix is "/noaccess". *
      • If only public access to types in exported packages is allowed, the suffix is "/public". + *
      • If only public access and unconditional access are allowed, the suffix is "/publicLookup". *
      • If only public and module access are allowed, the suffix is "/module". *
      • If only public, module and package access are allowed, the suffix is "/package". *
      • If only public, module, package, and private access are allowed, the suffix is "/private". @@ -884,6 +1034,9 @@ public class MethodHandles { * because it requires a direct subclass relationship between * caller and callee.) * @see #in + * + * @revised 9 + * @spec JPMS */ @Override public String toString() { @@ -893,13 +1046,15 @@ public class MethodHandles { return cname + "/noaccess"; case PUBLIC: return cname + "/public"; + case PUBLIC|UNCONDITIONAL: + return cname + "/publicLookup"; case PUBLIC|MODULE: return cname + "/module"; case PUBLIC|MODULE|PACKAGE: return cname + "/package"; - case ALL_MODES & ~PROTECTED: + case FULL_POWER_MODES & ~PROTECTED: return cname + "/private"; - case ALL_MODES: + case FULL_POWER_MODES: return cname; case TRUSTED: return "/trusted"; // internal only; not exported @@ -1292,9 +1447,10 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method } /** - * Produces a VarHandle giving access to non-static fields of type - * {@code T} declared by a receiver class of type {@code R}, supporting - * shape {@code (R : T)}. + * Produces a VarHandle giving access to a non-static field {@code name} + * of type {@code type} declared in a class of type {@code recv}. + * The VarHandle's variable type is {@code type} and it has one + * coordinate type, {@code recv}. *

        * Access checking is performed immediately on behalf of the lookup * class. @@ -1317,7 +1473,7 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method *

        * If the field is declared {@code volatile} then the returned VarHandle * will override access to the field (effectively ignore the - * {@code volatile} declaration) in accordance to it's specified + * {@code volatile} declaration) in accordance to its specified * access modes. *

        * If the field type is {@code float} or {@code double} then numeric @@ -1413,9 +1569,10 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method } /** - * Produces a VarHandle giving access to a static field of type - * {@code T} declared by a given declaring class, supporting shape - * {@code ((empty) : T)}. + * Produces a VarHandle giving access to a static field {@code name} of + * type {@code type} declared in a class of type {@code decl}. + * The VarHandle's variable type is {@code type} and it has no + * coordinate types. *

        * Access checking is performed immediately on behalf of the lookup * class. @@ -1441,7 +1598,7 @@ assertEquals(""+l, (String) MH_this.invokeExact(subl)); // Listie method *

        * If the field is declared {@code volatile} then the returned VarHandle * will override access to the field (effectively ignore the - * {@code volatile} declaration) in accordance to it's specified + * {@code volatile} declaration) in accordance to its specified * access modes. *

        * If the field type is {@code float} or {@code double} then numeric @@ -1536,7 +1693,13 @@ return mh1; public MethodHandle bind(Object receiver, String name, MethodType type) throws NoSuchMethodException, IllegalAccessException { Class refc = receiver.getClass(); // may get NPE MemberName method = resolveOrFail(REF_invokeSpecial, refc, name, type); - MethodHandle mh = getDirectMethodNoRestrict(REF_invokeSpecial, refc, method, findBoundCallerClass(method)); + MethodHandle mh = getDirectMethodNoRestrictInvokeSpecial(refc, method, findBoundCallerClass(method)); + if (!mh.type().leadingReferenceParameter().isAssignableFrom(receiver.getClass())) { + throw new IllegalAccessException("The restricted defining class " + + mh.type().leadingReferenceParameter().getName() + + " is not assignable from receiver class " + + receiver.getClass().getName()); + } return mh.bindArgumentL(0, receiver).setVarargs(method); } @@ -1580,6 +1743,7 @@ return mh1; if (refKind == REF_invokeSpecial) refKind = REF_invokeVirtual; assert(method.isMethod()); + @SuppressWarnings("deprecation") Lookup lookup = m.isAccessible() ? IMPL_LOOKUP : this; return lookup.getDirectMethodNoSecurityManager(refKind, method.getDeclaringClass(), method, findBoundCallerClass(method)); } @@ -1662,6 +1826,7 @@ return mh1; public MethodHandle unreflectConstructor(Constructor c) throws IllegalAccessException { MemberName ctor = new MemberName(c); assert(ctor.isConstructor()); + @SuppressWarnings("deprecation") Lookup lookup = c.isAccessible() ? IMPL_LOOKUP : this; return lookup.getDirectConstructorNoSecurityManager(ctor.getDeclaringClass(), ctor); } @@ -1692,6 +1857,7 @@ return mh1; assert(isSetter ? MethodHandleNatives.refKindIsSetter(field.getReferenceKind()) : MethodHandleNatives.refKindIsGetter(field.getReferenceKind())); + @SuppressWarnings("deprecation") Lookup lookup = f.isAccessible() ? IMPL_LOOKUP : this; return lookup.getDirectFieldNoSecurityManager(field.getReferenceKind(), f.getDeclaringClass(), field); } @@ -1719,11 +1885,12 @@ return mh1; } /** - * Produces a VarHandle that accesses fields of type {@code T} declared - * by a class of type {@code R}, as described by the given reflected - * field. - * If the field is non-static the VarHandle supports a shape of - * {@code (R : T)}, otherwise supports a shape of {@code ((empty) : T)}. + * Produces a VarHandle giving access to a reflected field {@code f} + * of type {@code T} declared in a class of type {@code R}. + * The VarHandle's variable type is {@code T}. + * If the field is non-static the VarHandle has one coordinate type, + * {@code R}. Otherwise, the field is static, and the VarHandle has no + * coordinate types. *

        * Access checking is performed immediately on behalf of the lookup * class, regardless of the value of the field's {@code accessible} @@ -1751,7 +1918,7 @@ return mh1; *

        * If the field is declared {@code volatile} then the returned VarHandle * will override access to the field (effectively ignore the - * {@code volatile} declaration) in accordance to it's specified + * {@code volatile} declaration) in accordance to its specified * access modes. *

        * If the field type is {@code float} or {@code double} then numeric @@ -1907,7 +2074,7 @@ return mh1; /** * Returns {@code true} if this lookup has {@code PRIVATE} access. - * @return {@code true} if this lookup has {@code PRIVATE} acesss. + * @return {@code true} if this lookup has {@code PRIVATE} access. * @since 9 */ public boolean hasPrivateAccess() { @@ -2033,9 +2200,9 @@ return mh1; (defc == refc || Modifier.isPublic(refc.getModifiers()))); if (!classOK && (allowedModes & PACKAGE) != 0) { - classOK = (VerifyAccess.isClassAccessible(defc, lookupClass(), ALL_MODES) && + classOK = (VerifyAccess.isClassAccessible(defc, lookupClass(), FULL_POWER_MODES) && (defc == refc || - VerifyAccess.isClassAccessible(refc, lookupClass(), ALL_MODES))); + VerifyAccess.isClassAccessible(refc, lookupClass(), FULL_POWER_MODES))); } if (!classOK) return "class is not public"; @@ -2082,7 +2249,7 @@ return mh1; throw method.makeAccessException("caller class must be a subclass below the method", caller); } MethodType rawType = mh.type(); - if (rawType.parameterType(0) == caller) return mh; + if (caller.isAssignableFrom(rawType.parameterType(0))) return mh; // no need to restrict; already narrow MethodType narrowType = rawType.changeParameterType(0, caller); assert(!mh.isVarargsCollector()); // viewAsType will lose varargs-ness assert(mh.viewAsTypeChecks(narrowType, true)); @@ -2095,11 +2262,11 @@ return mh1; final boolean checkSecurity = true; return getDirectMethodCommon(refKind, refc, method, checkSecurity, doRestrict, callerClass); } - /** Check access and get the requested method, eliding receiver narrowing rules. */ - private MethodHandle getDirectMethodNoRestrict(byte refKind, Class refc, MemberName method, Class callerClass) throws IllegalAccessException { + /** Check access and get the requested method, for invokespecial with no restriction on the application of narrowing rules. */ + private MethodHandle getDirectMethodNoRestrictInvokeSpecial(Class refc, MemberName method, Class callerClass) throws IllegalAccessException { final boolean doRestrict = false; final boolean checkSecurity = true; - return getDirectMethodCommon(refKind, refc, method, checkSecurity, doRestrict, callerClass); + return getDirectMethodCommon(REF_invokeSpecial, refc, method, checkSecurity, doRestrict, callerClass); } /** Check access and get the requested method, eliding security manager checks. */ private MethodHandle getDirectMethodNoSecurityManager(byte refKind, Class refc, MemberName method, Class callerClass) throws IllegalAccessException { @@ -2151,10 +2318,8 @@ return mh1; DirectMethodHandle dmh = DirectMethodHandle.make(refKind, refc, method); MethodHandle mh = dmh; // Optionally narrow the receiver argument to refc using restrictReceiver. - if (doRestrict && - (refKind == REF_invokeSpecial || - (MethodHandleNatives.refKindHasReceiver(refKind) && - restrictProtectedReceiver(method)))) { + if ((doRestrict && refKind == REF_invokeSpecial) || + (MethodHandleNatives.refKindHasReceiver(refKind) && restrictProtectedReceiver(method))) { mh = restrictReceiver(method, dmh, lookupClass()); } mh = maybeBindCaller(method, mh, callerClass); @@ -2347,53 +2512,6 @@ return mh1; static ConcurrentHashMap LOOKASIDE_TABLE = new ConcurrentHashMap<>(); } - /** - * Helper class used to lazily create PUBLIC_LOOKUP with a lookup class - * in an unnamed module. - * - * @see Lookup#publicLookup - */ - private static class LookupHelper { - private static final String UNNAMED = "Unnamed"; - private static final String OBJECT = "java/lang/Object"; - - private static Class createClass() { - try { - ClassWriter cw = new ClassWriter(0); - cw.visit(Opcodes.V1_8, - Opcodes.ACC_FINAL + Opcodes.ACC_SUPER, - UNNAMED, - null, - OBJECT, - null); - cw.visitSource(UNNAMED, null); - cw.visitEnd(); - byte[] bytes = cw.toByteArray(); - ClassLoader loader = new ClassLoader(null) { - @Override - protected Class findClass(String cn) throws ClassNotFoundException { - if (cn.equals(UNNAMED)) - return super.defineClass(UNNAMED, bytes, 0, bytes.length); - throw new ClassNotFoundException(cn); - } - }; - return loader.loadClass(UNNAMED); - } catch (Exception e) { - throw new InternalError(e); - } - } - - private static final Class PUBLIC_LOOKUP_CLASS = createClass(); - - /** - * Lookup that is trusted minimally. It can only be used to create - * method handles to publicly accessible members in exported packages. - * - * @see MethodHandles#publicLookup - */ - static final Lookup PUBLIC_LOOKUP = new Lookup(PUBLIC_LOOKUP_CLASS, Lookup.PUBLIC); - } - /** * Produces a method handle constructing arrays of a desired type. * The return type of the method handle will be the array type. @@ -2461,9 +2579,11 @@ return mh1; } /** - * - * Produces a VarHandle giving access to elements of an array type - * {@code T[]}, supporting shape {@code (T[], int : T)}. + * Produces a VarHandle giving access to elements of an array of type + * {@code arrayClass}. The VarHandle's variable type is the component type + * of {@code arrayClass} and the list of coordinate types is + * {@code (arrayClass, int)}, where the {@code int} coordinate type + * corresponds to an argument that is an index into an array. *

        * Certain access modes of the returned VarHandle are unsupported under * the following conditions: @@ -2518,13 +2638,14 @@ return mh1; /** * Produces a VarHandle giving access to elements of a {@code byte[]} array * viewed as if it were a different primitive array type, such as - * {@code int[]} or {@code long[]}. The shape of the resulting VarHandle is - * {@code (byte[], int : T)}, where the {@code int} coordinate type - * corresponds to an argument that is an index in a {@code byte[]} array, - * and {@code T} is the component type of the given view array class. The - * returned VarHandle accesses bytes at an index in a {@code byte[]} array, - * composing bytes to or from a value of {@code T} according to the given - * endianness. + * {@code int[]} or {@code long[]}. + * The VarHandle's variable type is the component type of + * {@code viewArrayClass} and the list of coordinate types is + * {@code (byte[], int)}, where the {@code int} coordinate type + * corresponds to an argument that is an index into a {@code byte[]} array. + * The returned VarHandle accesses bytes at an index in a {@code byte[]} + * array, composing bytes to or from a value of the component type of + * {@code viewArrayClass} according to the given endianness. *

        * The supported component types (variables types) are {@code short}, * {@code char}, {@code int}, {@code long}, {@code float} and @@ -2602,13 +2723,14 @@ return mh1; * Produces a VarHandle giving access to elements of a {@code ByteBuffer} * viewed as if it were an array of elements of a different primitive * component type to that of {@code byte}, such as {@code int[]} or - * {@code long[]}. The shape of the resulting VarHandle is - * {@code (ByteBuffer, int : T)}, where the {@code int} coordinate type - * corresponds to an argument that is an index in a {@code ByteBuffer}, and - * {@code T} is the component type of the given view array class. The - * returned VarHandle accesses bytes at an index in a {@code ByteBuffer}, - * composing bytes to or from a value of {@code T} according to the given - * endianness. + * {@code long[]}. + * The VarHandle's variable type is the component type of + * {@code viewArrayClass} and the list of coordinate types is + * {@code (ByteBuffer, int)}, where the {@code int} coordinate type + * corresponds to an argument that is an index into a {@code byte[]} array. + * The returned VarHandle accesses bytes at an index in a + * {@code ByteBuffer}, composing bytes to or from a value of the component + * type of {@code viewArrayClass} according to the given endianness. *

        * The supported component types (variables types) are {@code short}, * {@code char}, {@code int}, {@code long}, {@code float} and @@ -4386,7 +4508,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum")); * The init functions can observe initial pre-loop state, in the form {@code (a...)}. * Most clause functions will not need all of this information, but they will be formally connected to it * as if by {@link #dropArguments}. - * + * * More specifically, we shall use the notation {@code (V*)} to express an arbitrary prefix of a full * sequence {@code (V...)} (and likewise for {@code (v*)}, {@code (A*)}, {@code (a*)}). * In that notation, the general form of an init function parameter list @@ -4399,7 +4521,7 @@ assertEquals("boojum", (String) catTrace.invokeExact("boo", "jum")); * met by the inputs to the loop combinator. *

        * Effectively identical sequences: - * + * * A parameter list {@code A} is defined to be effectively identical to another parameter list {@code B} * if {@code A} and {@code B} are identical, or if {@code A} is shorter and is identical with a proper prefix of {@code B}. * When speaking of an unordered set of parameter lists, we say they the set is "effectively identical" diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java index 53e88de34f2..df7904de00d 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodType.java @@ -88,13 +88,14 @@ import sun.invoke.util.VerifyType; * (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 + * @since 1.7 */ public final class MethodType implements java.io.Serializable { private static final long serialVersionUID = 292L; // {rtype, {ptype...}} // The rtype and ptypes fields define the structural identity of the method type: - private final Class rtype; + private final @Stable Class rtype; private final @Stable Class[] ptypes; // The remaining fields are caches of various sorts: @@ -116,7 +117,8 @@ class MethodType implements java.io.Serializable { /** * Construct a temporary unchecked instance of MethodType for use only as a key to the intern table. - * Does not check the given parameters for validity, and must be discarded after it is used as a searching key. + * Does not check the given parameters for validity, and must discarded (if untrusted) or checked + * (if trusted) after it has been used as a searching key. * The parameters are reversed for this constructor, so that it is not accidentally used. */ private MethodType(Class[] ptypes, Class rtype) { @@ -180,6 +182,7 @@ class MethodType implements java.io.Serializable { checkSlotCount(ptypes.length + slots); return slots; } + static { // MAX_JVM_ARITY must be power of 2 minus 1 for following code trick to work: assert((MAX_JVM_ARITY & (MAX_JVM_ARITY+1)) == 0); @@ -302,18 +305,26 @@ class MethodType implements java.io.Serializable { */ /*trusted*/ static MethodType makeImpl(Class rtype, Class[] ptypes, boolean trusted) { - MethodType mt = internTable.get(new MethodType(ptypes, rtype)); - if (mt != null) - return mt; if (ptypes.length == 0) { ptypes = NO_PTYPES; trusted = true; } - mt = new MethodType(rtype, ptypes, trusted); + MethodType primordialMT = new MethodType(ptypes, rtype); + MethodType mt = internTable.get(primordialMT); + if (mt != null) + return mt; + // promote the object to the Real Thing, and reprobe + if (trusted) { + MethodType.checkRtype(rtype); + MethodType.checkPtypes(ptypes); + mt = primordialMT; + } else { + mt = new MethodType(rtype, ptypes, false); + } mt.form = MethodTypeForm.findForm(mt); return internTable.add(mt); } - private static final MethodType[] objectOnlyTypes = new MethodType[20]; + private static final @Stable MethodType[] objectOnlyTypes = new MethodType[20]; /** * Finds or creates a method type whose components are {@code Object} with an optional trailing {@code Object[]} array. @@ -397,9 +408,14 @@ class MethodType implements java.io.Serializable { checkSlotCount(parameterSlotCount() + ptypesToInsert.length + ins); int ilen = ptypesToInsert.length; if (ilen == 0) return this; - Class[] nptypes = Arrays.copyOfRange(ptypes, 0, len+ilen); - System.arraycopy(nptypes, num, nptypes, num+ilen, len-num); + Class[] nptypes = new Class[len + ilen]; + if (num > 0) { + System.arraycopy(ptypes, 0, nptypes, 0, num); + } System.arraycopy(ptypesToInsert, 0, nptypes, num, ilen); + if (num < len) { + System.arraycopy(ptypes, num, nptypes, num+ilen, len-num); + } return makeImpl(rtype, nptypes, true); } @@ -635,11 +651,14 @@ class MethodType implements java.io.Serializable { return form.basicType(); } + private static final @Stable Class[] METHOD_HANDLE_ARRAY + = new Class[] { MethodHandle.class }; + /** * @return a version of the original type with MethodHandle prepended as the first argument */ /*non-public*/ MethodType invokerType() { - return insertParameterTypes(0, MethodHandle.class); + return insertParameterTypes(0, METHOD_HANDLE_ARRAY); } /** diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java index 6e5d350495d..2d32abde706 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/MutableCallSite.java @@ -81,6 +81,7 @@ assertEquals("Wilma, dear?", (String) worker2.invokeExact()); * For target values which will be frequently updated, consider using * a {@linkplain VolatileCallSite volatile call site} instead. * @author John Rose, JSR 292 EG + * @since 1.7 */ public class MutableCallSite extends CallSite { /** diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java b/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java index d9f94f39e77..0566e6b483e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java @@ -54,6 +54,7 @@ import java.util.Objects; * lambda actually captured by that class. * * @see LambdaMetafactory + * @since 1.8 */ public final class SerializedLambda implements Serializable { private static final long serialVersionUID = 8025925345765570181L; diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java b/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java index 5d9b3bfe843..83b4d49cd42 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/SwitchPoint.java @@ -108,6 +108,7 @@ package java.lang.invoke; * } * } * @author Remi Forax, JSR 292 EG + * @since 1.7 */ public class SwitchPoint { private static final MethodHandle diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java index 57e3a3f4a3c..9e2533f071e 100644 --- a/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VarHandle.java @@ -41,7 +41,7 @@ import static java.lang.invoke.MethodHandleStatics.UNSAFE; import static java.lang.invoke.MethodHandleStatics.newInternalError; /** - * A VarHandle is a dynamically typed reference to a variable, or to a + * A VarHandle is a dynamically strongly typed reference to a variable, or to a * parametrically-defined family of variables, including static fields, * non-static fields, array elements, or components of an off-heap data * structure. Access to such variables is supported under various @@ -53,63 +53,62 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * *

        A VarHandle has: *

          - *
        • a {@link #varType variable type}, referred to as {@code T}, which is the - * type of variable(s) referenced by this VarHandle; - *
        • a list of {@link #coordinateTypes coordinate types}, referred to as - * {@code CT}, where the types (primitive and reference) are represented by - * {@link Class} objects). A list of arguments corresponding to instances of - * the coordinate types uniquely locates a variable referenced by this - * VarHandle; and - *
        • a shape, that combines the variable type and coordinate types, - * and is declared with the notation {@code (CT : T)}. An empty list of - * coordinate types is declared as {@code (empty)}. + *
        • a {@link #varType variable type} T, the type of every variable referenced + * by this VarHandle; and + *
        • a list of {@link #coordinateTypes coordinate types} + * {@code CT1, CT2, ..., CTn}, the types of coordinate expressions that + * jointly locate a variable referenced by this VarHandle. *
        + * Variable and coordinate types may be primitive or reference, and are + * represented by {@code Class} objects. The list of coordinate types may be + * empty. * *

        Factory methods that produce or {@link java.lang.invoke.MethodHandles.Lookup - * lookup} VarHandle instances document the supported variable type, coordinate - * types, and shape. + * lookup} VarHandle instances document the supported variable type and the list + * of coordinate types. * - * For example, a VarHandle referencing a non-static field will declare a shape - * of {@code (R : T)}, where {@code R} is the receiver type and - * {@code T} is the field type, and where the VarHandle and an instance of the - * receiver type can be utilized to access the field variable. - * A VarHandle referencing array elements will declare a shape of - * {@code (T[], int : T)}, where {@code T[]} is the array type and {@code T} - * its component type, and where the VarHandle, an instance of the array type, - * and an {@code int} index can be utilized to access an array element variable. + *

        Each access mode is associated with one access mode method, a + * signature polymorphic method named + * for the access mode. When an access mode method is invoked on a VarHandle + * instance, the initial arguments to the invocation are coordinate expressions + * that indicate in precisely which object the variable is to be accessed. + * Trailing arguments to the invocation represent values of importance to the + * access mode. For example, the various compare-and-set or compare-and-exchange + * access modes require two trailing arguments for the variable's expected value + * and new value. * - *

        Each access mode is associated with a - * signature polymorphic method of the - * same name, where the VarHandle shape and access mode uniquely determine the - * canonical {@link #accessModeType(AccessMode) access mode type}, - * which in turn determines the matching constraints on a valid symbolic - * type descriptor at the call site of an access mode's method - * invocation. + *

        The arity and types of arguments to the invocation of an access mode + * method are not checked statically. Instead, each access mode method + * specifies an {@link #accessModeType(AccessMode) access mode type}, + * represented as an instance of {@link MethodType}, that serves as a kind of + * method signature against which the arguments are checked dynamically. An + * access mode type gives formal parameter types in terms of the coordinate + * types of a VarHandle instance and the types for values of importance to the + * access mode. An access mode type also gives a return type, often in terms of + * the variable type of a VarHandle instance. When an access mode method is + * invoked on a VarHandle instance, the symbolic type descriptor at the + * call site, the run time types of arguments to the invocation, and the run + * time type of the return value, must match the types + * given in the access mode type. A runtime exception will be thrown if the + * match fails. * - * As such, VarHandles are dynamically and strongly typed. Their arity, - * argument types, and return type of an access mode method invocation are not - * statically checked. If they, and associated values, do not match the arity - * and types of the access mode's type, an exception will be thrown. - * - * The parameter types of an access mode method type will consist of those that - * are the VarHandles's coordinate types (in order), followed by access mode - * parameter types specific to the access mode. - * - *

        An access mode's method documents the form of its method signature, which - * is derived from the access mode parameter types. The form is declared with - * the notation {@code (CT, P1 p1, P2 p2, ..., PN pn)R}, where {@code CT} is the - * coordinate types (as documented by a VarHandle factory method), {@code P1}, - * {@code P2} and {@code PN} are the first, second and the n'th access mode - * parameters named {@code p1}, {@code p2} and {@code pn} respectively, and - * {@code R} is the return type. - * - * For example, for the generic shape of {@code (CT : T)} the - * {@link #compareAndSet} access mode method documents that its method - * signature is of the form {@code (CT, T expectedValue, T newValue)boolean}, - * where the parameter types named {@code extendedValue} and {@code newValue} - * are the access mode parameter types. If the VarHandle accesses array - * elements with a shape of say {@code (T[], int : T)} then the access mode - * method type is {@code (T[], int, T, T)boolean}. + * For example, the access mode method {@link #compareAndSet} specifies that if + * its receiver is a VarHandle instance with coordinate types + * {@code CT1, ..., CTn} and variable type {@code T}, then its access mode type + * is {@code (CT1 c1, ..., CTn cn, T expectedValue, T newValue)boolean}. + * Suppose that a VarHandle instance can access array elements, and that its + * coordinate types are {@code String[]} and {@code int} while its variable type + * is {@code String}. The access mode type for {@code compareAndSet} on this + * VarHandle instance would be + * {@code (String[] c1, int c2, String expectedValue, String newValue)boolean}. + * Such a VarHandle instance may produced by the + * {@link MethodHandles#arrayElementVarHandle(Class) array factory method} and + * access array elements as follows: + *

         {@code
        + * String[] sa = ...
        + * VarHandle avh = MethodHandles.arrayElementVarHandle(String[].class);
        + * boolean r = avh.compareAndSet(sa, 10, "expected", "new");
        + * }
        * *

        Access modes are grouped into the following categories: *

          @@ -172,10 +171,10 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * lookup} VarHandle instances document the set of access modes that are * supported, which may also include documenting restrictions based on the * variable type and whether a variable is read-only. If an access mode is not - * supported then the corresponding signature-polymorphic method will on - * invocation throw an {@code UnsupportedOperationException}. Factory methods - * should document any additional undeclared exceptions that may be thrown by - * access mode methods. + * supported then the corresponding access mode method will on invocation throw + * an {@code UnsupportedOperationException}. Factory methods should document + * any additional undeclared exceptions that may be thrown by access mode + * methods. * The {@link #get get} access mode is supported for all * VarHandle instances and the corresponding method never throws * {@code UnsupportedOperationException}. @@ -215,7 +214,7 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * precise phrasing of the specification of access mode methods and memory fence * methods may accompany future updates of the Java Language Specification. * - *

          Compilation of an access mode's method

          + *

          Compiling invocation of access mode methods

          * A Java method call expression naming an access mode method can invoke a * VarHandle from Java source code. From the viewpoint of source code, these * methods can take any arguments and their polymorphic result (if expressed) @@ -247,7 +246,7 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * except the null reference. * * - *

          Invocation of an access mode's method

          + *

          Performing invocation of access mode methods

          * The first time an {@code invokevirtual} instruction is executed it is linked * by symbolically resolving the names in the instruction and verifying that * the method call is statically legal. This also holds for calls to access mode @@ -264,38 +263,31 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError; * invoking is not present on the individual VarHandle being invoked. * *

          - * Invocation of an access mode's signature-polymorphic method behaves as if an - * invocation of {@link MethodHandle#invoke}, where the receiving method handle - * is bound to a VarHandle instance and the access mode. More specifically, the - * following: + * Invocation of an access mode method behaves as if an invocation of + * {@link MethodHandle#invoke}, where the receiving method handle accepts the + * VarHandle instance as the leading argument. More specifically, the + * following, where {@code {access-mode}} corresponds to the access mode method + * name: *

           {@code
            * VarHandle vh = ..
            * R r = (R) vh.{access-mode}(p1, p2, ..., pN);
            * }
          - * behaves as if (modulo the access mode methods do not declare throwing of - * {@code Throwable}): + * behaves as if: *
           {@code
            * VarHandle vh = ..
          + * VarHandle.AccessMode am = VarHandle.AccessMode.valueFromMethodName("{access-mode}");
            * MethodHandle mh = MethodHandles.varHandleExactInvoker(
          - *                       VarHandle.AccessMode.{access-mode},
          - *                       vh.accessModeType(VarHandle.AccessMode.{access-mode}));
          + *                       am,
          + *                       vh.accessModeType(am));
            *
          - * mh = mh.bindTo(vh);
          - * R r = (R) mh.invoke(p1, p2, ..., pN)
          + * R r = (R) mh.invoke(vh, p1, p2, ..., pN)
            * }
          - * or, more concisely, behaves as if: - *
           {@code
          - * VarHandle vh = ..
          - * MethodHandle mh = vh.toMethodHandle(VarHandle.AccessMode.{access-mode});
          - *
          - * R r = (R) mh.invoke(p1, p2, ..., pN)
          - * }
          - * In terms of equivalent {@code invokevirtual} bytecode behaviour an access - * mode method invocation is equivalent to: + * (modulo access mode methods do not declare throwing of {@code Throwable}). + * This is equivalent to: *
           {@code
            * MethodHandle mh = MethodHandles.lookup().findVirtual(
            *                       VarHandle.class,
          - *                       VarHandle.AccessMode.{access-mode}.methodName(),
          + *                       "{access-mode}",
            *                       MethodType.methodType(R, p1, p2, ..., pN));
            *
            * R r = (R) mh.invokeExact(vh, p1, p2, ..., pN)
          @@ -306,6 +298,17 @@ import static java.lang.invoke.MethodHandleStatics.newInternalError;
            * widen primitive values, as if by {@link MethodHandle#asType asType} (see also
            * {@link MethodHandles#varHandleInvoker}).
            *
          + * More concisely, such behaviour is equivalent to:
          + * 
           {@code
          + * VarHandle vh = ..
          + * VarHandle.AccessMode am = VarHandle.AccessMode.valueFromMethodName("{access-mode}");
          + * MethodHandle mh = vh.toMethodHandle(am);
          + *
          + * R r = (R) mh.invoke(p1, p2, ..., pN)
          + * }
          + * Where, in this case, the method handle is bound to the VarHandle instance. + * + * *

          Invocation checking

          * In typical programs, VarHandle access mode type matching will usually * succeed. But if a match fails, the JVM will throw a @@ -439,7 +442,7 @@ public abstract class VarHandle { * if the variable was declared non-{@code volatile}. Commonly referred to * as plain read access. * - *

          The method signature is of the form {@code (CT)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn)T}. * *

          The symbolic type descriptor at the call site of {@code get} * must match the access mode type that is the result of calling @@ -449,15 +452,15 @@ public abstract class VarHandle { * throws {@code UnsupportedOperationException}. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT)} + * {@code (CT1 ct1, ..., CTn)} * , statically represented using varargs. * @return the signature-polymorphic result that is the value of the * variable * , statically represented using {@code Object}. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -469,21 +472,21 @@ public abstract class VarHandle { * semantics of setting as if the variable was declared non-{@code volatile} * and non-{@code final}. Commonly referred to as plain write access. * - *

          The method signature is of the form {@code (CT, T newValue)void} + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)void} * *

          The symbolic type descriptor at the call site of {@code set} * must match the access mode type that is the result of calling * {@code accessModeType(VarHandle.AccessMode.SET)} on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -497,7 +500,7 @@ public abstract class VarHandle { * Returns the value of a variable, with memory semantics of reading as if * the variable was declared {@code volatile}. * - *

          The method signature is of the form {@code (CT)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn)T}. * *

          The symbolic type descriptor at the call site of {@code getVolatile} * must match the access mode type that is the result of calling @@ -505,17 +508,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT)} + * {@code (CT1 ct1, ..., CTn ctn)} * , statically represented using varargs. * @return the signature-polymorphic result that is the value of the * variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -526,7 +529,7 @@ public abstract class VarHandle { * Sets the value of a variable to the {@code newValue}, with memory * semantics of setting as if the variable was declared {@code volatile}. * - *

          The method signature is of the form {@code (CT, T newValue)void}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)void}. * *

          The symbolic type descriptor at the call site of {@code setVolatile} * must match the access mode type that is the result of calling @@ -538,14 +541,14 @@ public abstract class VarHandle { * memory ordering effects compatible with {@code memory_order_seq_cst}. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -557,7 +560,7 @@ public abstract class VarHandle { * Returns the value of a variable, accessed in program order, but with no * assurance of memory ordering effects with respect to other threads. * - *

          The method signature is of the form {@code (CT)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn)T}. * *

          The symbolic type descriptor at the call site of {@code getOpaque} * must match the access mode type that is the result of calling @@ -565,17 +568,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT)} + * {@code (CT1 ct1, ..., CTn ctn)} * , statically represented using varargs. * @return the signature-polymorphic result that is the value of the * variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -587,7 +590,7 @@ public abstract class VarHandle { * but with no assurance of memory ordering effects with respect to other * threads. * - *

          The method signature is of the form {@code (CT, T newValue)void}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)void}. * *

          The symbolic type descriptor at the call site of {@code setOpaque} * must match the access mode type that is the result of calling @@ -595,14 +598,14 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -616,7 +619,7 @@ public abstract class VarHandle { * Returns the value of a variable, and ensures that subsequent loads and * stores are not reordered before this access. * - *

          The method signature is of the form {@code (CT)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn)T}. * *

          The symbolic type descriptor at the call site of {@code getAcquire} * must match the access mode type that is the result of calling @@ -629,17 +632,17 @@ public abstract class VarHandle { * ordering. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT)} + * {@code (CT1 ct1, ..., CTn ctn)} * , statically represented using varargs. * @return the signature-polymorphic result that is the value of the * variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -650,7 +653,7 @@ public abstract class VarHandle { * Sets the value of a variable to the {@code newValue}, and ensures that * prior loads and stores are not reordered after this access. * - *

          The method signature is of the form {@code (CT, T newValue)void}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)void}. * *

          The symbolic type descriptor at the call site of {@code setRelease} * must match the access mode type that is the result of calling @@ -663,14 +666,14 @@ public abstract class VarHandle { * ordering. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. */ public final native @MethodHandle.PolymorphicSignature @@ -687,7 +690,7 @@ public abstract class VarHandle { * {@code expectedValue}, as accessed with the memory semantics of * {@link #getVolatile}. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}. * *

          The symbolic type descriptor at the call site of {@code * compareAndSet} must match the access mode type that is the result of @@ -695,16 +698,16 @@ public abstract class VarHandle { * this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return {@code true} if successful, otherwise {@code false} if the * witness value was not the same as the {@code expectedValue}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -720,7 +723,7 @@ public abstract class VarHandle { * {@code expectedValue}, as accessed with the memory semantics of * {@link #getVolatile}. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)T}. * *

          The symbolic type descriptor at the call site of {@code * compareAndExchange} @@ -729,7 +732,7 @@ public abstract class VarHandle { * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return the signature-polymorphic result that is the witness value, which * will be the same as the {@code expectedValue} if successful @@ -755,7 +758,7 @@ public abstract class VarHandle { * {@code expectedValue}, as accessed with the memory semantics of * {@link #getAcquire}. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)T}. * *

          The symbolic type descriptor at the call site of {@code * compareAndExchangeAcquire} @@ -764,17 +767,17 @@ public abstract class VarHandle { * this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return the signature-polymorphic result that is the witness value, which * will be the same as the {@code expectedValue} if successful * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #set(Object...) * @see #getAcquire(Object...) */ @@ -790,7 +793,7 @@ public abstract class VarHandle { * {@code expectedValue}, as accessed with the memory semantics of * {@link #get}. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)T}. * *

          The symbolic type descriptor at the call site of {@code * compareAndExchangeRelease} @@ -799,17 +802,17 @@ public abstract class VarHandle { * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return the signature-polymorphic result that is the witness value, which * will be the same as the {@code expectedValue} if successful * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setRelease(Object...) * @see #get(Object...) */ @@ -830,7 +833,7 @@ public abstract class VarHandle { *

          This operation may fail spuriously (typically, due to memory * contention) even if the witness value does match the expected value. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}. * *

          The symbolic type descriptor at the call site of {@code * weakCompareAndSetPlain} must match the access mode type that is the result of @@ -838,17 +841,17 @@ public abstract class VarHandle { * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return {@code true} if successful, otherwise {@code false} if the * witness value was not the same as the {@code expectedValue} or if this * operation spuriously failed. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #set(Object...) * @see #get(Object...) */ @@ -867,7 +870,7 @@ public abstract class VarHandle { *

          This operation may fail spuriously (typically, due to memory * contention) even if the witness value does match the expected value. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}. * *

          The symbolic type descriptor at the call site of {@code * weakCompareAndSet} must match the access mode type that is the @@ -875,17 +878,17 @@ public abstract class VarHandle { * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return {@code true} if successful, otherwise {@code false} if the * witness value was not the same as the {@code expectedValue} or if this * operation spuriously failed. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -904,7 +907,7 @@ public abstract class VarHandle { *

          This operation may fail spuriously (typically, due to memory * contention) even if the witness value does match the expected value. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}. * *

          The symbolic type descriptor at the call site of {@code * weakCompareAndSetAcquire} @@ -913,17 +916,17 @@ public abstract class VarHandle { * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return {@code true} if successful, otherwise {@code false} if the * witness value was not the same as the {@code expectedValue} or if this * operation spuriously failed. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #set(Object...) * @see #getAcquire(Object...) */ @@ -942,7 +945,7 @@ public abstract class VarHandle { *

          This operation may fail spuriously (typically, due to memory * contention) even if the witness value does match the expected value. * - *

          The method signature is of the form {@code (CT, T expectedValue, T newValue)boolean}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)boolean}. * *

          The symbolic type descriptor at the call site of {@code * weakCompareAndSetRelease} @@ -951,17 +954,17 @@ public abstract class VarHandle { * on this VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T expectedValue, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T expectedValue, T newValue)} * , statically represented using varargs. * @return {@code true} if successful, otherwise {@code false} if the * witness value was not the same as the {@code expectedValue} or if this * operation spuriously failed. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setRelease(Object...) * @see #get(Object...) */ @@ -976,7 +979,7 @@ public abstract class VarHandle { * previous value, as accessed with the memory semantics of * {@link #getVolatile}. * - *

          The method signature is of the form {@code (CT, T newValue)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)T}. * *

          The symbolic type descriptor at the call site of {@code getAndSet} * must match the access mode type that is the result of calling @@ -984,17 +987,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1009,7 +1012,7 @@ public abstract class VarHandle { * previous value, as accessed with the memory semantics of * {@link #getAcquire}. * - *

          The method signature is of the form {@code (CT, T newValue)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)T}. * *

          The symbolic type descriptor at the call site of {@code getAndSetAcquire} * must match the access mode type that is the result of calling @@ -1017,17 +1020,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1042,7 +1045,7 @@ public abstract class VarHandle { * previous value, as accessed with the memory semantics of * {@link #get}. * - *

          The method signature is of the form {@code (CT, T newValue)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T newValue)T}. * *

          The symbolic type descriptor at the call site of {@code getAndSetRelease} * must match the access mode type that is the result of calling @@ -1050,17 +1053,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T newValue)} + * {@code (CT1 ct1, ..., CTn ctn, T newValue)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1078,7 +1081,7 @@ public abstract class VarHandle { * previous value, as accessed with the memory semantics of * {@link #getVolatile}. * - *

          The method signature is of the form {@code (CT, T value)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T value)T}. * *

          The symbolic type descriptor at the call site of {@code getAndAdd} * must match the access mode type that is the result of calling @@ -1086,17 +1089,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T value)} + * {@code (CT1 ct1, ..., CTn ctn, T value)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1111,7 +1114,7 @@ public abstract class VarHandle { * previous value, as accessed with the memory semantics of * {@link #getAcquire}. * - *

          The method signature is of the form {@code (CT, T value)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T value)T}. * *

          The symbolic type descriptor at the call site of {@code getAndAddAcquire} * must match the access mode type that is the result of calling @@ -1119,17 +1122,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T value)} + * {@code (CT1 ct1, ..., CTn ctn, T value)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1144,7 +1147,7 @@ public abstract class VarHandle { * previous value, as accessed with the memory semantics of * {@link #get}. * - *

          The method signature is of the form {@code (CT, T value)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T value)T}. * *

          The symbolic type descriptor at the call site of {@code getAndAddRelease} * must match the access mode type that is the result of calling @@ -1152,17 +1155,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T value)} + * {@code (CT1 ct1, ..., CTn ctn, T value)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1185,7 +1188,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical OR is performed instead of a bitwise OR. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseOr} * must match the access mode type that is the result of calling @@ -1193,17 +1196,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1222,7 +1225,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical OR is performed instead of a bitwise OR. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseOrAcquire} * must match the access mode type that is the result of calling @@ -1230,17 +1233,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #set(Object...) * @see #getAcquire(Object...) */ @@ -1259,7 +1262,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical OR is performed instead of a bitwise OR. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseOrRelease} * must match the access mode type that is the result of calling @@ -1267,17 +1270,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setRelease(Object...) * @see #get(Object...) */ @@ -1296,7 +1299,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical AND is performed instead of a bitwise AND. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseAnd} * must match the access mode type that is the result of calling @@ -1304,17 +1307,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1333,7 +1336,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical AND is performed instead of a bitwise AND. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseAndAcquire} * must match the access mode type that is the result of calling @@ -1341,17 +1344,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #set(Object...) * @see #getAcquire(Object...) */ @@ -1370,7 +1373,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical AND is performed instead of a bitwise AND. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseAndRelease} * must match the access mode type that is the result of calling @@ -1378,17 +1381,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setRelease(Object...) * @see #get(Object...) */ @@ -1407,7 +1410,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical XOR is performed instead of a bitwise XOR. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseXor} * must match the access mode type that is the result of calling @@ -1415,17 +1418,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setVolatile(Object...) * @see #getVolatile(Object...) */ @@ -1444,7 +1447,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical XOR is performed instead of a bitwise XOR. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseXorAcquire} * must match the access mode type that is the result of calling @@ -1452,17 +1455,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #set(Object...) * @see #getAcquire(Object...) */ @@ -1481,7 +1484,7 @@ public abstract class VarHandle { *

          If the variable type is the non-integral {@code boolean} type then a * logical XOR is performed instead of a bitwise XOR. * - *

          The method signature is of the form {@code (CT, T mask)T}. + *

          The method signature is of the form {@code (CT1 ct1, ..., CTn ctn, T mask)T}. * *

          The symbolic type descriptor at the call site of {@code getAndBitwiseXorRelease} * must match the access mode type that is the result of calling @@ -1489,17 +1492,17 @@ public abstract class VarHandle { * VarHandle. * * @param args the signature-polymorphic parameter list of the form - * {@code (CT, T mask)} + * {@code (CT1 ct1, ..., CTn ctn, T mask)} * , statically represented using varargs. * @return the signature-polymorphic result that is the previous value of * the variable * , statically represented using {@code Object}. * @throws UnsupportedOperationException if the access mode is unsupported * for this VarHandle. - * @throws WrongMethodTypeException if the access mode type is not - * compatible with the caller's symbolic type descriptor. - * @throws ClassCastException if the access mode type is compatible with the - * caller's symbolic type descriptor, but a reference cast fails. + * @throws WrongMethodTypeException if the access mode type does not + * match the caller's symbolic type descriptor. + * @throws ClassCastException if the access mode type matches the caller's + * symbolic type descriptor, but a reference cast fails. * @see #setRelease(Object...) * @see #get(Object...) */ @@ -1790,7 +1793,7 @@ public abstract class VarHandle { /** * Returns the {@code VarHandle} signature-polymorphic method name - * associated with this {@code AccessMode} value + * associated with this {@code AccessMode} value. * * @return the signature-polymorphic method name * @see #valueFromMethodName @@ -1861,14 +1864,13 @@ public abstract class VarHandle { } /** - * Obtains the canonical access mode type for this VarHandle and a given - * access mode. + * Obtains the access mode type for this VarHandle and a given access mode. * *

          The access mode type's parameter types will consist of a prefix that * is the coordinate types of this VarHandle followed by further - * types as defined by the access mode's method. + * types as defined by the access mode method. * The access mode type's return type is defined by the return type of the - * access mode's method. + * access mode method. * * @param accessMode the access mode, corresponding to the * signature-polymorphic method of the same name @@ -1891,7 +1893,7 @@ public abstract class VarHandle { * *

          The return of a {@code false} value for a given access mode indicates * that an {@code UnsupportedOperationException} is thrown on invocation - * of the corresponding access mode's signature-polymorphic method. + * of the corresponding access mode method. * * @param accessMode the access mode, corresponding to the * signature-polymorphic method of the same name @@ -1908,7 +1910,7 @@ public abstract class VarHandle { * * @apiNote This method, for a VarHandle {@code vh} and access mode * {@code {access-mode}}, returns a method handle that is equivalent to - * method handle {@code bhm} in the following code (though it may be more + * method handle {@code bmh} in the following code (though it may be more * efficient): *

          {@code
                * MethodHandle mh = MethodHandles.varHandleExactInvoker(
          diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java b/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java
          index de88f36bbb3..1046e72edf6 100644
          --- a/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java
          +++ b/jdk/src/java.base/share/classes/java/lang/invoke/VolatileCallSite.java
          @@ -40,6 +40,7 @@ package java.lang.invoke;
            * with {@code MutableCallSite}.
            * @see MutableCallSite
            * @author John Rose, JSR 292 EG
          + * @since 1.7
            */
           public class VolatileCallSite extends CallSite {
               /**
          diff --git a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
          index 9753569374d..d5fc16c1ef6 100644
          --- a/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
          +++ b/jdk/src/java.base/share/classes/java/lang/module/Configuration.java
          @@ -1,5 +1,5 @@
           /*
          - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
          + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
            * 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,126 +42,48 @@ import java.util.stream.Collectors;
           import java.util.stream.Stream;
           
           /**
          - * The configuration that is the result of resolution or resolution with
          - * service binding.
          + * A configuration that is the result of 
          + * resolution or resolution with 
          + * service binding.
            *
          - * 

          Resolution

          + *

          A configuration encapsulates the readability graph that is the + * output of resolution. A readability graph is a directed graph where the nodes + * are of type {@link ResolvedModule} and the edges represent the readability + * amongst the modules. {@code Configuration} defines the {@link #modules() + * modules()} method to get the set of resolved modules in the graph. {@code + * ResolvedModule} defines the {@link ResolvedModule#reads() reads()} method to + * get the set of modules that a resolved module reads. The modules that are + * read may be in the same configuration or may be in {@link #parents() parent} + * configurations.

          * - *

          Resolution is the process of computing the transitive closure of a set - * of root modules over a set of observable modules by resolving the - * dependences expressed by {@code requires} clauses. + *

          Configuration defines the {@link #resolve(ModuleFinder,List,ModuleFinder,Collection) + * resolve} method to resolve a collection of root modules, and the {@link + * #resolveAndBind(ModuleFinder,List,ModuleFinder,Collection) resolveAndBind} + * method to do resolution with service binding. There are instance and + * static variants of both methods. The instance methods create a configuration + * with the receiver as the parent configuration. The static methods are for + * more advanced cases where there can be more than one parent configuration.

          * - * The dependence graph is augmented with edges that take account of - * implicitly declared dependences ({@code requires transitive}) to create a - * readability graph. A {@code Configuration} encapsulates the - * resulting graph of {@link ResolvedModule resolved modules}. - * - *

          Suppose we have the following observable modules:

          - *
           {@code
          - *     module m1 { requires m2; }
          - *     module m2 { requires transitive m3; }
          - *     module m3 { }
          - *     module m4 { }
          - * } 
          - * - *

          If the module {@code m1} is resolved then the resulting configuration - * contains three modules ({@code m1}, {@code m2}, {@code m3}). The edges in - * its readability graph are:

          - *
           {@code
          - *     m1 --> m2  (meaning m1 reads m2)
          - *     m1 --> m3
          - *     m2 --> m3
          - * } 
          - * - *

          Resolution is an additive process. When computing the transitive closure - * then the dependence relation may include dependences on modules in parent - * configurations. The result is a relative configuration that is - * relative to one or more parent configurations and where the readability graph - * may have edges from modules in the configuration to modules in parent - * configurations. - * - *

          - * - *

          Suppose we have the following observable modules:

          - *
           {@code
          - *     module m1 { requires m2; requires java.xml; }
          - *     module m2 { }
          - * } 
          - * - *

          If module {@code m1} is resolved with the configuration for the {@link - * java.lang.reflect.Layer#boot() boot} layer as the parent then the resulting - * configuration contains two modules ({@code m1}, {@code m2}). The edges in - * its readability graph are: - *

           {@code
          - *     m1 --> m2
          - *     m1 --> java.xml
          - * } 
          - * where module {@code java.xml} is in the parent configuration. For - * simplicity, this example omits the implicitly declared dependence on the - * {@code java.base} module. - * - * - *

          {@link ModuleDescriptor#isAutomatic() Automatic} modules receive special - * treatment during resolution. Each automatic module is resolved so that it - * reads all other modules in the configuration and all parent configurations. - * Each automatic module is also resolved as if it {@code requires transitive} - * all other automatic modules in the configuration (and all automatic modules - * in parent configurations).

          - - *

          Service binding

          - * - *

          Service binding is the process of augmenting a graph of resolved modules - * from the set of observable modules induced by the service-use dependence - * ({@code uses} and {@code provides} clauses). Any module that was not - * previously in the graph requires resolution to compute its transitive - * closure. Service binding is an iterative process in that adding a module - * that satisfies some service-use dependence may introduce new service-use - * dependences.

          - * - *

          Suppose we have the following observable modules:

          - *
           {@code
          - *     module m1 { exports p; uses p.S; }
          - *     module m2 { requires m1; provides p.S with p2.S2; }
          - *     module m3 { requires m1; requires m4; provides p.S with p3.S3; }
          - *     module m4 { }
          - * } 
          - * - *

          If the module {@code m1} is resolved then the resulting graph of modules - * has one module ({@code m1}). If the graph is augmented with modules induced - * by the service-use dependence relation then the configuration will contain - * four modules ({@code m1}, {@code m2}, {@code m3}, {@code m4}). The edges in - * its readability graph are:

          - *
           {@code
          - *     m2 --> m1
          - *     m3 --> m1
          - *     m3 --> m4
          - * } 
          - *

          The edges in the conceptual service-use graph are:

          - *
           {@code
          - *     m1 --> m2  (meaning m1 uses a service that is provided by m2)
          - *     m1 --> m3
          - * } 
          - * - *

          If this configuration is instantiated as a {@code Layer}, and if code in - * module {@code m1} uses {@link java.util.ServiceLoader ServiceLoader} to - * iterate over implementations of {@code p.S.class}, then it will iterate over - * an instance of {@code p2.S2} and {@code p3.S3}.

          + *

          Each {@link java.lang.ModuleLayer layer} of modules in the Java virtual + * machine is created from a configuration. The configuration for the {@link + * java.lang.ModuleLayer#boot() boot} layer is obtained by invoking {@code + * ModuleLayer.boot().configuration()}. The configuration for the boot layer + * will often be the parent when creating new configurations.

          * *

          Example

          * - *

          The following example uses the {@code resolveRequires} method to resolve - * a module named myapp with the configuration for the boot layer as - * the parent configuration. It prints the name of each resolved module and - * the names of the modules that each module reads.

          + *

          The following example uses the {@link + * #resolve(ModuleFinder,ModuleFinder,Collection) resolve} method to resolve a + * module named myapp with the configuration for the boot layer as the + * parent configuration. It prints the name of each resolved module and the + * names of the modules that each module reads.

          * *
          {@code
            *    ModuleFinder finder = ModuleFinder.of(dir1, dir2, dir3);
            *
          - *    Configuration parent = Layer.boot().configuration();
          + *    Configuration parent = ModuleLayer.boot().configuration();
            *
          - *    Configuration cf = parent.resolveRequires(finder,
          - *                                              ModuleFinder.of(),
          - *                                              Set.of("myapp"));
          + *    Configuration cf = parent.resolve(finder, ModuleFinder.of(), Set.of("myapp"));
            *    cf.modules().forEach(m -> {
            *        System.out.format("%s -> %s%n",
            *            m.name(),
          @@ -172,7 +94,8 @@ import java.util.stream.Stream;
            * }
          * * @since 9 - * @see java.lang.reflect.Layer + * @spec JPMS + * @see java.lang.ModuleLayer */ public final class Configuration { @@ -186,11 +109,20 @@ public final class Configuration { private final Set modules; private final Map nameToModule; + // module constraints on target + private final String osName; + private final String osArch; + + String osName() { return osName; } + String osArch() { return osArch; } + private Configuration() { this.parents = Collections.emptyList(); this.graph = Collections.emptyMap(); this.modules = Collections.emptySet(); this.nameToModule = Collections.emptyMap(); + this.osName = null; + this.osArch = null; } private Configuration(List parents, @@ -214,27 +146,29 @@ public final class Configuration { this.graph = g; this.modules = Set.of(moduleArray); this.nameToModule = Map.ofEntries(nameEntries); - } + this.osName = resolver.osName(); + this.osArch = resolver.osArch(); + } /** * Resolves a collection of root modules, with this configuration as its * parent, to create a new configuration. This method works exactly as * specified by the static {@link - * #resolveRequires(ModuleFinder,List,ModuleFinder,Collection) resolveRequires} + * #resolve(ModuleFinder,List,ModuleFinder,Collection) resolve} * method when invoked with this configuration as the parent. In other words, * if this configuration is {@code cf} then this method is equivalent to * invoking: *
           {@code
          -     *     Configuration.resolveRequires(before, List.of(cf), after, roots);
          +     *     Configuration.resolve(before, List.of(cf), after, roots);
                * }
          * * @param before * The before module finder to find modules * @param after - * The after module finder to locate modules when a - * module cannot be located by the {@code before} module finder - * and the module is not in this configuration + * The after module finder to locate modules when not + * located by the {@code before} module finder or in parent + * configurations * @param roots * The possibly-empty collection of module names of the modules * to resolve @@ -242,16 +176,20 @@ public final class Configuration { * @return The configuration that is the result of resolving the given * root modules * + * @throws FindException + * If resolution fails for any of the observability-related reasons + * specified by the static {@code resolve} method * @throws ResolutionException - * If resolution or the post-resolution checks fail + * If any of the post-resolution consistency checks specified by + * the static {@code resolve} method fail * @throws SecurityException * If locating a module is denied by the security manager */ - public Configuration resolveRequires(ModuleFinder before, - ModuleFinder after, - Collection roots) + public Configuration resolve(ModuleFinder before, + ModuleFinder after, + Collection roots) { - return resolveRequires(before, List.of(this), after, roots); + return resolve(before, List.of(this), after, roots); } @@ -259,12 +197,12 @@ public final class Configuration { * Resolves a collection of root modules, with service binding, and with * this configuration as its parent, to create a new configuration. * This method works exactly as specified by the static {@link - * #resolveRequiresAndUses(ModuleFinder,List,ModuleFinder,Collection) - * resolveRequiresAndUses} method when invoked with this configuration + * #resolveAndBind(ModuleFinder,List,ModuleFinder,Collection) + * resolveAndBind} method when invoked with this configuration * as the parent. In other words, if this configuration is {@code cf} then * this method is equivalent to invoking: *
           {@code
          -     *     Configuration.resolveRequiresAndUses(before, List.of(cf), after, roots);
          +     *     Configuration.resolveAndBind(before, List.of(cf), after, roots);
                * }
          * * @@ -272,25 +210,29 @@ public final class Configuration { * The before module finder to find modules * @param after * The after module finder to locate modules when not - * located by the {@code before} module finder and this - * configuration + * located by the {@code before} module finder or in parent + * configurations * @param roots * The possibly-empty collection of module names of the modules * to resolve * - * @return The configuration that is the result of resolving the given - * root modules + * @return The configuration that is the result of resolving, with service + * binding, the given root modules * + * @throws FindException + * If resolution fails for any of the observability-related reasons + * specified by the static {@code resolve} method * @throws ResolutionException - * If resolution or the post-resolution checks fail + * If any of the post-resolution consistency checks specified by + * the static {@code resolve} method fail * @throws SecurityException * If locating a module is denied by the security manager */ - public Configuration resolveRequiresAndUses(ModuleFinder before, - ModuleFinder after, - Collection roots) + public Configuration resolveAndBind(ModuleFinder before, + ModuleFinder after, + Collection roots) { - return resolveRequiresAndUses(before, List.of(this), after, roots); + return resolveAndBind(before, List.of(this), after, roots); } @@ -301,14 +243,14 @@ public final class Configuration { * * This method is used to create the configuration for the boot layer. */ - static Configuration resolveRequiresAndUses(ModuleFinder finder, - Collection roots, - boolean check, - PrintStream traceOutput) + static Configuration resolveAndBind(ModuleFinder finder, + Collection roots, + boolean check, + PrintStream traceOutput) { List parents = List.of(empty()); Resolver resolver = new Resolver(finder, parents, ModuleFinder.of(), traceOutput); - resolver.resolveRequires(roots).resolveUses(); + resolver.resolve(roots).bind(); return new Configuration(parents, resolver, check); } @@ -328,13 +270,14 @@ public final class Configuration { * *

          When all modules have been resolved then the resulting dependency * graph is checked to ensure that it does not contain cycles. A - * readability graph is constructed and in conjunction with the module + * readability graph is constructed, and in conjunction with the module * exports and service use, checked for consistency.

          * - *

          Resolution and the (post-resolution) consistency checks may fail for - * following reasons:

          + *

          Resolution may fail with {@code FindException} for the following + * observability-related reasons:

          * *
            + * *
          • A root module, or a direct or transitive dependency, is not * found.

          • * @@ -343,9 +286,20 @@ public final class Configuration { * descriptor ({@code module-info.class}) or two versions of the same * module are found in the same directory.

            * + *
          + * + *

          Post-resolution consistency checks may fail with {@code + * ResolutionException} for the following reasons:

          + * + *
            + * *
          • A cycle is detected, say where module {@code m1} requires * module {@code m2} and {@code m2} requires {@code m1}.

          • * + *
          • A module reads two or more modules with the same name. This + * includes the case where a module reads another with the same name as + * itself.

          • + * *
          • Two or more modules in the configuration export the same * package to a module that reads both. This includes the case where a * module {@code M} containing package {@code p} reads another module @@ -356,21 +310,13 @@ public final class Configuration { * module {@code M} nor exported to {@code M} by any module that * {@code M} reads.

          • * - *
          • A module {@code M} declares that it - * "{@code provides ... with q.T}" but package {@code q} is not in - * module {@code M}.

          • - * - *
          • Two or more modules in the configuration are specific to - * different {@link ModuleDescriptor#osName() operating systems}, - * {@link ModuleDescriptor#osArch() architectures}, or {@link - * ModuleDescriptor#osVersion() versions}.

          • - * - *
          • Other implementation specific checks, for example referential - * integrity checks to ensure that different versions of tighly coupled - * modules cannot be combined in the same configuration.

          • - * *
          * + * @implNote In the implementation then observability of modules may depend + * on referential integrity or other checks that ensure different builds of + * tightly coupled modules or modules for specific operating systems or + * architectures are not combined in the same configuration. + * * @param before * The before module finder to find modules * @param parents @@ -386,17 +332,22 @@ public final class Configuration { * @return The configuration that is the result of resolving the given * root modules * + * @throws FindException + * If resolution fails for an observability-related reason * @throws ResolutionException - * If resolution or the post-resolution checks fail + * If a post-resolution consistency checks fails * @throws IllegalArgumentException - * If the list of parents is empty + * If the list of parents is empty, or the list has two or more + * parents with modules for different target operating systems, + * architectures, or versions + * * @throws SecurityException * If locating a module is denied by the security manager */ - public static Configuration resolveRequires(ModuleFinder before, - List parents, - ModuleFinder after, - Collection roots) + public static Configuration resolve(ModuleFinder before, + List parents, + ModuleFinder after, + Collection roots) { Objects.requireNonNull(before); Objects.requireNonNull(after); @@ -407,7 +358,7 @@ public final class Configuration { throw new IllegalArgumentException("'parents' is empty"); Resolver resolver = new Resolver(before, parentList, after, null); - resolver.resolveRequires(roots); + resolver.resolve(roots); return new Configuration(parentList, resolver, true); } @@ -417,24 +368,24 @@ public final class Configuration { * configuration. * *

          This method works exactly as specified by {@link - * #resolveRequires(ModuleFinder,List,ModuleFinder,Collection) - * resolveRequires} except that the graph of resolved modules is augmented + * #resolve(ModuleFinder,List,ModuleFinder,Collection) + * resolve} except that the graph of resolved modules is augmented * with modules induced by the service-use dependence relation.

          * *

          More specifically, the root modules are resolved as if by calling - * {@code resolveRequires}. The resolved modules, and all modules in the + * {@code resolve}. The resolved modules, and all modules in the * parent configurations, with {@link ModuleDescriptor#uses() service * dependences} are then examined. All modules found by the given module * finders that {@link ModuleDescriptor#provides() provide} an * implementation of one or more of the service types are added to the * module graph and then resolved as if by calling the {@code - * resolveRequires} method. Adding modules to the module graph may - * introduce new service-use dependences and so the process works - * iteratively until no more modules are added.

          + * resolve} method. Adding modules to the module graph may introduce new + * service-use dependences and so the process works iteratively until no + * more modules are added.

          * - *

          As service binding involves resolution then it may fail with {@link - * ResolutionException} for exactly the same reasons specified in - * {@code resolveRequires}.

          + *

          As service binding involves resolution then it may fail with {@code + * FindException} or {@code ResolutionException} for exactly the same + * reasons specified in {@code resolve}.

          * * @param before * The before module finder to find modules @@ -448,20 +399,26 @@ public final class Configuration { * The possibly-empty collection of module names of the modules * to resolve * - * @return The configuration that is the result of resolving the given - * root modules + * @return The configuration that is the result of resolving, with service + * binding, the given root modules * + * @throws FindException + * If resolution fails for any of the observability-related reasons + * specified by the static {@code resolve} method * @throws ResolutionException - * If resolution or the post-resolution checks fail + * If any of the post-resolution consistency checks specified by + * the static {@code resolve} method fail * @throws IllegalArgumentException - * If the list of parents is empty + * If the list of parents is empty, or the list has two or more + * parents with modules for different target operating systems, + * architectures, or versions * @throws SecurityException * If locating a module is denied by the security manager */ - public static Configuration resolveRequiresAndUses(ModuleFinder before, - List parents, - ModuleFinder after, - Collection roots) + public static Configuration resolveAndBind(ModuleFinder before, + List parents, + ModuleFinder after, + Collection roots) { Objects.requireNonNull(before); Objects.requireNonNull(after); @@ -472,7 +429,7 @@ public final class Configuration { throw new IllegalArgumentException("'parents' is empty"); Resolver resolver = new Resolver(before, parentList, after, null); - resolver.resolveRequires(roots).resolveUses(); + resolver.resolve(roots).bind(); return new Configuration(parentList, resolver, true); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/FindException.java b/jdk/src/java.base/share/classes/java/lang/module/FindException.java index d76f2935e7e..411959eb418 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/FindException.java +++ b/jdk/src/java.base/share/classes/java/lang/module/FindException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,14 @@ package java.lang.module; /** - * Thrown by module finders when finding a module fails. + * Thrown by a {@link ModuleFinder ModuleFinder} when an error occurs finding + * a module. Also thrown by {@link + * Configuration#resolve(ModuleFinder,java.util.List,ModuleFinder,java.util.Collection) + * Configuration.resolve} when resolution fails for observability-related + * reasons. * - * @see ModuleFinder * @since 9 + * @spec JPMS */ public class FindException extends RuntimeException { diff --git a/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java b/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java index 981f23a5189..3e306886fb2 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java +++ b/jdk/src/java.base/share/classes/java/lang/module/InvalidModuleDescriptorException.java @@ -31,6 +31,7 @@ package java.lang.module; * * @see ModuleDescriptor#read * @since 9 + * @spec JPMS */ public class InvalidModuleDescriptorException extends RuntimeException { private static final long serialVersionUID = 4863390386809347380L; diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java index b10d986ade9..01b4316fa20 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. * 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.io.UncheckedIOException; import java.nio.ByteBuffer; import java.nio.file.Path; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.EnumSet; @@ -56,29 +57,83 @@ import jdk.internal.module.ModuleInfo; /** * A module descriptor. * - *

          A {@code ModuleDescriptor} is typically created from the binary form - * of a module declaration. Alternatively, the {@link ModuleDescriptor.Builder} - * class can be used to create a {@code ModuleDescriptor} from its components. - * The {@link #module module}, {@link #openModule openModule}, and {@link - * #automaticModule automaticModule} methods create builders for building - * different kinds of modules.

          + *

          A module descriptor describes a named module and defines methods to + * obtain each of its components. The module descriptor for a named module + * in the Java virtual machine is obtained by invoking the {@link + * java.lang.Module Module}'s {@link java.lang.Module#getDescriptor + * getDescriptor} method. Module descriptors can also be created using the + * {@link ModuleDescriptor.Builder} class or by reading the binary form of a + * module declaration ({@code module-info.class}) using the {@link + * #read(InputStream,Supplier) read} methods defined here.

          + * + *

          A module descriptor describes a normal, open, or automatic + * module. Normal modules and open modules describe their {@link + * #requires() dependences}, {@link #exports() exported-packages}, the services + * that they {@link #uses() use} or {@link #provides() provide}, and other + * components. Normal modules may {@link #opens() open} specific + * packages. The module descriptor for an open modules does not declare any + * open packages (its {@code opens} method returns an empty set) but when + * instantiated in the Java virtual machine then it is treated as if all + * packages are open. The module descriptor for an automatic module does not + * declare any dependences (except for the mandatory dependency on {@code + * java.base}), and does not declare any exported or open packages. Automatic + * module receive special treatment during resolution so that they read all + * other modules in the configuration. When an automatic module is instantiated + * in the Java virtual machine then it reads every unnamed module and is + * treated as if all packages are exported and open.

          * *

          {@code ModuleDescriptor} objects are immutable and safe for use by * multiple concurrent threads.

          * + * @see java.lang.Module * @since 9 - * @see java.lang.reflect.Module + * @spec JPMS */ public class ModuleDescriptor implements Comparable { + /** + * A modifier on a module. + * + * @see ModuleDescriptor#modifiers() + * @since 9 + */ + public static enum Modifier { + /** + * An open module. An open module does not declare any open packages + * but the resulting module is treated as if all packages are open. + */ + OPEN, + + /** + * An automatic module. An automatic module is treated as if it exports + * and opens all packages. + * + * @apiNote This modifier does not correspond to a module flag in the + * binary form of a module declaration ({@code module-info.class}). + */ + AUTOMATIC, + + /** + * The module was not explicitly or implicitly declared. + */ + SYNTHETIC, + + /** + * The module was implicitly declared. + */ + MANDATED; + } + + /** *

          A dependence upon a module

          * * @see ModuleDescriptor#requires() * @since 9 + * @spec JPMS */ public final static class Requires @@ -88,7 +143,9 @@ public class ModuleDescriptor /** * A modifier on a module dependence. * + * @see Requires#modifiers() * @since 9 + * @spec JPMS */ public static enum Modifier { @@ -122,8 +179,10 @@ public class ModuleDescriptor private final Set mods; private final String name; private final Version compiledVersion; + private final String rawCompiledVersion; - private Requires(Set ms, String mn, Version v) { + private Requires(Set ms, String mn, Version v, String vs) { + assert v == null || vs == null; if (ms.isEmpty()) { ms = Collections.emptySet(); } else { @@ -132,12 +191,14 @@ public class ModuleDescriptor this.mods = ms; this.name = mn; this.compiledVersion = v; + this.rawCompiledVersion = vs; } private Requires(Set ms, String mn, Version v, boolean unused) { this.mods = ms; this.name = mn; this.compiledVersion = v; + this.rawCompiledVersion = null; } /** @@ -161,24 +222,52 @@ public class ModuleDescriptor /** * Returns the version of the module if recorded at compile-time. * - * @return The version of the module if recorded at compile-time + * @return The version of the module if recorded at compile-time, + * or an empty {@code Optional} if no version was recorded or + * the version string recorded is {@linkplain Version#parse(String) + * unparseable} */ public Optional compiledVersion() { return Optional.ofNullable(compiledVersion); } + /** + * Returns the string with the possibly-unparseable version of the module + * if recorded at compile-time. + * + * @return The string containing the version of the module if recorded + * at compile-time, or an empty {@code Optional} if no version + * was recorded + * + * @see #compiledVersion() + */ + public Optional rawCompiledVersion() { + if (compiledVersion != null) { + return Optional.of(compiledVersion.toString()); + } else { + return Optional.ofNullable(rawCompiledVersion); + } + } + /** * Compares this module dependence to another. * *

          Two {@code Requires} objects are compared by comparing their - * module name lexicographically. Where the module names are equal then - * the sets of modifiers are compared based on a value computed from the - * ordinal of each modifier. Where the module names are equal and the - * set of modifiers are equal then the version of the modules recorded - * at compile-time are compared. When comparing the versions recorded - * at compile-time then a dependence that has a recorded version is - * considered to succeed a dependence that does not have a recorded - * version.

          + * module names lexicographically. Where the module names are equal + * then the sets of modifiers are compared in the same way that + * module modifiers are compared (see {@link ModuleDescriptor#compareTo + * ModuleDescriptor.compareTo}). Where the module names are equal and + * the set of modifiers are equal then the version of the modules + * recorded at compile-time are compared. When comparing the versions + * recorded at compile-time then a dependence that has a recorded + * version is considered to succeed a dependence that does not have a + * recorded version. If both recorded versions are {@linkplain + * Version#parse(String) unparseable} then the {@linkplain + * #rawCompiledVersion() raw version strings} are compared + * lexicographically.

          + * + * @param that + * The module dependence to compare * * @return A negative integer, zero, or a positive integer if this module * dependence is less than, equal to, or greater than the given @@ -186,39 +275,26 @@ public class ModuleDescriptor */ @Override public int compareTo(Requires that) { + if (this == that) return 0; + int c = this.name().compareTo(that.name()); - if (c != 0) - return c; + if (c != 0) return c; // modifiers - c = Long.compare(this.modsValue(), that.modsValue()); - if (c != 0) - return c; + long v1 = modsValue(this.modifiers()); + long v2 = modsValue(that.modifiers()); + c = Long.compare(v1, v2); + if (c != 0) return c; // compiledVersion - if (this.compiledVersion != null) { - if (that.compiledVersion != null) - c = this.compiledVersion.compareTo(that.compiledVersion); - else - c = 1; - } else { - if (that.compiledVersion != null) - c = -1; - } + c = compare(this.compiledVersion, that.compiledVersion); + if (c != 0) return c; - return c; - } + // rawCompiledVersion + c = compare(this.rawCompiledVersion, that.rawCompiledVersion); + if (c != 0) return c; - /** - * Return a value for the modifiers to allow sets of modifiers to be - * compared. - */ - private long modsValue() { - long value = 0; - for (Modifier m : mods) { - value += 1 << m.ordinal(); - } - return value; + return 0; } /** @@ -245,7 +321,8 @@ public class ModuleDescriptor return false; Requires that = (Requires)ob; return name.equals(that.name) && mods.equals(that.mods) - && Objects.equals(compiledVersion, that.compiledVersion); + && Objects.equals(compiledVersion, that.compiledVersion) + && Objects.equals(rawCompiledVersion, that.rawCompiledVersion); } /** @@ -262,13 +339,15 @@ public class ModuleDescriptor int hash = name.hashCode() * 43 + mods.hashCode(); if (compiledVersion != null) hash = hash * 43 + compiledVersion.hashCode(); + if (rawCompiledVersion != null) + hash = hash * 43 + rawCompiledVersion.hashCode(); return hash; } /** - * Returns a string describing module dependence. + * Returns a string describing this module dependence. * - * @return A string describing module dependence + * @return A string describing this module dependence */ @Override public String toString() { @@ -285,18 +364,23 @@ public class ModuleDescriptor /** - *

          A module export, may be qualified or unqualified.

          + *

          A package exported by a module, may be qualified or unqualified.

          * * @see ModuleDescriptor#exports() * @since 9 + * @spec JPMS */ - public final static class Exports { + public final static class Exports + implements Comparable + { /** - * A modifier on a module export. + * A modifier on an exported package. * + * @see Exports#modifiers() * @since 9 + * @spec JPMS */ public static enum Modifier { @@ -380,6 +464,52 @@ public class ModuleDescriptor return targets; } + /** + * Compares this module export to another. + * + *

          Two {@code Exports} objects are compared by comparing the package + * names lexicographically. Where the packages names are equal then the + * sets of modifiers are compared in the same way that module modifiers + * are compared (see {@link ModuleDescriptor#compareTo + * ModuleDescriptor.compareTo}). Where the package names are equal and + * the set of modifiers are equal then the set of target modules are + * compared. This is done by sorting the names of the target modules + * in ascending order, and according to their natural ordering, and then + * comparing the corresponding elements lexicographically. Where the + * sets differ in size, and the larger set contains all elements of the + * smaller set, then the larger set is considered to succeed the smaller + * set.

          + * + * @param that + * The module export to compare + * + * @return A negative integer, zero, or a positive integer if this module + * export is less than, equal to, or greater than the given + * export dependence + */ + @Override + public int compareTo(Exports that) { + if (this == that) return 0; + + int c = source.compareTo(that.source); + if (c != 0) + return c; + + // modifiers + long v1 = modsValue(this.modifiers()); + long v2 = modsValue(that.modifiers()); + c = Long.compare(v1, v2); + if (c != 0) + return c; + + // targets + c = compare(targets, that.targets); + if (c != 0) + return c; + + return 0; + } + /** * Computes a hash code for this module export. * @@ -425,9 +555,9 @@ public class ModuleDescriptor } /** - * Returns a string describing module export. + * Returns a string describing the exported package. * - * @return A string describing module export + * @return A string describing the exported package */ @Override public String toString() { @@ -441,8 +571,7 @@ public class ModuleDescriptor /** - *

          Represents a module opens directive, may be qualified or - * unqualified.

          + *

          A package opened by a module, may be qualified or unqualified.

          * *

          The opens directive in a module declaration declares a * package to be open to allow all types in the package, and all their @@ -452,26 +581,30 @@ public class ModuleDescriptor * * @see ModuleDescriptor#opens() * @since 9 + * @spec JPMS */ - public final static class Opens { - + public final static class Opens + implements Comparable + { /** - * A modifier on a module opens directive. + * A modifier on an open package. * + * @see Opens#modifiers() * @since 9 + * @spec JPMS */ public static enum Modifier { /** - * The opens was not explicitly or implicitly declared in the - * source of the module declaration. + * The open package was not explicitly or implicitly declared in + * the source of the module declaration. */ SYNTHETIC, /** - * The opens was implicitly declared in the source of the module - * declaration. + * The open package was implicitly declared in the source of the + * module declaration. */ MANDATED; @@ -543,6 +676,52 @@ public class ModuleDescriptor return targets; } + /** + * Compares this module opens to another. + * + *

          Two {@code Opens} objects are compared by comparing the package + * names lexicographically. Where the packages names are equal then the + * sets of modifiers are compared in the same way that module modifiers + * are compared (see {@link ModuleDescriptor#compareTo + * ModuleDescriptor.compareTo}). Where the package names are equal and + * the set of modifiers are equal then the set of target modules are + * compared. This is done by sorting the names of the target modules + * in ascending order, and according to their natural ordering, and then + * comparing the corresponding elements lexicographically. Where the + * sets differ in size, and the larger set contains all elements of the + * smaller set, then the larger set is considered to succeed the smaller + * set.

          + * + * @param that + * The module opens to compare + * + * @return A negative integer, zero, or a positive integer if this module + * opens is less than, equal to, or greater than the given + * module opens + */ + @Override + public int compareTo(Opens that) { + if (this == that) return 0; + + int c = source.compareTo(that.source); + if (c != 0) + return c; + + // modifiers + long v1 = modsValue(this.modifiers()); + long v2 = modsValue(that.modifiers()); + c = Long.compare(v1, v2); + if (c != 0) + return c; + + // targets + c = compare(targets, that.targets); + if (c != 0) + return c; + + return 0; + } + /** * Computes a hash code for this module opens. * @@ -588,9 +767,9 @@ public class ModuleDescriptor } /** - * Returns a string describing module opens. + * Returns a string describing the open package. * - * @return A string describing module opens + * @return A string describing the open package */ @Override public String toString() { @@ -608,10 +787,12 @@ public class ModuleDescriptor * * @see ModuleDescriptor#provides() * @since 9 + * @spec JPMS */ - public final static class Provides { - + public final static class Provides + implements Comparable + { private final String service; private final List providers; @@ -628,7 +809,7 @@ public class ModuleDescriptor /** * Returns the fully qualified class name of the service type. * - * @return The fully qualified class name of the service type. + * @return The fully qualified class name of the service type */ public String service() { return service; } @@ -641,6 +822,46 @@ public class ModuleDescriptor */ public List providers() { return providers; } + /** + * Compares this provides to another. + * + *

          Two {@code Provides} objects are compared by comparing the fully + * qualified class name of the service type lexicographically. Where the + * class names are equal then the list of the provider class names are + * compared by comparing the corresponding elements of both lists + * lexicographically and in sequence. Where the lists differ in size, + * {@code N} is the size of the shorter list, and the first {@code N} + * corresponding elements are equal, then the longer list is considered + * to succeed the shorter list.

          + * + * @param that + * The {@code Provides} to compare + * + * @return A negative integer, zero, or a positive integer if this provides + * is less than, equal to, or greater than the given provides + */ + public int compareTo(Provides that) { + if (this == that) return 0; + + int c = service.compareTo(that.service); + if (c != 0) return c; + + // compare provider class names in sequence + int size1 = this.providers.size(); + int size2 = that.providers.size(); + for (int index=0; index size2) ? 1 : -1; + } + } + /** * Computes a hash code for this provides. * @@ -699,7 +920,7 @@ public class ModuleDescriptor * *

          A version string has three components: The version number itself, an * optional pre-release version, and an optional build version. Each - * component is sequence of tokens; each token is either a non-negative + * component is a sequence of tokens; each token is either a non-negative * integer or a string. Tokens are separated by the punctuation characters * {@code '.'}, {@code '-'}, or {@code '+'}, or by transitions from a * sequence of digits to a sequence of characters that are neither digits @@ -740,6 +961,7 @@ public class ModuleDescriptor * * @see ModuleDescriptor#version() * @since 9 + * @spec JPMS */ public final static class Version @@ -1009,53 +1231,40 @@ public class ModuleDescriptor } - + private final String name; private final Version version; - private final boolean open; - - // Indicates if synthesised for a JAR file found on the module path - private final boolean automatic; - - // Not generated from a module-info.java - private final boolean synthetic; - + private final String rawVersionString; + private final Set modifiers; + private final boolean open; // true if modifiers contains OPEN + private final boolean automatic; // true if modifiers contains AUTOMATIC private final Set requires; private final Set exports; private final Set opens; private final Set uses; private final Set provides; - - // Added post-compilation by tools private final Set packages; private final String mainClass; - private final String osName; - private final String osArch; - private final String osVersion; - private ModuleDescriptor(String name, Version version, - boolean open, - boolean automatic, - boolean synthetic, + String rawVersionString, + Set modifiers, Set requires, Set exports, Set opens, Set uses, Set provides, Set packages, - String mainClass, - String osName, - String osArch, - String osVersion) + String mainClass) { + assert version == null || rawVersionString == null; this.name = name; this.version = version; - this.open = open; - this.automatic = automatic; - this.synthetic = synthetic; - + this.rawVersionString = rawVersionString; + this.modifiers = emptyOrUnmodifiableSet(modifiers); + this.open = modifiers.contains(Modifier.OPEN); + this.automatic = modifiers.contains(Modifier.AUTOMATIC); assert (requires.stream().map(Requires::name).distinct().count() == requires.size()); this.requires = emptyOrUnmodifiableSet(requires); @@ -1066,35 +1275,6 @@ public class ModuleDescriptor this.packages = emptyOrUnmodifiableSet(packages); this.mainClass = mainClass; - this.osName = osName; - this.osArch = osArch; - this.osVersion = osVersion; - } - - /** - * Clones the given module descriptor with an augmented set of packages - */ - ModuleDescriptor(ModuleDescriptor md, Set pkgs) { - this.name = md.name; - this.version = md.version; - this.open = md.open; - this.automatic = md.automatic; - this.synthetic = md.synthetic; - - this.requires = md.requires; - this.exports = md.exports; - this.opens = md.opens; - this.uses = md.uses; - this.provides = md.provides; - - Set packages = new HashSet<>(md.packages); - packages.addAll(pkgs); - this.packages = emptyOrUnmodifiableSet(packages); - - this.mainClass = md.mainClass; - this.osName = md.osName; - this.osArch = md.osArch; - this.osVersion = md.osVersion; } /** @@ -1103,9 +1283,7 @@ public class ModuleDescriptor */ ModuleDescriptor(String name, Version version, - boolean open, - boolean automatic, - boolean synthetic, + Set modifiers, Set requires, Set exports, Set opens, @@ -1113,16 +1291,14 @@ public class ModuleDescriptor Set provides, Set packages, String mainClass, - String osName, - String osArch, - String osVersion, int hashCode, boolean unused) { this.name = name; this.version = version; - this.open = open; - this.automatic = automatic; - this.synthetic = synthetic; + this.rawVersionString = null; + this.modifiers = modifiers; + this.open = modifiers.contains(Modifier.OPEN); + this.automatic = modifiers.contains(Modifier.AUTOMATIC); this.requires = requires; this.exports = exports; this.opens = opens; @@ -1130,14 +1306,11 @@ public class ModuleDescriptor this.provides = provides; this.packages = packages; this.mainClass = mainClass; - this.osName = osName; - this.osArch = osArch; - this.osVersion = osVersion; this.hash = hashCode; } /** - *

          The module name.

          + *

          Returns the module name.

          * * @return The module name */ @@ -1145,12 +1318,20 @@ public class ModuleDescriptor return name; } + /** + *

          Returns the set of module modifiers.

          + * + * @return A possibly-empty unmodifiable set of modifiers + */ + public Set modifiers() { + return modifiers; + } + /** *

          Returns {@code true} if this is an open module.

          * - *

          An open module does not declare any open packages (the {@link #opens() - * opens} method returns an empty set) but the resulting module is treated - * as if all packages are open.

          + *

          This method is equivalent to testing if the set of {@link #modifiers + * modifiers} contains the {@link Modifier#OPEN OPEN} modifier.

          * * @return {@code true} if this is an open module */ @@ -1161,12 +1342,8 @@ public class ModuleDescriptor /** *

          Returns {@code true} if this is an automatic module.

          * - *

          An automatic module is defined implicitly rather than explicitly - * and therefore does not have a module declaration. JAR files located on - * the application module path, or by the {@link ModuleFinder} returned by - * {@link ModuleFinder#of(java.nio.file.Path[]) ModuleFinder.of}, are - * treated as automatic modules if they do have not have a module - * declaration.

          + *

          This method is equivalent to testing if the set of {@link #modifiers + * modifiers} contains the {@link Modifier#OPEN AUTOMATIC} modifier.

          * * @return {@code true} if this is an automatic module */ @@ -1175,20 +1352,13 @@ public class ModuleDescriptor } /** - *

          Returns {@code true} if this module descriptor was not generated - * from an explicit module declaration ({@code module-info.java}) - * or an implicit module declaration (an {@link #isAutomatic() automatic} - * module).

          + *

          Returns the set of {@code Requires} objects representing the module + * dependences.

          * - * @return {@code true} if this module descriptor was not generated by - * an explicit or implicit module declaration - */ - public boolean isSynthetic() { - return synthetic; - } - - /** - *

          The dependences of this module.

          + *

          The set includes a dependency on "{@code java.base}" when this + * module is not named "{@code java.base}". If this module is an automatic + * module then it does not have a dependency on any module other than + * "{@code java.base}".

          * * @return A possibly-empty unmodifiable set of {@link Requires} objects */ @@ -1197,7 +1367,11 @@ public class ModuleDescriptor } /** - *

          The module exports.

          + *

          Returns the set of {@code Exports} objects representing the exported + * packages.

          + * + *

          If this module is an automatic module then the set of exports + * is empty.

          * * @return A possibly-empty unmodifiable set of exported packages */ @@ -1206,16 +1380,11 @@ public class ModuleDescriptor } /** - *

          The module opens directives.

          + *

          Returns the set of {@code Opens} objects representing the open + * packages.

          * - *

          Each {@code Opens} object in the set represents a package (and - * the set of target module names when qualified) where all types in the - * package, and all their members, not just public types and their public - * members, can be reflected on when using APIs that bypass or suppress - * default Java language access control checks.

          - * - *

          This method returns an empty set when invoked on {@link #isOpen() - * open} module.

          + *

          If this module is an open module or an automatic module then the + * set of open packages is empty.

          * * @return A possibly-empty unmodifiable set of open packages */ @@ -1224,7 +1393,10 @@ public class ModuleDescriptor } /** - *

          The service dependences of this module.

          + *

          Returns the set of service dependences.

          + * + *

          If this module is an automatic module then the set of service + * dependences is empty.

          * * @return A possibly-empty unmodifiable set of the fully qualified class * names of the service types used @@ -1234,7 +1406,8 @@ public class ModuleDescriptor } /** - *

          The services that this module provides.

          + *

          Returns the set of {@code Provides} objects representing the + * services that the module provides.

          * * @return The possibly-empty unmodifiable set of the services that this * module provides @@ -1244,20 +1417,39 @@ public class ModuleDescriptor } /** - * Returns this module's version. + *

          Returns the module version.

          * - * @return This module's version + * @return This module's version, or an empty {@code Optional} if the + * module does not have a version or the version is + * {@linkplain Version#parse(String) unparseable} */ public Optional version() { return Optional.ofNullable(version); } /** - * Returns a string containing this module's name and, if present, its - * version. + *

          Returns the string with the possibly-unparseable version of the + * module

          * - * @return A string containing this module's name and, if present, its - * version. + * @return The string containing the version of the module or an empty + * {@code Optional} if the module does not have a version + * + * @see #version() + */ + public Optional rawVersion() { + if (version != null) { + return Optional.of(version.toString()); + } else { + return Optional.ofNullable(rawVersionString); + } + } + + /** + *

          Returns a string containing the module name and, if present, its + * version.

          + * + * @return A string containing the module name and, if present, its + * version */ public String toNameAndVersion() { if (version != null) { @@ -1268,51 +1460,22 @@ public class ModuleDescriptor } /** - * Returns the module's main class. + *

          Returns the module main class.

          * - * @return The fully qualified class name of this module's main class + * @return The fully qualified class name of the module's main class */ public Optional mainClass() { return Optional.ofNullable(mainClass); } /** - * Returns the operating system name if this module is operating system - * specific. + * Returns the set of packages in the module. * - * @return The operating system name or an empty {@code Optional} - * if this module is not operating system specific - */ - public Optional osName() { - return Optional.ofNullable(osName); - } - - /** - * Returns the operating system architecture if this module is operating - * system architecture specific. + *

          The set of packages includes all exported and open packages, as well + * as the packages of any service providers, and the package for the main + * class.

          * - * @return The operating system architecture or an empty {@code Optional} - * if this module is not operating system architecture specific - */ - public Optional osArch() { - return Optional.ofNullable(osArch); - } - - /** - * Returns the operating system version if this module is operating - * system version specific. - * - * @return The operating system version or an empty {@code Optional} - * if this module is not operating system version specific - */ - public Optional osVersion() { - return Optional.ofNullable(osVersion); - } - - /** - * Returns the names of all packages in this module. - * - * @return A possibly-empty unmodifiable set of all packages in the module + * @return A possibly-empty unmodifiable set of the packages in the module */ public Set packages() { return packages; @@ -1320,77 +1483,81 @@ public class ModuleDescriptor /** - * A builder used for building {@link ModuleDescriptor} objects. + * A builder for building {@link ModuleDescriptor} objects. * - *

          {@code ModuleDescriptor} defines the {@link #module module}, {@link - * #openModule openModule}, and {@link #automaticModule automaticModule} - * methods to create builders for building different kinds of modules.

          + *

          {@code ModuleDescriptor} defines the {@link #newModule newModule}, + * {@link #newOpenModule newOpenModule}, and {@link #newAutomaticModule + * newAutomaticModule} methods to create builders for building + * normal, open, and automatic modules.

          + * + *

          The set of packages in the module are accumulated by the {@code + * Builder} as the {@link ModuleDescriptor.Builder#exports(String) exports}, + * {@link ModuleDescriptor.Builder#opens(String) opens}, + * {@link ModuleDescriptor.Builder#packages(Set) packages}, + * {@link ModuleDescriptor.Builder#provides(String,List) provides}, and + * {@link ModuleDescriptor.Builder#mainClass(String) mainClass} methods are + * invoked.

          + * + *

          The module names, package names, and class names that are parameters + * specified to the builder methods are the module names, package names, + * and qualified names of classes (in named packages) as defined in the + * The Java™ Language Specification.

          * *

          Example usage:

          - *
          {@code    ModuleDescriptor descriptor = ModuleDescriptor.module("m1")
          -     *         .exports("p")
          -     *         .requires("m2")
          +     * 
          {@code    ModuleDescriptor descriptor = ModuleDescriptor.newModule("stats.core")
          +     *         .requires("java.base")
          +     *         .exports("org.acme.stats.core.clustering")
          +     *         .exports("org.acme.stats.core.regression")
          +     *         .packages(Set.of("org.acme.stats.core.internal"))
                *         .build();
                * }
          * * @apiNote A {@code Builder} checks the components and invariants as - * components are added to the builder. The rational for this is to detect + * components are added to the builder. The rationale for this is to detect * errors as early as possible and not defer all validation to the - * {@link #build build} method. A {@code Builder} cannot be used to create - * a {@link ModuleDescriptor#isSynthetic() synthetic} module. + * {@link #build build} method. * * @since 9 + * @spec JPMS */ public static final class Builder { final String name; - final boolean strict; // true if module names are checked + final boolean strict; + final Set modifiers; final boolean open; - final boolean synthetic; - boolean automatic; + final boolean automatic; + final Set packages = new HashSet<>(); final Map requires = new HashMap<>(); final Map exports = new HashMap<>(); final Map opens = new HashMap<>(); - final Set concealedPackages = new HashSet<>(); final Set uses = new HashSet<>(); final Map provides = new HashMap<>(); Version version; - String osName; - String osArch; - String osVersion; + String rawVersionString; String mainClass; /** * Initializes a new builder with the given module name. * - * @param strict - * Indicates whether module names are checked or not + * If {@code strict} is {@code true} then module, package, and class + * names are checked to ensure they are legal names. In addition, the + * {@link #build buid} method will add "{@code requires java.base}" if + * the dependency is not declared. */ - Builder(String name, boolean strict, boolean open, boolean synthetic) { + Builder(String name, boolean strict, Set modifiers) { this.name = (strict) ? requireModuleName(name) : name; this.strict = strict; - this.open = open; - this.synthetic = synthetic; - } - - /* package */ Builder automatic(boolean automatic) { - this.automatic = automatic; - return this; + this.modifiers = modifiers; + this.open = modifiers.contains(Modifier.OPEN); + this.automatic = modifiers.contains(Modifier.AUTOMATIC); + assert !open || !automatic; } /** - * Returns the set of packages that are exported (unconditionally or - * unconditionally). + * Returns a snapshot of the packages in the module. */ - /* package */ Set exportedPackages() { - return exports.keySet(); - } - - /** - * Returns the set of packages that are opened (unconditionally or - * unconditionally). - */ - /* package */Set openPackages() { - return opens.keySet(); + /* package */ Set packages() { + return Collections.unmodifiableSet(packages); } /** @@ -1406,8 +1573,12 @@ public class ModuleDescriptor * initialized to build * @throws IllegalStateException * If the dependence on the module has already been declared + * or this builder is for an automatic module */ public Builder requires(Requires req) { + if (automatic) + throw new IllegalStateException("Automatic modules cannot declare" + + " dependences"); String mn = req.name(); if (name.equals(mn)) throw new IllegalArgumentException("Dependence on self"); @@ -1433,11 +1604,12 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the module name is {@code null}, is not a legal Java - * identifier, or is equal to the module name that this builder + * If the module name is {@code null}, is not a legal module + * name, or is equal to the module name that this builder * was initialized to build * @throws IllegalStateException * If the dependence on the module has already been declared + * or this builder is for an automatic module */ public Builder requires(Set ms, String mn, @@ -1445,7 +1617,21 @@ public class ModuleDescriptor Objects.requireNonNull(compiledVersion); if (strict) mn = requireModuleName(mn); - return requires(new Requires(ms, mn, compiledVersion)); + return requires(new Requires(ms, mn, compiledVersion, null)); + } + + /* package */Builder requires(Set ms, + String mn, + String rawCompiledVersion) { + Requires r; + try { + Version v = Version.parse(rawCompiledVersion); + r = new Requires(ms, mn, v, null); + } catch (IllegalArgumentException e) { + if (strict) throw e; + r = new Requires(ms, mn, null, rawCompiledVersion); + } + return requires(r); } /** @@ -1460,16 +1646,17 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the module name is {@code null}, is not a legal Java - * identifier, or is equal to the module name that this builder + * If the module name is {@code null}, is not a legal module + * name, or is equal to the module name that this builder * was initialized to build * @throws IllegalStateException * If the dependence on the module has already been declared + * or this builder is for an automatic module */ public Builder requires(Set ms, String mn) { if (strict) mn = requireModuleName(mn); - return requires(new Requires(ms, mn, null)); + return requires(new Requires(ms, mn, null, null)); } /** @@ -1481,18 +1668,19 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the module name is {@code null}, is not a legal Java - * identifier, or is equal to the module name that this builder + * If the module name is {@code null}, is not a legal module + * name, or is equal to the module name that this builder * was initialized to build * @throws IllegalStateException * If the dependence on the module has already been declared + * or this builder is for an automatic module */ public Builder requires(String mn) { return requires(EnumSet.noneOf(Requires.Modifier.class), mn); } /** - * Adds an export. + * Adds an exported package. * * @param e * The export @@ -1500,29 +1688,27 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method or the package is already - * declared as exported + * If the {@link Exports#source package} is already declared as + * exported or this builder is for an automatic module */ public Builder exports(Exports e) { - // can't be exported and concealed - String source = e.source(); - if (concealedPackages.contains(source)) { - throw new IllegalStateException("Package " + source - + " already declared"); + if (automatic) { + throw new IllegalStateException("Automatic modules cannot declare" + + " exported packages"); } + String source = e.source(); if (exports.containsKey(source)) { throw new IllegalStateException("Exported package " + source + " already declared"); } - exports.put(source, e); + packages.add(source); return this; } /** - * Adds an export, with the given (and possibly empty) set of modifiers, - * to export a package to a set of target modules. + * Adds an exported package with the given (and possibly empty) set of + * modifiers. The package is exported to a set of target modules. * * @param ms * The set of modifiers @@ -1534,33 +1720,34 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the package name or any of the target modules is {@code - * null} or is not a legal Java identifier, or the set of - * targets is empty + * If the package name is {@code null} or is not a legal + * package name, the set of target modules is empty, or the set + * of target modules contains a name that is not a legal module + * name * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method or the package is already - * declared as exported + * If the package is already declared as exported + * or this builder is for an automatic module */ public Builder exports(Set ms, String pn, Set targets) { - Exports e = new Exports(ms, requirePackageName(pn), targets); + Exports e = new Exports(ms, pn, targets); // check targets targets = e.targets(); if (targets.isEmpty()) throw new IllegalArgumentException("Empty target set"); - if (strict) + if (strict) { + requirePackageName(e.source()); targets.stream().forEach(Checks::requireModuleName); - + } return exports(e); } /** - * Adds an unqualified export with the given (and possibly empty) set - * of modifiers. + * Adds an exported package with the given (and possibly empty) set of + * modifiers. The package is exported to all modules. * * @param ms * The set of modifiers @@ -1570,160 +1757,22 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the package name is {@code null} or is not a legal Java - * identifier + * If the package name is {@code null} or is not a legal + * package name * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method or the package is already - * declared as exported + * If the package is already declared as exported + * or this builder is for an automatic module */ public Builder exports(Set ms, String pn) { - Exports e = new Exports(ms, requirePackageName(pn), Collections.emptySet()); + if (strict) { + requirePackageName(pn); + } + Exports e = new Exports(ms, pn, Collections.emptySet()); return exports(e); } /** - * Adds an export to export a package to a set of target modules. - * - * @param pn - * The package name - * @param targets - * The set of target modules names - * - * @return This builder - * - * @throws IllegalArgumentException - * If the package name or any of the target modules is {@code - * null} or is not a legal Java identifier, or the set of - * targets is empty - * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method or the package is already - * declared as exported - */ - public Builder exports(String pn, Set targets) { - return exports(Collections.emptySet(), pn, targets); - } - - /** - * Adds an unqualified export. - * - * @param pn - * The package name - * - * @return This builder - * - * @throws IllegalArgumentException - * If the package name is {@code null} or is not a legal Java - * identifier - * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method or the package is already - * declared as exported - */ - public Builder exports(String pn) { - return exports(Collections.emptySet(), pn); - } - - /** - * Adds an opens directive. - * - * @param obj - * The {@code Opens} object - * - * @return This builder - * - * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method, the package is already - * declared as open, or this is a builder for an open module - */ - public Builder opens(Opens obj) { - if (open) { - throw new IllegalStateException("open modules cannot declare" - + " open packages"); - } - - // can't be open and concealed - String source = obj.source(); - if (concealedPackages.contains(source)) { - throw new IllegalStateException("Package " + source - + " already declared"); - } - if (opens.containsKey(source)) { - throw new IllegalStateException("Open package " + source - + " already declared"); - } - - opens.put(source, obj); - return this; - } - - - /** - * Adds an opens directive, with the given (and possibly empty) - * set of modifiers, to open a package to a set of target modules. - * - * @param ms - * The set of modifiers - * @param pn - * The package name - * @param targets - * The set of target modules names - * - * @return This builder - * - * @throws IllegalArgumentException - * If the package name or any of the target modules is {@code - * null} or is not a legal Java identifier, or the set of - * targets is empty - * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method, the package is already - * declared as open, or this is a builder for an open module - */ - public Builder opens(Set ms, - String pn, - Set targets) - { - Opens e = new Opens(ms, requirePackageName(pn), targets); - - // check targets - targets = e.targets(); - if (targets.isEmpty()) - throw new IllegalArgumentException("Empty target set"); - if (strict) - targets.stream().forEach(Checks::requireModuleName); - - return opens(e); - } - - /** - * Adds an opens directive to open a package with the given (and - * possibly empty) set of modifiers. - * - * @param ms - * The set of modifiers - * @param pn - * The package name - * - * @return This builder - * - * @throws IllegalArgumentException - * If the package name is {@code null} or is not a legal Java - * identifier - * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method, the package is already - * declared as open, or this is a builder for an open module - */ - public Builder opens(Set ms, String pn) { - Opens e = new Opens(ms, requirePackageName(pn), Collections.emptySet()); - return opens(e); - } - - /** - * Adds an opens directive to open a package to a set of target + * Adds an exported package. The package is exported to a set of target * modules. * * @param pn @@ -1734,20 +1783,20 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the package name or any of the target modules is {@code - * null} or is not a legal Java identifier, or the set of - * targets is empty + * If the package name is {@code null} or is not a legal + * package name, the set of target modules is empty, or the set + * of target modules contains a name that is not a legal module + * name * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method, the package is already - * declared as open, or this is a builder for an open module + * If the package is already declared as exported + * or this builder is for an automatic module */ - public Builder opens(String pn, Set targets) { - return opens(Collections.emptySet(), pn, targets); + public Builder exports(String pn, Set targets) { + return exports(Collections.emptySet(), pn, targets); } /** - * Adds an opens directive to open a package. + * Adds an exported package. The package is exported to all modules. * * @param pn * The package name @@ -1755,12 +1804,146 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the package name is {@code null} or is not a legal Java - * identifier + * If the package name is {@code null} or is not a legal + * package name * @throws IllegalStateException - * If the package is already declared as a package with the - * {@link #contains contains} method, the package is already - * declared as open, or this is a builder for an open module + * If the package is already declared as exported + * or this builder is for an automatic module + */ + public Builder exports(String pn) { + return exports(Collections.emptySet(), pn); + } + + /** + * Adds an open package. + * + * @param obj + * The {@code Opens} object + * + * @return This builder + * + * @throws IllegalStateException + * If the package is already declared as open, or this is a + * builder for an open module or automatic module + */ + public Builder opens(Opens obj) { + if (open || automatic) { + throw new IllegalStateException("Open or automatic modules cannot" + + " declare open packages"); + } + String source = obj.source(); + if (opens.containsKey(source)) { + throw new IllegalStateException("Open package " + source + + " already declared"); + } + opens.put(source, obj); + packages.add(source); + return this; + } + + + /** + * Adds an open package with the given (and possibly empty) set of + * modifiers. The package is open to a set of target modules. + * + * @param ms + * The set of modifiers + * @param pn + * The package name + * @param targets + * The set of target modules names + * + * @return This builder + * + * @throws IllegalArgumentException + * If the package name is {@code null} or is not a legal + * package name, the set of target modules is empty, or the set + * of target modules contains a name that is not a legal module + * name + * @throws IllegalStateException + * If the package is already declared as open, or this is a + * builder for an open module or automatic module + */ + public Builder opens(Set ms, + String pn, + Set targets) + { + Opens opens = new Opens(ms, pn, targets); + + // check targets + targets = opens.targets(); + if (targets.isEmpty()) + throw new IllegalArgumentException("Empty target set"); + if (strict) { + requirePackageName(opens.source()); + targets.stream().forEach(Checks::requireModuleName); + } + return opens(opens); + } + + /** + * Adds an open package with the given (and possibly empty) set of + * modifiers. The package is open to all modules. + * + * @param ms + * The set of modifiers + * @param pn + * The package name + * + * @return This builder + * + * @throws IllegalArgumentException + * If the package name is {@code null} or is not a legal + * package name + * @throws IllegalStateException + * If the package is already declared as open, or this is a + * builder for an open module or automatic module + */ + public Builder opens(Set ms, String pn) { + if (strict) { + requirePackageName(pn); + } + Opens e = new Opens(ms, pn, Collections.emptySet()); + return opens(e); + } + + /** + * Adds an open package. The package is open to a set of target modules. + * + * @param pn + * The package name + * @param targets + * The set of target modules names + * + * @return This builder + * + * @throws IllegalArgumentException + * If the package name is {@code null} or is not a legal + * package name, the set of target modules is empty, or the set + * of target modules contains a name that is not a legal module + * name + * @throws IllegalStateException + * If the package is already declared as open, or this is a + * builder for an open module or automatic module + */ + public Builder opens(String pn, Set targets) { + return opens(Collections.emptySet(), pn, targets); + } + + /** + * Adds an open package. The package is open to all modules. + * + * @param pn + * The package name + * + * @return This builder + * + * @throws IllegalArgumentException + * If the package name is {@code null} or is not a legal + * package name + * @throws IllegalStateException + * If the package is already declared as open, or this is a + * builder for an open module or automatic module */ public Builder opens(String pn) { return opens(Collections.emptySet(), pn); @@ -1775,12 +1958,16 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If the service type is {@code null} or is not a legal Java - * identifier + * If the service type is {@code null} or not a qualified name of + * a class in a named package * @throws IllegalStateException * If a dependency on the service type has already been declared + * or this is a builder for an automatic module */ public Builder uses(String service) { + if (automatic) + throw new IllegalStateException("Automatic modules can not declare" + + " service dependences"); if (uses.contains(requireServiceTypeName(service))) throw new IllegalStateException("Dependence upon service " + service + " already declared"); @@ -1789,7 +1976,9 @@ public class ModuleDescriptor } /** - * Provides a service with one or more implementations. + * Provides a service with one or more implementations. The package for + * each {@link Provides#providers provider} (or provider factory) is + * added to the module if not already added. * * @param p * The provides @@ -1801,16 +1990,18 @@ public class ModuleDescriptor * declared */ public Builder provides(Provides p) { - String st = p.service(); - if (provides.containsKey(st)) + String service = p.service(); + if (provides.containsKey(service)) throw new IllegalStateException("Providers of service " - + st + " already declared"); - provides.put(st, p); + + service + " already declared"); + provides.put(service, p); + p.providers().forEach(name -> packages.add(packageName(name))); return this; } /** - * Provides implementations of a service. + * Provides implementations of a service. The package for each provider + * (or provider factory) is added to the module if not already added. * * @param service * The service type @@ -1821,103 +2012,59 @@ public class ModuleDescriptor * * @throws IllegalArgumentException * If the service type or any of the provider class names is - * {@code null} or is not a legal Java identifier, or the list - * of provider class names is empty + * {@code null} or not a qualified name of a class in a named + * package, or the list of provider class names is empty * @throws IllegalStateException * If the providers for the service type have already been * declared */ public Builder provides(String service, List providers) { - if (provides.containsKey(service)) - throw new IllegalStateException("Providers of service " - + service + " already declared by " + name); - - Provides p = new Provides(requireServiceTypeName(service), providers); + Provides p = new Provides(service, providers); // check providers after the set has been copied. List providerNames = p.providers(); if (providerNames.isEmpty()) throw new IllegalArgumentException("Empty providers set"); - providerNames.forEach(Checks::requireServiceProviderName); - provides.put(service, p); - return this; + if (strict) { + requireServiceTypeName(p.service()); + providerNames.forEach(Checks::requireServiceProviderName); + } else { + // Disallow service/providers in unnamed package + String pn = packageName(service); + if (pn.isEmpty()) { + throw new IllegalArgumentException(service + + ": unnamed package"); + } + for (String name : providerNames) { + pn = packageName(name); + if (pn.isEmpty()) { + throw new IllegalArgumentException(name + + ": unnamed package"); + } + } + } + return provides(p); } /** - * Provides an implementation of a service. - * - * @param service - * The service type - * @param provider - * The provider or provider factory class name - * - * @return This builder - * - * @throws IllegalArgumentException - * If the service type or the provider class name is {@code - * null} or is not a legal Java identifier - * @throws IllegalStateException - * If the providers for the service type have already been - * declared - */ - public Builder provides(String service, String provider) { - if (provider == null) - throw new IllegalArgumentException("'provider' is null"); - return provides(service, List.of(provider)); - } - - /** - * Adds a (possible empty) set of packages to the module + * Adds packages to the module. All packages in the set of package names + * that are not in the module are added to module. * * @param pns - * The set of package names + * The (possibly empty) set of package names * * @return This builder * * @throws IllegalArgumentException * If any of the package names is {@code null} or is not a - * legal Java identifier - * @throws IllegalStateException - * If any of packages are already declared as packages in - * the module. This includes packages that are already - * declared as exported or open packages. + * legal package name */ - public Builder contains(Set pns) { - pns.forEach(this::contains); - return this; - } - - /** - * Adds a package to the module. - * - * @param pn - * The package name - * - * @return This builder - * - * @throws IllegalArgumentException - * If the package name is {@code null}, or is not a legal Java - * identifier - * @throws IllegalStateException - * If the package is already declared as a package in the - * module. This includes the package already declared as an - * exported or open package. - */ - public Builder contains(String pn) { - Checks.requirePackageName(pn); - if (concealedPackages.contains(pn)) { - throw new IllegalStateException("Package " + pn - + " already declared"); + public Builder packages(Set pns) { + if (strict) { + pns = new HashSet<>(pns); + pns.forEach(Checks::requirePackageName); } - if (exports.containsKey(pn)) { - throw new IllegalStateException("Exported package " - + pn + " already declared"); - } - if (opens.containsKey(pn)) { - throw new IllegalStateException("Open package " - + pn + " already declared"); - } - concealedPackages.add(pn); + this.packages.addAll(pns); return this; } @@ -1931,28 +2078,41 @@ public class ModuleDescriptor */ public Builder version(Version v) { version = requireNonNull(v); + rawVersionString = null; return this; } /** * Sets the module version. * - * @param v + * @param vs * The version string to parse * * @return This builder * * @throws IllegalArgumentException - * If {@code v} is null or cannot be parsed as a version string + * If {@code vs} is {@code null} or cannot be parsed as a + * version string * * @see Version#parse(String) */ - public Builder version(String v) { - return version(Version.parse(v)); + public Builder version(String vs) { + try { + version = Version.parse(vs); + rawVersionString = null; + } catch (IllegalArgumentException e) { + if (strict) throw e; + version = null; + rawVersionString = vs; + } + return this; } /** - * Sets the module main class. + * Sets the module main class. The package for the main class is added + * to the module if not already added. In other words, this method is + * equivalent to first invoking this builder's {@link #packages(Set) + * packages} method to add the package name of the main class. * * @param mc * The module main class @@ -1960,100 +2120,67 @@ public class ModuleDescriptor * @return This builder * * @throws IllegalArgumentException - * If {@code mainClass} is null or is not a legal Java identifier + * If {@code mainClass} is {@code null} or not a qualified + * name of a class in a named package */ public Builder mainClass(String mc) { - mainClass = requireBinaryName("main class name", mc); - return this; - } - - /** - * Sets the operating system name. - * - * @param name - * The operating system name - * - * @return This builder - * - * @throws IllegalArgumentException - * If {@code name} is null or the empty String - */ - public Builder osName(String name) { - if (name == null || name.isEmpty()) - throw new IllegalArgumentException("OS name is null or empty"); - osName = name; - return this; - } - - /** - * Sets the operating system architecture. - * - * @param arch - * The operating system architecture - * - * @return This builder - * - * @throws IllegalArgumentException - * If {@code name} is null or the empty String - */ - public Builder osArch(String arch) { - if (arch == null || arch.isEmpty()) - throw new IllegalArgumentException("OS arch is null or empty"); - osArch = arch; - return this; - } - - /** - * Sets the operating system version. - * - * @param version - * The operating system version - * - * @return This builder - * - * @throws IllegalArgumentException - * If {@code name} is null or the empty String - */ - public Builder osVersion(String version) { - if (version == null || version.isEmpty()) - throw new IllegalArgumentException("OS version is null or empty"); - osVersion = version; + String pn; + if (strict) { + mc = requireQualifiedClassName("main class name", mc); + pn = packageName(mc); + assert !pn.isEmpty(); + } else { + // Disallow main class in unnamed package + pn = packageName(mc); + if (pn.isEmpty()) { + throw new IllegalArgumentException(mc + ": unnamed package"); + } + } + packages.add(pn); + mainClass = mc; return this; } /** * Builds and returns a {@code ModuleDescriptor} from its components. * + *

          The module will require "{@code java.base}" even if the dependence + * has not been declared (the exception is when building a module named + * "{@code java.base}" as it cannot require itself). The dependence on + * "{@code java.base}" will have the {@link + * java.lang.module.ModuleDescriptor.Requires.Modifier#MANDATED MANDATED} + * modifier if the dependence was not declared.

          + * * @return The module descriptor */ public ModuleDescriptor build() { Set requires = new HashSet<>(this.requires.values()); - - Set packages = new HashSet<>(); - packages.addAll(exports.keySet()); - packages.addAll(opens.keySet()); - packages.addAll(concealedPackages); - Set exports = new HashSet<>(this.exports.values()); Set opens = new HashSet<>(this.opens.values()); + // add dependency on java.base + if (strict + && !name.equals("java.base") + && !this.requires.containsKey("java.base")) { + requires.add(new Requires(Set.of(Requires.Modifier.MANDATED), + "java.base", + null, + null)); + } + Set provides = new HashSet<>(this.provides.values()); return new ModuleDescriptor(name, version, - open, - automatic, - synthetic, + rawVersionString, + modifiers, requires, exports, opens, uses, provides, packages, - mainClass, - osName, - osArch, - osVersion); + mainClass); } } @@ -2062,16 +2189,22 @@ public class ModuleDescriptor * Compares this module descriptor to another. * *

          Two {@code ModuleDescriptor} objects are compared by comparing their - * module name lexicographically. Where the module names are equal then - * the versions, if present, are compared.

          - * - * @apiNote For now, the natural ordering is not consistent with equals. - * If two module descriptors have equal module names, equal versions if - * present, but their corresponding components are not equal, then they - * will be considered equal by this method. + * module names lexicographically. Where the module names are equal then the + * module versions are compared. When comparing the module versions then a + * module descriptor with a version is considered to succeed a module + * descriptor that does not have a version. If both versions are {@linkplain + * Version#parse(String) unparseable} then the {@linkplain #rawVersion() + * raw version strings} are compared lexicographically. Where the module names + * are equal and the versions are equal (or not present in both), then the + * set of modifiers are compared. Sets of modifiers are compared by comparing + * a binary value computed for each set. If a modifier is present + * in the set then the bit at the position of its ordinal is {@code 1} + * in the binary value, otherwise {@code 0}. If the two set of modifiers + * are also equal then the other components of the module descriptors are + * compared in a manner that is consistent with {@code equals}.

          * * @param that - * The object to which this module descriptor is to be compared + * The module descriptor to compare * * @return A negative integer, zero, or a positive integer if this module * descriptor is less than, equal to, or greater than the given @@ -2079,16 +2212,44 @@ public class ModuleDescriptor */ @Override public int compareTo(ModuleDescriptor that) { + if (this == that) return 0; + int c = this.name().compareTo(that.name()); if (c != 0) return c; - if (version == null) { - if (that.version == null) - return 0; - return -1; - } - if (that.version == null) - return +1; - return version.compareTo(that.version); + + c = compare(this.version, that.version); + if (c != 0) return c; + + c = compare(this.rawVersionString, that.rawVersionString); + if (c != 0) return c; + + long v1 = modsValue(this.modifiers()); + long v2 = modsValue(that.modifiers()); + c = Long.compare(v1, v2); + if (c != 0) return c; + + c = compare(this.requires, that.requires); + if (c != 0) return c; + + c = compare(this.packages, that.packages); + if (c != 0) return c; + + c = compare(this.exports, that.exports); + if (c != 0) return c; + + c = compare(this.opens, that.opens); + if (c != 0) return c; + + c = compare(this.uses, that.uses); + if (c != 0) return c; + + c = compare(this.provides, that.provides); + if (c != 0) return c; + + c = compare(this.mainClass, that.mainClass); + if (c != 0) return c; + + return 0; } /** @@ -2115,24 +2276,18 @@ public class ModuleDescriptor return false; ModuleDescriptor that = (ModuleDescriptor)ob; return (name.equals(that.name) - && open == that.open - && automatic == that.automatic - && synthetic == that.synthetic + && modifiers.equals(that.modifiers) && requires.equals(that.requires) + && Objects.equals(packages, that.packages) && exports.equals(that.exports) && opens.equals(that.opens) && uses.equals(that.uses) && provides.equals(that.provides) && Objects.equals(version, that.version) - && Objects.equals(mainClass, that.mainClass) - && Objects.equals(osName, that.osName) - && Objects.equals(osArch, that.osArch) - && Objects.equals(osVersion, that.osVersion) - && Objects.equals(packages, that.packages)); + && Objects.equals(rawVersionString, that.rawVersionString) + && Objects.equals(mainClass, that.mainClass)); } - private transient int hash; // cached hash code - /** * Computes a hash code for this module descriptor. * @@ -2147,31 +2302,28 @@ public class ModuleDescriptor int hc = hash; if (hc == 0) { hc = name.hashCode(); - hc = hc * 43 + Boolean.hashCode(open); - hc = hc * 43 + Boolean.hashCode(automatic); - hc = hc * 43 + Boolean.hashCode(synthetic); + hc = hc * 43 + Objects.hashCode(modifiers); hc = hc * 43 + requires.hashCode(); + hc = hc * 43 + Objects.hashCode(packages); hc = hc * 43 + exports.hashCode(); hc = hc * 43 + opens.hashCode(); hc = hc * 43 + uses.hashCode(); hc = hc * 43 + provides.hashCode(); hc = hc * 43 + Objects.hashCode(version); + hc = hc * 43 + Objects.hashCode(rawVersionString); hc = hc * 43 + Objects.hashCode(mainClass); - hc = hc * 43 + Objects.hashCode(osName); - hc = hc * 43 + Objects.hashCode(osArch); - hc = hc * 43 + Objects.hashCode(osVersion); - hc = hc * 43 + Objects.hashCode(packages); if (hc == 0) hc = -1; hash = hc; } return hc; } + private transient int hash; // cached hash code /** - * Returns a string describing this descriptor. + *

          Returns a string describing the module.

          * - * @return A string describing this descriptor + * @return A string describing the module */ @Override public String toString() { @@ -2201,31 +2353,50 @@ public class ModuleDescriptor * * @param name * The module name + * @param ms + * The set of module modifiers * * @return A new builder * * @throws IllegalArgumentException - * If the module name is {@code null} or is not a legal Java - * identifier + * If the module name is {@code null} or is not a legal module + * name, or the set of modifiers contains {@link + * Modifier#AUTOMATIC AUTOMATIC} with other modifiers */ - public static Builder module(String name) { - return new Builder(name, true, false, false); + public static Builder newModule(String name, Set ms) { + Set mods = new HashSet<>(ms); + if (mods.contains(Modifier.AUTOMATIC) && mods.size() > 1) + throw new IllegalArgumentException("AUTOMATIC cannot be used with" + + " other modifiers"); + + return new Builder(name, true, mods); + } + + /** + * Instantiates a builder to build a module descriptor for a normal + * module. This method is equivalent to invoking {@link #newModule(String,Set) + * newModule} with an empty set of {@link ModuleDescriptor.Modifier modifiers}. + * + * @param name + * The module name + * + * @return A new builder + * + * @throws IllegalArgumentException + * If the module name is {@code null} or is not a legal module + * name + */ + public static Builder newModule(String name) { + return new Builder(name, true, Set.of()); } /** * Instantiates a builder to build a module descriptor for an open module. - * An open module does not declare any open packages but the resulting - * module is treated as if all packages are open. + * This method is equivalent to invoking {@link #newModule(String,Set) + * newModule} with the {@link ModuleDescriptor.Modifier#OPEN OPEN} modifier. * - *

          As an example, the following creates a module descriptor for an open - * name "{@code m}" containing two packages, one of which is exported.

          - *
          {@code
          -     *     ModuleDescriptor descriptor = ModuleDescriptor.openModule("m")
          -     *         .requires("java.base")
          -     *         .exports("p")
          -     *         .contains("q")
          -     *         .build();
          -     * }
          + *

          The builder for an open module cannot be used to declare any open + * packages.

          * * @param name * The module name @@ -2233,19 +2404,22 @@ public class ModuleDescriptor * @return A new builder that builds an open module * * @throws IllegalArgumentException - * If the module name is {@code null} or is not a legal Java - * identifier + * If the module name is {@code null} or is not a legal module + * name */ - public static Builder openModule(String name) { - return new Builder(name, true, true, false); + public static Builder newOpenModule(String name) { + return new Builder(name, true, Set.of(Modifier.OPEN)); } /** * Instantiates a builder to build a module descriptor for an automatic - * module. Automatic modules receive special treatment during resolution - * (see {@link Configuration}) so that they read all other modules. When - * Instantiated in the Java virtual machine as a {@link java.lang.reflect.Module} - * then the Module reads every unnamed module in the Java virtual machine. + * module. This method is equivalent to invoking {@link #newModule(String,Set) + * newModule} with the {@link ModuleDescriptor.Modifier#AUTOMATIC AUTOMATIC} + * modifier. + * + *

          The builder for an automatic module cannot be used to declare module + * or service dependences. It also cannot be used to declare any exported + * or open packages.

          * * @param name * The module name @@ -2253,13 +2427,13 @@ public class ModuleDescriptor * @return A new builder that builds an automatic module * * @throws IllegalArgumentException - * If the module name is {@code null} or is not a legal Java - * identifier + * If the module name is {@code null} or is not a legal module + * name * * @see ModuleFinder#of(Path[]) */ - public static Builder automaticModule(String name) { - return new Builder(name, true, false, false).automatic(true); + public static Builder newAutomaticModule(String name) { + return new Builder(name, true, Set.of(Modifier.AUTOMATIC)); } @@ -2269,8 +2443,12 @@ public class ModuleDescriptor * *

          If the descriptor encoded in the input stream does not indicate a * set of packages in the module then the {@code packageFinder} will be - * invoked. If the {@code packageFinder} throws an {@link UncheckedIOException} - * then {@link IOException} cause will be re-thrown.

          + * invoked. The set of packages that the {@code packageFinder} returns + * must include all the packages that the module exports, opens, as well + * as the packages of the service implementations that the module provides, + * and the package of the main class (if the module has a main class). If + * the {@code packageFinder} throws an {@link UncheckedIOException} then + * {@link IOException} cause will be re-thrown.

          * *

          If there are bytes following the module descriptor then it is * implementation specific as to whether those bytes are read, ignored, @@ -2292,7 +2470,9 @@ public class ModuleDescriptor * @return The module descriptor * * @throws InvalidModuleDescriptorException - * If an invalid module descriptor is detected + * If an invalid module descriptor is detected or the set of + * packages returned by the {@code packageFinder} does not include + * all of the packages obtained from the module descriptor * @throws IOException * If an I/O error occurs reading from the input stream or {@code * UncheckedIOException} is thrown by the package finder @@ -2305,8 +2485,12 @@ public class ModuleDescriptor } /** - * Reads the binary form of a module declaration from an input stream - * as a module descriptor. + * Reads the binary form of a module declaration from an input stream as a + * module descriptor. This method works exactly as specified by the 2-arg + * {@link #read(InputStream,Supplier) read} method with the exception that + * a packager finder is not used to find additional packages when the + * module descriptor read from the stream does not indicate the set of + * packages. * * @param in * The input stream @@ -2327,7 +2511,13 @@ public class ModuleDescriptor * as a module descriptor. * *

          If the descriptor encoded in the byte buffer does not indicate a - * set of packages then the {@code packageFinder} will be invoked.

          + * set of packages in the module then the {@code packageFinder} will be + * invoked. The set of packages that the {@code packageFinder} returns + * must include all the packages that the module exports, opens, as well + * as the packages of the service implementations that the module provides, + * and the package of the main class (if the module has a main class). If + * the {@code packageFinder} throws an {@link UncheckedIOException} then + * {@link IOException} cause will be re-thrown.

          * *

          The module descriptor is read from the buffer stating at index * {@code p}, where {@code p} is the buffer's {@link ByteBuffer#position() @@ -2353,7 +2543,9 @@ public class ModuleDescriptor * @return The module descriptor * * @throws InvalidModuleDescriptorException - * If an invalid module descriptor is detected + * If an invalid module descriptor is detected or the set of + * packages returned by the {@code packageFinder} does not include + * all of the packages obtained from the module descriptor */ public static ModuleDescriptor read(ByteBuffer bb, Supplier> packageFinder) @@ -2362,8 +2554,11 @@ public class ModuleDescriptor } /** - * Reads the binary form of a module declaration from a byte buffer - * as a module descriptor. + * Reads the binary form of a module declaration from a byte buffer as a + * module descriptor. This method works exactly as specified by the 2-arg + * {@link #read(ByteBuffer,Supplier) read} method with the exception that a + * packager finder is not used to find additional packages when the module + * descriptor encoded in the buffer does not indicate the set of packages. * * @param bb * The byte buffer @@ -2398,6 +2593,11 @@ public class ModuleDescriptor } } + private static String packageName(String cn) { + int index = cn.lastIndexOf('.'); + return (index == -1) ? "" : cn.substring(0, index); + } + /** * Returns a string containing the given set of modifiers and label. */ @@ -2407,6 +2607,36 @@ public class ModuleDescriptor .collect(Collectors.joining(" ")); } + private static > + int compare(T obj1, T obj2) { + if (obj1 != null) { + return (obj2 != null) ? obj1.compareTo(obj2) : 1; + } else { + return (obj2 == null) ? 0 : -1; + } + } + + /** + * Compares two sets of {@code Comparable} objects. + */ + @SuppressWarnings("unchecked") + private static > + int compare(Set s1, Set s2) { + T[] a1 = (T[]) s1.toArray(); + T[] a2 = (T[]) s2.toArray(); + Arrays.sort(a1); + Arrays.sort(a2); + return Arrays.compare(a1, a2); + } + + private static > long modsValue(Set set) { + long value = 0; + for (Enum e : set) { + value += 1 << e.ordinal(); + } + return value; + } + static { /** * Setup the shared secret to allow code in other packages access @@ -2417,19 +2647,21 @@ public class ModuleDescriptor @Override public Builder newModuleBuilder(String mn, boolean strict, - boolean open, - boolean synthetic) { - return new Builder(mn, strict, open, synthetic); + Set modifiers) { + return new Builder(mn, strict, modifiers); } @Override - public Set exportedPackages(ModuleDescriptor.Builder builder) { - return builder.exportedPackages(); + public Set packages(ModuleDescriptor.Builder builder) { + return builder.packages(); } @Override - public Set openPackages(ModuleDescriptor.Builder builder) { - return builder.openPackages(); + public void requires(ModuleDescriptor.Builder builder, + Set ms, + String mn, + String rawCompiledVersion) { + builder.requires(ms, mn, rawCompiledVersion); } @Override @@ -2466,23 +2698,10 @@ public class ModuleDescriptor return new Provides(service, providers, true); } - @Override - public Version newVersion(String v) { - return new Version(v); - } - - @Override - public ModuleDescriptor newModuleDescriptor(ModuleDescriptor md, - Set pkgs) { - return new ModuleDescriptor(md, pkgs); - } - @Override public ModuleDescriptor newModuleDescriptor(String name, Version version, - boolean open, - boolean automatic, - boolean synthetic, + Set modifiers, Set requires, Set exports, Set opens, @@ -2490,15 +2709,10 @@ public class ModuleDescriptor Set provides, Set packages, String mainClass, - String osName, - String osArch, - String osVersion, int hashCode) { return new ModuleDescriptor(name, version, - open, - automatic, - synthetic, + modifiers, requires, exports, opens, @@ -2506,20 +2720,17 @@ public class ModuleDescriptor provides, packages, mainClass, - osName, - osArch, - osVersion, hashCode, false); } @Override - public Configuration resolveRequiresAndUses(ModuleFinder finder, - Collection roots, - boolean check, - PrintStream traceOutput) + public Configuration resolveAndBind(ModuleFinder finder, + Collection roots, + boolean check, + PrintStream traceOutput) { - return Configuration.resolveRequiresAndUses(finder, roots, check, traceOutput); + return Configuration.resolveAndBind(finder, roots, check, traceOutput); } }); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java index 5d01f698806..0be9d8d9eff 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleFinder.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package java.lang.module; -import java.io.File; -import java.io.FilePermission; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -42,14 +40,15 @@ import java.util.Objects; import java.util.Optional; import java.util.Set; +import jdk.internal.module.ModuleBootstrap; +import jdk.internal.module.ModulePatcher; import jdk.internal.module.ModulePath; import jdk.internal.module.SystemModuleFinder; -import sun.security.action.GetPropertyAction; /** * A finder of modules. A {@code ModuleFinder} is used to find modules during - * resolution or - * service binding. + * resolution or + * service binding. * *

          A {@code ModuleFinder} can only find one module with a given name. A * {@code ModuleFinder} that finds modules in a sequence of directories, for @@ -85,6 +84,7 @@ import sun.security.action.GetPropertyAction; *

          A {@code ModuleFinder} is not required to be thread safe.

          * * @since 9 + * @spec JPMS */ public interface ModuleFinder { @@ -124,8 +124,8 @@ public interface ModuleFinder { * to find that module.

          * * @apiNote This is important to have for methods such as {@link - * Configuration#resolveRequiresAndUses resolveRequiresAndUses} that need - * to scan the module path to find modules that provide a specific service. + * Configuration#resolveAndBind resolveAndBind} that need to scan the + * module path to find modules that provide a specific service. * * @return The set of all module references that this finder locates * @@ -144,9 +144,9 @@ public interface ModuleFinder { * *

          If there is a security manager set then its {@link * SecurityManager#checkPermission(Permission) checkPermission} method is - * invoked to check that the caller has been granted {@link FilePermission} - * to recursively read the directory that is the value of the system - * property {@code java.home}.

          + * invoked to check that the caller has been granted + * {@link RuntimePermission RuntimePermission("accessSystemModules")} + * to access the system modules.

          * * @return A {@code ModuleFinder} that locates the system modules * @@ -154,31 +154,55 @@ public interface ModuleFinder { * If denied by the security manager */ static ModuleFinder ofSystem() { - String home; - SecurityManager sm = System.getSecurityManager(); if (sm != null) { - PrivilegedAction pa = new GetPropertyAction("java.home"); - home = AccessController.doPrivileged(pa); - Permission p = new FilePermission(home + File.separator + "-", "read"); - sm.checkPermission(p); + sm.checkPermission(new RuntimePermission("accessSystemModules")); + PrivilegedAction pa = ModuleFinder::privilegedOfSystem; + return AccessController.doPrivileged(pa); } else { - home = System.getProperty("java.home"); + return privilegedOfSystem(); } + } + /** + * Returns a module finder that locates the system modules. This method + * assumes it has permissions to access the runtime image. + */ + private static ModuleFinder privilegedOfSystem() { + String home = System.getProperty("java.home"); Path modules = Paths.get(home, "lib", "modules"); if (Files.isRegularFile(modules)) { return SystemModuleFinder.getInstance(); } else { - Path mlib = Paths.get(home, "modules"); - if (Files.isDirectory(mlib)) { - return of(mlib); + Path dir = Paths.get(home, "modules"); + if (Files.isDirectory(dir)) { + return privilegedOf(ModuleBootstrap.patcher(), dir); } else { throw new InternalError("Unable to detect the run-time image"); } } } + /** + * Returns a module finder that locates the system modules in an exploded + * image. The image may be patched. + */ + private static ModuleFinder privilegedOf(ModulePatcher patcher, Path dir) { + ModuleFinder finder = ModulePath.of(patcher, dir); + return new ModuleFinder() { + @Override + public Optional find(String name) { + PrivilegedAction> pa = () -> finder.find(name); + return AccessController.doPrivileged(pa); + } + @Override + public Set findAll() { + PrivilegedAction> pa = finder::findAll; + return AccessController.doPrivileged(pa); + } + }; + } + /** * Returns a module finder that locates modules on the file system by * searching a sequence of directories and/or packaged modules. @@ -198,25 +222,20 @@ public interface ModuleFinder { * *

          If an element is a path to a directory of modules then each entry in * the directory is a packaged module or the top-level directory of an - * exploded module. The module finder's {@link #find(String) find} or - * {@link #findAll() findAll} methods throw {@link FindException} if a - * directory containing more than one module with the same name is - * encountered.

          - * - *

          If an element in the array is a path to a directory, and that - * directory contains a file named {@code module-info.class}, then the + * exploded module. It is an error if a directory contains more than one + * module with the same name. If an element is a path to a directory, and + * that directory contains a file named {@code module-info.class}, then the * directory is treated as an exploded module rather than a directory of * modules.

          * - *

          The module finder returned by this method supports modules that are - * packaged as JAR files. A JAR file with a {@code module-info.class} in - * the top-level directory of the JAR file (or overridden by a versioned - * entry in a {@link java.util.jar.JarFile#isMultiRelease() multi-release} - * JAR file) is a modular JAR and is an explicit module. - * A JAR file that does not have a {@code module-info.class} in the - * top-level directory is an {@link ModuleDescriptor#isAutomatic automatic} - * module. The {@link ModuleDescriptor} for an automatic module is created as - * follows: + *

          The module finder returned by this method + * supports modules packaged as JAR files. A JAR file with a {@code + * module-info.class} in its top-level directory, or in a versioned entry + * in a {@linkplain java.util.jar.JarFile#isMultiRelease() multi-release} + * JAR file, is a modular JAR file and thus defines an explicit + * module. A JAR file that does not have a {@code module-info.class} in its + * top-level directory defines an automatic module, as follows: + *

          * *
            * @@ -235,63 +254,67 @@ public interface ModuleFinder { * ModuleDescriptor.Version} and ignored if it cannot be parsed as * a {@code Version}.

            * - *
          • For the module name, then any trailing digits and dots - * are removed, all non-alphanumeric characters ({@code [^A-Za-z0-9]}) - * are replaced with a dot ({@code "."}), all repeating dots are - * replaced with one dot, and all leading and trailing dots are - * removed.

          • + *
          • All non-alphanumeric characters ({@code [^A-Za-z0-9]}) + * in the module name are replaced with a dot ({@code "."}), all + * repeating dots are replaced with one dot, and all leading and + * trailing dots are removed.

          • * *
          • As an example, a JAR file named {@code foo-bar.jar} will * derive a module name {@code foo.bar} and no version. A JAR file - * named {@code foo-1.2.3-SNAPSHOT.jar} will derive a module name - * {@code foo} and {@code 1.2.3-SNAPSHOT} as the version.

          • + * named {@code foo-bar-1.2.3-SNAPSHOT.jar} will derive a module + * name {@code foo.bar} and {@code 1.2.3-SNAPSHOT} as the version. + *

            * *
          * - *
        • It {@link ModuleDescriptor#requires() requires} {@code - * java.base}.

        • - * - *
        • The set of packages in the module is derived from the names - * of non-directory entries in the JAR file. A candidate package name - * is derived from an entry using the characters up to, but not - * including, the last forward slash. All remaining forward slashes are - * replaced with dot ({@code "."}). If the resulting string is a valid - * Java identifier then it is assumed to be a package name. For example, - * if the JAR file contains an entry "{@code p/q/Foo.class}" then the - * package name derived is "{@code p.q}". All packages are {@link - * ModuleDescriptor#exports() exported}.

        • + *
        • The set of packages in the module is derived from the + * non-directory entries in the JAR file that have names ending in + * "{@code .class}". A candidate package name is derived from the name + * using the characters up to, but not including, the last forward slash. + * All remaining forward slashes are replaced with dot ({@code "."}). If + * the resulting string is a legal package name then it is assumed to be + * a package name. For example, if the JAR file contains the entry + * "{@code p/q/Foo.class}" then the package name derived is + * "{@code p.q}".

        • * *
        • The contents of entries starting with {@code * META-INF/services/} are assumed to be service configuration files * (see {@link java.util.ServiceLoader}). If the name of a file - * (that follows {@code META-INF/services/}) is a legal Java identifier - * then it is assumed to be the fully-qualified binary name of a - * service type. The entries in the file are assumed to be the - * fully-qualified binary names of provider classes.

        • + * (that follows {@code META-INF/services/}) is a legal class name + * then it is assumed to be the fully-qualified class name of a service + * type. The entries in the file are assumed to be the fully-qualified + * class names of provider classes.

          * *
        • If the JAR file has a {@code Main-Class} attribute in its - * main manifest then its value is the {@link + * main manifest then its value is the module {@link * ModuleDescriptor#mainClass() main class}.

        • * *
        * *

        If a {@code ModuleDescriptor} cannot be created (by means of the * {@link ModuleDescriptor.Builder ModuleDescriptor.Builder} API) for an - * automatic module then {@code FindException} is thrown. This can arise, - * for example, when a legal Java identifier name cannot be derived from - * the file name of the JAR file or where the JAR file contains a {@code - * .class} in the top-level directory of the JAR file.

        + * automatic module then {@code FindException} is thrown. This can arise + * when a legal module name cannot be derived from the file name of the JAR + * file, where the JAR file contains a {@code .class} in the top-level + * directory of the JAR file, where an entry in a service configuration + * file is not a legal class name or its package name is not in the set of + * packages derived for the module, or where the module main class is not + * a legal class name or its package is not in the module.

        * *

        In addition to JAR files, an implementation may also support modules - * that are packaged in other implementation specific module formats. When - * a file is encountered that is not recognized as a packaged module then - * {@code FindException} is thrown. An implementation may choose to ignore - * some files, {@link java.nio.file.Files#isHidden hidden} files for - * example. Paths to files that do not exist are always ignored.

        + * that are packaged in other implementation specific module formats. If + * an element in the array specified to this method is a path to a directory + * of modules then entries in the directory that not recognized as modules + * are ignored. If an element in the array is a path to a packaged module + * that is not recognized then a {@code FindException} is thrown when the + * file is encountered. Paths to files that do not exist are always ignored. + *

        * *

        As with automatic modules, the contents of a packaged or exploded * module may need to be scanned in order to determine the packages - * in the module. If a {@code .class} file (other than {@code + * in the module. Whether {@linkplain java.nio.file.Files#isHidden(Path) + * hidden files} are ignored or not is implementation specific and therefore + * not specified. If a {@code .class} file (other than {@code * module-info.class}) is found in the top-level directory then it is * assumed to be a class in the unnamed package and so {@code FindException} * is thrown.

        @@ -325,7 +348,7 @@ public interface ModuleFinder { }; } - return new ModulePath(entries); + return ModulePath.of(entries); } /** diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java index d79d210edd0..e97f32f7185 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReader.java @@ -45,10 +45,14 @@ import java.util.stream.Stream; * module. A module reader is also intended to be used by {@code ClassLoader} * implementations that load classes and resources from modules.

        * - *

        A resource in a module is identified by a name that is a + *

        A resource in a module is identified by an abstract name that is a * '{@code /}'-separated path string. For example, module {@code java.base} may * have a resource "{@code java/lang/Object.class}" that, by convention, is the - * class file for {@code java.lang.Object}.

        + * class file for {@code java.lang.Object}. A module reader may treat + * directories in the module content as resources (whether it does or not is + * module reader specific). Where the module content contains a directory + * that can be located as a resource then its name ends with a slash ('/'). The + * directory can also be located with a name that drops the trailing slash.

        * *

        A {@code ModuleReader} is {@linkplain ModuleReference#open open} upon * creation and is closed by invoking the {@link #close close} method. Failure @@ -61,8 +65,18 @@ import java.util.stream.Stream; * open}, {@link #read read}, and {@link #list list} methods may throw {@code * SecurityException} if access is denied by the security manager.

        * + * @implSpec Implementations of {@code ModuleReader} should take great care + * when translating an abstract resource name to the location of a resource in + * a packaged module or on the file system. Implementations are advised to + * treat resource names with elements such as '{@code .}, '{@code ..}', + * elements containing file separators, or empty elements as "not found". More + * generally, if the resource name is not in the stream of elements that the + * {@code list} method returns then the resource should be treated as "not + * found" to avoid inconsistencies. + * * @see ModuleReference * @since 9 + * @spec JPMS */ public interface ModuleReader extends Closeable { @@ -70,6 +84,9 @@ public interface ModuleReader extends Closeable { /** * Finds a resource, returning a URI to the resource in the module. * + *

        If the module reader can determine that the name locates a directory + * then the resulting URI will end with a slash ('/').

        + * * @param name * The name of the resource to open for reading * @@ -130,7 +147,7 @@ public interface ModuleReader extends Closeable { * * @apiNote This method is intended for high-performance class loading. It * is not capable (or intended) to read arbitrary large resources that - * could potentially be 2GB or larger. The rational for using this method + * could potentially be 2GB or larger. The rationale for using this method * in conjunction with the {@code release} method is to allow module reader * implementations manage buffers in an efficient manner. * @@ -148,6 +165,9 @@ public interface ModuleReader extends Closeable { * If an I/O error occurs or the module reader is closed * @throws SecurityException * If denied by the security manager + * @throws OutOfMemoryError + * If the resource is larger than {@code Integer.MAX_VALUE}, + * the maximum capacity of a byte buffer * * @see ClassLoader#defineClass(String, ByteBuffer, java.security.ProtectionDomain) */ @@ -182,7 +202,9 @@ public interface ModuleReader extends Closeable { /** * Lists the contents of the module, returning a stream of elements that - * are the names of all resources in the module. + * are the names of all resources in the module. Whether the stream of + * elements includes names corresponding to directories in the module is + * module reader specific. * *

        In lazy implementations then an {@code IOException} may be thrown * when using the stream to list the module contents. If this occurs then diff --git a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java index 09a5acec219..54291e78dcc 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ModuleReference.java @@ -44,6 +44,7 @@ import java.util.Optional; * @see ModuleFinder * @see ModuleReader * @since 9 + * @spec JPMS */ public abstract class ModuleReference { @@ -76,7 +77,7 @@ public abstract class ModuleReference { /** * Returns the location of this module's content, if known. * - *

        This URI, when present, is used as the {@linkplain + *

        This URI, when present, can be used as the {@linkplain * java.security.CodeSource#getLocation location} value of a {@link * java.security.CodeSource CodeSource} so that a module's classes can be * granted specific permissions when loaded by a {@link diff --git a/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java b/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java index fb14cfe8200..69cc71f3466 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ResolutionException.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,12 @@ package java.lang.module; /** - * Thrown when resolving a set of modules or binding fails. + * Thrown when resolving a set of modules, or resolving a set of modules with + * service binding, fails. * * @see Configuration * @since 9 + * @spec JPMS */ public class ResolutionException extends RuntimeException { private static final long serialVersionUID = -1031186845316729450L; diff --git a/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java b/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java index 05ef3c4dc1c..a3858ef6c13 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java +++ b/jdk/src/java.base/share/classes/java/lang/module/ResolvedModule.java @@ -37,6 +37,7 @@ import java.util.Set; * module's content. * * @since 9 + * @spec JPMS * @see Configuration#modules() */ public final class ResolvedModule { diff --git a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java index d2aafdc5d87..6adf93f8317 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/Resolver.java +++ b/jdk/src/java.base/share/classes/java/lang/module/Resolver.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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,6 @@ package java.lang.module; import java.io.PrintStream; import java.lang.module.ModuleDescriptor.Provides; import java.lang.module.ModuleDescriptor.Requires.Modifier; -import java.lang.reflect.Layer; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; @@ -47,10 +46,11 @@ import java.util.stream.Collectors; import jdk.internal.module.ModuleHashes; import jdk.internal.module.ModuleReferenceImpl; +import jdk.internal.module.ModuleTarget; /** - * The resolver used by {@link Configuration#resolveRequires} and - * {@link Configuration#resolveRequiresAndUses}. + * The resolver used by {@link Configuration#resolve} and {@link + * Configuration#resolveAndBind}. * * @implNote The resolver is used at VM startup and so deliberately avoids * using lambda and stream usages in code paths used during startup. @@ -66,7 +66,20 @@ final class Resolver { // maps module name to module reference private final Map nameToReference = new HashMap<>(); + // true if all automatic modules have been found + private boolean haveAllAutomaticModules; + // module constraints on target platform + private String osName; + private String osArch; + + String osName() { return osName; } + String osArch() { return osArch; } + + /** + * @throws IllegalArgumentException if there are more than one parent and + * the constraints on the target platform conflict + */ Resolver(ModuleFinder beforeFinder, List parents, ModuleFinder afterFinder, @@ -75,15 +88,44 @@ final class Resolver { this.parents = parents; this.afterFinder = afterFinder; this.traceOutput = traceOutput; + + // record constraints on target platform, checking that they don't conflict + for (Configuration parent : parents) { + String value = parent.osName(); + if (value != null) { + if (osName == null) { + osName = value; + } else { + if (!value.equals(osName)) { + failParentConflict("Operating System", osName, value); + } + } + } + value = parent.osArch(); + if (value != null) { + if (osArch == null) { + osArch = value; + } else { + if (!value.equals(osArch)) { + failParentConflict("OS architecture", osArch, value); + } + } + } + } } + private void failParentConflict(String constraint, String s1, String s2) { + String msg = "Parents have conflicting constraints on target " + + constraint + ": " + s1 + ", " + s2; + throw new IllegalArgumentException(msg); + } /** * Resolves the given named modules. * * @throws ResolutionException */ - Resolver resolveRequires(Collection roots) { + Resolver resolve(Collection roots) { // create the visit stack to get us started Deque q = new ArrayDeque<>(); @@ -100,7 +142,7 @@ final class Resolver { mref = findWithAfterFinder(root); if (mref == null) { - fail("Module %s not found", root); + findFail("Module %s not found", root); } } @@ -109,8 +151,7 @@ final class Resolver { mref.location().ifPresent(uri -> trace(" (%s)", uri)); } - assert mref.descriptor().name().equals(root); - nameToReference.put(root, mref); + addFoundModule(mref); q.push(mref.descriptor()); } @@ -132,6 +173,21 @@ final class Resolver { ModuleDescriptor descriptor = q.poll(); assert nameToReference.containsKey(descriptor.name()); + // if the module is an automatic module then all automatic + // modules need to be resolved + if (descriptor.isAutomatic() && !haveAllAutomaticModules) { + addFoundAutomaticModules().forEach(mref -> { + ModuleDescriptor other = mref.descriptor(); + q.offer(other); + if (isTracing()) { + trace("Automatic module %s located, required by %s", + other.name(), descriptor.name()); + mref.location().ifPresent(uri -> trace(" (%s)", uri)); + } + }); + haveAllAutomaticModules = true; + } + // process dependences for (ModuleDescriptor.Requires requires : descriptor.requires()) { @@ -152,19 +208,24 @@ final class Resolver { mref = findWithAfterFinder(dn); if (mref == null) { - fail("Module %s not found, required by %s", - dn, descriptor.name()); + findFail("Module %s not found, required by %s", + dn, descriptor.name()); } } if (!nameToReference.containsKey(dn)) { - nameToReference.put(dn, mref); + addFoundModule(mref); q.offer(mref.descriptor()); - resolved.add(mref.descriptor()); if (isTracing()) { - trace("Module %s located, required by %s", - dn, descriptor.name()); + String prefix; + if (mref.descriptor().isAutomatic()) { + prefix = "Automatic module"; + } else { + prefix = "Module"; + } + trace(prefix + " %s located, required by %s", + dn, descriptor.name()); mref.location().ifPresent(uri -> trace(" (%s)", uri)); } } @@ -181,7 +242,7 @@ final class Resolver { * Augments the set of resolved modules with modules induced by the * service-use relation. */ - Resolver resolveUses() { + Resolver bind() { // Scan the finders for all available service provider modules. As // java.base uses services then then module finders will be scanned @@ -211,7 +272,7 @@ final class Resolver { // the initial set of modules that may use services Set initialConsumers; - if (Layer.boot() == null) { + if (ModuleLayer.boot() == null) { initialConsumers = new HashSet<>(); } else { initialConsumers = parents.stream() @@ -246,7 +307,7 @@ final class Resolver { mref.location() .ifPresent(uri -> trace(" (%s)", uri)); } - nameToReference.put(pn, mref); + addFoundModule(mref); q.push(provider); } } @@ -262,6 +323,84 @@ final class Resolver { return this; } + /** + * Add all automatic modules that have not already been found to the + * nameToReference map. + */ + private Set addFoundAutomaticModules() { + Set result = new HashSet<>(); + findAll().forEach(mref -> { + String mn = mref.descriptor().name(); + if (mref.descriptor().isAutomatic() && !nameToReference.containsKey(mn)) { + addFoundModule(mref); + result.add(mref); + } + }); + return result; + } + + /** + * Add the module to the nameToReference map. Also check any constraints on + * the target platform with the constraints of other modules. + */ + private void addFoundModule(ModuleReference mref) { + String mn = mref.descriptor().name(); + + if (mref instanceof ModuleReferenceImpl) { + ModuleTarget target = ((ModuleReferenceImpl)mref).moduleTarget(); + if (target != null) + checkTargetConstraints(mn, target); + } + + nameToReference.put(mn, mref); + } + + /** + * Check that the module's constraints on the target platform do not + * conflict with the constraints of other modules resolved so far or + * modules in parent configurations. + */ + private void checkTargetConstraints(String mn, ModuleTarget target) { + String value = target.osName(); + if (value != null) { + if (osName == null) { + osName = value; + } else { + if (!value.equals(osName)) { + failTargetConstraint(mn, target); + } + } + } + value = target.osArch(); + if (value != null) { + if (osArch == null) { + osArch = value; + } else { + if (!value.equals(osArch)) { + failTargetConstraint(mn, target); + } + } + } + } + + private void failTargetConstraint(String mn, ModuleTarget target) { + String s1 = targetAsString(osName, osArch); + String s2 = targetAsString(target.osName(), target.osArch()); + findFail("Module %s has constraints on target platform (%s) that" + + " conflict with other modules: %s", mn, s1, s2); + } + + private String targetAsString(ModuleTarget target) { + return targetAsString(target.osName(), target.osArch()); + } + + private String targetAsString(String osName, String osArch) { + return new StringJoiner("-") + .add(Objects.toString(osName, "*")) + .add(Objects.toString(osArch, "*")) + .toString(); + } + /** * Execute post-resolution checks and returns the module graph of resolved @@ -281,7 +420,6 @@ final class Resolver { if (check) { detectCycles(); - checkPlatformConstraints(); checkHashes(); } @@ -319,8 +457,7 @@ final class Resolver { if (!visited.contains(descriptor)) { boolean added = visitPath.add(descriptor); if (!added) { - throw new ResolutionException("Cycle detected: " + - cycleAsString(descriptor)); + resolveFail("Cycle detected: %s", cycleAsString(descriptor)); } for (ModuleDescriptor.Requires requires : descriptor.requires()) { String dn = requires.name(); @@ -353,86 +490,6 @@ final class Resolver { } - /** - * If there are platform specific modules then check that the OS name, - * architecture and version match. - * - * @apiNote This method does not currently check if the OS matches - * platform specific modules in parent configurations. - */ - private void checkPlatformConstraints() { - - // first module encountered that is platform specific - String savedModuleName = null; - String savedOsName = null; - String savedOsArch = null; - String savedOsVersion = null; - - for (ModuleReference mref : nameToReference.values()) { - ModuleDescriptor descriptor = mref.descriptor(); - - String osName = descriptor.osName().orElse(null); - String osArch = descriptor.osArch().orElse(null); - String osVersion = descriptor.osVersion().orElse(null); - - if (osName != null || osArch != null || osVersion != null) { - - if (savedModuleName == null) { - - savedModuleName = descriptor.name(); - savedOsName = osName; - savedOsArch = osArch; - savedOsVersion = osVersion; - - } else { - - boolean matches = platformMatches(osName, savedOsName) - && platformMatches(osArch, savedOsArch) - && platformMatches(osVersion, savedOsVersion); - - if (!matches) { - String s1 = platformAsString(savedOsName, - savedOsArch, - savedOsVersion); - - String s2 = platformAsString(osName, osArch, osVersion); - fail("Mismatching constraints on target platform: " - + savedModuleName + ": " + s1 - + ", " + descriptor.name() + ": " + s2); - } - - } - - } - } - - } - - /** - * Returns true if the s1 and s2 are equal or one of them is null. - */ - private boolean platformMatches(String s1, String s2) { - if (s1 == null || s2 == null) - return true; - else - return Objects.equals(s1, s2); - } - - /** - * Return a string that encodes the OS name/arch/version. - */ - private String platformAsString(String osName, - String osArch, - String osVersion) { - - return new StringJoiner("-") - .add(Objects.toString(osName, "*")) - .add(Objects.toString(osArch, "*")) - .add(Objects.toString(osVersion, "*")) - .toString(); - - } - /** * Checks the hashes in the module descriptor to ensure that they match * any recorded hashes. @@ -460,7 +517,7 @@ final class Resolver { continue; if (!(mref2 instanceof ModuleReferenceImpl)) { - fail("Unable to compute the hash of module %s", dn); + findFail("Unable to compute the hash of module %s", dn); } // skip checking the hash if the module has been patched @@ -469,11 +526,11 @@ final class Resolver { byte[] recordedHash = hashes.hashFor(dn); byte[] actualHash = other.computeHash(algorithm); if (actualHash == null) - fail("Unable to compute the hash of module %s", dn); + findFail("Unable to compute the hash of module %s", dn); if (!Arrays.equals(recordedHash, actualHash)) { - fail("Hash of %s (%s) differs to expected hash (%s)" + - " recorded in %s", dn, toHexString(actualHash), - toHexString(recordedHash), descriptor.name()); + findFail("Hash of %s (%s) differs to expected hash (%s)" + + " recorded in %s", dn, toHexString(actualHash), + toHexString(recordedHash), descriptor.name()); } } } @@ -514,7 +571,7 @@ final class Resolver { // need "requires transitive" from the modules in parent configurations // as there may be selected modules that have a dependency on modules in // the parent configuration. - if (Layer.boot() == null) { + if (ModuleLayer.boot() == null) { g2 = new HashMap<>(capacity); } else { g2 = parents.stream() @@ -669,16 +726,30 @@ final class Resolver { /** - * Checks the readability graph to ensure that no two modules export the - * same package to a module. This includes the case where module M has - * a local package P and M reads another module that exports P to M. - * Also checks the uses/provides of module M to ensure that it reads a - * module that exports the package of the service type to M. + * Checks the readability graph to ensure that + *

          + *
        1. A module does not read two or more modules with the same name. + * This includes the case where a module reads another another with the + * same name as itself.

        2. + *
        3. Two or more modules in the configuration don't export the same + * package to a module that reads both. This includes the case where a + * module {@code M} containing package {@code p} reads another module + * that exports {@code p} to {@code M}.

        4. + *
        5. A module {@code M} doesn't declare that it "{@code uses p.S}" + * or "{@code provides p.S with ...}" but package {@code p} is neither + * in module {@code M} nor exported to {@code M} by any module that + * {@code M} reads.

        6. + *
        */ private void checkExportSuppliers(Map> graph) { for (Map.Entry> e : graph.entrySet()) { ModuleDescriptor descriptor1 = e.getKey().descriptor(); + String name1 = descriptor1.name(); + + // the names of the modules that are read (including self) + Set names = new HashSet<>(); + names.add(name1); // the map of packages that are local or exported to descriptor1 Map packageToExporter = new HashMap<>(); @@ -694,37 +765,49 @@ final class Resolver { for (ResolvedModule endpoint : reads) { ModuleDescriptor descriptor2 = endpoint.descriptor(); - for (ModuleDescriptor.Exports export : descriptor2.exports()) { - - if (export.isQualified()) { - if (!export.targets().contains(descriptor1.name())) - continue; + String name2 = descriptor2.name(); + if (descriptor2 != descriptor1 && !names.add(name2)) { + if (name2.equals(name1)) { + resolveFail("Module %s reads another module named %s", + name1, name1); + } else{ + resolveFail("Module %s reads more than one module named %s", + name1, name2); } + } - // source is exported to descriptor2 - String source = export.source(); - ModuleDescriptor other - = packageToExporter.putIfAbsent(source, descriptor2); + if (descriptor2.isAutomatic()) { + // automatic modules read self and export all packages + if (descriptor2 != descriptor1) { + for (String source : descriptor2.packages()) { + ModuleDescriptor supplier + = packageToExporter.putIfAbsent(source, descriptor2); - if (other != null && other != descriptor2) { - // package might be local to descriptor1 - if (other == descriptor1) { - fail("Module %s contains package %s" - + ", module %s exports package %s to %s", - descriptor1.name(), - source, - descriptor2.name(), - source, - descriptor1.name()); - } else { - fail("Modules %s and %s export package %s to module %s", - descriptor2.name(), - other.name(), - source, - descriptor1.name()); + // descriptor2 and 'supplier' export source to descriptor1 + if (supplier != null) { + failTwoSuppliers(descriptor1, source, descriptor2, supplier); + } } } + } else { + for (ModuleDescriptor.Exports export : descriptor2.exports()) { + if (export.isQualified()) { + if (!export.targets().contains(descriptor1.name())) + continue; + } + + // source is exported by descriptor2 + String source = export.source(); + ModuleDescriptor supplier + = packageToExporter.putIfAbsent(source, descriptor2); + + // descriptor2 and 'supplier' export source to descriptor1 + if (supplier != null) { + failTwoSuppliers(descriptor1, source, descriptor2, supplier); + } + } + } } @@ -735,8 +818,8 @@ final class Resolver { for (String service : descriptor1.uses()) { String pn = packageName(service); if (!packageToExporter.containsKey(pn)) { - fail("Module %s does not read a module that exports %s", - descriptor1.name(), pn); + resolveFail("Module %s does not read a module that exports %s", + descriptor1.name(), pn); } } @@ -744,15 +827,8 @@ final class Resolver { for (ModuleDescriptor.Provides provides : descriptor1.provides()) { String pn = packageName(provides.service()); if (!packageToExporter.containsKey(pn)) { - fail("Module %s does not read a module that exports %s", - descriptor1.name(), pn); - } - - for (String provider : provides.providers()) { - if (!packages.contains(packageName(provider))) { - fail("Provider %s not in module %s", - provider, descriptor1.name()); - } + resolveFail("Module %s does not read a module that exports %s", + descriptor1.name(), pn); } } @@ -762,6 +838,42 @@ final class Resolver { } + /** + * Fail because a module in the configuration exports the same package to + * a module that reads both. This includes the case where a module M + * containing a package p reads another module that exports p to at least + * module M. + */ + private void failTwoSuppliers(ModuleDescriptor descriptor, + String source, + ModuleDescriptor supplier1, + ModuleDescriptor supplier2) { + + if (supplier2 == descriptor) { + ModuleDescriptor tmp = supplier1; + supplier1 = supplier2; + supplier2 = tmp; + } + + if (supplier1 == descriptor) { + resolveFail("Module %s contains package %s" + + ", module %s exports package %s to %s", + descriptor.name(), + source, + supplier2.name(), + source, + descriptor.name()); + } else { + resolveFail("Modules %s and %s export package %s to module %s", + supplier1.name(), + supplier2.name(), + source, + descriptor.name()); + } + + } + + /** * Find a module of the given name in the parent configurations */ @@ -779,24 +891,16 @@ final class Resolver { * Invokes the beforeFinder to find method to find the given module. */ private ModuleReference findWithBeforeFinder(String mn) { - try { - return beforeFinder.find(mn).orElse(null); - } catch (FindException e) { - // unwrap - throw new ResolutionException(e.getMessage(), e.getCause()); - } + + return beforeFinder.find(mn).orElse(null); + } /** * Invokes the afterFinder to find method to find the given module. */ private ModuleReference findWithAfterFinder(String mn) { - try { - return afterFinder.find(mn).orElse(null); - } catch (FindException e) { - // unwrap - throw new ResolutionException(e.getMessage(), e.getCause()); - } + return afterFinder.find(mn).orElse(null); } /** @@ -804,34 +908,27 @@ final class Resolver { * and after ModuleFinders. */ private Set findAll() { - try { + Set beforeModules = beforeFinder.findAll(); + Set afterModules = afterFinder.findAll(); - Set beforeModules = beforeFinder.findAll(); - Set afterModules = afterFinder.findAll(); + if (afterModules.isEmpty()) + return beforeModules; - if (afterModules.isEmpty()) - return beforeModules; + if (beforeModules.isEmpty() + && parents.size() == 1 + && parents.get(0) == Configuration.empty()) + return afterModules; - if (beforeModules.isEmpty() - && parents.size() == 1 - && parents.get(0) == Configuration.empty()) - return afterModules; - - Set result = new HashSet<>(beforeModules); - for (ModuleReference mref : afterModules) { - String name = mref.descriptor().name(); - if (!beforeFinder.find(name).isPresent() - && findInParent(name) == null) { - result.add(mref); - } + Set result = new HashSet<>(beforeModules); + for (ModuleReference mref : afterModules) { + String name = mref.descriptor().name(); + if (!beforeFinder.find(name).isPresent() + && findInParent(name) == null) { + result.add(mref); } - - return result; - - } catch (FindException e) { - // unwrap - throw new ResolutionException(e.getMessage(), e.getCause()); } + + return result; } /** @@ -842,10 +939,18 @@ final class Resolver { return (index == -1) ? "" : cn.substring(0, index); } + /** + * Throw FindException with the given format string and arguments + */ + private static void findFail(String fmt, Object ... args) { + String msg = String.format(fmt, args); + throw new FindException(msg); + } + /** * Throw ResolutionException with the given format string and arguments */ - private static void fail(String fmt, Object ... args) { + private static void resolveFail(String fmt, Object ... args) { String msg = String.format(fmt, args); throw new ResolutionException(msg); } diff --git a/jdk/src/java.base/share/classes/java/lang/module/package-info.java b/jdk/src/java.base/share/classes/java/lang/module/package-info.java index f641638cb2c..b531f13748c 100644 --- a/jdk/src/java.base/share/classes/java/lang/module/package-info.java +++ b/jdk/src/java.base/share/classes/java/lang/module/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. * 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,112 @@ * Classes to support module descriptors and creating configurations of modules * by means of resolution and service binding. * + *

        Resolution

        + * + *

        Resolution is the process of computing the transitive closure of a set + * of root modules over a set of observable modules by resolving the + * dependences expressed by {@link + * java.lang.module.ModuleDescriptor.Requires requires} clauses. + * The dependence graph is augmented with edges that take account of + * implicitly declared dependences ({@code requires transitive}) to create a + * readability graph. The result of resolution is a {@link + * java.lang.module.Configuration Configuration} that encapsulates the + * readability graph.

        + * + *

        As an example, suppose we have the following observable modules:

        + *
         {@code
        + *     module m1 { requires m2; }
        + *     module m2 { requires transitive m3; }
        + *     module m3 { }
        + *     module m4 { }
        + * } 
        + * + *

        If the module {@code m1} is resolved then the resulting configuration + * contains three modules ({@code m1}, {@code m2}, {@code m3}). The edges in + * its readability graph are:

        + *
         {@code
        + *     m1 --> m2  (meaning m1 reads m2)
        + *     m1 --> m3
        + *     m2 --> m3
        + * } 
        + * + *

        Resolution is an additive process. When computing the transitive closure + * then the dependence relation may include dependences on modules in {@link + * java.lang.module.Configuration#parents() parent} configurations. The result + * is a relative configuration that is relative to one or more parent + * configurations and where the readability graph may have edges from modules + * in the configuration to modules in parent configurations.

        + * + *

        As an example, suppose we have the following observable modules:

        + *
         {@code
        + *     module m1 { requires m2; requires java.xml; }
        + *     module m2 { }
        + * } 
        + * + *

        If module {@code m1} is resolved with the configuration for the {@link + * java.lang.ModuleLayer#boot() boot} layer as the parent then the resulting + * configuration contains two modules ({@code m1}, {@code m2}). The edges in + * its readability graph are: + *

         {@code
        + *     m1 --> m2
        + *     m1 --> java.xml
        + * } 
        + * where module {@code java.xml} is in the parent configuration. For + * simplicity, this example omits the implicitly declared dependence on the + * {@code java.base} module. + * + *

        Requires clauses that are "{@code requires static}" express an optional + * dependence (except at compile-time). If a module declares that it + * "{@code requires static M}" then resolution does not search the observable + * modules for "{@code M}". However, if "{@code M}" is resolved (because resolution + * resolves a module that requires "{@code M}" without the {@link + * java.lang.module.ModuleDescriptor.Requires.Modifier#STATIC static} modifier) + * then the readability graph will contain read edges for each module that + * "{@code requires static M}".

        + * + *

        {@link java.lang.module.ModuleDescriptor#isAutomatic() Automatic} modules + * receive special treatment during resolution. Each automatic module is resolved + * as if it "{@code requires transitive}" all observable automatic modules and + * all automatic modules in the parent configurations. Each automatic module is + * resolved so that it reads all other modules in the resulting configuration and + * all modules in parent configurations.

        + * + *

        Service binding

        + * + *

        Service binding is the process of augmenting a graph of resolved modules + * from the set of observable modules induced by the service-use dependence + * ({@code uses} and {@code provides} clauses). Any module that was not + * previously in the graph requires resolution to compute its transitive + * closure. Service binding is an iterative process in that adding a module + * that satisfies some service-use dependence may introduce new service-use + * dependences.

        + * + *

        Suppose we have the following observable modules:

        + *
         {@code
        + *     module m1 { exports p; uses p.S; }
        + *     module m2 { requires m1; provides p.S with p2.S2; }
        + *     module m3 { requires m1; requires m4; provides p.S with p3.S3; }
        + *     module m4 { }
        + * } 
        + * + *

        If the module {@code m1} is resolved then the resulting graph of modules + * has one module ({@code m1}). If the graph is augmented with modules induced + * by the service-use dependence relation then the configuration will contain + * four modules ({@code m1}, {@code m2}, {@code m3}, {@code m4}). The edges in + * its readability graph are:

        + *
         {@code
        + *     m2 --> m1
        + *     m3 --> m1
        + *     m3 --> m4
        + * } 
        + *

        The edges in the conceptual service-use graph are:

        + *
         {@code
        + *     m1 --> m2  (meaning m1 uses a service that is provided by m2)
        + *     m1 --> m3
        + * } 
        + * + *

        General Exceptions

        + * *

        Unless otherwise noted, passing a {@code null} argument to a constructor * or method of any class or interface in this package will cause a {@link * java.lang.NullPointerException NullPointerException} to be thrown. Additionally, @@ -34,6 +140,7 @@ * will cause a {@code NullPointerException}, unless otherwise specified.

        * * @since 9 + * @spec JPMS */ package java.lang.module; diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java b/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java index 63bd43c53c1..04e2101e2cc 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java @@ -119,7 +119,7 @@ import java.util.function.Function; * Using a static nested class, as above, will avoid accidentally retaining the * object reference. *

        - * + * * Cleaning actions should be prepared to be invoked concurrently with * other cleaning actions. * Typically the cleaning actions should be very quick to execute diff --git a/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java b/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java index d7637943726..bb97d6947a5 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/FinalReference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,4 +33,9 @@ class FinalReference extends Reference { public FinalReference(T referent, ReferenceQueue q) { super(referent, q); } + + @Override + public boolean enqueue() { + throw new InternalError("should never reach here"); + } } diff --git a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java index cd4bd8065bc..5125e7cb553 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/Reference.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/Reference.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -140,15 +140,26 @@ public abstract class Reference { } } - /* Atomically get and clear (set to null) the VM's pending list. + /* + * system property to disable clearing before enqueuing. + */ + private static final class ClearBeforeEnqueue { + static final boolean DISABLE = + Boolean.getBoolean("jdk.lang.ref.disableClearBeforeEnqueue"); + } + + /* + * Atomically get and clear (set to null) the VM's pending list. */ private static native Reference getAndClearReferencePendingList(); - /* Test whether the VM's pending list contains any entries. + /* + * Test whether the VM's pending list contains any entries. */ private static native boolean hasReferencePendingList(); - /* Wait until the VM's pending list may be non-null. + /* + * Wait until the VM's pending list may be non-null. */ private static native void waitForReferencePendingList(); @@ -261,7 +272,6 @@ public abstract class Reference { this.referent = null; } - /* -- Queue operations -- */ /** @@ -278,8 +288,8 @@ public abstract class Reference { } /** - * Adds this reference object to the queue with which it is registered, - * if any. + * Clears this reference object and adds it to the queue with which + * it is registered, if any. * *

        This method is invoked only by Java code; when the garbage collector * enqueues references it does so directly, without invoking this method. @@ -289,10 +299,11 @@ public abstract class Reference { * it was not registered with a queue when it was created */ public boolean enqueue() { + if (!ClearBeforeEnqueue.DISABLE) + this.referent = null; return this.queue.enqueue(this); } - /* -- Constructors -- */ Reference(T referent) { @@ -419,5 +430,4 @@ public abstract class Reference { // HotSpot needs to retain the ref and not GC it before a call to this // method } - } diff --git a/jdk/src/java.base/share/classes/java/lang/ref/package-info.java b/jdk/src/java.base/share/classes/java/lang/ref/package-info.java index 58600cba1b8..3f37878650c 100644 --- a/jdk/src/java.base/share/classes/java/lang/ref/package-info.java +++ b/jdk/src/java.base/share/classes/java/lang/ref/package-info.java @@ -93,7 +93,7 @@ * structure, this check will add little overhead to the hashtable * access methods. * - * + * *

        Reachability

        * * Going from strongest to weakest, the different levels of diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java b/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java index f585b476504..35c689d56cc 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * 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,37 +29,46 @@ import java.lang.annotation.Annotation; import java.security.AccessController; import jdk.internal.misc.VM; +import jdk.internal.module.IllegalAccessLogger; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; import jdk.internal.reflect.ReflectionFactory; import sun.security.action.GetPropertyAction; /** - * The AccessibleObject class is the base class for Field, Method and - * Constructor objects. It provides the ability to flag a reflected - * object as suppressing default Java language access control checks - * when it is used. The access checks -- module boundaries, - * public, default (package) access, protected, and private members -- - * are performed when Fields, Methods or Constructors are used to set - * or get fields, to invoke methods or to create and initialize new - * instances of classes, respectively. Unlike access control specified - * in the The Java™ Language Specification and - * The Java Virtual Machine Specification, access checks - * with reflected objects assume {@link Module#canRead readability}. + * The {@code AccessibleObject} class is the base class for {@code Field}, + * {@code Method}, and {@code Constructor} objects (known as reflected + * objects). It provides the ability to flag a reflected object as + * suppressing checks for Java language access control when it is used. This + * permits sophisticated applications with sufficient privilege, such as Java + * Object Serialization or other persistence mechanisms, to manipulate objects + * in a manner that would normally be prohibited. * - *

        Setting the {@code accessible} flag in a reflected object - * permits sophisticated applications with sufficient privilege, such - * as Java Object Serialization or other persistence mechanisms, to - * manipulate objects in a manner that would normally be prohibited. + *

        Java language access control prevents use of private members outside + * their class; package access members outside their package; protected members + * outside their package or subclasses; and public members outside their + * module unless they are declared in an {@link Module#isExported(String,Module) + * exported} package and the user {@link Module#canRead reads} their module. By + * default, Java language access control is enforced (with one variation) when + * {@code Field}s, {@code Method}s, or {@code Constructor}s are used to get or + * set fields, to invoke methods, or to create and initialize new instances of + * classes, respectively. Every reflected object checks that the code using it + * is in an appropriate class, package, or module.

        * - *

        By default, a reflected object is not accessible. + *

        The one variation from Java language access control is that the checks + * by reflected objects assume readability. That is, the module containing + * the use of a reflected object is assumed to read the module in which + * the underlying field, method, or constructor is declared.

        * - * @see Field - * @see Method - * @see Constructor - * @see ReflectPermission + *

        Whether the checks for Java language access control can be suppressed + * (and thus, whether access can be enabled) depends on whether the reflected + * object corresponds to a member in an exported or open package + * (see {@link #setAccessible(boolean)}).

        * + * @jls 6.6 Access Control * @since 1.2 + * @revised 9 + * @spec JPMS */ public class AccessibleObject implements AnnotatedElement { @@ -78,15 +87,11 @@ public class AccessibleObject implements AnnotatedElement { /** * Convenience method to set the {@code accessible} flag for an - * array of objects with a single security check (for efficiency). + * array of reflected objects with a single security check (for efficiency). * - *

        This method cannot be used to enable access to an object that is a - * {@link Member member} of a class in a different module to the caller and - * where the class is in a package that is not exported to the caller's - * module. Additionally, if the member is non-public or its declaring - * class is non-public, then this method can only be used to enable access - * if the package is {@link Module#isOpen(String,Module) open} to at least - * the caller's module. + *

        This method may be used to enable access to all reflected objects in + * the array when access to each reflected object can be enabled as + * specified by {@link #setAccessible(boolean) setAccessible(boolean)}.

        * *

        If there is a security manager, its * {@code checkPermission} method is first called with a @@ -99,10 +104,15 @@ public class AccessibleObject implements AnnotatedElement { * @param array the array of AccessibleObjects * @param flag the new value for the {@code accessible} flag * in each object - * @throws InaccessibleObjectException if access cannot be enabled - * @throws SecurityException if the request is denied. + * @throws InaccessibleObjectException if access cannot be enabled for all + * objects in the array + * @throws SecurityException if the request is denied by the security manager + * or an element in the array is a constructor for {@code + * java.lang.Class} * @see SecurityManager#checkPermission * @see ReflectPermission + * @revised 9 + * @spec JPMS */ @CallerSensitive public static void setAccessible(AccessibleObject[] array, boolean flag) { @@ -120,41 +130,143 @@ public class AccessibleObject implements AnnotatedElement { } /** - * Set the {@code accessible} flag for this object to + * Set the {@code accessible} flag for this reflected object to * the indicated boolean value. A value of {@code true} indicates that - * the reflected object should suppress Java language access - * checking when it is used. A value of {@code false} indicates - * that the reflected object should enforce Java language access checks - * while assuming readability (as noted in the class description). + * the reflected object should suppress checks for Java language access + * control when it is used. A value of {@code false} indicates that + * the reflected object should enforce checks for Java language access + * control when it is used, with the variation noted in the class description. * - *

        This method cannot be used to enable access to an object that is a - * {@link Member member} of a class in a different module to the caller and - * where the class is in a package that is not exported to the caller's - * module. Additionally, if the member is non-public or its declaring - * class is non-public, then this method can only be used to enable access - * if the package is {@link Module#isOpen(String,Module) open} to at least - * the caller's module. + *

        This method may be used by a caller in class {@code C} to enable + * access to a {@link Member member} of {@link Member#getDeclaringClass() + * declaring class} {@code D} if any of the following hold:

        * - *

        If there is a security manager, its + *

          + *
        • {@code C} and {@code D} are in the same module.
        • + * + *
        • The member is {@code public} and {@code D} is {@code public} in + * a package that the module containing {@code D} {@link + * Module#isExported(String,Module) exports} to at least the module + * containing {@code C}.
        • + * + *
        • The member is {@code protected} {@code static}, {@code D} is + * {@code public} in a package that the module containing {@code D} + * exports to at least the module containing {@code C}, and {@code C} + * is a subclass of {@code D}.
        • + * + *
        • {@code D} is in a package that the module containing {@code D} + * {@link Module#isOpen(String,Module) opens} to at least the module + * containing {@code C}. + * All packages in unnamed and open modules are open to all modules and + * so this method always succeeds when {@code D} is in an unnamed or + * open module.
        • + *
        + * + *

        This method cannot be used to enable access to private members, + * members with default (package) access, protected instance members, or + * protected constructors when the declaring class is in a different module + * to the caller and the package containing the declaring class is not open + * to the caller's module.

        + * + *

        If there is a security manager, its * {@code checkPermission} method is first called with a * {@code ReflectPermission("suppressAccessChecks")} permission. * * @param flag the new value for the {@code accessible} flag * @throws InaccessibleObjectException if access cannot be enabled - * @throws SecurityException if the request is denied - * @see SecurityManager#checkPermission - * @see ReflectPermission + * @throws SecurityException if the request is denied by the security manager + * @see #trySetAccessible * @see java.lang.invoke.MethodHandles#privateLookupIn + * @revised 9 + * @spec JPMS */ public void setAccessible(boolean flag) { AccessibleObject.checkPermission(); setAccessible0(flag); } - void setAccessible0(boolean flag) { + /** + * Sets the accessible flag and returns the new value + */ + boolean setAccessible0(boolean flag) { this.override = flag; + return flag; } + /** + * Set the {@code accessible} flag for this reflected object to {@code true} + * if possible. This method sets the {@code accessible} flag, as if by + * invoking {@link #setAccessible(boolean) setAccessible(true)}, and returns + * the possibly-updated value for the {@code accessible} flag. If access + * cannot be enabled, i.e. the checks or Java language access control cannot + * be suppressed, this method returns {@code false} (as opposed to {@code + * setAccessible(true)} throwing {@code InaccessibleObjectException} when + * it fails). + * + *

        This method is a no-op if the {@code accessible} flag for + * this reflected object is {@code true}. + * + *

        For example, a caller can invoke {@code trySetAccessible} + * on a {@code Method} object for a private instance method + * {@code p.T::privateMethod} to suppress the checks for Java language access + * control when the {@code Method} is invoked. + * If {@code p.T} class is in a different module to the caller and + * package {@code p} is open to at least the caller's module, + * the code below successfully sets the {@code accessible} flag + * to {@code true}. + * + *

        +     * {@code
        +     *     p.T obj = ....;  // instance of p.T
        +     *     :
        +     *     Method m = p.T.class.getDeclaredMethod("privateMethod");
        +     *     if (m.trySetAccessible()) {
        +     *         m.invoke(obj);
        +     *     } else {
        +     *         // package p is not opened to the caller to access private member of T
        +     *         ...
        +     *     }
        +     * }
        + * + *

        If there is a security manager, its {@code checkPermission} method + * is first called with a {@code ReflectPermission("suppressAccessChecks")} + * permission.

        + * + * @return {@code true} if the {@code accessible} flag is set to {@code true}; + * {@code false} if access cannot be enabled. + * @throws SecurityException if the request is denied by the security manager + * + * @since 9 + * @spec JPMS + * @see java.lang.invoke.MethodHandles#privateLookupIn + */ + @CallerSensitive + public final boolean trySetAccessible() { + AccessibleObject.checkPermission(); + + if (override == true) return true; + + // if it's not a Constructor, Method, Field then no access check + if (!Member.class.isInstance(this)) { + return setAccessible0(true); + } + + // does not allow to suppress access check for Class's constructor + Class declaringClass = ((Member) this).getDeclaringClass(); + if (declaringClass == Class.class && this instanceof Constructor) { + return false; + } + + if (checkCanSetAccessible(Reflection.getCallerClass(), + declaringClass, + false)) { + return setAccessible0(true); + } else { + return false; + } + } + + /** * If the given AccessibleObject is a {@code Constructor}, {@code Method} * or {@code Field} then checks that its declaring class is in a package @@ -164,106 +276,206 @@ public class AccessibleObject implements AnnotatedElement { // do nothing, needs to be overridden by Constructor, Method, Field } + void checkCanSetAccessible(Class caller, Class declaringClass) { + checkCanSetAccessible(caller, declaringClass, true); + } + + private boolean checkCanSetAccessible(Class caller, + Class declaringClass, + boolean throwExceptionIfDenied) { Module callerModule = caller.getModule(); Module declaringModule = declaringClass.getModule(); - if (callerModule == declaringModule) return; - if (callerModule == Object.class.getModule()) return; - if (!declaringModule.isNamed()) return; + if (callerModule == declaringModule) return true; + if (callerModule == Object.class.getModule()) return true; + if (!declaringModule.isNamed()) return true; - // package is open to caller - String pn = packageName(declaringClass); - if (declaringModule.isOpen(pn, callerModule)) { - printStackTraceIfOpenedReflectively(declaringModule, pn, callerModule); - return; - } - - // package is exported to caller and class/member is public - boolean isExported = declaringModule.isExported(pn, callerModule); - boolean isClassPublic = Modifier.isPublic(declaringClass.getModifiers()); + String pn = declaringClass.getPackageName(); int modifiers; if (this instanceof Executable) { modifiers = ((Executable) this).getModifiers(); } else { modifiers = ((Field) this).getModifiers(); } - boolean isMemberPublic = Modifier.isPublic(modifiers); - if (isExported && isClassPublic && isMemberPublic) { - printStackTraceIfExportedReflectively(declaringModule, pn, callerModule); - return; + + // class is public and package is exported to caller + boolean isClassPublic = Modifier.isPublic(declaringClass.getModifiers()); + if (isClassPublic && declaringModule.isExported(pn, callerModule)) { + // member is public + if (Modifier.isPublic(modifiers)) { + logIfExportedByBackdoor(caller, declaringClass); + return true; + } + + // member is protected-static + if (Modifier.isProtected(modifiers) + && Modifier.isStatic(modifiers) + && isSubclassOf(caller, declaringClass)) { + logIfExportedByBackdoor(caller, declaringClass); + return true; + } } - // not accessible - String msg = "Unable to make "; - if (this instanceof Field) - msg += "field "; - msg += this + " accessible: " + declaringModule + " does not \""; - if (isClassPublic && isMemberPublic) - msg += "exports"; - else - msg += "opens"; - msg += " " + pn + "\" to " + callerModule; - InaccessibleObjectException e = new InaccessibleObjectException(msg); - if (Reflection.printStackTraceWhenAccessFails()) { - e.printStackTrace(System.err); + // package is open to caller + if (declaringModule.isOpen(pn, callerModule)) { + logIfOpenedByBackdoor(caller, declaringClass); + return true; } - throw e; - } - private void printStackTraceIfOpenedReflectively(Module module, - String pn, - Module other) { - printStackTraceIfExposedReflectively(module, pn, other, true); - } - - private void printStackTraceIfExportedReflectively(Module module, - String pn, - Module other) { - printStackTraceIfExposedReflectively(module, pn, other, false); - } - - private void printStackTraceIfExposedReflectively(Module module, - String pn, - Module other, - boolean open) - { - if (Reflection.printStackTraceWhenAccessSucceeds() - && !module.isStaticallyExportedOrOpen(pn, other, open)) - { - String msg = other + " allowed to invoke setAccessible on "; + if (throwExceptionIfDenied) { + // not accessible + String msg = "Unable to make "; if (this instanceof Field) msg += "field "; - msg += this; - new Exception(msg) { - private static final long serialVersionUID = 42L; - public String toString() { - return "WARNING: " + getMessage(); - } - }.printStackTrace(System.err); + msg += this + " accessible: " + declaringModule + " does not \""; + if (isClassPublic && Modifier.isPublic(modifiers)) + msg += "exports"; + else + msg += "opens"; + msg += " " + pn + "\" to " + callerModule; + InaccessibleObjectException e = new InaccessibleObjectException(msg); + if (printStackTraceWhenAccessFails()) { + e.printStackTrace(System.err); + } + throw e; + } + return false; + } + + private boolean isSubclassOf(Class queryClass, Class ofClass) { + while (queryClass != null) { + if (queryClass == ofClass) { + return true; + } + queryClass = queryClass.getSuperclass(); + } + return false; + } + + private void logIfOpenedByBackdoor(Class caller, Class declaringClass) { + Module callerModule = caller.getModule(); + Module targetModule = declaringClass.getModule(); + // callerModule is null during early startup + if (callerModule != null && !callerModule.isNamed() && targetModule.isNamed()) { + IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger(); + if (logger != null) { + logger.logIfOpenedByBackdoor(caller, declaringClass, this::toShortString); + } + } + } + + private void logIfExportedByBackdoor(Class caller, Class declaringClass) { + Module callerModule = caller.getModule(); + Module targetModule = declaringClass.getModule(); + // callerModule is null during early startup + if (callerModule != null && !callerModule.isNamed() && targetModule.isNamed()) { + IllegalAccessLogger logger = IllegalAccessLogger.illegalAccessLogger(); + if (logger != null) { + logger.logIfExportedByBackdoor(caller, declaringClass, this::toShortString); + } } } /** - * Returns the package name of the given class. + * Returns a short descriptive string to describe this object in log messages. */ - private static String packageName(Class c) { - while (c.isArray()) { - c = c.getComponentType(); - } - String pn = c.getPackageName(); - return (pn != null) ? pn : ""; + String toShortString() { + return toString(); } /** - * Get the value of the {@code accessible} flag for this object. + * Get the value of the {@code accessible} flag for this reflected object. * * @return the value of the object's {@code accessible} flag + * + * @deprecated + * This method is deprecated because its name hints that it checks + * if the reflected object is accessible when it actually indicates + * if the checks for Java language access control are suppressed. + * This method may return {@code false} on a reflected object that is + * accessible to the caller. To test if this reflected object is accessible, + * it should use {@link #canAccess(Object)}. + * + * @revised 9 + * @spec JPMS */ + @Deprecated(since="9") public boolean isAccessible() { return override; } + /** + * Test if the caller can access this reflected object. If this reflected + * object corresponds to an instance method or field then this method tests + * if the caller can access the given {@code obj} with the reflected object. + * For instance methods or fields then the {@code obj} argument must be an + * instance of the {@link Member#getDeclaringClass() declaring class}. For + * static members and constructors then {@code obj} must be {@code null}. + * + *

        This method returns {@code true} if the {@code accessible} flag + * is set to {@code true}, i.e. the checks for Java language access control + * are suppressed, or if the caller can access the member as + * specified in The Java™ Language Specification, + * with the variation noted in the class description.

        + * + * @param obj an instance object of the declaring class of this reflected + * object if it is an instance method or field + * + * @return {@code true} if the caller can access this reflected object. + * + * @throws IllegalArgumentException + *
          + *
        • if this reflected object is a static member or constructor and + * the given {@code obj} is non-{@code null}, or
        • + *
        • if this reflected object is an instance method or field + * and the given {@code obj} is {@code null} or of type + * that is not a subclass of the {@link Member#getDeclaringClass() + * declaring class} of the member.
        • + *
        + * + * @since 9 + * @spec JPMS + * @jls 6.6 Access Control + * @see #trySetAccessible + * @see #setAccessible(boolean) + */ + @CallerSensitive + public final boolean canAccess(Object obj) { + if (!Member.class.isInstance(this)) { + return override; + } + + Class declaringClass = ((Member) this).getDeclaringClass(); + int modifiers = ((Member) this).getModifiers(); + if (!Modifier.isStatic(modifiers) && + (this instanceof Method || this instanceof Field)) { + if (obj == null) { + throw new IllegalArgumentException("null object for " + this); + } + // if this object is an instance member, the given object + // must be a subclass of the declaring class of this reflected object + if (!declaringClass.isAssignableFrom(obj.getClass())) { + throw new IllegalArgumentException("object is not an instance of " + + declaringClass.getName()); + } + } else if (obj != null) { + throw new IllegalArgumentException("non-null object for " + this); + } + + // access check is suppressed + if (override) return true; + + Class caller = Reflection.getCallerClass(); + Class targetClass; + if (this instanceof Constructor) { + targetClass = declaringClass; + } else { + targetClass = Modifier.isStatic(modifiers) ? null : obj.getClass(); + } + return verifyAccess(caller, declaringClass, targetClass, modifiers); + } + /** * Constructor: only used by the Java Virtual Machine. */ @@ -302,7 +514,7 @@ public class AccessibleObject implements AnnotatedElement { return AnnotatedElement.super.isAnnotationPresent(annotationClass); } - /** + /** * @throws NullPointerException {@inheritDoc} * @since 1.8 */ @@ -372,9 +584,22 @@ public class AccessibleObject implements AnnotatedElement { final void checkAccess(Class caller, Class memberClass, Class targetClass, int modifiers) throws IllegalAccessException + { + if (!verifyAccess(caller, memberClass, targetClass, modifiers)) { + IllegalAccessException e = Reflection.newIllegalAccessException( + caller, memberClass, targetClass, modifiers); + if (printStackTraceWhenAccessFails()) { + e.printStackTrace(System.err); + } + throw e; + } + } + + final boolean verifyAccess(Class caller, Class memberClass, + Class targetClass, int modifiers) { if (caller == memberClass) { // quick check - return; // ACCESS IS OK + return true; // ACCESS IS OK } Object cache = securityCheckCache; // read volatile if (targetClass != null // instance member or constructor @@ -385,26 +610,31 @@ public class AccessibleObject implements AnnotatedElement { Class[] cache2 = (Class[]) cache; if (cache2[1] == targetClass && cache2[0] == caller) { - return; // ACCESS IS OK + return true; // ACCESS IS OK } // (Test cache[1] first since range check for [1] // subsumes range check for [0].) } } else if (cache == caller) { // Non-protected case (or targetClass == memberClass or static member). - return; // ACCESS IS OK + return true; // ACCESS IS OK } // If no return, fall through to the slow path. - slowCheckMemberAccess(caller, memberClass, targetClass, modifiers); + return slowVerifyAccess(caller, memberClass, targetClass, modifiers); } // Keep all this slow stuff out of line: - void slowCheckMemberAccess(Class caller, Class memberClass, - Class targetClass, int modifiers) - throws IllegalAccessException + private boolean slowVerifyAccess(Class caller, Class memberClass, + Class targetClass, int modifiers) { - Reflection.ensureMemberAccess(caller, memberClass, targetClass, modifiers); + if (!Reflection.verifyMemberAccess(caller, memberClass, targetClass, modifiers)) { + // access denied + return false; + } + + // access okay + logIfExportedByBackdoor(caller, memberClass); // Success: Update the cache. Object cache = (targetClass != null @@ -418,5 +648,27 @@ public class AccessibleObject implements AnnotatedElement { // guarantees that the initializing stores for the cache // elements will occur before the volatile write. securityCheckCache = cache; // write volatile + return true; + } + + // true to print a stack trace when access fails + private static volatile boolean printStackWhenAccessFails; + + // true if printStack* values are initialized + private static volatile boolean printStackPropertiesSet; + + /** + * Returns true if a stack trace should be printed when access fails. + */ + private static boolean printStackTraceWhenAccessFails() { + if (!printStackPropertiesSet && VM.initLevel() >= 1) { + String s = GetPropertyAction.privilegedGetProperty( + "sun.reflect.debugModuleAccessChecks"); + if (s != null) { + printStackWhenAccessFails = !s.equalsIgnoreCase("false"); + } + printStackPropertiesSet = true; + } + return printStackWhenAccessFails; } } diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java index 2f26c0b1bdc..3bc54c2856a 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/AnnotatedElement.java @@ -109,22 +109,22 @@ import sun.reflect.annotation.AnnotationType; *

    * * - * * - * * - * * - * * - * * - * * *
    lookup expressionlookup expressionmemberbytecode behavior
    Overview of kind of presence detected by different AnnotatedElement methods
    Kind of Presence
    MethodDirectly PresentIndirectly PresentPresentAssociated
    {@code T}{@link #getAnnotation(Class) getAnnotation(Class<T>)} + *
    {@code T}{@link #getAnnotation(Class) getAnnotation(Class<T>)} * X
    {@code Annotation[]}{@link #getAnnotations getAnnotations()} + *
    {@code Annotation[]}{@link #getAnnotations getAnnotations()} * X
    {@code T[]}{@link #getAnnotationsByType(Class) getAnnotationsByType(Class<T>)} + *
    {@code T[]}{@link #getAnnotationsByType(Class) getAnnotationsByType(Class<T>)} * X
    {@code T}{@link #getDeclaredAnnotation(Class) getDeclaredAnnotation(Class<T>)} + *
    {@code T}{@link #getDeclaredAnnotation(Class) getDeclaredAnnotation(Class<T>)} * X
    {@code Annotation[]}{@link #getDeclaredAnnotations getDeclaredAnnotations()} + *
    {@code Annotation[]}{@link #getDeclaredAnnotations getDeclaredAnnotations()} * X
    {@code T[]}{@link #getDeclaredAnnotationsByType(Class) getDeclaredAnnotationsByType(Class<T>)} + *
    {@code T[]}{@link #getDeclaredAnnotationsByType(Class) getDeclaredAnnotationsByType(Class<T>)} * XX
    diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java index f64e84f7f37..ecc3fd1f462 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Constructor.java @@ -38,6 +38,7 @@ import sun.reflect.generics.factory.GenericsFactory; import sun.reflect.generics.scope.ConstructorScope; import java.lang.annotation.Annotation; import java.lang.annotation.AnnotationFormatError; +import java.util.StringJoiner; /** * {@code Constructor} provides information about, and access to, a single @@ -168,6 +169,12 @@ public final class Constructor extends Executable { * is true.

    * * @param flag {@inheritDoc} + * + * @throws InaccessibleObjectException {@inheritDoc} + * @throws SecurityException if the request is denied by the security manager + * or this is a constructor for {@code java.lang.Class} + * + * @spec JPMS */ @Override @CallerSensitive @@ -353,6 +360,20 @@ public final class Constructor extends Executable { sb.append(getDeclaringClass().getTypeName()); } + @Override + String toShortString() { + StringBuilder sb = new StringBuilder("constructor "); + sb.append(getDeclaringClass().getTypeName()); + sb.append('('); + StringJoiner sj = new StringJoiner(","); + for (Class parameterType : getParameterTypes()) { + sj.add(parameterType.getTypeName()); + } + sb.append(sj); + sb.append(')'); + return sb.toString(); + } + /** * Returns a string describing this {@code Constructor}, * including type parameters. The string is formatted as the diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java index 05b71785ffa..1f1192f6a5b 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Field.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Field.java @@ -158,6 +158,10 @@ class Field extends AccessibleObject implements Member { return res; } + /** + * @throws InaccessibleObjectException {@inheritDoc} + * @throws SecurityException {@inheritDoc} + */ @Override @CallerSensitive public void setAccessible(boolean flag) { @@ -320,6 +324,11 @@ class Field extends AccessibleObject implements Member { + getName()); } + @Override + String toShortString() { + return "field " + getDeclaringClass().getTypeName() + "." + getName(); + } + /** * Returns a string describing this {@code Field}, including * its generic type. The format is the access modifiers for the diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java b/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java index 34db5150f85..b03d449fecc 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/InaccessibleObjectException.java @@ -30,6 +30,7 @@ package java.lang.reflect; * * @see AccessibleObject#setAccessible(boolean) * @since 9 + * @spec JPMS */ public class InaccessibleObjectException extends RuntimeException { diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java index 027a711d3e1..b915b5524ae 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Method.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Method.java @@ -42,6 +42,7 @@ import sun.reflect.annotation.AnnotationParser; import java.lang.annotation.Annotation; import java.lang.annotation.AnnotationFormatError; import java.nio.ByteBuffer; +import java.util.StringJoiner; /** * A {@code Method} provides information about, and access to, a single method @@ -179,6 +180,10 @@ public final class Method extends Executable { return res; } + /** + * @throws InaccessibleObjectException {@inheritDoc} + * @throws SecurityException {@inheritDoc} + */ @Override @CallerSensitive public void setAccessible(boolean flag) { @@ -412,6 +417,21 @@ public final class Method extends Executable { sb.append(getName()); } + @Override + String toShortString() { + StringBuilder sb = new StringBuilder("method "); + sb.append(getDeclaringClass().getTypeName()).append('.'); + sb.append(getName()); + sb.append('('); + StringJoiner sj = new StringJoiner(","); + for (Class parameterType : getParameterTypes()) { + sj.add(parameterType.getTypeName()); + } + sb.append(sj); + sb.append(')'); + return sb.toString(); + } + /** * Returns a string describing this {@code Method}, including * type parameters. The string is formatted as the method access diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java index 15d41a4101d..e2a950ed1c1 100644 --- a/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java +++ b/jdk/src/java.base/share/classes/java/lang/reflect/Proxy.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. * 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 java.lang.reflect; +import java.lang.module.ModuleDescriptor; import java.security.AccessController; import java.security.PrivilegedAction; import java.util.Arrays; @@ -52,6 +53,9 @@ import sun.reflect.misc.ReflectUtil; import sun.security.action.GetPropertyAction; import sun.security.util.SecurityConstants; +import static java.lang.module.ModuleDescriptor.Modifier.SYNTHETIC; + + /** * * {@code Proxy} provides static methods for creating objects that act like instances @@ -153,7 +157,7 @@ import sun.security.util.SecurityConstants; * like they do for instances of {@code java.lang.Object}. * * - *

    Package and Module Membership of Proxy Class

    + *

    Package and Module Membership of Proxy Class

    * * The package and module to which a proxy class belongs are chosen such that * the accessibility of the proxy class is in line with the accessibility of @@ -164,7 +168,8 @@ import sun.security.util.SecurityConstants; * methods is specified as follows: * *
      - *
    1. If all the proxy interfaces are in exported packages: + *
    2. If all the proxy interfaces are in exported or open + * packages: *
        *
      1. if all the proxy interfaces are public, then the proxy class is * public in a package exported by the @@ -178,10 +183,11 @@ import sun.security.util.SecurityConstants; * not possible.
      2. *
      *
    3. - *
    4. If at least one proxy interface is a non-exported package: + *
    5. If at least one proxy interface is in a package that is + * non-exported and non-open: *
        *
      1. if all the proxy interfaces are public, then the proxy class is - * public in a non-exported package of + * public in a non-exported, non-open package of * dynamic module. * The names of the package and the module are unspecified.
      2. * @@ -195,23 +201,24 @@ import sun.security.util.SecurityConstants; *
      * *

      - * Note that if proxy interfaces with a mix of accessibilities -- - * exported public, exported non-public, non-exported public, non-exported non-public -- - * are proxied by the same instance, then the proxy class's accessibility is + * Note that if proxy interfaces with a mix of accessibilities -- for example, + * an exported public interface and a non-exported non-public interface -- are + * proxied by the same instance, then the proxy class's accessibility is * governed by the least accessible proxy interface. *

      * Note that it is possible for arbitrary code to obtain access to a proxy class - * in an exported package with {@link AccessibleObject#setAccessible setAccessible}, - * whereas a proxy class in a non-exported package is never accessible to + * in an open package with {@link AccessibleObject#setAccessible setAccessible}, + * whereas a proxy class in a non-open package is never accessible to * code outside the module of the proxy class. * *

      - * Throughout this specification, a "non-exported package" refers to a package that - * is not exported to all modules. Specifically, it refers to a package that - * either is not exported at all by its containing module or is exported in a - * qualified fashion by its containing module. + * Throughout this specification, a "non-exported package" refers to a package + * that is not exported to all modules, and a "non-open package" refers to + * a package that is not open to all modules. Specifically, these terms refer to + * a package that either is not exported/open by its containing module or is + * exported/open in a qualified fashion by its containing module. * - *

      Dynamic Modules

      + *

      Dynamic Modules

      *

      * A dynamic module is a named module generated at runtime. A proxy class * defined in a dynamic module is encapsulated and not accessible to any module. @@ -220,11 +227,11 @@ import sun.security.util.SecurityConstants; * {@code Proxy.newProxyInstance} method should be used instead. * *

      - * A dynamic module can read the modules of all of the superinterfaces of a proxy class - * and the modules of the types referenced by all public method signatures + * A dynamic module can read the modules of all of the superinterfaces of a proxy + * class and the modules of the types referenced by all public method signatures * of a proxy class. If a superinterface or a referenced type, say {@code T}, - * is in a non-exported package, the {@linkplain java.lang.reflect.Module module} - * of {@code T} is updated to export the package of {@code T} to the dynamic module. + * is in a non-exported package, the {@linkplain Module module} of {@code T} is + * updated to export the package of {@code T} to the dynamic module. * *

      Methods Duplicated in Multiple Proxy Interfaces

      * @@ -272,6 +279,8 @@ import sun.security.util.SecurityConstants; * @author Peter Jones * @see InvocationHandler * @since 1.3 + * @revised 9 + * @spec JPMS */ public class Proxy implements java.io.Serializable { private static final long serialVersionUID = -2222568056686623797L; @@ -350,14 +359,17 @@ public class Proxy implements java.io.Serializable { * @throws NullPointerException if the {@code interfaces} array * argument or any of its elements are {@code null} * - * @deprecated Proxy classes generated in a named module are encapsulated and not - * accessible to code outside its module. - * {@link Constructor#newInstance(Object...) Constructor.newInstance} will throw - * {@code IllegalAccessException} when it is called on an inaccessible proxy class. + * @deprecated Proxy classes generated in a named module are encapsulated + * and not accessible to code outside its module. + * {@link Constructor#newInstance(Object...) Constructor.newInstance} + * will throw {@code IllegalAccessException} when it is called on + * an inaccessible proxy class. * Use {@link #newProxyInstance(ClassLoader, Class[], InvocationHandler)} * to create a proxy instance instead. * * @see Package and Module Membership of Proxy Class + * @revised 9 + * @spec JPMS */ @Deprecated @CallerSensitive @@ -500,17 +512,19 @@ public class Proxy implements java.io.Serializable { "Unnamed package cannot be added to " + m); } - // add the package to the runtime module if not exists if (m.isNamed()) { - m.addPackage(proxyPkg); + if (!m.getDescriptor().packages().contains(proxyPkg)) { + throw new InternalError(proxyPkg + " not exist in " + m.getName()); + } } /* * Choose a name for the proxy class to generate. */ long num = nextUniqueNumber.getAndIncrement(); - String proxyName = proxyPkg.isEmpty() ? proxyClassNamePrefix + num - : proxyPkg + "." + proxyClassNamePrefix + num; + String proxyName = proxyPkg.isEmpty() + ? proxyClassNamePrefix + num + : proxyPkg + "." + proxyClassNamePrefix + num; ClassLoader loader = getLoader(m); trace(proxyName, m, loader, interfaces); @@ -570,9 +584,13 @@ public class Proxy implements java.io.Serializable { c.getModule().getName(), c.getName(), access, ld); } - static void trace(String cn, Module module, ClassLoader loader, List> interfaces) { + static void trace(String cn, + Module module, + ClassLoader loader, + List> interfaces) { if (isDebug()) { - System.out.format("PROXY: %s/%s defined by %s%n", module.getName(), cn, loader); + System.err.format("PROXY: %s/%s defined by %s%n", + module.getName(), cn, loader); } if (isDebug("debug")) { interfaces.stream() @@ -581,7 +599,7 @@ public class Proxy implements java.io.Serializable { } private static final String DEBUG = - GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", ""); + GetPropertyAction.privilegedGetProperty("jdk.proxy.debug", ""); private static boolean isDebug() { return !DEBUG.isEmpty(); @@ -592,15 +610,16 @@ public class Proxy implements java.io.Serializable { // ProxyBuilder instance members start here.... - private final ClassLoader loader; private final List> interfaces; private final Module module; ProxyBuilder(ClassLoader loader, List> interfaces) { if (!VM.isModuleSystemInited()) { - throw new InternalError("Proxy is not supported until module system is fully initialized"); + throw new InternalError("Proxy is not supported until " + + "module system is fully initialized"); } if (interfaces.size() > 65535) { - throw new IllegalArgumentException("interface limit exceeded: " + interfaces.size()); + throw new IllegalArgumentException("interface limit exceeded: " + + interfaces.size()); } Set> refTypes = referencedTypes(loader, interfaces); @@ -608,7 +627,6 @@ public class Proxy implements java.io.Serializable { // IAE if violates any restrictions specified in newProxyInstance validateProxyInterfaces(loader, interfaces, refTypes); - this.loader = loader; this.interfaces = interfaces; this.module = mapToModule(loader, interfaces, refTypes); assert getLoader(module) == loader; @@ -648,8 +666,8 @@ public class Proxy implements java.io.Serializable { * Validate the given proxy interfaces and the given referenced types * are visible to the defining loader. * - * @throws IllegalArgumentException if it violates the restrictions specified - * in {@link Proxy#newProxyInstance} + * @throws IllegalArgumentException if it violates the restrictions + * specified in {@link Proxy#newProxyInstance} */ private static void validateProxyInterfaces(ClassLoader loader, List> interfaces, @@ -720,9 +738,9 @@ public class Proxy implements java.io.Serializable { * is in the same module of the package-private interface. * * If all proxy interfaces are public and at least one in a non-exported - * package, then the proxy class is in a dynamic module in a non-exported - * package. Reads edge and qualified exports are added for - * dynamic module to access. + * package, then the proxy class is in a dynamic module in a + * non-exported package. Reads edge and qualified exports are added + * for dynamic module to access. */ private static Module mapToModule(ClassLoader loader, List> interfaces, @@ -741,11 +759,12 @@ public class Proxy implements java.io.Serializable { } } - // all proxy interfaces are public and exported, the proxy class is in unnamed module - // Such proxy class is accessible to any unnamed module and named module that - // can read unnamed module + // all proxy interfaces are public and exported, the proxy class + // is in unnamed module. Such proxy class is accessible to + // any unnamed module and named module that can read unnamed module if (packagePrivateTypes.isEmpty() && modulePrivateTypes.isEmpty()) { - return loader != null ? loader.getUnnamedModule() : BootLoader.getUnnamedModule(); + return loader != null ? loader.getUnnamedModule() + : BootLoader.getUnnamedModule(); } if (packagePrivateTypes.size() > 0) { @@ -767,7 +786,8 @@ public class Proxy implements java.io.Serializable { Module target = null; for (Module m : packagePrivateTypes.values()) { if (getLoader(m) != loader) { - // the specified loader is not the same class loader of the non-public interface + // the specified loader is not the same class loader + // of the non-public interface throw new IllegalArgumentException( "non-public interface is not defined by the given loader"); } @@ -788,8 +808,9 @@ public class Proxy implements java.io.Serializable { return target; } - // all proxy interfaces are public and at least one in a non-exported package - // map to dynamic proxy module and add reads edge and qualified exports, if necessary + // All proxy interfaces are public and at least one in a non-exported + // package. So maps to a dynamic proxy module and add reads edge + // and qualified exports, if necessary Module target = getDynamicModule(loader); // set up proxy class access to proxy interfaces and types @@ -845,8 +866,8 @@ public class Proxy implements java.io.Serializable { private static final AtomicInteger counter = new AtomicInteger(); /* - * Define a dynamic module for the generated proxy classes in a non-exported package - * named com.sun.proxy.$MODULE. + * Define a dynamic module for the generated proxy classes in + * a non-exported package named com.sun.proxy.$MODULE. * * Each class loader will have one dynamic module. */ @@ -855,7 +876,11 @@ public class Proxy implements java.io.Serializable { // create a dynamic module and setup module access String mn = "jdk.proxy" + counter.incrementAndGet(); String pn = PROXY_PACKAGE_PREFIX + "." + mn; - Module m = Modules.defineModule(ld, mn, Collections.singleton(pn)); + ModuleDescriptor descriptor = + ModuleDescriptor.newModule(mn, Set.of(SYNTHETIC)) + .packages(Set.of(pn)) + .build(); + Module m = Modules.defineModule(ld, descriptor, null); Modules.addReads(m, Proxy.class.getModule()); // java.base to create proxy instance Modules.addExports(m, pn, Object.class.getModule()); @@ -869,7 +894,7 @@ public class Proxy implements java.io.Serializable { * that dispatches method invocations to the specified invocation * handler. *

      - * {@code IllegalArgumentException} will be thrown + * {@code IllegalArgumentException} will be thrown * if any of the following restrictions is violated: *