Merge
This commit is contained in:
commit
543fcb3a25
2
.hgtags
2
.hgtags
@ -340,3 +340,5 @@ f242d4332f563648426a1b0fa02d8741beba19ef jdk9-b92
|
||||
5ac6287ec71aafe021cc839d8bc828108d23aaba jdk-9+95
|
||||
139f19d70350238e15e107945cea75082b6380b3 jdk-9+96
|
||||
4edcff1b9a8875eb6380a2165dfec599e8e3f7c0 jdk-9+97
|
||||
d00ad2d9049ac60815f70bff445e95df85648bd2 jdk-9+98
|
||||
f9bcdce2df26678c3fe468130b535c0342c69b89 jdk-9+99
|
||||
|
@ -340,3 +340,5 @@ cf1dc4c035fb84693d4ae5ad818785cb4d1465d1 jdk9-b90
|
||||
12a6fb4f070f8ca8fbca219ab9abf5da8908b317 jdk-9+95
|
||||
5582a79892596169ebddb3e2c2aa44939e4e3f40 jdk-9+96
|
||||
75c3897541ecb52ee16d001ea605b12971df7303 jdk-9+97
|
||||
48987460c7d49a29013963ee44d090194396bb61 jdk-9+98
|
||||
7c0577bea4c65d69c5bef67023a89d2efa4fb2f7 jdk-9+99
|
||||
|
8
README
8
README
@ -6,7 +6,7 @@ README:
|
||||
|
||||
The root repository can be obtained with something like:
|
||||
hg clone http://hg.openjdk.java.net/jdk9/jdk9 openjdk9
|
||||
|
||||
|
||||
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
|
||||
@ -17,7 +17,7 @@ README:
|
||||
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
|
||||
|
||||
@ -28,10 +28,10 @@ Simple Build Instructions:
|
||||
|
||||
2. Configure the build:
|
||||
bash ./configure
|
||||
|
||||
|
||||
3. Build the OpenJDK:
|
||||
make all
|
||||
The resulting JDK image should be found in build/*/images/j2sdk-image
|
||||
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".
|
||||
|
@ -250,9 +250,7 @@ Compilers</a>, <a href="#freetype">freetype</a>, <a href="#cups">cups</a>, and
|
||||
</ul></li>
|
||||
<li><p><strong>Mac OS X</strong></p>
|
||||
|
||||
<p>Install <a href="https://developer.apple.com/xcode/">XCode 4.5.2</a> and also
|
||||
install the "Command line tools" found under the preferences pane
|
||||
"Downloads"</p></li>
|
||||
<p>Install <a href="https://developer.apple.com/xcode/">XCode 6.3</a></p></li>
|
||||
</ul>
|
||||
|
||||
<p><a name="linux"></a></p>
|
||||
@ -279,39 +277,67 @@ OpenJDK.</p>
|
||||
<h5>Studio Compilers</h5>
|
||||
|
||||
<p>At a minimum, the <a href="http://www.oracle.com/
|
||||
technetwork/server-storage/solarisstudio/downloads/index.htm">Studio 12 Update 1 Compilers</a> (containing
|
||||
version 5.10 of the C and C++ compilers) is required, including specific
|
||||
technetwork/server-storage/solarisstudio/downloads/index.htm">Studio 12 Update 4 Compilers</a> (containing
|
||||
version 5.13 of the C and C++ compilers) is required, including specific
|
||||
patches.</p>
|
||||
|
||||
<p>The Solaris SPARC patch list is:</p>
|
||||
<p>The Solaris Studio installation should contain at least these packages:</p>
|
||||
|
||||
<ul>
|
||||
<li>118683-05: SunOS 5.10: Patch for profiling libraries and assembler</li>
|
||||
<li>119963-21: SunOS 5.10: Shared library patch for C++</li>
|
||||
<li>120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch</li>
|
||||
<li>128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler</li>
|
||||
<li>141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C
|
||||
C++ F77 F95</li>
|
||||
<li>141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler</li>
|
||||
<li>142371-01: Sun Studio 12.1 Update 1: Patch for dbx</li>
|
||||
<li>143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling</li>
|
||||
<li>143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C
|
||||
C++ F77 F95</li>
|
||||
<li>142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools</li>
|
||||
</ul>
|
||||
<blockquote>
|
||||
<p><table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><strong>Package</strong></td>
|
||||
<td><strong>Version</strong></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/backend</td>
|
||||
<td>12.4-1.0.6.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/c++</td>
|
||||
<td>12.4-1.0.10.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/cc</td>
|
||||
<td>12.4-1.0.4.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/library/c++-libs</td>
|
||||
<td>12.4-1.0.10.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/library/math-libs</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/library/studio-gccrt</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-common</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-ja</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-legal</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-zhCN</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table></p>
|
||||
</blockquote>
|
||||
|
||||
<p>The Solaris X86 patch list is:</p>
|
||||
|
||||
<ul>
|
||||
<li>119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler</li>
|
||||
<li>119964-21: SunOS 5.10_x86: Shared library patch for C++_x86</li>
|
||||
<li>120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch</li>
|
||||
<li>141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86
|
||||
backend</li>
|
||||
<li>128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler</li>
|
||||
<li>142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler</li>
|
||||
<li>142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools</li>
|
||||
</ul>
|
||||
<p>In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc
|
||||
version.</p>
|
||||
|
||||
<p>Place the <code>bin</code> directory in <code>PATH</code>.</p>
|
||||
|
||||
@ -1144,10 +1170,6 @@ where the resulting bits can be used.</p>
|
||||
<p>With Linux, it was just a matter of picking a stable distribution that is a
|
||||
good representative for Linux in general.</p>
|
||||
|
||||
<p><strong>NOTE: We expect a change here from Fedora 9 to something else, but it has not
|
||||
been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community
|
||||
feedback would be welcome on what a good choice would be here.</strong></p>
|
||||
|
||||
<p>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
|
||||
@ -1176,7 +1198,7 @@ so that they can be dealt with accordingly.</p>
|
||||
<tr>
|
||||
<td>Linux X86 (32-bit) and X64 (64-bit)</td>
|
||||
<td>Oracle Enterprise Linux 6.4</td>
|
||||
<td>gcc 4.8.2 </td>
|
||||
<td>gcc 4.9.2 </td>
|
||||
<td>JDK 8</td>
|
||||
<td>2 or more</td>
|
||||
<td>1 GB</td>
|
||||
@ -1184,8 +1206,8 @@ so that they can be dealt with accordingly.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Solaris SPARCV9 (64-bit)</td>
|
||||
<td>Solaris 10 Update 10</td>
|
||||
<td>Studio 12 Update 3 + patches</td>
|
||||
<td>Solaris 11 Update 1</td>
|
||||
<td>Studio 12 Update 4 + patches</td>
|
||||
<td>JDK 8</td>
|
||||
<td>4 or more</td>
|
||||
<td>4 GB</td>
|
||||
@ -1193,8 +1215,8 @@ so that they can be dealt with accordingly.</p>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Solaris X64 (64-bit)</td>
|
||||
<td>Solaris 10 Update 10</td>
|
||||
<td>Studio 12 Update 3 + patches</td>
|
||||
<td>Solaris 11 Update 1</td>
|
||||
<td>Studio 12 Update 4 + patches</td>
|
||||
<td>JDK 8</td>
|
||||
<td>4 or more</td>
|
||||
<td>4 GB</td>
|
||||
@ -1221,7 +1243,7 @@ so that they can be dealt with accordingly.</p>
|
||||
<tr>
|
||||
<td>Mac OS X X64 (64-bit)</td>
|
||||
<td>Mac OS X 10.9 "Mavericks"</td>
|
||||
<td>XCode 5.1.1 or newer</td>
|
||||
<td>Xcode 6.3 or newer</td>
|
||||
<td>JDK 8</td>
|
||||
<td>2 or more</td>
|
||||
<td>4 GB</td>
|
||||
|
100
README-builds.md
100
README-builds.md
@ -215,9 +215,7 @@ And for specific systems:
|
||||
|
||||
* **Mac OS X**
|
||||
|
||||
Install [XCode 4.5.2](https://developer.apple.com/xcode/) and also
|
||||
install the "Command line tools" found under the preferences pane
|
||||
"Downloads"
|
||||
Install [XCode 6.3](https://developer.apple.com/xcode/)
|
||||
|
||||
<a name="linux"></a>
|
||||
#### Linux
|
||||
@ -239,36 +237,66 @@ OpenJDK.
|
||||
<a name="studio"></a>
|
||||
##### Studio Compilers
|
||||
|
||||
At a minimum, the [Studio 12 Update 1 Compilers](http://www.oracle.com/
|
||||
At a minimum, the [Studio 12 Update 4 Compilers](http://www.oracle.com/
|
||||
technetwork/server-storage/solarisstudio/downloads/index.htm) (containing
|
||||
version 5.10 of the C and C++ compilers) is required, including specific
|
||||
version 5.13 of the C and C++ compilers) is required, including specific
|
||||
patches.
|
||||
|
||||
The Solaris SPARC patch list is:
|
||||
The Solaris Studio installation should contain at least these packages:
|
||||
|
||||
* 118683-05: SunOS 5.10: Patch for profiling libraries and assembler
|
||||
* 119963-21: SunOS 5.10: Shared library patch for C++
|
||||
* 120753-08: SunOS 5.10: Microtasking libraries (libmtsk) patch
|
||||
* 128228-09: Sun Studio 12 Update 1: Patch for Sun C++ Compiler
|
||||
* 141860-03: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C
|
||||
C++ F77 F95
|
||||
* 141861-05: Sun Studio 12 Update 1: Patch for Sun C Compiler
|
||||
* 142371-01: Sun Studio 12.1 Update 1: Patch for dbx
|
||||
* 143384-02: Sun Studio 12 Update 1: Patch for debuginfo handling
|
||||
* 143385-02: Sun Studio 12 Update 1: Patch for Compiler Common patch for Sun C
|
||||
C++ F77 F95
|
||||
* 142369-01: Sun Studio 12.1: Patch for Performance Analyzer Tools
|
||||
> <table border="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td>**Package**</td>
|
||||
<td>**Version**</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/backend</td>
|
||||
<td>12.4-1.0.6.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/c++</td>
|
||||
<td>12.4-1.0.10.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/cc</td>
|
||||
<td>12.4-1.0.4.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/library/c++-libs</td>
|
||||
<td>12.4-1.0.10.0</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/library/math-libs</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/library/studio-gccrt</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-common</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-ja</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-legal</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>developer/solarisstudio-124/studio-zhCN</td>
|
||||
<td>12.4-1.0.0.1</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
The Solaris X86 patch list is:
|
||||
|
||||
* 119961-07: SunOS 5.10_x86, x64, Patch for profiling libraries and assembler
|
||||
* 119964-21: SunOS 5.10_x86: Shared library patch for C++\_x86
|
||||
* 120754-08: SunOS 5.10_x86: Microtasking libraries (libmtsk) patch
|
||||
* 141858-06: Sun Studio 12 Update 1_x86: Sun Compiler Common patch for x86
|
||||
backend
|
||||
* 128229-09: Sun Studio 12 Update 1_x86: Patch for C++ Compiler
|
||||
* 142363-05: Sun Studio 12 Update 1_x86: Patch for C Compiler
|
||||
* 142368-01: Sun Studio 12.1_x86: Patch for Performance Analyzer Tools
|
||||
In particular backend 12.4-1.0.6.0 contains a critical patch for the sparc
|
||||
version.
|
||||
|
||||
Place the `bin` directory in `PATH`.
|
||||
|
||||
@ -1044,10 +1072,6 @@ where the resulting bits can be used.
|
||||
With Linux, it was just a matter of picking a stable distribution that is a
|
||||
good representative for Linux in general.
|
||||
|
||||
**NOTE: We expect a change here from Fedora 9 to something else, but it has not
|
||||
been completely determined yet, possibly Ubuntu 12.04 X64, unbiased community
|
||||
feedback would be welcome on what a good choice would be here.**
|
||||
|
||||
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
|
||||
@ -1075,7 +1099,7 @@ so that they can be dealt with accordingly.
|
||||
<tr>
|
||||
<td>Linux X86 (32-bit) and X64 (64-bit)</td>
|
||||
<td>Oracle Enterprise Linux 6.4</td>
|
||||
<td>gcc 4.8.2 </td>
|
||||
<td>gcc 4.9.2 </td>
|
||||
<td>JDK 8</td>
|
||||
<td>2 or more</td>
|
||||
<td>1 GB</td>
|
||||
@ -1083,8 +1107,8 @@ so that they can be dealt with accordingly.
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Solaris SPARCV9 (64-bit)</td>
|
||||
<td>Solaris 10 Update 10</td>
|
||||
<td>Studio 12 Update 3 + patches</td>
|
||||
<td>Solaris 11 Update 1</td>
|
||||
<td>Studio 12 Update 4 + patches</td>
|
||||
<td>JDK 8</td>
|
||||
<td>4 or more</td>
|
||||
<td>4 GB</td>
|
||||
@ -1092,8 +1116,8 @@ so that they can be dealt with accordingly.
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Solaris X64 (64-bit)</td>
|
||||
<td>Solaris 10 Update 10</td>
|
||||
<td>Studio 12 Update 3 + patches</td>
|
||||
<td>Solaris 11 Update 1</td>
|
||||
<td>Studio 12 Update 4 + patches</td>
|
||||
<td>JDK 8</td>
|
||||
<td>4 or more</td>
|
||||
<td>4 GB</td>
|
||||
@ -1120,7 +1144,7 @@ so that they can be dealt with accordingly.
|
||||
<tr>
|
||||
<td>Mac OS X X64 (64-bit)</td>
|
||||
<td>Mac OS X 10.9 "Mavericks"</td>
|
||||
<td>XCode 5.1.1 or newer</td>
|
||||
<td>Xcode 6.3 or newer</td>
|
||||
<td>JDK 8</td>
|
||||
<td>2 or more</td>
|
||||
<td>4 GB</td>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2012, 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
|
||||
@ -149,6 +149,19 @@ AC_DEFUN_ONCE([BPERF_SETUP_BUILD_JOBS],
|
||||
AC_SUBST(JOBS)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([BPERF_SETUP_TEST_JOBS],
|
||||
[
|
||||
# The number of test jobs will be chosen automatically if TEST_JOBS is 0
|
||||
AC_ARG_WITH(test-jobs, [AS_HELP_STRING([--with-test-jobs],
|
||||
[number of parallel tests jobs to run @<:@based on build jobs@:>@])])
|
||||
if test "x$with_test_jobs" = x; then
|
||||
TEST_JOBS=0
|
||||
else
|
||||
TEST_JOBS=$with_test_jobs
|
||||
fi
|
||||
AC_SUBST(TEST_JOBS)
|
||||
])
|
||||
|
||||
AC_DEFUN([BPERF_SETUP_CCACHE],
|
||||
[
|
||||
AC_ARG_ENABLE([ccache],
|
||||
|
@ -44,6 +44,7 @@ m4_include([boot-jdk.m4])
|
||||
m4_include([build-performance.m4])
|
||||
m4_include([flags.m4])
|
||||
m4_include([help.m4])
|
||||
m4_include([hotspot.m4])
|
||||
m4_include([jdk-options.m4])
|
||||
m4_include([jdk-version.m4])
|
||||
m4_include([libraries.m4])
|
||||
@ -94,9 +95,10 @@ JDKOPT_SETUP_OPEN_OR_CUSTOM
|
||||
|
||||
# These are needed to be able to create a configuration name (and thus the output directory)
|
||||
JDKOPT_SETUP_JDK_VARIANT
|
||||
JDKOPT_SETUP_JVM_INTERPRETER
|
||||
JDKOPT_SETUP_JVM_VARIANTS
|
||||
HOTSPOT_SETUP_JVM_INTERPRETER
|
||||
HOTSPOT_SETUP_JVM_VARIANTS
|
||||
JDKOPT_SETUP_DEBUG_LEVEL
|
||||
HOTSPOT_SETUP_DEBUG_LEVEL
|
||||
|
||||
# With basic setup done, call the custom early hook.
|
||||
CUSTOM_EARLY_HOOK
|
||||
@ -132,6 +134,7 @@ BASIC_SETUP_DEFAULT_MAKE_TARGET
|
||||
|
||||
# We need build & target for this.
|
||||
JDKOPT_SETUP_JDK_OPTIONS
|
||||
HOTSPOT_SETUP_HOTSPOT_OPTIONS
|
||||
JDKVER_SETUP_JDK_VERSION_NUMBERS
|
||||
|
||||
###############################################################################
|
||||
@ -220,7 +223,7 @@ LIB_SETUP_LIBRARIES
|
||||
#
|
||||
###############################################################################
|
||||
|
||||
JDKOPT_SETUP_BUILD_TWEAKS
|
||||
HOTSPOT_SETUP_BUILD_TWEAKS
|
||||
JDKOPT_DETECT_INTREE_EC
|
||||
|
||||
###############################################################################
|
||||
@ -233,6 +236,7 @@ JDKOPT_DETECT_INTREE_EC
|
||||
BPERF_SETUP_BUILD_CORES
|
||||
BPERF_SETUP_BUILD_MEMORY
|
||||
BPERF_SETUP_BUILD_JOBS
|
||||
BPERF_SETUP_TEST_JOBS
|
||||
|
||||
# Setup arguments for the boot jdk (after cores and memory have been setup)
|
||||
BOOTJDK_SETUP_BOOT_JDK_ARGUMENTS
|
||||
|
@ -120,13 +120,17 @@ AC_DEFUN([FLAGS_SETUP_SYSROOT_FLAGS],
|
||||
|
||||
AC_DEFUN_ONCE([FLAGS_SETUP_INIT_FLAGS],
|
||||
[
|
||||
# Option used to tell the compiler whether to create 32- or 64-bit executables
|
||||
# COMPILER_TARGET_BITS_FLAG : option for selecting 32- or 64-bit output
|
||||
# COMPILER_COMMAND_FILE_FLAG : option for passing a command file to the compiler
|
||||
if test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
COMPILER_TARGET_BITS_FLAG="-q"
|
||||
COMPILER_COMMAND_FILE_FLAG="-f"
|
||||
else
|
||||
COMPILER_TARGET_BITS_FLAG="-m"
|
||||
COMPILER_COMMAND_FILE_FLAG="@"
|
||||
fi
|
||||
AC_SUBST(COMPILER_TARGET_BITS_FLAG)
|
||||
AC_SUBST(COMPILER_COMMAND_FILE_FLAG)
|
||||
|
||||
# FIXME: figure out if we should select AR flags depending on OS or toolchain.
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
@ -226,37 +230,38 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
||||
else
|
||||
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
|
||||
fi
|
||||
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
|
||||
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
else
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
PICFLAG=''
|
||||
C_FLAG_REORDER=''
|
||||
CXX_FLAG_REORDER=''
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# Linking is different on MacOSX
|
||||
PICFLAG=''
|
||||
SHARED_LIBRARY_FLAGS="-dynamiclib -compatibility_version 1.0.0 -current_version 1.0.0 $PICFLAG"
|
||||
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker @loader_path/.'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,@loader_path/.'
|
||||
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Xlinker -install_name -Xlinker @rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-install_name,@rpath/[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE=''
|
||||
else
|
||||
# Default works for linux, might work on other platforms as well.
|
||||
PICFLAG='-fPIC'
|
||||
SHARED_LIBRARY_FLAGS='-shared'
|
||||
SET_EXECUTABLE_ORIGIN='-Xlinker -rpath -Xlinker \$$$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Xlinker -z -Xlinker origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Xlinker -soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Xlinker -version-script=[$]1'
|
||||
SET_EXECUTABLE_ORIGIN='-Wl,-rpath,\$$$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="-Wl,-z,origin $SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME='-Wl,-soname=[$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-Wl,-version-script=[$]1'
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
PICFLAG="-KPIC"
|
||||
@ -265,7 +270,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
||||
SHARED_LIBRARY_FLAGS="-G"
|
||||
SET_EXECUTABLE_ORIGIN='-R\$$$$ORIGIN[$]1'
|
||||
SET_SHARED_LIBRARY_ORIGIN="$SET_EXECUTABLE_ORIGIN"
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
SET_SHARED_LIBRARY_NAME='-h [$]1'
|
||||
SET_SHARED_LIBRARY_MAPFILE='-M[$]1'
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
PICFLAG="-qpic=large"
|
||||
@ -280,7 +285,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
||||
PICFLAG=""
|
||||
C_FLAG_REORDER=''
|
||||
CXX_FLAG_REORDER=''
|
||||
SHARED_LIBRARY_FLAGS="-LD"
|
||||
SHARED_LIBRARY_FLAGS="-dll"
|
||||
SET_EXECUTABLE_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_ORIGIN=''
|
||||
SET_SHARED_LIBRARY_NAME=''
|
||||
@ -293,6 +298,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS],
|
||||
AC_SUBST(SET_SHARED_LIBRARY_ORIGIN)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_NAME)
|
||||
AC_SUBST(SET_SHARED_LIBRARY_MAPFILE)
|
||||
AC_SUBST(SHARED_LIBRARY_FLAGS)
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = xsolaris; then
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -D__solaris__"
|
||||
@ -573,6 +579,25 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
|
||||
;;
|
||||
esac
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
if test "x$OPENJDK_TARGET_CPU" = xx86; then
|
||||
# Force compatibility with i586 on 32 bit intel platforms.
|
||||
COMMON_CCXXFLAGS="${COMMON_CCXXFLAGS} -march=i586"
|
||||
fi
|
||||
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -Wall -Wextra -Wno-unused -Wno-unused-parameter -Wformat=2 \
|
||||
-pipe -D_GNU_SOURCE -D_REENTRANT -D_LARGEFILE64_SOURCE"
|
||||
case $OPENJDK_TARGET_CPU_ARCH in
|
||||
ppc )
|
||||
# on ppc we don't prevent gcc to omit frame pointer but do prevent strict aliasing
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
|
||||
;;
|
||||
* )
|
||||
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS_JDK -fno-omit-frame-pointer"
|
||||
CFLAGS_JDK="${CFLAGS_JDK} -fno-strict-aliasing"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
COMMON_CCXXFLAGS_JDK="$COMMON_CCXXFLAGS $COMMON_CCXXFLAGS_JDK -DTRACING -DMACRO_MEMSYS_OPS -DBREAKPTS"
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = xx86; then
|
||||
@ -748,17 +773,17 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
# If this is a --hash-style=gnu system, use --hash-style=both, why?
|
||||
# We have previously set HAS_GNU_HASH if this is the case
|
||||
if test -n "$HAS_GNU_HASH"; then
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker --hash-style=both"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,--hash-style=both"
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
# And since we now know that the linker is gnu, then add -z defs, to forbid
|
||||
# undefined symbols in object files.
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -z -Xlinker defs"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-z,defs"
|
||||
case $DEBUG_LEVEL in
|
||||
release )
|
||||
# tell linker to optimize libraries.
|
||||
# Should this be supplied to the OSS linker as well?
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Xlinker -O1"
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -Wl,-O1"
|
||||
;;
|
||||
slowdebug )
|
||||
if test "x$HAS_LINKER_NOW" = "xtrue"; then
|
||||
@ -785,7 +810,7 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
esac
|
||||
fi
|
||||
elif test "x$TOOLCHAIN_TYPE" = xsolstudio; then
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -z defs -xildoff -ztext"
|
||||
LDFLAGS_JDK="$LDFLAGS_JDK -Wl,-z,defs -xildoff -ztext"
|
||||
LDFLAGS_CXX_JDK="$LDFLAGS_CXX_JDK -norunpath -xnolib"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xxlc; then
|
||||
LDFLAGS_JDK="${LDFLAGS_JDK} -brtl -bnolibpath -bexpall -bernotok"
|
||||
@ -803,17 +828,19 @@ AC_DEFUN_ONCE([FLAGS_SETUP_COMPILER_FLAGS_FOR_JDK],
|
||||
fi
|
||||
LDFLAGS_JDKEXE="${LDFLAGS_JDKEXE} /STACK:$LDFLAGS_STACK_SIZE"
|
||||
elif test "x$OPENJDK_TARGET_OS" = xlinux; then
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Xlinker --allow-shlib-undefined"
|
||||
LDFLAGS_JDKEXE="$LDFLAGS_JDKEXE -Wl,--allow-shlib-undefined"
|
||||
fi
|
||||
|
||||
# Customize LDFLAGS for libs
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDK}"
|
||||
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS}"
|
||||
if test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} -dll -libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
|
||||
-libpath:${OUTPUT_ROOT}/support/modules_libs/java.base"
|
||||
JDKLIB_LIBS=""
|
||||
else
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} ${SHARED_LIBRARY_FLAGS} \
|
||||
LDFLAGS_JDKLIB="${LDFLAGS_JDKLIB} \
|
||||
-L${OUTPUT_ROOT}/support/modules_libs/java.base${OPENJDK_TARGET_CPU_LIBDIR}"
|
||||
|
||||
# On some platforms (mac) the linker warns about non existing -L dirs.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -86,7 +86,11 @@ Then run configure with '--with-freetype-src=<freetype_src>'. This will
|
||||
automatically build the freetype library into '<freetype_src>/lib64' for 64-bit
|
||||
builds or into '<freetype_src>/lib32' for 32-bit builds.
|
||||
Afterwards you can always use '--with-freetype-include=<freetype_src>/include'
|
||||
and '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds."
|
||||
and '--with-freetype-lib=<freetype_src>/lib[32|64]' for other builds.
|
||||
|
||||
Alternatively you can unpack the sources like this to use the default directory:
|
||||
|
||||
tar --one-top-level=$HOME/freetype --strip-components=1 -xzf freetype-2.5.3.tar.gz"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
268
common/autoconf/hotspot.m4
Normal file
268
common/autoconf/hotspot.m4
Normal file
@ -0,0 +1,268 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Check which interpreter of the JVM we want to build.
|
||||
# Currently we have:
|
||||
# template: Template interpreter (the default)
|
||||
# cpp : C++ interpreter
|
||||
AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_INTERPRETER],
|
||||
[
|
||||
AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
|
||||
[JVM interpreter to build (template, cpp) @<:@template@:>@])])
|
||||
|
||||
AC_MSG_CHECKING([which interpreter of the JVM to build])
|
||||
if test "x$with_jvm_interpreter" = x; then
|
||||
JVM_INTERPRETER="template"
|
||||
else
|
||||
JVM_INTERPRETER="$with_jvm_interpreter"
|
||||
fi
|
||||
AC_MSG_RESULT([$JVM_INTERPRETER])
|
||||
|
||||
if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
|
||||
AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
|
||||
fi
|
||||
|
||||
AC_SUBST(JVM_INTERPRETER)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
# Check which variants of the JVM that we want to build.
|
||||
# Currently we have:
|
||||
# server: normal interpreter and a C2 or tiered C1/C2 compiler
|
||||
# client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
|
||||
# minimal1: reduced form of client with optional VM services and features stripped out
|
||||
# zero: no machine code interpreter, no compiler
|
||||
# zeroshark: zero interpreter and shark/llvm compiler backend
|
||||
# core: interpreter only, no compiler (only works on some platforms)
|
||||
AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_VARIANTS],
|
||||
[
|
||||
AC_MSG_CHECKING([which variants of the JVM to build])
|
||||
AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
|
||||
[JVM variants (separated by commas) to build (server, client, minimal1, zero, zeroshark, core) @<:@server@:>@])])
|
||||
|
||||
if test "x$with_jvm_variants" = x; then
|
||||
with_jvm_variants="server"
|
||||
fi
|
||||
|
||||
JVM_VARIANTS=",$with_jvm_variants,"
|
||||
TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
|
||||
|
||||
if test "x$TEST_VARIANTS" != "x,"; then
|
||||
AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, zero, zeroshark, core])
|
||||
fi
|
||||
AC_MSG_RESULT([$with_jvm_variants])
|
||||
|
||||
JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
|
||||
JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
|
||||
JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
|
||||
JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
|
||||
JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
|
||||
JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
|
||||
|
||||
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Replace the commas with AND for use in the build directory name.
|
||||
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
|
||||
COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
|
||||
if test "x$COUNT_VARIANTS" != "x,1"; then
|
||||
BUILDING_MULTIPLE_JVM_VARIANTS=yes
|
||||
else
|
||||
BUILDING_MULTIPLE_JVM_VARIANTS=no
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZERO" = xtrue && test "x$BUILDING_MULTIPLE_JVM_VARIANTS" = xyes; then
|
||||
AC_MSG_ERROR([You cannot build multiple variants with zero.])
|
||||
fi
|
||||
|
||||
AC_SUBST(JVM_VARIANTS)
|
||||
AC_SUBST(JVM_VARIANT_SERVER)
|
||||
AC_SUBST(JVM_VARIANT_CLIENT)
|
||||
AC_SUBST(JVM_VARIANT_MINIMAL1)
|
||||
AC_SUBST(JVM_VARIANT_ZERO)
|
||||
AC_SUBST(JVM_VARIANT_ZEROSHARK)
|
||||
AC_SUBST(JVM_VARIANT_CORE)
|
||||
|
||||
INCLUDE_SA=true
|
||||
if test "x$JVM_VARIANT_ZERO" = xtrue ; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix ; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
AC_SUBST(INCLUDE_SA)
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||
MACOSX_UNIVERSAL="true"
|
||||
fi
|
||||
|
||||
AC_SUBST(MACOSX_UNIVERSAL)
|
||||
])
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Setup legacy vars/targets and new vars to deal with different debug levels.
|
||||
#
|
||||
# release: no debug information, all optimizations, no asserts.
|
||||
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||
#
|
||||
AC_DEFUN_ONCE([HOTSPOT_SETUP_DEBUG_LEVEL],
|
||||
[
|
||||
case $DEBUG_LEVEL in
|
||||
release )
|
||||
VARIANT="OPT"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="false"
|
||||
BUILD_VARIANT_RELEASE=""
|
||||
HOTSPOT_DEBUG_LEVEL="product"
|
||||
HOTSPOT_EXPORT="product"
|
||||
;;
|
||||
fastdebug )
|
||||
VARIANT="DBG"
|
||||
FASTDEBUG="true"
|
||||
DEBUG_CLASSFILES="true"
|
||||
BUILD_VARIANT_RELEASE="-fastdebug"
|
||||
HOTSPOT_DEBUG_LEVEL="fastdebug"
|
||||
HOTSPOT_EXPORT="fastdebug"
|
||||
;;
|
||||
slowdebug )
|
||||
VARIANT="DBG"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="true"
|
||||
BUILD_VARIANT_RELEASE="-debug"
|
||||
HOTSPOT_DEBUG_LEVEL="debug"
|
||||
HOTSPOT_EXPORT="debug"
|
||||
;;
|
||||
optimized )
|
||||
VARIANT="OPT"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="false"
|
||||
BUILD_VARIANT_RELEASE="-optimized"
|
||||
HOTSPOT_DEBUG_LEVEL="optimized"
|
||||
HOTSPOT_EXPORT="optimized"
|
||||
;;
|
||||
esac
|
||||
|
||||
# The debug level 'optimized' is a little special because it is currently only
|
||||
# applicable to the HotSpot build where it means to build a completely
|
||||
# optimized version of the VM without any debugging code (like for the
|
||||
# 'release' debug level which is called 'product' in the HotSpot build) but
|
||||
# with the exception that it can contain additional code which is otherwise
|
||||
# protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
|
||||
# test new and/or experimental features which are not intended for customer
|
||||
# shipment. Because these new features need to be tested and benchmarked in
|
||||
# real world scenarios, we want to build the containing JDK at the 'release'
|
||||
# debug level.
|
||||
if test "x$DEBUG_LEVEL" = xoptimized; then
|
||||
DEBUG_LEVEL="release"
|
||||
fi
|
||||
|
||||
#####
|
||||
# Generate the legacy makefile targets for hotspot.
|
||||
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
||||
# JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
|
||||
# determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
|
||||
# But until then ...
|
||||
HOTSPOT_TARGET=""
|
||||
|
||||
if test "x$JVM_VARIANT_SERVER" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZERO" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_CORE" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
|
||||
fi
|
||||
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
|
||||
|
||||
# On Macosx universal binaries are produced, but they only contain
|
||||
# 64 bit intel. This invalidates control of which jvms are built
|
||||
# from configure, but only server is valid anyway. Fix this
|
||||
# when hotspot makefiles are rewritten.
|
||||
if test "x$MACOSX_UNIVERSAL" = xtrue; then
|
||||
HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
|
||||
fi
|
||||
|
||||
#####
|
||||
|
||||
AC_SUBST(DEBUG_LEVEL)
|
||||
AC_SUBST(VARIANT)
|
||||
AC_SUBST(FASTDEBUG)
|
||||
AC_SUBST(DEBUG_CLASSFILES)
|
||||
AC_SUBST(BUILD_VARIANT_RELEASE)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([HOTSPOT_SETUP_HOTSPOT_OPTIONS],
|
||||
[
|
||||
# Control wether Hotspot runs Queens test after build.
|
||||
AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
|
||||
[run the Queens test after Hotspot build @<:@disabled@:>@])],,
|
||||
[enable_hotspot_test_in_build=no])
|
||||
if test "x$enable_hotspot_test_in_build" = "xyes"; then
|
||||
TEST_IN_BUILD=true
|
||||
else
|
||||
TEST_IN_BUILD=false
|
||||
fi
|
||||
AC_SUBST(TEST_IN_BUILD)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([HOTSPOT_SETUP_BUILD_TWEAKS],
|
||||
[
|
||||
HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
|
||||
AC_SUBST(HOTSPOT_MAKE_ARGS)
|
||||
])
|
@ -23,19 +23,16 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
###############################################################################
|
||||
# Check which variant of the JDK that we want to build.
|
||||
# Currently we have:
|
||||
# normal: standard edition
|
||||
# but the custom make system may add other variants
|
||||
#
|
||||
# Effectively the JDK variant gives a name to a specific set of
|
||||
# modules to compile into the JDK.
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Check which variant of the JDK that we want to build.
|
||||
# Currently we have:
|
||||
# normal: standard edition
|
||||
# but the custom make system may add other variants
|
||||
#
|
||||
# Effectively the JDK variant gives a name to a specific set of
|
||||
# modules to compile into the JDK. In the future, these modules
|
||||
# might even be Jigsaw modules.
|
||||
#
|
||||
AC_MSG_CHECKING([which variant of the JDK to build])
|
||||
AC_ARG_WITH([jdk-variant], [AS_HELP_STRING([--with-jdk-variant],
|
||||
[JDK variant to build (normal) @<:@normal@:>@])])
|
||||
@ -51,138 +48,14 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VARIANT],
|
||||
AC_MSG_RESULT([$JDK_VARIANT])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_INTERPRETER],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Check which interpreter of the JVM we want to build.
|
||||
# Currently we have:
|
||||
# template: Template interpreter (the default)
|
||||
# cpp : C++ interpreter
|
||||
AC_MSG_CHECKING([which interpreter of the JVM to build])
|
||||
AC_ARG_WITH([jvm-interpreter], [AS_HELP_STRING([--with-jvm-interpreter],
|
||||
[JVM interpreter to build (template, cpp) @<:@template@:>@])])
|
||||
|
||||
if test "x$with_jvm_interpreter" = x; then
|
||||
with_jvm_interpreter="template"
|
||||
fi
|
||||
|
||||
JVM_INTERPRETER="$with_jvm_interpreter"
|
||||
|
||||
if test "x$JVM_INTERPRETER" != xtemplate && test "x$JVM_INTERPRETER" != xcpp; then
|
||||
AC_MSG_ERROR([The available JVM interpreters are: template, cpp])
|
||||
fi
|
||||
|
||||
AC_SUBST(JVM_INTERPRETER)
|
||||
|
||||
AC_MSG_RESULT([$with_jvm_interpreter])
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JVM_VARIANTS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Check which variants of the JVM that we want to build.
|
||||
# Currently we have:
|
||||
# server: normal interpreter and a tiered C1/C2 compiler
|
||||
# client: normal interpreter and C1 (no C2 compiler) (only 32-bit platforms)
|
||||
# minimal1: reduced form of client with optional VM services and features stripped out
|
||||
# kernel: kernel footprint JVM that passes the TCK without major performance problems,
|
||||
# ie normal interpreter and C1, only the serial GC, kernel jvmti etc
|
||||
# zero: no machine code interpreter, no compiler
|
||||
# zeroshark: zero interpreter and shark/llvm compiler backend
|
||||
# core: interpreter only, no compiler (only works on some platforms)
|
||||
AC_MSG_CHECKING([which variants of the JVM to build])
|
||||
AC_ARG_WITH([jvm-variants], [AS_HELP_STRING([--with-jvm-variants],
|
||||
[JVM variants (separated by commas) to build (server, client, minimal1, kernel, zero, zeroshark, core) @<:@server@:>@])])
|
||||
|
||||
if test "x$with_jvm_variants" = x; then
|
||||
with_jvm_variants="server"
|
||||
fi
|
||||
|
||||
JVM_VARIANTS=",$with_jvm_variants,"
|
||||
TEST_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,//' -e 's/client,//' -e 's/minimal1,//' -e 's/kernel,//' -e 's/zero,//' -e 's/zeroshark,//' -e 's/core,//'`
|
||||
|
||||
if test "x$TEST_VARIANTS" != "x,"; then
|
||||
AC_MSG_ERROR([The available JVM variants are: server, client, minimal1, kernel, zero, zeroshark, core])
|
||||
fi
|
||||
AC_MSG_RESULT([$with_jvm_variants])
|
||||
|
||||
JVM_VARIANT_SERVER=`$ECHO "$JVM_VARIANTS" | $SED -e '/,server,/!s/.*/false/g' -e '/,server,/s/.*/true/g'`
|
||||
JVM_VARIANT_CLIENT=`$ECHO "$JVM_VARIANTS" | $SED -e '/,client,/!s/.*/false/g' -e '/,client,/s/.*/true/g'`
|
||||
JVM_VARIANT_MINIMAL1=`$ECHO "$JVM_VARIANTS" | $SED -e '/,minimal1,/!s/.*/false/g' -e '/,minimal1,/s/.*/true/g'`
|
||||
JVM_VARIANT_KERNEL=`$ECHO "$JVM_VARIANTS" | $SED -e '/,kernel,/!s/.*/false/g' -e '/,kernel,/s/.*/true/g'`
|
||||
JVM_VARIANT_ZERO=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zero,/!s/.*/false/g' -e '/,zero,/s/.*/true/g'`
|
||||
JVM_VARIANT_ZEROSHARK=`$ECHO "$JVM_VARIANTS" | $SED -e '/,zeroshark,/!s/.*/false/g' -e '/,zeroshark,/s/.*/true/g'`
|
||||
JVM_VARIANT_CORE=`$ECHO "$JVM_VARIANTS" | $SED -e '/,core,/!s/.*/false/g' -e '/,core,/s/.*/true/g'`
|
||||
|
||||
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a client JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
if test "x$JVM_VARIANT_KERNEL" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a kernel JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
AC_MSG_ERROR([You cannot build a minimal JVM for a 64-bit machine.])
|
||||
fi
|
||||
fi
|
||||
|
||||
# Replace the commas with AND for use in the build directory name.
|
||||
ANDED_JVM_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/^,//' -e 's/,$//' -e 's/,/AND/g'`
|
||||
COUNT_VARIANTS=`$ECHO "$JVM_VARIANTS" | $SED -e 's/server,/1/' -e 's/client,/1/' -e 's/minimal1,/1/' -e 's/kernel,/1/' -e 's/zero,/1/' -e 's/zeroshark,/1/' -e 's/core,/1/'`
|
||||
if test "x$COUNT_VARIANTS" != "x,1"; then
|
||||
BUILDING_MULTIPLE_JVM_VARIANTS=yes
|
||||
else
|
||||
BUILDING_MULTIPLE_JVM_VARIANTS=no
|
||||
fi
|
||||
|
||||
AC_SUBST(JVM_VARIANTS)
|
||||
AC_SUBST(JVM_VARIANT_SERVER)
|
||||
AC_SUBST(JVM_VARIANT_CLIENT)
|
||||
AC_SUBST(JVM_VARIANT_MINIMAL1)
|
||||
AC_SUBST(JVM_VARIANT_KERNEL)
|
||||
AC_SUBST(JVM_VARIANT_ZERO)
|
||||
AC_SUBST(JVM_VARIANT_ZEROSHARK)
|
||||
AC_SUBST(JVM_VARIANT_CORE)
|
||||
|
||||
INCLUDE_SA=true
|
||||
if test "x$JVM_VARIANT_ZERO" = xtrue ; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue ; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix ; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
if test "x$OPENJDK_TARGET_CPU" = xaarch64; then
|
||||
INCLUDE_SA=false
|
||||
fi
|
||||
AC_SUBST(INCLUDE_SA)
|
||||
|
||||
if test "x$OPENJDK_TARGET_OS" = "xmacosx"; then
|
||||
MACOSX_UNIVERSAL="true"
|
||||
fi
|
||||
|
||||
AC_SUBST(MACOSX_UNIVERSAL)
|
||||
])
|
||||
|
||||
# Set the debug level
|
||||
# release: no debug information, all optimizations, no asserts.
|
||||
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
[
|
||||
###############################################################################
|
||||
#
|
||||
# Set the debug level
|
||||
# release: no debug information, all optimizations, no asserts.
|
||||
# optimized: no debug information, all optimizations, no asserts, HotSpot target is 'optimized'.
|
||||
# fastdebug: debug information (-g), all optimizations, all asserts
|
||||
# slowdebug: debug information (-g), no optimizations, all asserts
|
||||
#
|
||||
DEBUG_LEVEL="release"
|
||||
AC_MSG_CHECKING([which debug level to use])
|
||||
AC_ARG_ENABLE([debug], [AS_HELP_STRING([--enable-debug],
|
||||
@ -208,118 +81,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_LEVEL],
|
||||
test "x$DEBUG_LEVEL" != xslowdebug; then
|
||||
AC_MSG_ERROR([Allowed debug levels are: release, fastdebug and slowdebug])
|
||||
fi
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Setup legacy vars/targets and new vars to deal with different debug levels.
|
||||
#
|
||||
|
||||
case $DEBUG_LEVEL in
|
||||
release )
|
||||
VARIANT="OPT"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="false"
|
||||
BUILD_VARIANT_RELEASE=""
|
||||
HOTSPOT_DEBUG_LEVEL="product"
|
||||
HOTSPOT_EXPORT="product"
|
||||
;;
|
||||
fastdebug )
|
||||
VARIANT="DBG"
|
||||
FASTDEBUG="true"
|
||||
DEBUG_CLASSFILES="true"
|
||||
BUILD_VARIANT_RELEASE="-fastdebug"
|
||||
HOTSPOT_DEBUG_LEVEL="fastdebug"
|
||||
HOTSPOT_EXPORT="fastdebug"
|
||||
;;
|
||||
slowdebug )
|
||||
VARIANT="DBG"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="true"
|
||||
BUILD_VARIANT_RELEASE="-debug"
|
||||
HOTSPOT_DEBUG_LEVEL="debug"
|
||||
HOTSPOT_EXPORT="debug"
|
||||
;;
|
||||
optimized )
|
||||
VARIANT="OPT"
|
||||
FASTDEBUG="false"
|
||||
DEBUG_CLASSFILES="false"
|
||||
BUILD_VARIANT_RELEASE="-optimized"
|
||||
HOTSPOT_DEBUG_LEVEL="optimized"
|
||||
HOTSPOT_EXPORT="optimized"
|
||||
;;
|
||||
esac
|
||||
|
||||
# The debug level 'optimized' is a little special because it is currently only
|
||||
# applicable to the HotSpot build where it means to build a completely
|
||||
# optimized version of the VM without any debugging code (like for the
|
||||
# 'release' debug level which is called 'product' in the HotSpot build) but
|
||||
# with the exception that it can contain additional code which is otherwise
|
||||
# protected by '#ifndef PRODUCT' macros. These 'optimized' builds are used to
|
||||
# test new and/or experimental features which are not intended for customer
|
||||
# shipment. Because these new features need to be tested and benchmarked in
|
||||
# real world scenarios, we want to build the containing JDK at the 'release'
|
||||
# debug level.
|
||||
if test "x$DEBUG_LEVEL" = xoptimized; then
|
||||
DEBUG_LEVEL="release"
|
||||
fi
|
||||
|
||||
#####
|
||||
# Generate the legacy makefile targets for hotspot.
|
||||
# The hotspot api for selecting the build artifacts, really, needs to be improved.
|
||||
# JDK-7195896 will fix this on the hotspot side by using the JVM_VARIANT_* variables to
|
||||
# determine what needs to be built. All we will need to set here is all_product, all_fastdebug etc
|
||||
# But until then ...
|
||||
HOTSPOT_TARGET=""
|
||||
|
||||
if test "x$JVM_VARIANT_SERVER" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL} "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_CLIENT" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}1 "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_MINIMAL1" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}minimal1 "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_KERNEL" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}kernel "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZERO" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}zero "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_ZEROSHARK" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}shark "
|
||||
fi
|
||||
|
||||
if test "x$JVM_VARIANT_CORE" = xtrue; then
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET${HOTSPOT_DEBUG_LEVEL}core "
|
||||
fi
|
||||
|
||||
HOTSPOT_TARGET="$HOTSPOT_TARGET docs export_$HOTSPOT_EXPORT"
|
||||
|
||||
# On Macosx universal binaries are produced, but they only contain
|
||||
# 64 bit intel. This invalidates control of which jvms are built
|
||||
# from configure, but only server is valid anyway. Fix this
|
||||
# when hotspot makefiles are rewritten.
|
||||
if test "x$MACOSX_UNIVERSAL" = xtrue; then
|
||||
HOTSPOT_TARGET=universal_${HOTSPOT_EXPORT}
|
||||
fi
|
||||
|
||||
#####
|
||||
|
||||
AC_SUBST(DEBUG_LEVEL)
|
||||
AC_SUBST(VARIANT)
|
||||
AC_SUBST(FASTDEBUG)
|
||||
AC_SUBST(DEBUG_CLASSFILES)
|
||||
AC_SUBST(BUILD_VARIANT_RELEASE)
|
||||
])
|
||||
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we build only OpenJDK even if closed sources are present?
|
||||
@ -367,12 +130,8 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_OPEN_OR_CUSTOM],
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
[
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Should we build a JDK/JVM with headful support (ie a graphical ui)?
|
||||
# We always build headless support.
|
||||
#
|
||||
AC_MSG_CHECKING([headful support])
|
||||
AC_ARG_ENABLE([headful], [AS_HELP_STRING([--disable-headful],
|
||||
[disable building headful support (graphical UI support) @<:@enabled@:>@])],
|
||||
@ -398,21 +157,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
AC_SUBST(SUPPORT_HEADFUL)
|
||||
AC_SUBST(BUILD_HEADLESS)
|
||||
|
||||
# Control wether Hotspot runs Queens test after build.
|
||||
AC_ARG_ENABLE([hotspot-test-in-build], [AS_HELP_STRING([--enable-hotspot-test-in-build],
|
||||
[run the Queens test after Hotspot build @<:@disabled@:>@])],,
|
||||
[enable_hotspot_test_in_build=no])
|
||||
if test "x$enable_hotspot_test_in_build" = "xyes"; then
|
||||
TEST_IN_BUILD=true
|
||||
else
|
||||
TEST_IN_BUILD=false
|
||||
fi
|
||||
AC_SUBST(TEST_IN_BUILD)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Choose cacerts source file
|
||||
#
|
||||
AC_ARG_WITH(cacerts-file, [AS_HELP_STRING([--with-cacerts-file],
|
||||
[specify alternative cacerts file])])
|
||||
if test "x$with_cacerts_file" != x; then
|
||||
@ -420,10 +165,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
fi
|
||||
AC_SUBST(CACERTS_FILE)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Enable or disable unlimited crypto
|
||||
#
|
||||
AC_ARG_ENABLE(unlimited-crypto, [AS_HELP_STRING([--enable-unlimited-crypto],
|
||||
[Enable unlimited crypto policy @<:@disabled@:>@])],,
|
||||
[enable_unlimited_crypto=no])
|
||||
@ -434,10 +176,7 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
fi
|
||||
AC_SUBST(UNLIMITED_CRYPTO)
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Compress jars
|
||||
#
|
||||
COMPRESS_JARS=false
|
||||
|
||||
AC_SUBST(COMPRESS_JARS)
|
||||
@ -455,19 +194,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS],
|
||||
AC_SUBST(COPYRIGHT_YEAR)
|
||||
])
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_BUILD_TWEAKS],
|
||||
[
|
||||
HOTSPOT_MAKE_ARGS="$HOTSPOT_TARGET"
|
||||
AC_SUBST(HOTSPOT_MAKE_ARGS)
|
||||
|
||||
# The name of the Service Agent jar.
|
||||
SALIB_NAME="${LIBRARY_PREFIX}saproc${SHARED_LIBRARY_SUFFIX}"
|
||||
if test "x$OPENJDK_TARGET_OS" = "xwindows"; then
|
||||
SALIB_NAME="${LIBRARY_PREFIX}sawindbg${SHARED_LIBRARY_SUFFIX}"
|
||||
fi
|
||||
AC_SUBST(SALIB_NAME)
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Enable or disable the elliptic curve crypto implementation
|
||||
@ -487,7 +213,6 @@ AC_DEFUN_ONCE([JDKOPT_DETECT_INTREE_EC],
|
||||
AC_SUBST(ENABLE_INTREE_EC)
|
||||
])
|
||||
|
||||
|
||||
AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
[
|
||||
#
|
||||
@ -498,8 +223,21 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_DEBUG_SYMBOLS],
|
||||
AC_ARG_WITH([native-debug-symbols],
|
||||
[AS_HELP_STRING([--with-native-debug-symbols],
|
||||
[set the native debug symbol configuration (none, internal, external, zipped) @<:@zipped@:>@])],
|
||||
[],
|
||||
[with_native_debug_symbols="zipped"])
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
if test "x$withval" = xexternal || test "x$withval" = xzipped; then
|
||||
AC_MSG_ERROR([AIX only supports the parameters 'none' and 'internal' for --with-native-debug-symbols])
|
||||
fi
|
||||
fi
|
||||
],
|
||||
[
|
||||
if test "x$OPENJDK_TARGET_OS" = xaix; then
|
||||
# AIX doesn't support 'zipped' so use 'internal' as default
|
||||
with_native_debug_symbols="internal"
|
||||
else
|
||||
with_native_debug_symbols="zipped"
|
||||
fi
|
||||
])
|
||||
NATIVE_DEBUG_SYMBOLS=$with_native_debug_symbols
|
||||
AC_MSG_RESULT([$NATIVE_DEBUG_SYMBOLS])
|
||||
|
||||
@ -632,5 +370,3 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_STATIC_BUILD],
|
||||
|
||||
AC_SUBST(STATIC_BUILD)
|
||||
])
|
||||
|
||||
|
||||
|
@ -321,6 +321,25 @@ AC_DEFUN_ONCE([LIB_SETUP_FREETYPE],
|
||||
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
fi
|
||||
if test "x$FOUND_FREETYPE" != xyes; then
|
||||
FREETYPE_BASE_DIR="$HOME/freetype"
|
||||
BASIC_WINDOWS_REWRITE_AS_UNIX_PATH(FREETYPE_BASE_DIR)
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib64], [well-known location])
|
||||
else
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
|
||||
fi
|
||||
if test "x$FOUND_FREETYPE" != xyes && test -d $FREETYPE_BASE_DIR \
|
||||
&& test -s "$FREETYPE_BASE_DIR/builds/windows/vc2010/freetype.vcxproj" && test "x$MSBUILD" != x; then
|
||||
# Source is available, as a last resort try to build freetype in default location
|
||||
LIB_BUILD_FREETYPE($FREETYPE_BASE_DIR)
|
||||
if test "x$OPENJDK_TARGET_CPU_BITS" = x64; then
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib64], [well-known location])
|
||||
else
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib32], [well-known location])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
FREETYPE_BASE_DIR="$SYSROOT/usr"
|
||||
LIB_CHECK_POTENTIAL_FREETYPE([$FREETYPE_BASE_DIR/include], [$FREETYPE_BASE_DIR/lib], [well-known location])
|
||||
|
@ -204,13 +204,12 @@ SUPPORT_HEADLESS:=@SUPPORT_HEADLESS@
|
||||
|
||||
# These are the libjvms that we want to build.
|
||||
# The java launcher uses the default.
|
||||
# The others can be selected by specifying -client -server -minimal1 -kernel -zero or -zeroshark
|
||||
# The others can be selected by specifying -client -server -minimal1 -zero or -zeroshark
|
||||
# on the java launcher command line.
|
||||
JVM_VARIANTS:=@JVM_VARIANTS@
|
||||
JVM_VARIANT_SERVER:=@JVM_VARIANT_SERVER@
|
||||
JVM_VARIANT_CLIENT:=@JVM_VARIANT_CLIENT@
|
||||
JVM_VARIANT_MINIMAL1:=@JVM_VARIANT_MINIMAL1@
|
||||
JVM_VARIANT_KERNEL:=@JVM_VARIANT_KERNEL@
|
||||
JVM_VARIANT_ZERO:=@JVM_VARIANT_ZERO@
|
||||
JVM_VARIANT_ZEROSHARK:=@JVM_VARIANT_ZEROSHARK@
|
||||
JVM_VARIANT_CORE:=@JVM_VARIANT_CORE@
|
||||
@ -270,6 +269,7 @@ SJAVAC_SERVER_DIR=$(MAKESUPPORT_OUTPUTDIR)/javacservers
|
||||
|
||||
# Number of parallel jobs to use for compilation
|
||||
JOBS?=@JOBS@
|
||||
TEST_JOBS?=@TEST_JOBS@
|
||||
|
||||
# Default make target
|
||||
DEFAULT_MAKE_TARGET:=@DEFAULT_MAKE_TARGET@
|
||||
@ -280,6 +280,8 @@ FREETYPE_BUNDLE_LIB_PATH=@FREETYPE_BUNDLE_LIB_PATH@
|
||||
CUPS_CFLAGS:=@CUPS_CFLAGS@
|
||||
ALSA_LIBS:=@ALSA_LIBS@
|
||||
ALSA_CFLAGS:=@ALSA_CFLAGS@
|
||||
LIBFFI_LIBS:=@LIBFFI_LIBS@
|
||||
LIBFFI_CFLAGS:=@LIBFFI_CFLAGS@
|
||||
|
||||
PACKAGE_PATH=@PACKAGE_PATH@
|
||||
|
||||
@ -300,11 +302,15 @@ MACOSX_VERSION_MIN=@MACOSX_VERSION_MIN@
|
||||
|
||||
# Toolchain type: gcc, clang, solstudio, lxc, microsoft...
|
||||
TOOLCHAIN_TYPE:=@TOOLCHAIN_TYPE@
|
||||
TOOLCHAIN_VERSION := @TOOLCHAIN_VERSION@
|
||||
|
||||
# Option used to tell the compiler whether to create 32- or 64-bit executables
|
||||
COMPILER_TARGET_BITS_FLAG:=@COMPILER_TARGET_BITS_FLAG@
|
||||
COMPILER_SUPPORTS_TARGET_BITS_FLAG=@COMPILER_SUPPORTS_TARGET_BITS_FLAG@
|
||||
|
||||
# Option used to pass a command file to the compiler
|
||||
COMPILER_COMMAND_FILE_FLAG:=@COMPILER_COMMAND_FILE_FLAG@
|
||||
|
||||
CC_OUT_OPTION:=@CC_OUT_OPTION@
|
||||
EXE_OUT_OPTION:=@EXE_OUT_OPTION@
|
||||
LD_OUT_OPTION:=@LD_OUT_OPTION@
|
||||
@ -388,6 +394,7 @@ LDFLAGS_TESTEXE:=@LDFLAGS_TESTEXE@
|
||||
BUILD_CC:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CC@
|
||||
BUILD_CXX:=@FIXPATH@ @BUILD_ICECC@ @BUILD_CXX@
|
||||
BUILD_LD:=@FIXPATH@ @BUILD_LD@
|
||||
BUILD_LDCXX:=@FIXPATH@ @BUILD_LDCXX@
|
||||
BUILD_AS:=@FIXPATH@ @BUILD_AS@
|
||||
BUILD_AR:=@FIXPATH@ @BUILD_AR@
|
||||
BUILD_NM:=@FIXPATH@ @BUILD_NM@
|
||||
@ -433,6 +440,8 @@ COMPRESS_JARS=@COMPRESS_JARS@
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_NAME=@SET_SHARED_LIBRARY_NAME@
|
||||
|
||||
SHARED_LIBRARY_FLAGS=@SHARED_LIBRARY_FLAGS@
|
||||
|
||||
# Set origin using the linker, ie use the relative path to the dependent library to find the dependees.
|
||||
# (Note absence of := assignment, because we do not want to evaluate the macro body here)
|
||||
SET_SHARED_LIBRARY_ORIGIN=@SET_SHARED_LIBRARY_ORIGIN@
|
||||
@ -650,9 +659,6 @@ PNG_CFLAGS:=@PNG_CFLAGS@
|
||||
# Misc
|
||||
#
|
||||
|
||||
# Name of Service Agent library
|
||||
SALIB_NAME=@SALIB_NAME@
|
||||
|
||||
INCLUDE_SA=@INCLUDE_SA@
|
||||
|
||||
OS_VERSION_MAJOR:=@OS_VERSION_MAJOR@
|
||||
|
@ -216,7 +216,11 @@ AC_DEFUN_ONCE([TOOLCHAIN_PRE_DETECTION],
|
||||
# The microsoft toolchain also requires INCLUDE and LIB to be set.
|
||||
export INCLUDE="$VS_INCLUDE"
|
||||
export LIB="$VS_LIB"
|
||||
else
|
||||
# Currently we do not define this for other toolchains. This might change as the need arise.
|
||||
TOOLCHAIN_VERSION=
|
||||
fi
|
||||
AC_SUBST(TOOLCHAIN_VERSION)
|
||||
|
||||
# For solaris we really need solaris tools, and not the GNU equivalent.
|
||||
# The build tools on Solaris reside in /usr/ccs (C Compilation System),
|
||||
@ -731,6 +735,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
BUILD_AS="$BUILD_CC -c"
|
||||
# Just like for the target compiler, use the compiler as linker
|
||||
BUILD_LD="$BUILD_CC"
|
||||
BUILD_LDCXX="$BUILD_CXX"
|
||||
|
||||
PATH="$OLDPATH"
|
||||
else
|
||||
@ -739,6 +744,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
BUILD_CC="$CC"
|
||||
BUILD_CXX="$CXX"
|
||||
BUILD_LD="$LD"
|
||||
BUILD_LDCXX="$LDCXX"
|
||||
BUILD_NM="$NM"
|
||||
BUILD_AS="$AS"
|
||||
BUILD_SYSROOT_CFLAGS="$SYSROOT_CFLAGS"
|
||||
@ -749,6 +755,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_BUILD_COMPILERS],
|
||||
AC_SUBST(BUILD_CC)
|
||||
AC_SUBST(BUILD_CXX)
|
||||
AC_SUBST(BUILD_LD)
|
||||
AC_SUBST(BUILD_LDCXX)
|
||||
AC_SUBST(BUILD_NM)
|
||||
AC_SUBST(BUILD_AS)
|
||||
AC_SUBST(BUILD_SYSROOT_CFLAGS)
|
||||
@ -822,13 +829,13 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
[HAS_CFLAG_OPTIMIZE_DEBUG=false])
|
||||
|
||||
# "-z relro" supported in GNU binutils 2.17 and later
|
||||
LINKER_RELRO_FLAG="-Xlinker -z -Xlinker relro"
|
||||
LINKER_RELRO_FLAG="-Wl,-z,relro"
|
||||
FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_RELRO_FLAG],
|
||||
[HAS_LINKER_RELRO=true],
|
||||
[HAS_LINKER_RELRO=false])
|
||||
|
||||
# "-z now" supported in GNU binutils 2.11 and later
|
||||
LINKER_NOW_FLAG="-Xlinker -z -Xlinker now"
|
||||
LINKER_NOW_FLAG="-Wl,-z,now"
|
||||
FLAGS_LINKER_CHECK_ARGUMENTS([$LINKER_NOW_FLAG],
|
||||
[HAS_LINKER_NOW=true],
|
||||
[HAS_LINKER_NOW=false])
|
||||
@ -841,7 +848,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_MISC_CHECKS],
|
||||
AC_MSG_CHECKING([for broken SuSE 'ld' which only understands anonymous version tags in executables])
|
||||
$ECHO "SUNWprivate_1.1 { local: *; };" > version-script.map
|
||||
$ECHO "int main() { }" > main.c
|
||||
if $CXX -Xlinker -version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
|
||||
if $CXX -Wl,-version-script=version-script.map main.c 2>&AS_MESSAGE_LOG_FD >&AS_MESSAGE_LOG_FD; then
|
||||
AC_MSG_RESULT(no)
|
||||
USING_BROKEN_SUSE_LD=no
|
||||
else
|
||||
|
@ -37,13 +37,18 @@ fi
|
||||
if [ "$OPENJDK_TARGET_OS" = "macosx" ]; then
|
||||
FULLDUMP_CMD="$OTOOL -v -V -h -X -d"
|
||||
LDD_CMD="$OTOOL -L"
|
||||
DIS_CMD="$OTOOL -v -t"
|
||||
DIS_CMD="$OTOOL -v -V -t"
|
||||
STAT_PRINT_SIZE="-f %z"
|
||||
elif [ "$OPENJDK_TARGET_OS" = "windows" ]; then
|
||||
FULLDUMP_CMD="$DUMPBIN -all"
|
||||
LDD_CMD="$DUMPBIN -dependants | $GREP .dll"
|
||||
DIS_CMD="$DUMPBIN -disasm:nobytes"
|
||||
STAT_PRINT_SIZE="-c %s"
|
||||
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
|
||||
FULLDUMP_CMD="dump -h -r -t -n -X64"
|
||||
LDD_CMD="$LDD"
|
||||
DIS_CMD="$OBJDUMP -d"
|
||||
STAT_PRINT_SIZE="-c %s"
|
||||
else
|
||||
FULLDUMP_CMD="$READELF -a"
|
||||
LDD_CMD="$LDD"
|
||||
@ -730,6 +735,9 @@ compare_bin_file() {
|
||||
# Some symbols get seemingly random 15 character prefixes. Filter them out.
|
||||
$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
|
||||
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SED 's/^\([a-zA-Z] [\.\$]\)[a-zA-Z0-9_\$]\{15,15\}\./\1./g' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
|
||||
elif [ "$OPENJDK_TARGET_OS" = "aix" ]; then
|
||||
$OBJDUMP -T $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
|
||||
$OBJDUMP -T $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
|
||||
else
|
||||
$NM -a $ORIG_OTHER_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.other
|
||||
$NM -a $ORIG_THIS_FILE 2> /dev/null | $GREP -v $NAME | $AWK '{print $2, $3, $4, $5}' | $SYM_SORT_CMD > $WORK_FILE_BASE.symbols.this
|
||||
@ -796,14 +804,21 @@ compare_bin_file() {
|
||||
DEP_MSG=" - "
|
||||
fi
|
||||
|
||||
# Some linux compilers add a unique Build ID
|
||||
if [ "$OPENJDK_TARGET_OS" = "linux" ]; then
|
||||
BUILD_ID_FILTER="$SED -r 's/(Build ID:) [0-9a-f]{40}/\1/'"
|
||||
else
|
||||
BUILD_ID_FILTER="$CAT"
|
||||
fi
|
||||
|
||||
# Compare fulldump output
|
||||
if [ -n "$FULLDUMP_CMD" ] && [ -z "$SKIP_FULLDUMP_DIFF" ]; then
|
||||
if [ -z "$FULLDUMP_DIFF_FILTER" ]; then
|
||||
FULLDUMP_DIFF_FILTER="$CAT"
|
||||
fi
|
||||
$FULLDUMP_CMD $OTHER_FILE | eval "$FULLDUMP_DIFF_FILTER" \
|
||||
$FULLDUMP_CMD $OTHER_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \
|
||||
> $WORK_FILE_BASE.fulldump.other 2>&1
|
||||
$FULLDUMP_CMD $THIS_FILE | eval "$FULLDUMP_DIFF_FILTER" \
|
||||
$FULLDUMP_CMD $THIS_FILE | eval "$BUILD_ID_FILTER" | eval "$FULLDUMP_DIFF_FILTER" \
|
||||
> $WORK_FILE_BASE.fulldump.this 2>&1
|
||||
|
||||
LC_ALL=C $DIFF $WORK_FILE_BASE.fulldump.other $WORK_FILE_BASE.fulldump.this \
|
||||
|
@ -57,14 +57,18 @@ ACCEPTED_BIN_DIFF="
|
||||
./demo/jvmti/mtrace/lib/libmtrace.so
|
||||
./demo/jvmti/versionCheck/lib/libversionCheck.so
|
||||
./demo/jvmti/waiters/lib/libwaiters.so
|
||||
./lib/i386/client/libjsig.so
|
||||
./lib/i386/client/libjvm.so
|
||||
./lib/i386/libattach.so
|
||||
./lib/i386/libdt_socket.so
|
||||
./lib/i386/libinstrument.so
|
||||
./lib/i386/libjsdt.so
|
||||
./lib/i386/libjsig.so
|
||||
./lib/i386/libmanagement.so
|
||||
./lib/i386/libnet.so
|
||||
./lib/i386/libnpt.so
|
||||
./lib/i386/libverify.so
|
||||
./lib/i386/server/libjsig.so
|
||||
./lib/i386/server/libjvm.so
|
||||
./bin/appletviewer
|
||||
./bin/idlj
|
||||
@ -105,6 +109,17 @@ ACCEPTED_BIN_DIFF="
|
||||
./bin/xjc
|
||||
"
|
||||
|
||||
# Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
|
||||
# server jvm with old hotspot build.
|
||||
KNOWN_FULLDUMP_DIFF="
|
||||
./lib/i386/server/libjvm.so
|
||||
"
|
||||
KNOWN_DIS_DIFF="
|
||||
./lib/i386/server/libjvm.so
|
||||
"
|
||||
DIS_DIFF_FILTER="$SED \
|
||||
-e 's/\(:\t\)\([0-9a-z]\{2,2\} \)\{1,7\}/\1<hex>/g' \
|
||||
-e 's/0x[0-9a-z]\{2,9\}/<hex>/g'"
|
||||
fi
|
||||
|
||||
if [ "$OPENJDK_TARGET_OS" = "linux" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
|
||||
@ -135,6 +150,7 @@ ACCEPTED_BIN_DIFF="
|
||||
./lib/amd64/libjsdt.so
|
||||
./lib/amd64/libjsig.so
|
||||
./lib/amd64/libmanagement.so
|
||||
./lib/amd64/libnet.so
|
||||
./lib/amd64/libnpt.so
|
||||
./lib/amd64/libsaproc.so
|
||||
./lib/amd64/libverify.so
|
||||
@ -179,6 +195,12 @@ ACCEPTED_BIN_DIFF="
|
||||
./bin/xjc
|
||||
"
|
||||
|
||||
# Issue with __FILE__ usage in generated header files prevent clean fulldump diff of
|
||||
# server jvm with old hotspot build.
|
||||
KNOWN_FULLDUMP_DIFF="
|
||||
./lib/amd64/server/libjvm.so
|
||||
"
|
||||
|
||||
fi
|
||||
|
||||
if [ "$OPENJDK_TARGET_OS" = "solaris" ] && [ "$OPENJDK_TARGET_CPU" = "x86_64" ]; then
|
||||
@ -299,14 +321,13 @@ SKIP_FULLDUMP_DIFF="true"
|
||||
|
||||
# Filter random C++ symbol strings.
|
||||
# Some numbers differ randomly.
|
||||
# Can't use space in these expressions as the shell will mess with them.
|
||||
DIS_DIFF_FILTER="$SED \
|
||||
-e 's/\.[a-zA-Z0-9_\$]\{15,15\}/<SYM>/g' \
|
||||
-e 's/\([0-9a-f][0-9a-f].\)\{2,8\}[0-9a-f][0-9a-f]/<NUMS>/g' \
|
||||
-e 's/\(0x\)[0-9a-f]*\([,(>]\)/\1<HEX>\2/g' \
|
||||
-e 's/\(0x\)[0-9a-f]*$/\1<HEX>/g' \
|
||||
-e 's/\(\#.\)[0-9a-f]*\(.<\)/\1<HEX>\2/g' \
|
||||
-e 's/[\.A-Za-z0-9%]\{16,16\}$/<BIN>/g'"
|
||||
-e 's/\.[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
|
||||
-e 's/\(\# \)[0-9a-f]*\( <\)/\1<HEX>\2/g' \
|
||||
-e 's/0x[0-9a-f]*$/<HEX>/g' \
|
||||
-e 's/0x[0-9a-f]*\([,(>]\)/<HEX>\1/g' \
|
||||
-e 's/: [0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/: <NUMS>/g' \
|
||||
-e 's/ [\.A-Za-z0-9%@]\{16\}$/ <BIN>/g'"
|
||||
|
||||
fi
|
||||
|
||||
@ -425,18 +446,23 @@ ACCEPTED_SMALL_SIZE_DIFF="
|
||||
./bin/xjc
|
||||
"
|
||||
|
||||
# Filter random C++ symbol strings.
|
||||
# Some numbers differ randomly.
|
||||
DIS_DIFF_FILTER="$SED \
|
||||
-e 's/\$[a-zA-Z0-9_\$]\{15,15\}/<SYM>/g' \
|
||||
-e 's/[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f].[0-9a-f][0-9a-f]/<NUMS>/g' \
|
||||
-e 's/\(%g1,.0x\)[0-9a-f]*\(,.%g1\)/\1<HEX>\2/g' \
|
||||
-e 's/\(!.\)[0-9a-f]*\(.<SUNWprivate_1.1+0x\)[0-9a-f]*/\1<NUM>\2<HEX>/g' \
|
||||
-e 's/\!.[0-9a-f]\{1,4\} <_DYNAMIC+0x[0-9a-f]\{1,4\}>/<DYNAMIC>/g'"
|
||||
-e 's/\$[a-zA-Z0-9_\$]\{15\}/<SYM>/g' \
|
||||
-e 's/: [0-9a-f][0-9a-f]\( [0-9a-f][0-9a-f]\)\{2,10\}/: <NUMS>/g' \
|
||||
-e 's/, [0-9a-fx\-]\{1,8\}/, <CONST>/g' \
|
||||
-e 's/call [0-9a-f]\{7\}/call <ADDR>/g' \
|
||||
-e 's/0x[0-9a-f]\{1,8\}/<HEX>/g' \
|
||||
-e 's/\! [0-9a-f]\{1,8\} /! <ADDR> /g'"
|
||||
|
||||
# Some xor instructions end up with different args in the lib but not in the object files.
|
||||
ACCEPTED_DIS_DIFF="
|
||||
./demo/jvmti/waiters/lib/libwaiters.so
|
||||
# libjvm.so
|
||||
# __FILE__ macro usage in debug.hpp causes differences between old and new
|
||||
# hotspot builds in ad_sparc.o and ad_sparc_clone.o. The .o files compare
|
||||
# equal when stripped, but at link time differences appear. Removing
|
||||
# __FILE__ from ShouldNotCallThis() and ShouldNotReachHere() removes
|
||||
# the differences.
|
||||
KNOWN_DIS_DIFF="
|
||||
./lib/sparcv9/server/libjvm.so
|
||||
"
|
||||
|
||||
SKIP_FULLDUMP_DIFF="true"
|
||||
@ -634,11 +660,12 @@ ACCEPTED_BIN_DIFF="
|
||||
SORT_SYMBOLS="
|
||||
./Contents/Home/lib/libsaproc.dylib
|
||||
./lib/libsaproc.dylib
|
||||
./lib/libjsig.dylib
|
||||
"
|
||||
|
||||
ACCEPTED_SMALL_SIZE_DIFF="$ACCEPTED_BIN_DIFF"
|
||||
|
||||
DIS_DIFF_FILTER="$SED \
|
||||
-e 's/0x[0-9a-f]\{4,16\}/<HEXSTR>/g'"
|
||||
DIS_DIFF_FILTER="LANG=C $SED \
|
||||
-e 's/0x[0-9a-f]\{3,16\}/<HEXSTR>/g' -e 's/^[0-9a-f]\{12,20\}/<ADDR>/'"
|
||||
|
||||
fi
|
||||
|
@ -32,7 +32,7 @@ installed_jib_script=${mydir}/../../.jib/jib
|
||||
install_data=${mydir}/../../.jib/.data
|
||||
|
||||
setup_url() {
|
||||
if [ -f "~/.config/jib/jib.conf" ]; then
|
||||
if [ -f ~/.config/jib/jib.conf ]; then
|
||||
source ~/.config/jib/jib.conf
|
||||
fi
|
||||
|
||||
@ -50,6 +50,9 @@ setup_url() {
|
||||
if [ -n "${JIB_SERVER}" ]; then
|
||||
jib_server="${JIB_SERVER}"
|
||||
fi
|
||||
if [ -n "${JIB_SERVER_MIRRORS}" ]; then
|
||||
jib_server_mirrors="${JIB_SERVER_MIRRORS}"
|
||||
fi
|
||||
if [ -n "${JIB_REPOSITORY}" ]; then
|
||||
jib_repository="${JIB_REPOSITORY}"
|
||||
fi
|
||||
@ -70,8 +73,9 @@ setup_url() {
|
||||
jib_url="${JIB_URL}"
|
||||
data_string="${jib_url}"
|
||||
else
|
||||
data_string="${jib_repository}/${jib_organization}/${jib_module}/${jib_revision}/${jib_module}-${jib_revision}.${jib_ext}"
|
||||
jib_url="${jib_server}/${data_string}"
|
||||
jib_path="${jib_repository}/${jib_organization}/${jib_module}/${jib_revision}/${jib_module}-${jib_revision}.${jib_ext}"
|
||||
data_string="${jib_path}"
|
||||
jib_url="${jib_server}/${jib_path}"
|
||||
fi
|
||||
}
|
||||
|
||||
@ -104,7 +108,25 @@ install_jib() {
|
||||
${getcmd} ${jib_url} > "${installed_jib_script}.gz"
|
||||
if [ ! -s "${installed_jib_script}.gz" ]; then
|
||||
echo "Failed to download ${jib_url}"
|
||||
exit 1
|
||||
if [ -n "${jib_path}" -a -n "${jib_server_mirrors}" ]; then
|
||||
OLD_IFS="${IFS}"
|
||||
IFS=" ,"
|
||||
for mirror in ${jib_server_mirrors}; do
|
||||
echo "Trying mirror ${mirror}"
|
||||
jib_url="${mirror}/${jib_path}"
|
||||
${getcmd} ${jib_url} > "${installed_jib_script}.gz"
|
||||
if [ -s "${installed_jib_script}.gz" ]; then
|
||||
echo "Download from mirror successful"
|
||||
break
|
||||
else
|
||||
echo "Failed to download ${jib_url}"
|
||||
fi
|
||||
done
|
||||
IFS="${OLD_IFS}"
|
||||
fi
|
||||
if [ ! -s "${installed_jib_script}.gz" ]; then
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
echo "Extracting JIB bootstrap script"
|
||||
rm -f "${installed_jib_script}"
|
||||
|
@ -357,8 +357,8 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
var devkit_platform_revisions = {
|
||||
linux_x64: "gcc4.9.2-OEL6.4+1.0",
|
||||
macosx_x64: "Xcode6.3-MacOSX10.9+1.0",
|
||||
solaris_x64: "SS12u3-Solaris10u10+1.0",
|
||||
solaris_sparcv9: "SS12u3-Solaris10u10+1.0",
|
||||
solaris_x64: "SS12u4-Solaris11u1+1.0",
|
||||
solaris_sparcv9: "SS12u4-Solaris11u1+1.0",
|
||||
windows_x64: "VS2013SP4+1.0"
|
||||
};
|
||||
|
||||
|
@ -340,3 +340,5 @@ f7d70caad89ad0c43bb057bca0aad6f17ce05a6a jdk9-b92
|
||||
fd038e8a16eec80d0d6b337d74a582790ed4b3ee jdk-9+95
|
||||
feb1bd85d7990dcf5584ca9e53104269c01db006 jdk-9+96
|
||||
10a482b863582376d4ca229090334b23b05159fc jdk-9+97
|
||||
ea285530245cf4e0edf0479121a41347d3030eba jdk-9+98
|
||||
180212ee1d8710691ba9944593dfc1ff3e4f1532 jdk-9+99
|
||||
|
@ -500,3 +500,5 @@ a22b7c80529f5f05c847e932e017456e83c46233 jdk9-b94
|
||||
0c79cf3cdf0904fc4a630b91b32904491e1ae430 jdk-9+95
|
||||
a94bb7203596dd632486f1e3655fa5f70541dc08 jdk-9+96
|
||||
de592ea5f7ba0f8a8c5afc03bd169f7690c72b6f jdk-9+97
|
||||
e5b1a23be1e105417ba1c4c576ab373eb3fa2c2b jdk-9+98
|
||||
f008e8cc10d5b3212fb22d58c96fa01d38654f19 jdk-9+99
|
||||
|
@ -26,6 +26,7 @@
|
||||
* @bug 8139564
|
||||
* @summary defaultmethods=debug should have logging from each of the statements in the code
|
||||
* @library /testlibrary
|
||||
* @ignore 8146435
|
||||
* @modules java.base/sun.misc
|
||||
* java.management
|
||||
* @run driver DefaultMethodsTest
|
||||
|
@ -340,3 +340,5 @@ b9c50c63305cf1120263f6b7c6993021b53c2c40 jdk9-b93
|
||||
c8d0845877a811ab4350935892f826929359a3ff jdk-9+95
|
||||
1f3182529f2c474e5506955ccb3820cfa5822265 jdk-9+96
|
||||
9c107c050335d7ee63b2a8b38ca5d498f19713a2 jdk-9+97
|
||||
52b01339235f24c93b679bd6b8fb36a1072ad0ac jdk-9+98
|
||||
52774b544850c791f1d1c67db2601b33739b18c9 jdk-9+99
|
||||
|
@ -357,7 +357,7 @@ class DurationImpl
|
||||
* The length of the duration in milliseconds.
|
||||
*/
|
||||
protected DurationImpl(final long durationInMilliSeconds) {
|
||||
|
||||
boolean is0x8000000000000000L = false;
|
||||
long l = durationInMilliSeconds;
|
||||
|
||||
if (l > 0) {
|
||||
@ -368,6 +368,7 @@ class DurationImpl
|
||||
if (l == 0x8000000000000000L) {
|
||||
// negating 0x8000000000000000L causes an overflow
|
||||
l++;
|
||||
is0x8000000000000000L = true;
|
||||
}
|
||||
l *= -1;
|
||||
}
|
||||
@ -406,7 +407,8 @@ class DurationImpl
|
||||
|
||||
// seconds & milliseconds
|
||||
int2long = (gregorianCalendar.get(Calendar.SECOND) * 1000)
|
||||
+ gregorianCalendar.get(Calendar.MILLISECOND);
|
||||
+ gregorianCalendar.get(Calendar.MILLISECOND)
|
||||
+ (is0x8000000000000000L ? 1 : 0);
|
||||
this.seconds = BigDecimal.valueOf(int2long, 3);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please 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 datatype;
|
||||
|
||||
import javax.xml.datatype.DatatypeConfigurationException;
|
||||
import javax.xml.datatype.DatatypeFactory;
|
||||
import javax.xml.datatype.Duration;
|
||||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
/*
|
||||
* @bug 8068839
|
||||
* @summary Verifies that Duration's edge cases
|
||||
*/
|
||||
public class JDK8068839Test {
|
||||
|
||||
@Test
|
||||
public void test() throws DatatypeConfigurationException {
|
||||
DatatypeFactory df = DatatypeFactory.newInstance();
|
||||
Duration durationx = df.newDuration(Long.MIN_VALUE);
|
||||
Assert.assertEquals(durationx.toString(), "-P292277024Y7M16DT7H12M55.808S");
|
||||
durationx = df.newDuration(Long.MAX_VALUE);
|
||||
Assert.assertEquals(durationx.toString(), "P292277024Y7M16DT7H12M55.807S");
|
||||
}
|
||||
|
||||
}
|
@ -343,3 +343,5 @@ e8d15c61400c1682a7873e053d7b39efde0b79be jdk9-b94
|
||||
3e03ddaaac6585fa27e91596eb2a9a31e10bdcc9 jdk-9+95
|
||||
b55cebc47555293cf9c2aefb3bf63c56e847ab19 jdk-9+96
|
||||
7293db4716ee25b814e14f738b9acfb85700e3fa jdk-9+97
|
||||
67c84077edc3db6b24998b35970b37c01aae985e jdk-9+98
|
||||
97b31ca0dd77483cf20ff99a033a455673639578 jdk-9+99
|
||||
|
@ -31,10 +31,10 @@ package javax.xml.bind.annotation.adapters;
|
||||
* <p> <b> Usage: </b> </p>
|
||||
*
|
||||
* <p>
|
||||
* Some Java types do not map naturally to a XML representation, for
|
||||
* Some Java types do not map naturally to an XML representation, for
|
||||
* example {@code HashMap} or other non JavaBean classes. Conversely,
|
||||
* a XML repsentation may map to a Java type but an application may
|
||||
* choose to accesss the XML representation using another Java
|
||||
* an XML representation may map to a Java type but an application may
|
||||
* choose to access the XML representation using another Java
|
||||
* type. For example, the schema to Java binding rules bind
|
||||
* xs:DateTime by default to XmlGregorianCalendar. But an application
|
||||
* may desire to bind xs:DateTime to a custom type,
|
||||
|
@ -340,3 +340,5 @@ b433e4dfb830fea60e5187e4580791b62cc362d2 jdk9-b90
|
||||
8581faf0d474472e32f589bbc16db7eec912d83f jdk-9+95
|
||||
c021b855f51e572e63982654b17742cb1f814fb4 jdk-9+96
|
||||
fdd84b2265ddce7f50e084b7c8635189bba6f012 jdk-9+97
|
||||
f86ee68d1107dad41a27efc34306e0e56244a12e jdk-9+98
|
||||
e1a789be1535741274c9779f4d4ca3495196b5c3 jdk-9+99
|
||||
|
@ -309,7 +309,7 @@ define SetupBuildJvmtiDemoBody
|
||||
|
||||
ifeq ($$($1_TOOLCHAIN), TOOLCHAIN_LINK_CXX)
|
||||
# For C++, we also need some special treatment.
|
||||
$1_LDFLAGS := $(LDFLAGS_CXX_JDK)
|
||||
$1_LDFLAGS := $$(LDFLAGS_CXX_JDK)
|
||||
$1_LIBS := $(LIBCXX)
|
||||
|
||||
ifeq ($(OPENJDK_TARGET_CPU_ARCH), sparc)
|
||||
@ -324,9 +324,9 @@ define SetupBuildJvmtiDemoBody
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := $$($1_CFLAGS_INCLUDE) $$(CFLAGS_JDKLIB) $$(CFLAGS_DEBUG_SYMBOLS), \
|
||||
CXXFLAGS := $$($1_CXXFLAGS), \
|
||||
LDFLAGS := $(filter-out -incremental:no -opt:ref, $(LDFLAGS_JDKLIB)) \
|
||||
LDFLAGS := $(filter-out -incremental:no -opt:ref, $$(LDFLAGS_JDKLIB)) \
|
||||
$$($1_LDFLAGS), \
|
||||
LDFLAGS_macosx := $(call SET_EXECUTABLE_ORIGIN), \
|
||||
LDFLAGS_macosx := $$(call SET_EXECUTABLE_ORIGIN), \
|
||||
LIBS := $$($1_LIBS), \
|
||||
LIBS_solaris := -lc, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
|
@ -127,8 +127,7 @@ ifneq ($(BUILD_JEXEC_SRC), )
|
||||
$(BUILD_JEXEC_INC), \
|
||||
CFLAGS_linux := -fPIC, \
|
||||
CFLAGS_solaris := -KPIC, \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE) \
|
||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)), \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE), \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/jexec_obj, \
|
||||
OUTPUT_DIR := $(BUILD_JEXEC_DST_DIR), \
|
||||
DEBUG_SYMBOLS := true, \
|
||||
|
@ -73,8 +73,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$$(eval $$(call SetupNativeCompilation, BUILD_JACCESSINSPECTOR$1, \
|
||||
SRC := $(TOPDIR)/jaccessinspector $(TOPDIR)/common \
|
||||
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
|
||||
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
|
||||
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib User32.lib, \
|
||||
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
|
||||
LIBS := advapi32.lib user32.lib, \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccessinspector$1, \
|
||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
|
||||
PROGRAM := jaccessinspector$1, \
|
||||
@ -100,8 +101,9 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
|
||||
$$(eval $$(call SetupNativeCompilation,BUILD_JACCESSWALKER$1, \
|
||||
SRC := $(TOPDIR)/jaccesswalker $(TOPDIR)/common \
|
||||
$(TOPDIR)/toolscommon $(TOPDIR)/include/bridge, \
|
||||
CFLAGS :== $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 /EHsc, \
|
||||
LDFLAGS := $$(LDFLAGS_JDKEXE) /STACK:655360 Advapi32.lib Comctl32.lib Gdi32.lib User32.lib, \
|
||||
CFLAGS := $$(CFLAGS_JDKEXE) $(TOOLS_CFLAGS) -DACCESSBRIDGE_ARCH_$2 -EHsc, \
|
||||
LDFLAGS := $$(LDFLAGS_JDKEXE) -stack:655360, \
|
||||
LIBS := advapi32.lib comctl32.lib gdi32.lib user32.lib, \
|
||||
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/jdk.accessibility/jaccesswalker$1, \
|
||||
OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/jdk.accessibility, \
|
||||
PROGRAM := jaccesswalker$1, \
|
||||
|
@ -89,7 +89,6 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
|
||||
MAPFILE := $(UNPACK_MAPFILE),\
|
||||
LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
|
||||
$(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(UNPACKEXE_LIBS) $(LIBCXX), \
|
||||
LIBS_solaris := -lc, \
|
||||
|
@ -25,6 +25,12 @@
|
||||
|
||||
include NativeCompilation.gmk
|
||||
|
||||
# SetupNativeCompilation now supports debug symbols on macosx for hotspot.
|
||||
# Disable it here for the jdk binaries until we decide to enable them.
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
ENABLE_DEBUG_SYMBOLS := false
|
||||
endif
|
||||
|
||||
# Prepare the find cache.
|
||||
$(eval $(call FillCacheFind, $(JDK_TOPDIR)/src/java.base/share/native/launcher))
|
||||
|
||||
@ -180,15 +186,12 @@ define SetupBuildLauncherBody
|
||||
CFLAGS_linux := -fPIC, \
|
||||
CFLAGS_solaris := -KPIC -DHAVE_GETHRTIME, \
|
||||
CFLAGS_windows := $$($1_CFLAGS_windows), \
|
||||
LDFLAGS := $(LDFLAGS_JDKEXE) \
|
||||
LDFLAGS := $$(LDFLAGS_JDKEXE) \
|
||||
$$(ORIGIN_ARG) \
|
||||
$$($1_LDFLAGS), \
|
||||
LDFLAGS_linux := \
|
||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
|
||||
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
|
||||
LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_NAME,$1), \
|
||||
LDFLAGS_solaris := $$($1_LDFLAGS_solaris) \
|
||||
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)$(SHARED_LIBRARY_SUFFIX)) \
|
||||
-L$(SUPPORT_OUTPUTDIR)/modules_libs/java.base$(OPENJDK_TARGET_CPU_LIBDIR)/jli, \
|
||||
MAPFILE := $$($1_MAPFILE), \
|
||||
LIBS := $(JDKEXE_LIBS) $$($1_LIBS), \
|
||||
|
@ -683,7 +683,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
|
||||
WARNINGS_AS_ERRORS_gcc := false, \
|
||||
WARNINGS_AS_ERRORS_solstudio := false, \
|
||||
MAPFILE := $(BUILD_LIBFONTMANAGER_MAPFILE), \
|
||||
LDFLAGS := $(subst -Xlinker -z -Xlinker defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
|
||||
LDFLAGS := $(subst -Wl$(COMMA)-z$(COMMA)defs,,$(LDFLAGS_JDKLIB)) $(LDFLAGS_CXX_JDK) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_macosx := -undefined dynamic_lookup, \
|
||||
@ -799,7 +799,7 @@ else # OPENJDK_TARGET_OS not windows
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
|
||||
LDFLAGS_macosx := -Xlinker -rpath -Xlinker @loader_path, \
|
||||
LDFLAGS_macosx := -Wl$(COMMA)-rpath$(COMMA)@loader_path, \
|
||||
LIBS_unix := $(JAWT_LIBS) $(JDKLIB_LIBS), \
|
||||
LIBS_solaris := $(X_LIBS) -lXrender, \
|
||||
LIBS_macosx := -framework Cocoa, \
|
||||
@ -1034,7 +1034,7 @@ ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
-I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN) \
|
||||
-Xlinker -rpath -Xlinker @loader_path \
|
||||
-Wl$(COMMA)-rpath$(COMMA)@loader_path \
|
||||
-L$(INSTALL_LIBRARIES_HERE), \
|
||||
LIBS := -lawt -losxapp -lawt_lwawt \
|
||||
-framework Cocoa \
|
||||
|
@ -65,7 +65,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
|
||||
-L$(call FindLibDirForModule, java.base)/jli, \
|
||||
LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/jli) \
|
||||
-L$(call FindLibDirForModule, java.base)/jli, \
|
||||
LDFLAGS_macosx := -Xlinker -all_load $(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
|
||||
LDFLAGS_macosx := -Wl$(COMMA)-all_load, \
|
||||
LDFLAGS_aix := -L$(SUPPORT_OUTPUTDIR)/native/java.base, \
|
||||
LDFLAGS_windows := -export:Agent_OnAttach, \
|
||||
LIBS := $(JDKLIB_LIBS), \
|
||||
@ -74,7 +74,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBINSTRUMENT, \
|
||||
LIBS_solaris := -ljli $(LIBDL), \
|
||||
LIBS_aix := -liconv -ljli_static $(LIBDL), \
|
||||
LIBS_macosx := -liconv -framework Cocoa -framework Security \
|
||||
-framework ApplicationServices, \
|
||||
-framework ApplicationServices \
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.base/libjli_static.a, \
|
||||
LIBS_windows := $(WIN_JAVA_LIB) advapi32.lib \
|
||||
$(SUPPORT_OUTPUTDIR)/native/java.base/jli_static.lib, \
|
||||
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
|
||||
|
@ -46,6 +46,12 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
# SetupNativeCompilation now supports debug symbols on macosx for hotspot.
|
||||
# Disable it here for the jdk libraries until we decide to enable them.
|
||||
ifeq ($(OPENJDK_TARGET_OS), macosx)
|
||||
ENABLE_DEBUG_SYMBOLS := false
|
||||
endif
|
||||
|
||||
################################################################################
|
||||
# Find the default set of src dirs for a native library.
|
||||
# Param 1 - module name
|
||||
|
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 1997, 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
|
||||
@ -27,7 +27,6 @@
|
||||
|
||||
SUNWprivate_1.1 {
|
||||
global:
|
||||
Java_java_util_jar_JarFile_getMetaInfEntryNames;
|
||||
Java_java_util_zip_Adler32_update;
|
||||
Java_java_util_zip_Adler32_updateBytes;
|
||||
Java_java_util_zip_Adler32_updateByteBuffer;
|
||||
@ -48,25 +47,6 @@ SUNWprivate_1.1 {
|
||||
Java_java_util_zip_Inflater_initIDs;
|
||||
Java_java_util_zip_Inflater_reset;
|
||||
Java_java_util_zip_Inflater_setDictionary;
|
||||
Java_java_util_zip_ZipFile_close;
|
||||
Java_java_util_zip_ZipFile_getCommentBytes;
|
||||
Java_java_util_zip_ZipFile_freeEntry;
|
||||
Java_java_util_zip_ZipFile_getEntry;
|
||||
Java_java_util_zip_ZipFile_getEntryBytes;
|
||||
Java_java_util_zip_ZipFile_getEntryCrc;
|
||||
Java_java_util_zip_ZipFile_getEntryCSize;
|
||||
Java_java_util_zip_ZipFile_getEntryFlag;
|
||||
Java_java_util_zip_ZipFile_getEntryMethod;
|
||||
Java_java_util_zip_ZipFile_getEntrySize;
|
||||
Java_java_util_zip_ZipFile_getEntryTime;
|
||||
Java_java_util_zip_ZipFile_getNextEntry;
|
||||
Java_java_util_zip_ZipFile_getZipMessage;
|
||||
Java_java_util_zip_ZipFile_getTotal;
|
||||
Java_java_util_zip_ZipFile_initIDs;
|
||||
Java_java_util_zip_ZipFile_open;
|
||||
Java_java_util_zip_ZipFile_read;
|
||||
Java_java_util_zip_ZipFile_startsWithLOC;
|
||||
|
||||
ZIP_Close;
|
||||
ZIP_CRC32;
|
||||
ZIP_FindEntry;
|
||||
|
@ -16,30 +16,14 @@ text: .text%ZIP_InflateFully;
|
||||
text: .text%ZIP_Lock;
|
||||
text: .text%ZIP_Unlock;
|
||||
text: .text%ZIP_FreeEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_initIDs;
|
||||
text: .text%Java_java_util_zip_ZipFile_open;
|
||||
text: .text%Java_java_util_zip_ZipFile_getTotal;
|
||||
text: .text%Java_java_util_zip_ZipFile_startsWithLOC;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_freeEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryTime;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntrySize;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
|
||||
text: .text%Java_java_util_zip_Inflater_initIDs;
|
||||
text: .text%Java_java_util_zip_Inflater_init;
|
||||
text: .text%inflateInit2_;
|
||||
text: .text%zcalloc;
|
||||
text: .text%Java_java_util_zip_Inflater_inflateBytes;
|
||||
text: .text%Java_java_util_zip_ZipFile_read;
|
||||
text: .text%ZIP_Read;
|
||||
text: .text%zcfree;
|
||||
text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
|
||||
text: .text%Java_java_util_zip_Inflater_reset;
|
||||
text: .text%Java_java_util_zip_Inflater_end;
|
||||
text: .text%inflateEnd;
|
||||
text: .text%Java_java_util_zip_ZipFile_close;
|
||||
text: .text%ZIP_Close;
|
||||
|
@ -15,19 +15,6 @@ text: .text%ZIP_InflateFully;
|
||||
text: .text%ZIP_Lock;
|
||||
text: .text%ZIP_Unlock;
|
||||
text: .text%ZIP_FreeEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_initIDs;
|
||||
text: .text%Java_java_util_zip_ZipFile_open;
|
||||
text: .text%Java_java_util_zip_ZipFile_getTotal;
|
||||
text: .text%Java_java_util_zip_ZipFile_startsWithLOC;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_freeEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryTime;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntrySize;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
|
||||
text: .text%Java_java_util_zip_Inflater_initIDs;
|
||||
text: .text%Java_java_util_zip_Inflater_init;
|
||||
text: .text%inflateInit2_;
|
||||
@ -35,7 +22,6 @@ text: .text%zcalloc;
|
||||
text: .text%inflateReset;
|
||||
text: .text%Java_java_util_zip_Inflater_inflateBytes;
|
||||
text: .text%inflate;
|
||||
text: .text%Java_java_util_zip_ZipFile_read;
|
||||
text: .text%ZIP_Read;
|
||||
text: .text%zcfree;
|
||||
text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
|
||||
@ -43,6 +29,5 @@ text: .text%ZIP_ReadEntry;
|
||||
text: .text%InflateFully;
|
||||
text: .text%inflateEnd;
|
||||
text: .text%Java_java_util_zip_Inflater_reset;
|
||||
text: .text%Java_java_util_zip_ZipFile_close;
|
||||
text: .text%ZIP_Close;
|
||||
text: .text%Java_java_util_zip_Inflater_end;
|
||||
|
@ -16,34 +16,16 @@ text: .text%ZIP_InflateFully;
|
||||
text: .text%ZIP_Lock;
|
||||
text: .text%ZIP_Unlock;
|
||||
text: .text%ZIP_FreeEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_initIDs;
|
||||
text: .text%Java_java_util_zip_ZipFile_open;
|
||||
text: .text%Java_java_util_zip_ZipFile_getTotal;
|
||||
text: .text%Java_java_util_zip_ZipFile_startsWithLOC;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_freeEntry;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryTime;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryCrc;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryCSize;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntrySize;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryFlag;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryMethod;
|
||||
text: .text%Java_java_util_zip_ZipFile_getEntryBytes;
|
||||
text: .text%Java_java_util_zip_Inflater_initIDs;
|
||||
text: .text%Java_java_util_zip_Inflater_init;
|
||||
text: .text%inflateInit2_;
|
||||
text: .text%zcalloc;
|
||||
text: .text%inflateReset;
|
||||
text: .text%Java_java_util_zip_Inflater_inflateBytes;
|
||||
text: .text%inflate;
|
||||
text: .text%Java_java_util_zip_ZipFile_read;
|
||||
text: .text%ZIP_Read;
|
||||
text: .text%zcfree;
|
||||
text: .text%Java_java_util_jar_JarFile_getMetaInfEntryNames;
|
||||
text: .text%ZIP_ReadEntry;
|
||||
text: .text%InflateFully;
|
||||
text: .text%inflateEnd;
|
||||
text: .text%Java_java_util_zip_Inflater_reset;
|
||||
text: .text%Java_java_util_zip_ZipFile_close;
|
||||
text: .text%ZIP_Close;
|
||||
text: .text%Java_java_util_zip_Inflater_end;
|
||||
|
@ -29,7 +29,6 @@ import java.io.IOException;
|
||||
import java.nio.channels.*;
|
||||
import java.nio.channels.spi.*;
|
||||
import java.util.*;
|
||||
import sun.misc.*;
|
||||
|
||||
/**
|
||||
* An implementation of Selector for Linux 2.6+ kernels that uses
|
||||
@ -50,7 +49,7 @@ class EPollSelectorImpl
|
||||
private Map<Integer,SelectionKeyImpl> fdToKey;
|
||||
|
||||
// True if this Selector has been closed
|
||||
private volatile boolean closed = false;
|
||||
private volatile boolean closed;
|
||||
|
||||
// Lock for interrupt triggering and clearing
|
||||
private final Object interruptLock = new Object();
|
||||
|
@ -322,19 +322,6 @@ class LinuxWatchService
|
||||
bytesRead = 0;
|
||||
}
|
||||
|
||||
// process any pending requests
|
||||
if ((nReady > 1) || (nReady == 1 && bytesRead == 0)) {
|
||||
try {
|
||||
read(socketpair[0], address, BUFFER_SIZE);
|
||||
boolean shutdown = processRequests();
|
||||
if (shutdown)
|
||||
break;
|
||||
} catch (UnixException x) {
|
||||
if (x.errno() != UnixConstants.EAGAIN)
|
||||
throw x;
|
||||
}
|
||||
}
|
||||
|
||||
// iterate over buffer to decode events
|
||||
int offset = 0;
|
||||
while (offset < bytesRead) {
|
||||
@ -369,6 +356,19 @@ class LinuxWatchService
|
||||
|
||||
offset += (SIZEOF_INOTIFY_EVENT + len);
|
||||
}
|
||||
|
||||
// process any pending requests
|
||||
if ((nReady > 1) || (nReady == 1 && bytesRead == 0)) {
|
||||
try {
|
||||
read(socketpair[0], address, BUFFER_SIZE);
|
||||
boolean shutdown = processRequests();
|
||||
if (shutdown)
|
||||
break;
|
||||
} catch (UnixException x) {
|
||||
if (x.errno() != UnixConstants.EAGAIN)
|
||||
throw x;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (UnixException x) {
|
||||
x.printStackTrace();
|
||||
|
@ -27,7 +27,7 @@ package com.sun.crypto.provider;
|
||||
|
||||
import java.io.*;
|
||||
import sun.security.util.*;
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
|
@ -30,7 +30,7 @@ import java.security.AlgorithmParametersSpi;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import javax.crypto.spec.GCMParameterSpec;
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import sun.security.util.*;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ import java.security.AlgorithmParametersSpi;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import javax.crypto.spec.PBEParameterSpec;
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import sun.security.util.*;
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@ import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.PBEParameterSpec;
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import sun.security.util.*;
|
||||
|
||||
/**
|
||||
|
@ -30,7 +30,7 @@ import java.security.AlgorithmParametersSpi;
|
||||
import java.security.spec.AlgorithmParameterSpec;
|
||||
import java.security.spec.InvalidParameterSpecException;
|
||||
import javax.crypto.spec.RC2ParameterSpec;
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import sun.security.util.*;
|
||||
|
||||
/**
|
||||
|
@ -93,7 +93,7 @@ public final class SunJCE extends Provider {
|
||||
|
||||
// Instance of this provider, so we don't have to call the provider list
|
||||
// to find ourselves or run the risk of not being in the list.
|
||||
private static volatile SunJCE instance = null;
|
||||
private static volatile SunJCE instance;
|
||||
|
||||
// lazy initialize SecureRandom to avoid potential recursion if Sun
|
||||
// provider has not been installed yet
|
||||
|
@ -118,7 +118,7 @@ class NTLM {
|
||||
public void debug(byte[] bytes) {
|
||||
if (DEBUG) {
|
||||
try {
|
||||
new sun.misc.HexDumpEncoder().encodeBuffer(bytes, System.out);
|
||||
new sun.security.util.HexDumpEncoder().encodeBuffer(bytes, System.out);
|
||||
} catch (IOException ioe) {
|
||||
// Impossible
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 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
|
||||
@ -225,9 +225,12 @@ public class CharArrayReader extends Reader {
|
||||
* Closes the stream and releases any system resources associated with
|
||||
* it. Once the stream has been closed, further read(), ready(),
|
||||
* mark(), reset(), or skip() invocations will throw an IOException.
|
||||
* Closing a previously closed stream has no effect.
|
||||
* Closing a previously closed stream has no effect. This method will block
|
||||
* while there is another thread blocking on the reader.
|
||||
*/
|
||||
public void close() {
|
||||
buf = null;
|
||||
synchronized (lock) {
|
||||
buf = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -420,11 +420,11 @@ public class File
|
||||
String scheme = uri.getScheme();
|
||||
if ((scheme == null) || !scheme.equalsIgnoreCase("file"))
|
||||
throw new IllegalArgumentException("URI scheme is not \"file\"");
|
||||
if (uri.getAuthority() != null)
|
||||
if (uri.getRawAuthority() != null)
|
||||
throw new IllegalArgumentException("URI has an authority component");
|
||||
if (uri.getFragment() != null)
|
||||
if (uri.getRawFragment() != null)
|
||||
throw new IllegalArgumentException("URI has a fragment component");
|
||||
if (uri.getQuery() != null)
|
||||
if (uri.getRawQuery() != null)
|
||||
throw new IllegalArgumentException("URI has a query component");
|
||||
String p = uri.getPath();
|
||||
if (p.equals(""))
|
||||
|
@ -48,9 +48,9 @@ package java.io;
|
||||
* @since 1.0
|
||||
*/
|
||||
public class PipedInputStream extends InputStream {
|
||||
boolean closedByWriter = false;
|
||||
volatile boolean closedByReader = false;
|
||||
boolean connected = false;
|
||||
boolean closedByWriter;
|
||||
volatile boolean closedByReader;
|
||||
boolean connected;
|
||||
|
||||
/* REMIND: identification of the read and write sides needs to be
|
||||
more sophisticated. Either using thread groups (but what about
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 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
|
||||
@ -241,13 +241,16 @@ public class PushbackReader extends FilterReader {
|
||||
* Closes the stream and releases any system resources associated with
|
||||
* it. Once the stream has been closed, further read(),
|
||||
* unread(), ready(), or skip() invocations will throw an IOException.
|
||||
* Closing a previously closed stream has no effect.
|
||||
* Closing a previously closed stream has no effect. This method will block
|
||||
* while there is another thread blocking on the reader.
|
||||
*
|
||||
* @exception IOException If an I/O error occurs
|
||||
*/
|
||||
public void close() throws IOException {
|
||||
super.close();
|
||||
buf = null;
|
||||
synchronized (lock) {
|
||||
super.close();
|
||||
buf = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 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
|
||||
@ -194,9 +194,12 @@ public class StringReader extends Reader {
|
||||
* Closes the stream and releases any system resources associated with
|
||||
* it. Once the stream has been closed, further read(),
|
||||
* ready(), mark(), or reset() invocations will throw an IOException.
|
||||
* Closing a previously closed stream has no effect.
|
||||
* Closing a previously closed stream has no effect. This method will block
|
||||
* while there is another thread blocking on the reader.
|
||||
*/
|
||||
public void close() {
|
||||
str = null;
|
||||
synchronized (lock) {
|
||||
str = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
package java.lang;
|
||||
|
||||
import sun.misc.FloatingDecimal;
|
||||
import jdk.internal.math.FloatingDecimal;
|
||||
import java.util.Arrays;
|
||||
import java.util.Spliterator;
|
||||
import java.util.stream.IntStream;
|
||||
|
@ -2518,7 +2518,7 @@ public final class Class<T> implements java.io.Serializable,
|
||||
|
||||
// Incremented by the VM on each call to JVM TI RedefineClasses()
|
||||
// that redefines this class or a superclass.
|
||||
private transient volatile int classRedefinedCount = 0;
|
||||
private transient volatile int classRedefinedCount;
|
||||
|
||||
// Lazily create and cache ReflectionData
|
||||
private ReflectionData<T> reflectionData() {
|
||||
@ -3331,7 +3331,8 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* uncloned, cached, and shared by all callers.
|
||||
*/
|
||||
T[] getEnumConstantsShared() {
|
||||
if (enumConstants == null) {
|
||||
T[] constants = enumConstants;
|
||||
if (constants == null) {
|
||||
if (!isEnum()) return null;
|
||||
try {
|
||||
final Method values = getMethod("values");
|
||||
@ -3344,16 +3345,16 @@ public final class Class<T> implements java.io.Serializable,
|
||||
});
|
||||
@SuppressWarnings("unchecked")
|
||||
T[] temporaryConstants = (T[])values.invoke(null);
|
||||
enumConstants = temporaryConstants;
|
||||
enumConstants = constants = temporaryConstants;
|
||||
}
|
||||
// These can happen when users concoct enum-like classes
|
||||
// that don't comply with the enum spec.
|
||||
catch (InvocationTargetException | NoSuchMethodException |
|
||||
IllegalAccessException ex) { return null; }
|
||||
}
|
||||
return enumConstants;
|
||||
return constants;
|
||||
}
|
||||
private transient volatile T[] enumConstants = null;
|
||||
private transient volatile T[] enumConstants;
|
||||
|
||||
/**
|
||||
* Returns a map from simple name to enum constant. This package-private
|
||||
@ -3363,19 +3364,21 @@ public final class Class<T> implements java.io.Serializable,
|
||||
* created lazily on first use. Typically it won't ever get created.
|
||||
*/
|
||||
Map<String, T> enumConstantDirectory() {
|
||||
if (enumConstantDirectory == null) {
|
||||
Map<String, T> directory = enumConstantDirectory;
|
||||
if (directory == null) {
|
||||
T[] universe = getEnumConstantsShared();
|
||||
if (universe == null)
|
||||
throw new IllegalArgumentException(
|
||||
getName() + " is not an enum type");
|
||||
Map<String, T> m = new HashMap<>(2 * universe.length);
|
||||
for (T constant : universe)
|
||||
m.put(((Enum<?>)constant).name(), constant);
|
||||
enumConstantDirectory = m;
|
||||
directory = new HashMap<>(2 * universe.length);
|
||||
for (T constant : universe) {
|
||||
directory.put(((Enum<?>)constant).name(), constant);
|
||||
}
|
||||
enumConstantDirectory = directory;
|
||||
}
|
||||
return enumConstantDirectory;
|
||||
return directory;
|
||||
}
|
||||
private transient volatile Map<String, T> enumConstantDirectory = null;
|
||||
private transient volatile Map<String, T> enumConstantDirectory;
|
||||
|
||||
/**
|
||||
* Casts an object to the class or interface represented
|
||||
|
@ -45,11 +45,11 @@ import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.Stack;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Vector;
|
||||
import java.util.Hashtable;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import sun.misc.CompoundEnumeration;
|
||||
import sun.misc.Resource;
|
||||
import sun.misc.URLClassPath;
|
||||
import sun.reflect.CallerSensitive;
|
||||
@ -2206,3 +2206,36 @@ class SystemClassLoaderAction
|
||||
return sys;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* A utility class that will enumerate over an array of enumerations.
|
||||
*/
|
||||
final class CompoundEnumeration<E> implements Enumeration<E> {
|
||||
private final Enumeration<E>[] enums;
|
||||
private int index;
|
||||
|
||||
public CompoundEnumeration(Enumeration<E>[] enums) {
|
||||
this.enums = enums;
|
||||
}
|
||||
|
||||
private boolean next() {
|
||||
while (index < enums.length) {
|
||||
if (enums[index] != null && enums[index].hasMoreElements()) {
|
||||
return true;
|
||||
}
|
||||
index++;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasMoreElements() {
|
||||
return next();
|
||||
}
|
||||
|
||||
public E nextElement() {
|
||||
if (!next()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
return enums[index].nextElement();
|
||||
}
|
||||
}
|
||||
|
@ -25,8 +25,8 @@
|
||||
|
||||
package java.lang;
|
||||
|
||||
import sun.misc.FloatingDecimal;
|
||||
import sun.misc.DoubleConsts;
|
||||
import jdk.internal.math.FloatingDecimal;
|
||||
import jdk.internal.math.DoubleConsts;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
|
||||
/**
|
||||
|
@ -25,9 +25,9 @@
|
||||
|
||||
package java.lang;
|
||||
|
||||
import sun.misc.FloatingDecimal;
|
||||
import sun.misc.FloatConsts;
|
||||
import sun.misc.DoubleConsts;
|
||||
import jdk.internal.math.FloatingDecimal;
|
||||
import jdk.internal.math.FloatConsts;
|
||||
import jdk.internal.math.DoubleConsts;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
|
||||
/**
|
||||
|
@ -40,6 +40,11 @@ import java.lang.ref.*;
|
||||
* maintained in the variable (e.g., User ID, Transaction ID) must be
|
||||
* automatically transmitted to any child threads that are created.
|
||||
*
|
||||
* <p>Note: During the creation of a new {@link
|
||||
* Thread#Thread(ThreadGroup,Runnable,String,long,boolean) thread}, it is
|
||||
* possible to <i>opt out</i> of receiving initial values for inheritable
|
||||
* thread-local variables.
|
||||
*
|
||||
* @author Josh Bloch and Doug Lea
|
||||
* @see ThreadLocal
|
||||
* @since 1.2
|
||||
|
@ -26,8 +26,8 @@
|
||||
package java.lang;
|
||||
|
||||
import java.util.Random;
|
||||
import sun.misc.FloatConsts;
|
||||
import sun.misc.DoubleConsts;
|
||||
import jdk.internal.math.FloatConsts;
|
||||
import jdk.internal.math.DoubleConsts;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
|
||||
/**
|
||||
|
@ -304,8 +304,8 @@ public final class StackWalker {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a {@code StackWalker} instance with the given {@ocde options} specifying
|
||||
* the stack frame information it can access. If the given {@ocde options}
|
||||
* Returns a {@code StackWalker} instance with the given {@code options} specifying
|
||||
* the stack frame information it can access. If the given {@code options}
|
||||
* is empty, this {@code StackWalker} is configured to skip all
|
||||
* {@linkplain Option#SHOW_HIDDEN_FRAMES hidden frames} and no
|
||||
* {@linkplain Option#RETAIN_CLASS_REFERENCE class reference} is retained.
|
||||
|
@ -26,7 +26,7 @@
|
||||
package java.lang;
|
||||
|
||||
import java.util.Random;
|
||||
import sun.misc.DoubleConsts;
|
||||
import jdk.internal.math.DoubleConsts;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
|
||||
/**
|
||||
|
@ -120,7 +120,8 @@ final class StringUTF16 {
|
||||
public static byte[] toBytes(char[] value, int off, int len) {
|
||||
byte[] val = newBytesFor(len);
|
||||
for (int i = 0; i < len; i++) {
|
||||
putChar(val, i, value[off++]);
|
||||
putChar(val, i, value[off]);
|
||||
off++;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
@ -145,11 +146,14 @@ final class StringUTF16 {
|
||||
@HotSpotIntrinsicCandidate
|
||||
private static int compress(char[] src, int srcOff, byte[] dst, int dstOff, int len) {
|
||||
for (int i = 0; i < len; i++) {
|
||||
int c = src[srcOff++];
|
||||
if (c >>> 8 != 0) {
|
||||
return 0;
|
||||
char c = src[srcOff];
|
||||
if (c > 0xFF) {
|
||||
len = 0;
|
||||
break;
|
||||
}
|
||||
dst[dstOff++] = (byte)c;
|
||||
dst[dstOff] = (byte)c;
|
||||
srcOff++;
|
||||
dstOff++;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
@ -160,11 +164,14 @@ final class StringUTF16 {
|
||||
// We need a range check here because 'getChar' has no checks
|
||||
checkBoundsOffCount(srcOff, len, src.length);
|
||||
for (int i = 0; i < len; i++) {
|
||||
int c = getChar(src, srcOff++);
|
||||
if (c >>> 8 != 0) {
|
||||
return 0;
|
||||
char c = getChar(src, srcOff);
|
||||
if (c > 0xFF) {
|
||||
len = 0;
|
||||
break;
|
||||
}
|
||||
dst[dstOff++] = (byte)c;
|
||||
dst[dstOff] = (byte)c;
|
||||
srcOff++;
|
||||
dstOff++;
|
||||
}
|
||||
return len;
|
||||
}
|
||||
@ -581,7 +588,7 @@ final class StringUTF16 {
|
||||
bits |= cp;
|
||||
putChar(result, i, cp);
|
||||
}
|
||||
if (bits >>> 8 != 0) {
|
||||
if (bits > 0xFF) {
|
||||
return new String(result, UTF16);
|
||||
} else {
|
||||
return newString(result, 0, len);
|
||||
@ -678,7 +685,7 @@ final class StringUTF16 {
|
||||
bits |= cp;
|
||||
putChar(result, i, cp);
|
||||
}
|
||||
if (bits >>> 8 != 0) {
|
||||
if (bits > 0xFF) {
|
||||
return new String(result, UTF16);
|
||||
} else {
|
||||
return newString(result, 0, len);
|
||||
|
@ -132,7 +132,7 @@ public final class System {
|
||||
|
||||
/* The security manager for the system.
|
||||
*/
|
||||
private static volatile SecurityManager security = null;
|
||||
private static volatile SecurityManager security;
|
||||
|
||||
/**
|
||||
* Reassigns the "standard" input stream.
|
||||
@ -206,7 +206,7 @@ public final class System {
|
||||
setErr0(err);
|
||||
}
|
||||
|
||||
private static volatile Console cons = null;
|
||||
private static volatile Console cons;
|
||||
/**
|
||||
* Returns the unique {@link java.io.Console Console} object associated
|
||||
* with the current Java virtual machine, if any.
|
||||
@ -216,12 +216,13 @@ public final class System {
|
||||
* @since 1.6
|
||||
*/
|
||||
public static Console console() {
|
||||
if (cons == null) {
|
||||
Console c = cons;
|
||||
if (c == null) {
|
||||
synchronized (System.class) {
|
||||
cons = SharedSecrets.getJavaIOAccess().console();
|
||||
cons = c = SharedSecrets.getJavaIOAccess().console();
|
||||
}
|
||||
}
|
||||
return cons;
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -207,12 +207,10 @@ class Thread implements Runnable {
|
||||
/* For generating thread ID */
|
||||
private static long threadSeqNumber;
|
||||
|
||||
/* Java thread status for tools,
|
||||
* initialized to indicate thread 'not yet started'
|
||||
/*
|
||||
* Java thread status for tools, default indicates thread 'not yet started'
|
||||
*/
|
||||
|
||||
private volatile int threadStatus = 0;
|
||||
|
||||
private volatile int threadStatus;
|
||||
|
||||
private static synchronized long nextThreadID() {
|
||||
return ++threadSeqNumber;
|
||||
@ -344,11 +342,11 @@ class Thread implements Runnable {
|
||||
|
||||
/**
|
||||
* Initializes a Thread with the current AccessControlContext.
|
||||
* @see #init(ThreadGroup,Runnable,String,long,AccessControlContext)
|
||||
* @see #init(ThreadGroup,Runnable,String,long,AccessControlContext,boolean)
|
||||
*/
|
||||
private void init(ThreadGroup g, Runnable target, String name,
|
||||
long stackSize) {
|
||||
init(g, target, name, stackSize, null);
|
||||
init(g, target, name, stackSize, null, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -361,9 +359,12 @@ class Thread implements Runnable {
|
||||
* zero to indicate that this parameter is to be ignored.
|
||||
* @param acc the AccessControlContext to inherit, or
|
||||
* AccessController.getContext() if null
|
||||
* @param inheritThreadLocals if {@code true}, inherit initial values for
|
||||
* inheritable thread-locals from the constructing thread
|
||||
*/
|
||||
private void init(ThreadGroup g, Runnable target, String name,
|
||||
long stackSize, AccessControlContext acc) {
|
||||
long stackSize, AccessControlContext acc,
|
||||
boolean inheritThreadLocals) {
|
||||
if (name == null) {
|
||||
throw new NullPointerException("name cannot be null");
|
||||
}
|
||||
@ -414,7 +415,7 @@ class Thread implements Runnable {
|
||||
acc != null ? acc : AccessController.getContext();
|
||||
this.target = target;
|
||||
setPriority(priority);
|
||||
if (parent.inheritableThreadLocals != null)
|
||||
if (inheritThreadLocals && parent.inheritableThreadLocals != null)
|
||||
this.inheritableThreadLocals =
|
||||
ThreadLocal.createInheritedMap(parent.inheritableThreadLocals);
|
||||
/* Stash the specified stack size in case the VM cares */
|
||||
@ -468,7 +469,7 @@ class Thread implements Runnable {
|
||||
* This is not a public constructor.
|
||||
*/
|
||||
Thread(Runnable target, AccessControlContext acc) {
|
||||
init(null, target, "Thread-" + nextThreadNum(), 0, acc);
|
||||
init(null, target, "Thread-" + nextThreadNum(), 0, acc, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -677,6 +678,62 @@ class Thread implements Runnable {
|
||||
init(group, target, name, stackSize);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocates a new {@code Thread} object so that it has {@code target}
|
||||
* as its run object, has the specified {@code name} as its name,
|
||||
* belongs to the thread group referred to by {@code group}, has
|
||||
* the specified {@code stackSize}, and inherits initial values for
|
||||
* {@linkplain InheritableThreadLocal inheritable thread-local} variables
|
||||
* if {@code inheritThreadLocals} is {@code true}.
|
||||
*
|
||||
* <p> This constructor is identical to {@link
|
||||
* #Thread(ThreadGroup,Runnable,String,long)} with the added ability to
|
||||
* suppress, or not, the inheriting of initial values for inheritable
|
||||
* thread-local variables from the constructing thread. This allows for
|
||||
* finer grain control over inheritable thread-locals. Care must be taken
|
||||
* when passing a value of {@code false} for {@code inheritThreadLocals},
|
||||
* as it may lead to unexpected behavior if the new thread executes code
|
||||
* that expects a specific thread-local value to be inherited.
|
||||
*
|
||||
* <p> Specifying a value of {@code true} for the {@code inheritThreadLocals}
|
||||
* parameter will cause this constructor to behave exactly like the
|
||||
* {@code Thread(ThreadGroup, Runnable, String, long)} constructor.
|
||||
*
|
||||
* @param group
|
||||
* the thread group. If {@code null} and there is a security
|
||||
* manager, the group is determined by {@linkplain
|
||||
* SecurityManager#getThreadGroup SecurityManager.getThreadGroup()}.
|
||||
* If there is not a security manager or {@code
|
||||
* SecurityManager.getThreadGroup()} returns {@code null}, the group
|
||||
* is set to the current thread's thread group.
|
||||
*
|
||||
* @param target
|
||||
* the object whose {@code run} method is invoked when this thread
|
||||
* is started. If {@code null}, this thread's run method is invoked.
|
||||
*
|
||||
* @param name
|
||||
* the name of the new thread
|
||||
*
|
||||
* @param stackSize
|
||||
* the desired stack size for the new thread, or zero to indicate
|
||||
* that this parameter is to be ignored
|
||||
*
|
||||
* @param inheritThreadLocals
|
||||
* if {@code true}, inherit initial values for inheritable
|
||||
* thread-locals from the constructing thread, otherwise no initial
|
||||
* values are inherited
|
||||
*
|
||||
* @throws SecurityException
|
||||
* if the current thread cannot create a thread in the specified
|
||||
* thread group
|
||||
*
|
||||
* @since 9
|
||||
*/
|
||||
public Thread(ThreadGroup group, Runnable target, String name,
|
||||
long stackSize, boolean inheritThreadLocals) {
|
||||
init(group, target, name, stackSize, null, inheritThreadLocals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Causes this thread to begin execution; the Java Virtual Machine
|
||||
* calls the <code>run</code> method of this thread.
|
||||
|
@ -83,7 +83,6 @@ private static CallSite bootstrapDynamic(MethodHandles.Lookup caller, String nam
|
||||
*/
|
||||
abstract
|
||||
public class CallSite {
|
||||
static { MethodHandleImpl.initStatics(); }
|
||||
|
||||
// The actual payload of this call site:
|
||||
/*package-private*/
|
||||
|
@ -1073,11 +1073,6 @@ import java.util.Objects;
|
||||
}
|
||||
}
|
||||
|
||||
// static {
|
||||
// System.out.println("Hello world! My methods are:");
|
||||
// System.out.println(Factory.INSTANCE.getMethods(MemberName.class, true, null));
|
||||
// }
|
||||
|
||||
static {
|
||||
// Allow privileged classes outside of java.lang
|
||||
jdk.internal.misc.SharedSecrets.setJavaLangInvokeAccess(new jdk.internal.misc.JavaLangInvokeAccess() {
|
||||
|
@ -420,7 +420,6 @@ mh.invokeExact(System.out, "Hello, world.");
|
||||
* @author John Rose, JSR 292 EG
|
||||
*/
|
||||
public abstract class MethodHandle {
|
||||
static { MethodHandleImpl.initStatics(); }
|
||||
|
||||
/**
|
||||
* Internal marker interface which distinguishes (to the Java compiler)
|
||||
|
@ -32,7 +32,6 @@ import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import sun.invoke.empty.Empty;
|
||||
import sun.invoke.util.ValueConversions;
|
||||
@ -65,11 +64,6 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
|
||||
/// Factory methods to create method handles:
|
||||
|
||||
static void initStatics() {
|
||||
// Trigger selected static initializations.
|
||||
MemberName.Factory.INSTANCE.getClass();
|
||||
}
|
||||
|
||||
static MethodHandle makeArrayElementAccessor(Class<?> arrayClass, boolean isSetter) {
|
||||
if (arrayClass == Object[].class)
|
||||
return (isSetter ? ArrayAccessor.OBJECT_ARRAY_SETTER : ArrayAccessor.OBJECT_ARRAY_GETTER);
|
||||
@ -700,33 +694,43 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
MethodHandle makeBlockInliningWrapper(MethodHandle target) {
|
||||
LambdaForm lform;
|
||||
if (DONT_INLINE_THRESHOLD > 0) {
|
||||
lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
|
||||
lform = Makers.PRODUCE_BLOCK_INLINING_FORM.apply(target);
|
||||
} else {
|
||||
lform = PRODUCE_REINVOKER_FORM.apply(target);
|
||||
lform = Makers.PRODUCE_REINVOKER_FORM.apply(target);
|
||||
}
|
||||
return new CountingWrapper(target, lform,
|
||||
PRODUCE_BLOCK_INLINING_FORM, PRODUCE_REINVOKER_FORM,
|
||||
Makers.PRODUCE_BLOCK_INLINING_FORM, Makers.PRODUCE_REINVOKER_FORM,
|
||||
DONT_INLINE_THRESHOLD);
|
||||
}
|
||||
|
||||
/** Constructs reinvoker lambda form which block inlining during JIT-compilation for a particular method handle */
|
||||
private static final Function<MethodHandle, LambdaForm> PRODUCE_BLOCK_INLINING_FORM = new Function<MethodHandle, LambdaForm>() {
|
||||
@Override
|
||||
public LambdaForm apply(MethodHandle target) {
|
||||
return DelegatingMethodHandle.makeReinvokerForm(target,
|
||||
MethodTypeForm.LF_DELEGATE_BLOCK_INLINING, CountingWrapper.class, "reinvoker.dontInline", false,
|
||||
DelegatingMethodHandle.NF_getTarget, CountingWrapper.NF_maybeStopCounting);
|
||||
}
|
||||
};
|
||||
private final static class Makers {
|
||||
/** Constructs reinvoker lambda form which block inlining during JIT-compilation for a particular method handle */
|
||||
static final Function<MethodHandle, LambdaForm> PRODUCE_BLOCK_INLINING_FORM = new Function<MethodHandle, LambdaForm>() {
|
||||
@Override
|
||||
public LambdaForm apply(MethodHandle target) {
|
||||
return DelegatingMethodHandle.makeReinvokerForm(target,
|
||||
MethodTypeForm.LF_DELEGATE_BLOCK_INLINING, CountingWrapper.class, "reinvoker.dontInline", false,
|
||||
DelegatingMethodHandle.NF_getTarget, CountingWrapper.NF_maybeStopCounting);
|
||||
}
|
||||
};
|
||||
|
||||
/** Constructs simple reinvoker lambda form for a particular method handle */
|
||||
private static final Function<MethodHandle, LambdaForm> PRODUCE_REINVOKER_FORM = new Function<MethodHandle, LambdaForm>() {
|
||||
@Override
|
||||
public LambdaForm apply(MethodHandle target) {
|
||||
return DelegatingMethodHandle.makeReinvokerForm(target,
|
||||
MethodTypeForm.LF_DELEGATE, DelegatingMethodHandle.class, DelegatingMethodHandle.NF_getTarget);
|
||||
}
|
||||
};
|
||||
/** Constructs simple reinvoker lambda form for a particular method handle */
|
||||
static final Function<MethodHandle, LambdaForm> PRODUCE_REINVOKER_FORM = new Function<MethodHandle, LambdaForm>() {
|
||||
@Override
|
||||
public LambdaForm apply(MethodHandle target) {
|
||||
return DelegatingMethodHandle.makeReinvokerForm(target,
|
||||
MethodTypeForm.LF_DELEGATE, DelegatingMethodHandle.class, DelegatingMethodHandle.NF_getTarget);
|
||||
}
|
||||
};
|
||||
|
||||
/** Maker of type-polymorphic varargs */
|
||||
static final ClassValue<MethodHandle[]> TYPED_COLLECTORS = new ClassValue<MethodHandle[]>() {
|
||||
@Override
|
||||
protected MethodHandle[] computeValue(Class<?> type) {
|
||||
return new MethodHandle[MAX_JVM_ARITY + 1];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Counting method handle. It has 2 states: counting and non-counting.
|
||||
@ -1527,15 +1531,6 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
return MethodHandles.collectArguments(rightFill, 0, midFill);
|
||||
}
|
||||
|
||||
// Type-polymorphic version of varargs maker.
|
||||
private static final ClassValue<MethodHandle[]> TYPED_COLLECTORS
|
||||
= new ClassValue<MethodHandle[]>() {
|
||||
@Override
|
||||
protected MethodHandle[] computeValue(Class<?> type) {
|
||||
return new MethodHandle[256];
|
||||
}
|
||||
};
|
||||
|
||||
static final int MAX_JVM_ARITY = 255; // limit imposed by the JVM
|
||||
|
||||
/** Return a method handle that takes the indicated number of
|
||||
@ -1557,7 +1552,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
if (elemType == Object.class)
|
||||
return varargsArray(nargs);
|
||||
// other cases: primitive arrays, subtypes of Object[]
|
||||
MethodHandle cache[] = TYPED_COLLECTORS.get(elemType);
|
||||
MethodHandle cache[] = Makers.TYPED_COLLECTORS.get(elemType);
|
||||
MethodHandle mh = nargs < cache.length ? cache[nargs] : null;
|
||||
if (mh != null) return mh;
|
||||
if (nargs == 0) {
|
||||
|
@ -87,9 +87,6 @@ class MethodHandleNatives {
|
||||
private static native void registerNatives();
|
||||
static {
|
||||
registerNatives();
|
||||
|
||||
// The JVM calls MethodHandleNatives.<clinit>. Cascade the <clinit> calls as needed:
|
||||
MethodHandleImpl.initStatics();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -61,7 +61,7 @@ public class MethodHandles {
|
||||
private MethodHandles() { } // do not instantiate
|
||||
|
||||
private static final MemberName.Factory IMPL_NAMES = MemberName.getFactory();
|
||||
static { MethodHandleImpl.initStatics(); }
|
||||
|
||||
// See IMPL_LOOKUP below.
|
||||
|
||||
//// Method handle creation from ordinary methods.
|
||||
|
231
jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java
Normal file
231
jdk/src/java.base/share/classes/java/lang/ref/Cleaner.java
Normal file
@ -0,0 +1,231 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package java.lang.ref;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
import jdk.internal.misc.CleanerImpl;
|
||||
|
||||
/**
|
||||
* {@code Cleaner} manages a set of object references and corresponding cleaning actions.
|
||||
* <p>
|
||||
* Cleaning actions are {@link #register(Object object, Runnable action) registered}
|
||||
* to run after the cleaner is notified that the object has become
|
||||
* phantom reachable.
|
||||
* The cleaner uses {@link PhantomReference} and {@link ReferenceQueue} to be
|
||||
* notified when the <a href="package-summary.html#reachability">reachability</a>
|
||||
* changes.
|
||||
* <p>
|
||||
* Each cleaner operates independently, managing the pending cleaning actions
|
||||
* and handling threading and termination when the cleaner is no longer in use.
|
||||
* Registering an object reference and corresponding cleaning action returns
|
||||
* a {@link Cleanable Cleanable}. The most efficient use is to explicitly invoke
|
||||
* the {@link Cleanable#clean clean} method when the object is closed or
|
||||
* no longer needed.
|
||||
* The cleaning action is a {@link Runnable} to be invoked at most once when
|
||||
* the object has become phantom reachable unless it has already been explicitly cleaned.
|
||||
* Note that the cleaning action must not refer to the object being registered.
|
||||
* If so, the object will not become phantom reachable and the cleaning action
|
||||
* will not be invoked automatically.
|
||||
* <p>
|
||||
* The execution of the cleaning action is performed
|
||||
* by a thread associated with the cleaner.
|
||||
* All exceptions thrown by the cleaning action are ignored.
|
||||
* The cleaner and other cleaning actions are not affected by
|
||||
* exceptions in a cleaning action.
|
||||
* The thread runs until all registered cleaning actions have
|
||||
* completed and the cleaner itself is reclaimed by the garbage collector.
|
||||
* <p>
|
||||
* The behavior of cleaners during {@link System#exit(int) System.exit}
|
||||
* is implementation specific. No guarantees are made relating
|
||||
* to whether cleaning actions are invoked or not.
|
||||
* <p>
|
||||
* Unless otherwise noted, passing a {@code null} argument to a constructor or
|
||||
* method in this class will cause a
|
||||
* {@link java.lang.NullPointerException NullPointerException} to be thrown.
|
||||
*
|
||||
* @apiNote
|
||||
* The cleaning action is invoked only after the associated object becomes
|
||||
* phantom reachable, so it is important that the object implementing the
|
||||
* cleaning action does not hold references to the object.
|
||||
* In this example, a static class encapsulates the cleaning state and action.
|
||||
* An "inner" class, anonymous or not, must not be used because it implicitly
|
||||
* contains a reference to the outer instance, preventing it from becoming
|
||||
* phantom reachable.
|
||||
* The choice of a new cleaner or sharing an existing cleaner is determined
|
||||
* by the use case.
|
||||
* <p>
|
||||
* If the CleaningExample is used in a try-finally block then the
|
||||
* {@code close} method calls the cleaning action.
|
||||
* If the {@code close} method is not called, the cleaning action is called
|
||||
* by the Cleaner when the CleaningExample instance has become phantom reachable.
|
||||
* <pre>{@code
|
||||
* public class CleaningExample implements AutoCloseable {
|
||||
* // A cleaner, preferably one shared within a library
|
||||
* private static final Cleaner cleaner = <cleaner>;
|
||||
*
|
||||
* static class State implements Runnable {
|
||||
*
|
||||
* State(...) {
|
||||
* // initialize State needed for cleaning action
|
||||
* }
|
||||
*
|
||||
* public void run() {
|
||||
* // cleanup action accessing State, executed at most once
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* private final State;
|
||||
* private final Cleaner.Cleanable cleanable
|
||||
*
|
||||
* public CleaningExample() {
|
||||
* this.state = new State(...);
|
||||
* this.cleanable = cleaner.register(this, state);
|
||||
* }
|
||||
*
|
||||
* public void close() {
|
||||
* cleanable.clean();
|
||||
* }
|
||||
* }
|
||||
* }</pre>
|
||||
* The cleaning action could be a lambda but all too easily will capture
|
||||
* the object reference, by referring to fields of the object being cleaned,
|
||||
* preventing the object from becoming phantom reachable.
|
||||
* Using a static nested class, as above, will avoid accidentally retaining the
|
||||
* object reference.
|
||||
* <p>
|
||||
* <a name="compatible-cleaners"></a>
|
||||
* Cleaning actions should be prepared to be invoked concurrently with
|
||||
* other cleaning actions.
|
||||
* Typically the cleaning actions should be very quick to execute
|
||||
* and not block. If the cleaning action blocks, it may delay processing
|
||||
* other cleaning actions registered to the same cleaner.
|
||||
* All cleaning actions registered to a cleaner should be mutually compatible.
|
||||
* @since 9
|
||||
*/
|
||||
public final class Cleaner {
|
||||
|
||||
/**
|
||||
* The Cleaner implementation.
|
||||
*/
|
||||
final CleanerImpl impl;
|
||||
|
||||
static {
|
||||
CleanerImpl.setCleanerImplAccess((Cleaner c) -> c.impl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a Cleaner implementation and start it.
|
||||
*/
|
||||
private Cleaner() {
|
||||
impl = new CleanerImpl();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new {@code Cleaner}.
|
||||
* <p>
|
||||
* The cleaner creates a {@link Thread#setDaemon(boolean) daemon thread}
|
||||
* to process the phantom reachable objects and to invoke cleaning actions.
|
||||
* The {@linkplain java.lang.Thread#getContextClassLoader context class loader}
|
||||
* of the thread is set to the
|
||||
* {@link ClassLoader#getSystemClassLoader() system class loader}.
|
||||
* The thread has no permissions, enforced only if a
|
||||
* {@link java.lang.System#setSecurityManager(SecurityManager) SecurityManager is set}.
|
||||
* <p>
|
||||
* The cleaner terminates when it is phantom reachable and all of the
|
||||
* registered cleaning actions are complete.
|
||||
*
|
||||
* @return a new {@code Cleaner}
|
||||
*
|
||||
* @throws SecurityException if the current thread is not allowed to
|
||||
* create or start the thread.
|
||||
*/
|
||||
public static Cleaner create() {
|
||||
Cleaner cleaner = new Cleaner();
|
||||
cleaner.impl.start(cleaner, null);
|
||||
return cleaner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new {@code Cleaner} using a {@code Thread} from the {@code ThreadFactory}.
|
||||
* <p>
|
||||
* A thread from the thread factory's {@link ThreadFactory#newThread(Runnable) newThread}
|
||||
* method is set to be a {@link Thread#setDaemon(boolean) daemon thread}
|
||||
* and started to process phantom reachable objects and invoke cleaning actions.
|
||||
* On each call the {@link ThreadFactory#newThread(Runnable) thread factory}
|
||||
* must provide a Thread that is suitable for performing the cleaning actions.
|
||||
* <p>
|
||||
* The cleaner terminates when it is phantom reachable and all of the
|
||||
* registered cleaning actions are complete.
|
||||
*
|
||||
* @param threadFactory a {@code ThreadFactory} to return a new {@code Thread}
|
||||
* to process cleaning actions
|
||||
* @return a new {@code Cleaner}
|
||||
*
|
||||
* @throws IllegalThreadStateException if the thread from the thread
|
||||
* factory was {@link Thread.State#NEW not a new thread}.
|
||||
* @throws SecurityException if the current thread is not allowed to
|
||||
* create or start the thread.
|
||||
*/
|
||||
public static Cleaner create(ThreadFactory threadFactory) {
|
||||
Objects.requireNonNull(threadFactory, "threadFactory");
|
||||
Cleaner cleaner = new Cleaner();
|
||||
cleaner.impl.start(cleaner, threadFactory);
|
||||
return cleaner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Registers an object and a cleaning action to run when the object
|
||||
* becomes phantom reachable.
|
||||
* Refer to the <a href="#compatible-cleaners">API Note</a> above for
|
||||
* cautions about the behavior of cleaning actions.
|
||||
*
|
||||
* @param obj the object to monitor
|
||||
* @param action a {@code Runnable} to invoke when the object becomes phantom reachable
|
||||
* @return a {@code Cleanable} instance
|
||||
*/
|
||||
public Cleanable register(Object obj, Runnable action) {
|
||||
Objects.requireNonNull(obj, "obj");
|
||||
Objects.requireNonNull(action, "action");
|
||||
return new CleanerImpl.PhantomCleanableRef(obj, this, action);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@code Cleanable} represents an object and a
|
||||
* cleaning action registered in a {@code Cleaner}.
|
||||
* @since 9
|
||||
*/
|
||||
public interface Cleanable {
|
||||
/**
|
||||
* Unregisters the cleanable and invokes the cleaning action.
|
||||
* The cleanable's cleaning action is invoked at most once
|
||||
* regardless of the number of calls to {@code clean}.
|
||||
*/
|
||||
void clean();
|
||||
}
|
||||
|
||||
}
|
@ -29,7 +29,6 @@ import java.security.PrivilegedAction;
|
||||
import java.security.AccessController;
|
||||
import jdk.internal.misc.JavaLangAccess;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import sun.misc.ManagedLocalsThread;
|
||||
import sun.misc.VM;
|
||||
|
||||
final class Finalizer extends FinalReference<Object> { /* Package-private; must be in
|
||||
@ -131,7 +130,7 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
|
||||
for (ThreadGroup tgn = tg;
|
||||
tgn != null;
|
||||
tg = tgn, tgn = tg.getParent());
|
||||
Thread sft = new ManagedLocalsThread(tg, proc, "Secondary finalizer");
|
||||
Thread sft = new Thread(tg, proc, "Secondary finalizer", 0, false);
|
||||
sft.start();
|
||||
try {
|
||||
sft.join();
|
||||
@ -190,10 +189,10 @@ final class Finalizer extends FinalReference<Object> { /* Package-private; must
|
||||
}}});
|
||||
}
|
||||
|
||||
private static class FinalizerThread extends ManagedLocalsThread {
|
||||
private static class FinalizerThread extends Thread {
|
||||
private volatile boolean running;
|
||||
FinalizerThread(ThreadGroup g) {
|
||||
super(g, "Finalizer");
|
||||
super(g, null, "Finalizer", 0, false);
|
||||
}
|
||||
public void run() {
|
||||
// in case of recursive call to run()
|
||||
|
@ -29,7 +29,6 @@ import sun.misc.Cleaner;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
import jdk.internal.misc.JavaLangRefAccess;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import sun.misc.ManagedLocalsThread;
|
||||
|
||||
/**
|
||||
* Abstract base class for reference objects. This class defines the
|
||||
@ -128,7 +127,7 @@ public abstract class Reference<T> {
|
||||
|
||||
/* High-priority thread to enqueue pending References
|
||||
*/
|
||||
private static class ReferenceHandler extends ManagedLocalsThread {
|
||||
private static class ReferenceHandler extends Thread {
|
||||
|
||||
private static void ensureClassInitialized(Class<?> clazz) {
|
||||
try {
|
||||
@ -147,7 +146,7 @@ public abstract class Reference<T> {
|
||||
}
|
||||
|
||||
ReferenceHandler(ThreadGroup g, String name) {
|
||||
super(g, name);
|
||||
super(g, null, name, 0, false);
|
||||
}
|
||||
|
||||
public void run() {
|
||||
|
@ -53,7 +53,7 @@ public class ReferenceQueue<T> {
|
||||
|
||||
private static class Lock { };
|
||||
private Lock lock = new Lock();
|
||||
private volatile Reference<? extends T> head = null;
|
||||
private volatile Reference<? extends T> head;
|
||||
private long queueLength = 0;
|
||||
|
||||
boolean enqueue(Reference<? extends T> r) { /* Called only by Reference class */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
@ -45,6 +45,8 @@
|
||||
* (or values) from being reclaimed, and phantom references are for
|
||||
* scheduling pre-mortem cleanup actions in a more flexible way than
|
||||
* is possible with the Java finalization mechanism.
|
||||
* Post-mortem cleanup actions can be registered and managed by a
|
||||
* {@link java.lang.ref.Cleaner}.
|
||||
*
|
||||
* <p> Each reference-object type is implemented by a subclass of the
|
||||
* abstract base {@link java.lang.ref.Reference} class.
|
||||
|
@ -42,4 +42,19 @@ public interface AnnotatedArrayType extends AnnotatedType {
|
||||
* @see GenericArrayType#getGenericComponentType()
|
||||
*/
|
||||
AnnotatedType getAnnotatedGenericComponentType();
|
||||
|
||||
/**
|
||||
* Returns the potentially annotated type that this type is a member of, if
|
||||
* this type represents a nested type. For example, if this type is
|
||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||
*
|
||||
* <p>Returns {@code null} for an {@code AnnotatedType} that is an instance
|
||||
* of {@code AnnotatedArrayType}.
|
||||
*
|
||||
* @return {@code null}
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
@Override
|
||||
AnnotatedType getAnnotatedOwnerType();
|
||||
}
|
||||
|
@ -41,4 +41,26 @@ public interface AnnotatedParameterizedType extends AnnotatedType {
|
||||
* @see ParameterizedType#getActualTypeArguments()
|
||||
*/
|
||||
AnnotatedType[] getAnnotatedActualTypeArguments();
|
||||
|
||||
/**
|
||||
* Returns the potentially annotated type that this type is a member of, if
|
||||
* this type represents a nested type. For example, if this type is
|
||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||
*
|
||||
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
|
||||
* top-level type, or a local or anonymous class, or a primitive type, or
|
||||
* void.
|
||||
*
|
||||
* @return an {@code AnnotatedType} object representing the potentially
|
||||
* annotated type that this type is a member of, or {@code null}
|
||||
* @throws TypeNotPresentException if the owner type
|
||||
* refers to a non-existent type declaration
|
||||
* @throws MalformedParameterizedTypeException if the owner type
|
||||
* refers to a parameterized type that cannot be instantiated
|
||||
* for any reason
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
@Override
|
||||
AnnotatedType getAnnotatedOwnerType();
|
||||
}
|
||||
|
@ -35,6 +35,37 @@ package java.lang.reflect;
|
||||
*/
|
||||
public interface AnnotatedType extends AnnotatedElement {
|
||||
|
||||
/**
|
||||
* Returns the potentially annotated type that this type is a member of, if
|
||||
* this type represents a nested type. For example, if this type is
|
||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||
*
|
||||
* <p>Returns {@code null} if this {@code AnnotatedType} represents a
|
||||
* top-level type, or a local or anonymous class, or a primitive type, or
|
||||
* void.
|
||||
*
|
||||
* <p>Returns {@code null} if this {@code AnnotatedType} is an instance of
|
||||
* {@code AnnotatedArrayType}, {@code AnnotatedTypeVariable}, or
|
||||
* {@code AnnotatedWildcardType}.
|
||||
*
|
||||
* @implSpec
|
||||
* This default implementation returns {@code null} and performs no other
|
||||
* action.
|
||||
*
|
||||
* @return an {@code AnnotatedType} object representing the potentially
|
||||
* annotated type that this type is a member of, or {@code null}
|
||||
* @throws TypeNotPresentException if the owner type
|
||||
* refers to a non-existent type declaration
|
||||
* @throws MalformedParameterizedTypeException if the owner type
|
||||
* refers to a parameterized type that cannot be instantiated
|
||||
* for any reason
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
default AnnotatedType getAnnotatedOwnerType() {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the underlying type that this annotated type represents.
|
||||
*
|
||||
|
@ -43,4 +43,19 @@ public interface AnnotatedTypeVariable extends AnnotatedType {
|
||||
* @see TypeVariable#getBounds()
|
||||
*/
|
||||
AnnotatedType[] getAnnotatedBounds();
|
||||
|
||||
/**
|
||||
* Returns the potentially annotated type that this type is a member of, if
|
||||
* this type represents a nested type. For example, if this type is
|
||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||
*
|
||||
* <p>Returns {@code null} for an {@code AnnotatedType} that is an instance
|
||||
* of {@code AnnotatedTypeVariable}.
|
||||
*
|
||||
* @return {@code null}
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
@Override
|
||||
AnnotatedType getAnnotatedOwnerType();
|
||||
}
|
||||
|
@ -54,4 +54,19 @@ public interface AnnotatedWildcardType extends AnnotatedType {
|
||||
* @see WildcardType#getUpperBounds()
|
||||
*/
|
||||
AnnotatedType[] getAnnotatedUpperBounds();
|
||||
|
||||
/**
|
||||
* Returns the potentially annotated type that this type is a member of, if
|
||||
* this type represents a nested type. For example, if this type is
|
||||
* {@code @TA O<T>.I<S>}, return a representation of {@code @TA O<T>}.
|
||||
*
|
||||
* <p>Returns {@code null} for an {@code AnnotatedType} that is an instance
|
||||
* of {@code AnnotatedWildcardType}.
|
||||
*
|
||||
* @return {@code null}
|
||||
*
|
||||
* @since 1.9
|
||||
*/
|
||||
@Override
|
||||
AnnotatedType getAnnotatedOwnerType();
|
||||
}
|
||||
|
@ -205,7 +205,7 @@ public final class Parameter implements AnnotatedElement {
|
||||
return tmp;
|
||||
}
|
||||
|
||||
private transient volatile Type parameterTypeCache = null;
|
||||
private transient volatile Type parameterTypeCache;
|
||||
|
||||
/**
|
||||
* Returns a {@code Class} object that identifies the
|
||||
@ -237,7 +237,7 @@ public final class Parameter implements AnnotatedElement {
|
||||
return executable.getAnnotatedParameterTypes()[index];
|
||||
}
|
||||
|
||||
private transient volatile Class<?> parameterClassCache = null;
|
||||
private transient volatile Class<?> parameterClassCache;
|
||||
|
||||
/**
|
||||
* Returns {@code true} if this parameter is implicitly declared
|
||||
|
@ -34,7 +34,6 @@ import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.function.BiFunction;
|
||||
import sun.misc.ProxyGenerator;
|
||||
import sun.misc.VM;
|
||||
import sun.reflect.CallerSensitive;
|
||||
import sun.reflect.Reflection;
|
||||
|
@ -23,7 +23,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.misc;
|
||||
package java.lang.reflect;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.DataOutputStream;
|
||||
@ -53,7 +53,7 @@ import sun.security.action.GetBooleanAction;
|
||||
* @author Peter Jones
|
||||
* @since 1.3
|
||||
*/
|
||||
public class ProxyGenerator {
|
||||
class ProxyGenerator {
|
||||
/*
|
||||
* In the comments below, "JVMS" refers to The Java Virtual Machine
|
||||
* Specification Second Edition and "JLS" refers to the original
|
||||
@ -314,13 +314,13 @@ public class ProxyGenerator {
|
||||
private static final boolean saveGeneratedFiles =
|
||||
java.security.AccessController.doPrivileged(
|
||||
new GetBooleanAction(
|
||||
"sun.misc.ProxyGenerator.saveGeneratedFiles")).booleanValue();
|
||||
"jdk.proxy.ProxyGenerator.saveGeneratedFiles")).booleanValue();
|
||||
|
||||
/**
|
||||
* Generate a public proxy class given a name and a list of proxy interfaces.
|
||||
*/
|
||||
public static byte[] generateProxyClass(final String name,
|
||||
Class<?>[] interfaces) {
|
||||
static byte[] generateProxyClass(final String name,
|
||||
Class<?>[] interfaces) {
|
||||
return generateProxyClass(name, interfaces, (ACC_PUBLIC | ACC_FINAL | ACC_SUPER));
|
||||
}
|
||||
|
||||
@ -331,9 +331,9 @@ public class ProxyGenerator {
|
||||
* @param interfaces proxy interfaces
|
||||
* @param accessFlags access flags of the proxy class
|
||||
*/
|
||||
public static byte[] generateProxyClass(final String name,
|
||||
Class<?>[] interfaces,
|
||||
int accessFlags)
|
||||
static byte[] generateProxyClass(final String name,
|
||||
Class<?>[] interfaces,
|
||||
int accessFlags)
|
||||
{
|
||||
ProxyGenerator gen = new ProxyGenerator(name, interfaces, accessFlags);
|
||||
final byte[] classFile = gen.generateClassFile();
|
@ -38,8 +38,8 @@ import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import sun.misc.DoubleConsts;
|
||||
import sun.misc.FloatConsts;
|
||||
import jdk.internal.math.DoubleConsts;
|
||||
import jdk.internal.math.FloatConsts;
|
||||
import jdk.internal.HotSpotIntrinsicCandidate;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +33,6 @@ import java.io.Serializable;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CharsetEncoder;
|
||||
import java.nio.charset.CoderResult;
|
||||
import java.nio.charset.CodingErrorAction;
|
||||
import java.nio.charset.CharacterCodingException;
|
||||
@ -490,17 +489,17 @@ public final class URI
|
||||
private transient String path; // null ==> opaque
|
||||
private transient String query;
|
||||
|
||||
// The remaining fields may be computed on demand
|
||||
// The remaining fields may be computed on demand, which is safe even in
|
||||
// the face of multiple threads racing to initialize them
|
||||
private transient String schemeSpecificPart;
|
||||
private transient int hash; // Zero ==> undefined
|
||||
|
||||
private transient volatile String schemeSpecificPart;
|
||||
private transient volatile int hash; // Zero ==> undefined
|
||||
|
||||
private transient volatile String decodedUserInfo = null;
|
||||
private transient volatile String decodedAuthority = null;
|
||||
private transient volatile String decodedPath = null;
|
||||
private transient volatile String decodedQuery = null;
|
||||
private transient volatile String decodedFragment = null;
|
||||
private transient volatile String decodedSchemeSpecificPart = null;
|
||||
private transient String decodedUserInfo;
|
||||
private transient String decodedAuthority;
|
||||
private transient String decodedPath;
|
||||
private transient String decodedQuery;
|
||||
private transient String decodedFragment;
|
||||
private transient String decodedSchemeSpecificPart;
|
||||
|
||||
/**
|
||||
* The string form of this URI.
|
||||
@ -911,8 +910,7 @@ public final class URI
|
||||
// either more fields or a more-obscure representation.
|
||||
if ((host != null) || (authority == null))
|
||||
return this;
|
||||
defineString();
|
||||
new Parser(string).parse(true);
|
||||
new Parser(toString()).parse(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -1144,8 +1142,17 @@ public final class URI
|
||||
* (never {@code null})
|
||||
*/
|
||||
public String getRawSchemeSpecificPart() {
|
||||
defineSchemeSpecificPart();
|
||||
return schemeSpecificPart;
|
||||
String part = schemeSpecificPart;
|
||||
if (part != null) {
|
||||
return part;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
appendSchemeSpecificPart(sb, null, getAuthority(), getUserInfo(),
|
||||
host, port, getPath(), getQuery());
|
||||
if (sb.length() == 0) {
|
||||
return null;
|
||||
}
|
||||
return schemeSpecificPart = sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1160,9 +1167,11 @@ public final class URI
|
||||
* (never {@code null})
|
||||
*/
|
||||
public String getSchemeSpecificPart() {
|
||||
if (decodedSchemeSpecificPart == null)
|
||||
decodedSchemeSpecificPart = decode(getRawSchemeSpecificPart());
|
||||
return decodedSchemeSpecificPart;
|
||||
String part = decodedSchemeSpecificPart;
|
||||
if (part == null) {
|
||||
decodedSchemeSpecificPart = part = decode(getRawSchemeSpecificPart());
|
||||
}
|
||||
return part;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1193,9 +1202,11 @@ public final class URI
|
||||
* or {@code null} if the authority is undefined
|
||||
*/
|
||||
public String getAuthority() {
|
||||
if (decodedAuthority == null)
|
||||
decodedAuthority = decode(authority);
|
||||
return decodedAuthority;
|
||||
String auth = decodedAuthority;
|
||||
if ((auth == null) && (authority != null)) {
|
||||
decodedAuthority = auth = decode(authority);
|
||||
}
|
||||
return auth;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1223,9 +1234,11 @@ public final class URI
|
||||
* or {@code null} if the user information is undefined
|
||||
*/
|
||||
public String getUserInfo() {
|
||||
if ((decodedUserInfo == null) && (userInfo != null))
|
||||
decodedUserInfo = decode(userInfo);
|
||||
return decodedUserInfo;
|
||||
String user = decodedUserInfo;
|
||||
if ((user == null) && (userInfo != null)) {
|
||||
decodedUserInfo = user = decode(userInfo);
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1307,9 +1320,11 @@ public final class URI
|
||||
* or {@code null} if the path is undefined
|
||||
*/
|
||||
public String getPath() {
|
||||
if ((decodedPath == null) && (path != null))
|
||||
decodedPath = decode(path);
|
||||
return decodedPath;
|
||||
String decoded = decodedPath;
|
||||
if ((decoded == null) && (path != null)) {
|
||||
decodedPath = decoded = decode(path);
|
||||
}
|
||||
return decoded;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1336,9 +1351,11 @@ public final class URI
|
||||
* or {@code null} if the query is undefined
|
||||
*/
|
||||
public String getQuery() {
|
||||
if ((decodedQuery == null) && (query != null))
|
||||
decodedQuery = decode(query, false);
|
||||
return decodedQuery;
|
||||
String decoded = decodedQuery;
|
||||
if ((decoded == null) && (query != null)) {
|
||||
decodedQuery = decoded = decode(query, false);
|
||||
}
|
||||
return decoded;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1365,9 +1382,11 @@ public final class URI
|
||||
* or {@code null} if the fragment is undefined
|
||||
*/
|
||||
public String getFragment() {
|
||||
if ((decodedFragment == null) && (fragment != null))
|
||||
decodedFragment = decode(fragment, false);
|
||||
return decodedFragment;
|
||||
String decoded = decodedFragment;
|
||||
if ((decoded == null) && (fragment != null)) {
|
||||
decodedFragment = decoded = decode(fragment, false);
|
||||
}
|
||||
return decoded;
|
||||
}
|
||||
|
||||
|
||||
@ -1453,24 +1472,27 @@ public final class URI
|
||||
* @return A hash-code value for this URI
|
||||
*/
|
||||
public int hashCode() {
|
||||
if (hash != 0)
|
||||
return hash;
|
||||
int h = hashIgnoringCase(0, scheme);
|
||||
h = hash(h, fragment);
|
||||
if (isOpaque()) {
|
||||
h = hash(h, schemeSpecificPart);
|
||||
} else {
|
||||
h = hash(h, path);
|
||||
h = hash(h, query);
|
||||
if (host != null) {
|
||||
h = hash(h, userInfo);
|
||||
h = hashIgnoringCase(h, host);
|
||||
h += 1949 * port;
|
||||
int h = hash;
|
||||
if (h == 0) {
|
||||
h = hashIgnoringCase(0, scheme);
|
||||
h = hash(h, fragment);
|
||||
if (isOpaque()) {
|
||||
h = hash(h, schemeSpecificPart);
|
||||
} else {
|
||||
h = hash(h, authority);
|
||||
h = hash(h, path);
|
||||
h = hash(h, query);
|
||||
if (host != null) {
|
||||
h = hash(h, userInfo);
|
||||
h = hashIgnoringCase(h, host);
|
||||
h += 1949 * port;
|
||||
} else {
|
||||
h = hash(h, authority);
|
||||
}
|
||||
}
|
||||
if (h != 0) {
|
||||
hash = h;
|
||||
}
|
||||
}
|
||||
hash = h;
|
||||
return h;
|
||||
}
|
||||
|
||||
@ -1600,8 +1622,59 @@ public final class URI
|
||||
* @return The string form of this URI
|
||||
*/
|
||||
public String toString() {
|
||||
defineString();
|
||||
return string;
|
||||
String s = string;
|
||||
if (s == null) {
|
||||
s = defineString();
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
private String defineString() {
|
||||
String s = string;
|
||||
if (s != null) {
|
||||
return s;
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (scheme != null) {
|
||||
sb.append(scheme);
|
||||
sb.append(':');
|
||||
}
|
||||
if (isOpaque()) {
|
||||
sb.append(schemeSpecificPart);
|
||||
} else {
|
||||
if (host != null) {
|
||||
sb.append("//");
|
||||
if (userInfo != null) {
|
||||
sb.append(userInfo);
|
||||
sb.append('@');
|
||||
}
|
||||
boolean needBrackets = ((host.indexOf(':') >= 0)
|
||||
&& !host.startsWith("[")
|
||||
&& !host.endsWith("]"));
|
||||
if (needBrackets) sb.append('[');
|
||||
sb.append(host);
|
||||
if (needBrackets) sb.append(']');
|
||||
if (port != -1) {
|
||||
sb.append(':');
|
||||
sb.append(port);
|
||||
}
|
||||
} else if (authority != null) {
|
||||
sb.append("//");
|
||||
sb.append(authority);
|
||||
}
|
||||
if (path != null)
|
||||
sb.append(path);
|
||||
if (query != null) {
|
||||
sb.append('?');
|
||||
sb.append(query);
|
||||
}
|
||||
}
|
||||
if (fragment != null) {
|
||||
sb.append('#');
|
||||
sb.append(fragment);
|
||||
}
|
||||
return string = sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1618,8 +1691,7 @@ public final class URI
|
||||
* charset
|
||||
*/
|
||||
public String toASCIIString() {
|
||||
defineString();
|
||||
return encode(string);
|
||||
return encode(toString());
|
||||
}
|
||||
|
||||
|
||||
@ -1825,7 +1897,7 @@ public final class URI
|
||||
}
|
||||
}
|
||||
|
||||
private void appendAuthority(StringBuffer sb,
|
||||
private void appendAuthority(StringBuilder sb,
|
||||
String authority,
|
||||
String userInfo,
|
||||
String host,
|
||||
@ -1875,7 +1947,7 @@ public final class URI
|
||||
}
|
||||
}
|
||||
|
||||
private void appendSchemeSpecificPart(StringBuffer sb,
|
||||
private void appendSchemeSpecificPart(StringBuilder sb,
|
||||
String opaquePart,
|
||||
String authority,
|
||||
String userInfo,
|
||||
@ -1916,7 +1988,7 @@ public final class URI
|
||||
}
|
||||
}
|
||||
|
||||
private void appendFragment(StringBuffer sb, String fragment) {
|
||||
private void appendFragment(StringBuilder sb, String fragment) {
|
||||
if (fragment != null) {
|
||||
sb.append('#');
|
||||
sb.append(quote(fragment, L_URIC, H_URIC));
|
||||
@ -1933,7 +2005,7 @@ public final class URI
|
||||
String query,
|
||||
String fragment)
|
||||
{
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (scheme != null) {
|
||||
sb.append(scheme);
|
||||
sb.append(':');
|
||||
@ -1945,61 +2017,6 @@ public final class URI
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
private void defineSchemeSpecificPart() {
|
||||
if (schemeSpecificPart != null) return;
|
||||
StringBuffer sb = new StringBuffer();
|
||||
appendSchemeSpecificPart(sb, null, getAuthority(), getUserInfo(),
|
||||
host, port, getPath(), getQuery());
|
||||
if (sb.length() == 0) return;
|
||||
schemeSpecificPart = sb.toString();
|
||||
}
|
||||
|
||||
private void defineString() {
|
||||
if (string != null) return;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (scheme != null) {
|
||||
sb.append(scheme);
|
||||
sb.append(':');
|
||||
}
|
||||
if (isOpaque()) {
|
||||
sb.append(schemeSpecificPart);
|
||||
} else {
|
||||
if (host != null) {
|
||||
sb.append("//");
|
||||
if (userInfo != null) {
|
||||
sb.append(userInfo);
|
||||
sb.append('@');
|
||||
}
|
||||
boolean needBrackets = ((host.indexOf(':') >= 0)
|
||||
&& !host.startsWith("[")
|
||||
&& !host.endsWith("]"));
|
||||
if (needBrackets) sb.append('[');
|
||||
sb.append(host);
|
||||
if (needBrackets) sb.append(']');
|
||||
if (port != -1) {
|
||||
sb.append(':');
|
||||
sb.append(port);
|
||||
}
|
||||
} else if (authority != null) {
|
||||
sb.append("//");
|
||||
sb.append(authority);
|
||||
}
|
||||
if (path != null)
|
||||
sb.append(path);
|
||||
if (query != null) {
|
||||
sb.append('?');
|
||||
sb.append(query);
|
||||
}
|
||||
}
|
||||
if (fragment != null) {
|
||||
sb.append('#');
|
||||
sb.append(fragment);
|
||||
}
|
||||
string = sb.toString();
|
||||
}
|
||||
|
||||
|
||||
// -- Normalization, resolution, and relativization --
|
||||
|
||||
// RFC2396 5.2 (6)
|
||||
@ -2650,13 +2667,13 @@ public final class URI
|
||||
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
|
||||
};
|
||||
|
||||
private static void appendEscape(StringBuffer sb, byte b) {
|
||||
private static void appendEscape(StringBuilder sb, byte b) {
|
||||
sb.append('%');
|
||||
sb.append(hexDigits[(b >> 4) & 0x0f]);
|
||||
sb.append(hexDigits[(b >> 0) & 0x0f]);
|
||||
}
|
||||
|
||||
private static void appendEncoded(StringBuffer sb, char c) {
|
||||
private static void appendEncoded(StringBuilder sb, char c) {
|
||||
ByteBuffer bb = null;
|
||||
try {
|
||||
bb = ThreadLocalCoders.encoderFor("UTF-8")
|
||||
@ -2677,15 +2694,14 @@ public final class URI
|
||||
// by the given mask pair
|
||||
//
|
||||
private static String quote(String s, long lowMask, long highMask) {
|
||||
int n = s.length();
|
||||
StringBuffer sb = null;
|
||||
StringBuilder sb = null;
|
||||
boolean allowNonASCII = ((lowMask & L_ESCAPED) != 0);
|
||||
for (int i = 0; i < s.length(); i++) {
|
||||
char c = s.charAt(i);
|
||||
if (c < '\u0080') {
|
||||
if (!match(c, lowMask, highMask)) {
|
||||
if (sb == null) {
|
||||
sb = new StringBuffer();
|
||||
sb = new StringBuilder();
|
||||
sb.append(s, 0, i);
|
||||
}
|
||||
appendEscape(sb, (byte)c);
|
||||
@ -2697,7 +2713,7 @@ public final class URI
|
||||
&& (Character.isSpaceChar(c)
|
||||
|| Character.isISOControl(c))) {
|
||||
if (sb == null) {
|
||||
sb = new StringBuffer();
|
||||
sb = new StringBuilder();
|
||||
sb.append(s, 0, i);
|
||||
}
|
||||
appendEncoded(sb, c);
|
||||
@ -2734,7 +2750,7 @@ public final class URI
|
||||
assert false;
|
||||
}
|
||||
|
||||
StringBuffer sb = new StringBuffer();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
while (bb.hasRemaining()) {
|
||||
int b = bb.get() & 0xff;
|
||||
if (b >= 0x80)
|
||||
@ -2865,12 +2881,6 @@ public final class URI
|
||||
fail("Expected " + expected, p);
|
||||
}
|
||||
|
||||
private void failExpecting(String expected, String prior, int p)
|
||||
throws URISyntaxException
|
||||
{
|
||||
fail("Expected " + expected + " following " + prior, p);
|
||||
}
|
||||
|
||||
|
||||
// -- Simple access to the input string --
|
||||
|
||||
|
@ -310,7 +310,8 @@ public final class URL implements java.io.Serializable {
|
||||
* @param host the name of the host.
|
||||
* @param port the port number on the host.
|
||||
* @param file the file on the host
|
||||
* @exception MalformedURLException if an unknown protocol is specified.
|
||||
* @exception MalformedURLException if an unknown protocol or the port
|
||||
* is a negative number other than -1
|
||||
* @see java.lang.System#getProperty(java.lang.String)
|
||||
* @see java.net.URL#setURLStreamHandlerFactory(
|
||||
* java.net.URLStreamHandlerFactory)
|
||||
@ -329,9 +330,9 @@ public final class URL implements java.io.Serializable {
|
||||
* name, {@code host} name, and {@code file} name. The
|
||||
* default port for the specified protocol is used.
|
||||
* <p>
|
||||
* This method is equivalent to calling the four-argument
|
||||
* constructor with the arguments being {@code protocol},
|
||||
* {@code host}, {@code -1}, and {@code file}.
|
||||
* This constructor is equivalent to the four-argument
|
||||
* constructor with the only difference of using the
|
||||
* default port for the specified protocol.
|
||||
*
|
||||
* No validation of the inputs is performed by this constructor.
|
||||
*
|
||||
@ -372,7 +373,8 @@ public final class URL implements java.io.Serializable {
|
||||
* @param port the port number on the host.
|
||||
* @param file the file on the host
|
||||
* @param handler the stream handler for the URL.
|
||||
* @exception MalformedURLException if an unknown protocol is specified.
|
||||
* @exception MalformedURLException if an unknown protocol or the port
|
||||
is a negative number other than -1
|
||||
* @exception SecurityException
|
||||
* if a security manager exists and its
|
||||
* {@code checkPermission} method doesn't allow
|
||||
@ -446,7 +448,9 @@ public final class URL implements java.io.Serializable {
|
||||
*
|
||||
* @param spec the {@code String} to parse as a URL.
|
||||
* @exception MalformedURLException if no protocol is specified, or an
|
||||
* unknown protocol is found, or {@code spec} is {@code null}.
|
||||
* unknown protocol is found, or {@code spec} is {@code null},
|
||||
* or the parsed URL fails to comply with the specific syntax
|
||||
* of the associated protocol.
|
||||
* @see java.net.URL#URL(java.net.URL, java.lang.String)
|
||||
*/
|
||||
public URL(String spec) throws MalformedURLException {
|
||||
@ -493,7 +497,9 @@ public final class URL implements java.io.Serializable {
|
||||
* @param context the context in which to parse the specification.
|
||||
* @param spec the {@code String} to parse as a URL.
|
||||
* @exception MalformedURLException if no protocol is specified, or an
|
||||
* unknown protocol is found, or {@code spec} is {@code null}.
|
||||
* unknown protocol is found, or {@code spec} is {@code null},
|
||||
* or the parsed URL fails to comply with the specific syntax
|
||||
* of the associated protocol.
|
||||
* @see java.net.URL#URL(java.lang.String, java.lang.String,
|
||||
* int, java.lang.String)
|
||||
* @see java.net.URLStreamHandler
|
||||
@ -513,7 +519,9 @@ public final class URL implements java.io.Serializable {
|
||||
* @param spec the {@code String} to parse as a URL.
|
||||
* @param handler the stream handler for the URL.
|
||||
* @exception MalformedURLException if no protocol is specified, or an
|
||||
* unknown protocol is found, or {@code spec} is {@code null}.
|
||||
* unknown protocol is found, or {@code spec} is {@code null},
|
||||
* or the parsed URL fails to comply with the specific syntax
|
||||
* of the associated protocol.
|
||||
* @exception SecurityException
|
||||
* if a security manager exists and its
|
||||
* {@code checkPermission} method doesn't allow
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1995, 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
|
||||
@ -1550,7 +1550,7 @@ public abstract class URLConnection {
|
||||
}
|
||||
|
||||
if (c1 == 0xFF && c2 == 0xD8 && c3 == 0xFF) {
|
||||
if (c4 == 0xE0) {
|
||||
if (c4 == 0xE0 || c4 == 0xEE) {
|
||||
return "image/jpeg";
|
||||
}
|
||||
|
||||
@ -1565,10 +1565,6 @@ public abstract class URLConnection {
|
||||
c11 == 0)) {
|
||||
return "image/jpeg";
|
||||
}
|
||||
|
||||
if (c4 == 0xEE) {
|
||||
return "image/jpg";
|
||||
}
|
||||
}
|
||||
|
||||
if (c1 == 0xD0 && c2 == 0xCF && c3 == 0x11 && c4 == 0xE0 &&
|
||||
|
@ -25,9 +25,7 @@
|
||||
|
||||
package java.nio;
|
||||
|
||||
import java.security.AccessController;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.concurrent.atomic.LongAdder;
|
||||
|
||||
import jdk.internal.misc.JavaNioAccess;
|
||||
import jdk.internal.misc.JavaLangRefAccess;
|
||||
@ -603,7 +601,8 @@ class Bits { // package-private
|
||||
private static final AtomicLong reservedMemory = new AtomicLong();
|
||||
private static final AtomicLong totalCapacity = new AtomicLong();
|
||||
private static final AtomicLong count = new AtomicLong();
|
||||
private static volatile boolean memoryLimitSet = false;
|
||||
private static volatile boolean memoryLimitSet;
|
||||
|
||||
// max. number of sleeps during try-reserving with exponentially
|
||||
// increasing delay before throwing OutOfMemoryError:
|
||||
// 1, 2, 4, 8, 16, 32, 64, 128, 256 (total 511 ms ~ 0.5 s)
|
||||
|
@ -26,8 +26,6 @@
|
||||
package java.nio.channels;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* A token representing the registration of a {@link SelectableChannel} with a
|
||||
@ -363,7 +361,7 @@ public abstract class SelectionKey {
|
||||
|
||||
// -- Attachments --
|
||||
|
||||
private volatile Object attachment = null;
|
||||
private volatile Object attachment;
|
||||
|
||||
private static final AtomicReferenceFieldUpdater<SelectionKey,Object>
|
||||
attachmentUpdater = AtomicReferenceFieldUpdater.newUpdater(
|
||||
|
@ -29,11 +29,7 @@
|
||||
package java.nio.channels.spi;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.nio.channels.*;
|
||||
import java.security.AccessController;
|
||||
import java.security.PrivilegedAction;
|
||||
import jdk.internal.misc.SharedSecrets;
|
||||
import sun.nio.ch.Interruptible;
|
||||
|
||||
@ -90,7 +86,7 @@ public abstract class AbstractInterruptibleChannel
|
||||
{
|
||||
|
||||
private final Object closeLock = new Object();
|
||||
private volatile boolean open = true;
|
||||
private volatile boolean closed;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of this class.
|
||||
@ -110,9 +106,9 @@ public abstract class AbstractInterruptibleChannel
|
||||
*/
|
||||
public final void close() throws IOException {
|
||||
synchronized (closeLock) {
|
||||
if (!open)
|
||||
if (closed)
|
||||
return;
|
||||
open = false;
|
||||
closed = true;
|
||||
implCloseChannel();
|
||||
}
|
||||
}
|
||||
@ -136,7 +132,7 @@ public abstract class AbstractInterruptibleChannel
|
||||
protected abstract void implCloseChannel() throws IOException;
|
||||
|
||||
public final boolean isOpen() {
|
||||
return open;
|
||||
return !closed;
|
||||
}
|
||||
|
||||
|
||||
@ -158,9 +154,9 @@ public abstract class AbstractInterruptibleChannel
|
||||
interruptor = new Interruptible() {
|
||||
public void interrupt(Thread target) {
|
||||
synchronized (closeLock) {
|
||||
if (!open)
|
||||
if (closed)
|
||||
return;
|
||||
open = false;
|
||||
closed = true;
|
||||
interrupted = target;
|
||||
try {
|
||||
AbstractInterruptibleChannel.this.implCloseChannel();
|
||||
@ -202,7 +198,7 @@ public abstract class AbstractInterruptibleChannel
|
||||
this.interrupted = null;
|
||||
throw new ClosedByInterruptException();
|
||||
}
|
||||
if (!completed && !open)
|
||||
if (!completed && closed)
|
||||
throw new AsynchronousCloseException();
|
||||
}
|
||||
|
||||
|
@ -276,7 +276,7 @@ public abstract class Charset
|
||||
|
||||
/* -- Static methods -- */
|
||||
|
||||
private static volatile String bugLevel = null;
|
||||
private static volatile String bugLevel;
|
||||
|
||||
static boolean atBugLevel(String bl) { // package-private
|
||||
String level = bugLevel;
|
||||
@ -324,8 +324,8 @@ public abstract class Charset
|
||||
// Cache of the most-recently-returned charsets,
|
||||
// along with the names that were used to find them
|
||||
//
|
||||
private static volatile Object[] cache1 = null; // "Level 1" cache
|
||||
private static volatile Object[] cache2 = null; // "Level 2" cache
|
||||
private static volatile Object[] cache1; // "Level 1" cache
|
||||
private static volatile Object[] cache2; // "Level 2" cache
|
||||
|
||||
private static void cache(String charsetName, Charset cs) {
|
||||
cache2 = cache1;
|
||||
|
@ -124,7 +124,7 @@ public class SecureRandom extends java.util.Random {
|
||||
private String algorithm;
|
||||
|
||||
// Seed Generator
|
||||
private static volatile SecureRandom seedGenerator = null;
|
||||
private static volatile SecureRandom seedGenerator;
|
||||
|
||||
/**
|
||||
* Constructs a secure random number generator (RNG) implementing the
|
||||
@ -522,10 +522,12 @@ public class SecureRandom extends java.util.Random {
|
||||
* @see #setSeed
|
||||
*/
|
||||
public static byte[] getSeed(int numBytes) {
|
||||
if (seedGenerator == null) {
|
||||
seedGenerator = new SecureRandom();
|
||||
SecureRandom seedGen = seedGenerator;
|
||||
if (seedGen == null) {
|
||||
seedGen = new SecureRandom();
|
||||
seedGenerator = seedGen;
|
||||
}
|
||||
return seedGenerator.generateSeed(numBytes);
|
||||
return seedGen.generateSeed(numBytes);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -27,7 +27,7 @@ package java.security.cert;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import sun.security.util.DerValue;
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ import java.security.PublicKey;
|
||||
import java.util.*;
|
||||
import javax.security.auth.x500.X500Principal;
|
||||
|
||||
import sun.misc.HexDumpEncoder;
|
||||
import sun.security.util.HexDumpEncoder;
|
||||
import sun.security.util.Debug;
|
||||
import sun.security.util.DerInputStream;
|
||||
import sun.security.util.DerValue;
|
||||
|
@ -630,7 +630,9 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
hashCode = 11 * hashCode + Arrays.hashCode(ampms);
|
||||
hashCode = 11 * hashCode + Arrays.deepHashCode(getZoneStringsWrapper());
|
||||
hashCode = 11 * hashCode + Objects.hashCode(localPatternChars);
|
||||
cachedHashCode = hashCode;
|
||||
if (hashCode != 0) {
|
||||
cachedHashCode = hashCode;
|
||||
}
|
||||
}
|
||||
|
||||
return hashCode;
|
||||
@ -670,12 +672,12 @@ public class DateFormatSymbols implements Serializable, Cloneable {
|
||||
private static final ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> cachedInstances
|
||||
= new ConcurrentHashMap<>(3);
|
||||
|
||||
private transient int lastZoneIndex = 0;
|
||||
private transient int lastZoneIndex;
|
||||
|
||||
/**
|
||||
* Cached hash code
|
||||
*/
|
||||
transient volatile int cachedHashCode = 0;
|
||||
transient volatile int cachedHashCode;
|
||||
|
||||
private void initializeData(Locale desiredLocale) {
|
||||
locale = desiredLocale;
|
||||
|
@ -42,14 +42,8 @@ import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.Serializable;
|
||||
import java.text.spi.DecimalFormatSymbolsProvider;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Currency;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
import sun.util.locale.provider.LocaleProviderAdapter;
|
||||
import sun.util.locale.provider.LocaleServiceProviderPool;
|
||||
import sun.util.locale.provider.ResourceBundleBasedAdapter;
|
||||
@ -875,7 +869,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
|
||||
|
||||
// currency; only the ISO code is serialized.
|
||||
private transient Currency currency;
|
||||
private transient volatile boolean currencyInitialized = false;
|
||||
private transient volatile boolean currencyInitialized;
|
||||
|
||||
// Proclaim JDK 1.1 FCS compatibility
|
||||
static final long serialVersionUID = 5772796243397350300L;
|
||||
|
@ -41,7 +41,7 @@ package java.text;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigInteger;
|
||||
import java.math.RoundingMode;
|
||||
import sun.misc.FloatingDecimal;
|
||||
import jdk.internal.math.FloatingDecimal;
|
||||
|
||||
/**
|
||||
* Digit List. Private to DecimalFormat.
|
||||
|
@ -1856,6 +1856,7 @@ public class SimpleDateFormat extends DateFormat {
|
||||
if (patternCharIndex == PATTERN_HOUR_OF_DAY1 ||
|
||||
patternCharIndex == PATTERN_HOUR1 ||
|
||||
(patternCharIndex == PATTERN_MONTH && count <= 2) ||
|
||||
(patternCharIndex == PATTERN_MONTH_STANDALONE && count <= 2) ||
|
||||
patternCharIndex == PATTERN_YEAR ||
|
||||
patternCharIndex == PATTERN_WEEK_YEAR) {
|
||||
// It would be good to unify this with the obeyCount logic below,
|
||||
@ -1976,6 +1977,20 @@ public class SimpleDateFormat extends DateFormat {
|
||||
}
|
||||
break parsing;
|
||||
|
||||
case PATTERN_MONTH_STANDALONE: // 'L'
|
||||
if (count <= 2) {
|
||||
// Don't want to parse the month if it is a string
|
||||
// while pattern uses numeric style: L or LL
|
||||
//[we computed 'value' above.]
|
||||
calb.set(Calendar.MONTH, value - 1);
|
||||
return pos.index;
|
||||
}
|
||||
Map<String, Integer> maps = getDisplayNamesMap(field, locale);
|
||||
if ((index = matchString(text, start, field, maps, calb)) > 0) {
|
||||
return index;
|
||||
}
|
||||
break parsing;
|
||||
|
||||
case PATTERN_HOUR_OF_DAY1: // 'k' 1-based. eg, 23:59 + 1 hour =>> 24:59
|
||||
if (!isLenient()) {
|
||||
// Validate the hour value in non-lenient
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user