Merge
This commit is contained in:
commit
9961d7cb45
@ -5,3 +5,4 @@ cbc8ad9dd0e085a607427ea35411990982f19a36 jdk7-b25
|
|||||||
56652b46f328937f6b9b5130f1e4cd80f48868ef jdk7-b28
|
56652b46f328937f6b9b5130f1e4cd80f48868ef jdk7-b28
|
||||||
31e08f70e88d77c2053f91c21b49a04296bdc59a jdk7-b29
|
31e08f70e88d77c2053f91c21b49a04296bdc59a jdk7-b29
|
||||||
2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30
|
2dab2f712e1832c92acfa63ec0337048b9422c20 jdk7-b30
|
||||||
|
3300a35a0bd56d695b92fe0b34f03ebbfc939064 jdk7-b31
|
||||||
|
@ -5,15 +5,12 @@
|
|||||||
</head>
|
</head>
|
||||||
<body style="background-color:lightcyan">
|
<body style="background-color:lightcyan">
|
||||||
<!-- ====================================================== -->
|
<!-- ====================================================== -->
|
||||||
<table width="100%" style="background-color:white">
|
+ <table width="100%">
|
||||||
<tr>
|
<tr>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
<a href="http://openjdk.java.net" border="0">
|
<img alt="OpenJDK"
|
||||||
<img alt="OpenJDK"
|
src="http://openjdk.java.net/images/openjdk.png"
|
||||||
src="http://openjdk.java.net/images/openjdk.png"
|
width=256 />
|
||||||
width=256
|
|
||||||
style="border-style: none"/>
|
|
||||||
</a>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@ -54,6 +51,7 @@
|
|||||||
<li><a href="#bootjdk">Bootstrap JDK</a> </li>
|
<li><a href="#bootjdk">Bootstrap JDK</a> </li>
|
||||||
<li><a href="#binaryplugs">Binary Plugs</a> </li>
|
<li><a href="#binaryplugs">Binary Plugs</a> </li>
|
||||||
<li><a href="#importjdk">Optional Import JDK</a> </li>
|
<li><a href="#importjdk">Optional Import JDK</a> </li>
|
||||||
|
<li><a href="#ant">Ant</a> </li>
|
||||||
<li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
|
<li><a href="#cacerts">Certificate Authority File (cacert)</a> </li>
|
||||||
<li><a href="#compilers">Compilers</a>
|
<li><a href="#compilers">Compilers</a>
|
||||||
<ul>
|
<ul>
|
||||||
@ -424,24 +422,37 @@
|
|||||||
you should use <tt>gmake</tt>
|
you should use <tt>gmake</tt>
|
||||||
which will be located in either the <tt>/opt/sfw/bin</tt> or
|
which will be located in either the <tt>/opt/sfw/bin</tt> or
|
||||||
<tt>/usr/sfw/bin</tt> directory.
|
<tt>/usr/sfw/bin</tt> directory.
|
||||||
|
In more recent versions of Solaris GNU make can be found
|
||||||
|
at <tt>/usr/bin/gmake</tt>.
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<strong>Windows:</strong>
|
<strong>Windows:</strong>
|
||||||
Make sure you start your build inside a bash/sh/ksh shell.
|
Make sure you start your build inside a bash/sh/ksh shell.
|
||||||
<br>
|
<br>
|
||||||
<b>WARNING:</b> Watch out for make version 3.81, it may
|
<b>WARNING:</b> Watch out for make version 3.81, it may
|
||||||
not work due to a lack of support for drive letter paths
|
not work due to a lack of support for MS-DOS drive letter paths
|
||||||
like <tt>C:/</tt>. See
|
like <tt>C:/</tt> or <tt>C:\</tt>.
|
||||||
<a href="#gmake">section on gmake</a>.
|
|
||||||
Use a 3.80 version, or find a newer
|
Use a 3.80 version, or find a newer
|
||||||
version that has this problem fixed.
|
version that has this problem fixed, like 3.82.
|
||||||
The older 3.80 version of make.exe can be downloaded with this
|
The older 3.80 version of make.exe can be downloaded with this
|
||||||
<a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2" target="_blank">
|
<a href="http://cygwin.paracoda.com/release/make/make-3.80-1.tar.bz2" target="_blank">
|
||||||
link</a>.
|
link</a>.
|
||||||
|
Use of this older 3.80 make.exe may require that you install the
|
||||||
|
libintl2.dll library or libintl2 cygwin package which is
|
||||||
|
no longer installed by default by the cygwin installer.
|
||||||
|
<br>
|
||||||
Also see the
|
Also see the
|
||||||
<a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
|
<a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
|
||||||
mozilla developer center</a>
|
mozilla developer center</a>
|
||||||
on this topic.
|
on this topic.
|
||||||
|
<br>
|
||||||
|
It's hoped that when make 3.82 starts shipping in a future cygwin
|
||||||
|
release that this MS-DOS path issue will be fixed.
|
||||||
|
In addition to the above 3.80 make.exe you can download
|
||||||
|
this
|
||||||
|
<a href="http://www.cmake.org/files/cygwin/make.exe">
|
||||||
|
www.cmake.org make.exe</a> which will not have a libintl2.dll
|
||||||
|
dependency.
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>
|
<p>
|
||||||
@ -507,6 +518,11 @@
|
|||||||
Install or upgrade the <a href="#freetype">FreeType development
|
Install or upgrade the <a href="#freetype">FreeType development
|
||||||
package</a>.
|
package</a>.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
Install
|
||||||
|
<a href="#ant">Ant</a>, set
|
||||||
|
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<!-- ------------------------------------------------------ -->
|
<!-- ------------------------------------------------------ -->
|
||||||
@ -567,6 +583,11 @@
|
|||||||
<a href="#cups">CUPS Include files</a>, set
|
<a href="#cups">CUPS Include files</a>, set
|
||||||
<tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
|
<tt><a href="#ALT_CUPS_HEADERS_PATH">ALT_CUPS_HEADERS_PATH</a></tt>.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
Install
|
||||||
|
<a href="#ant">Ant</a>, set
|
||||||
|
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<!-- ------------------------------------------------------ -->
|
<!-- ------------------------------------------------------ -->
|
||||||
@ -654,6 +675,11 @@
|
|||||||
Install
|
Install
|
||||||
<a href="#dxsdk">Microsoft DirectX SDK</a>.
|
<a href="#dxsdk">Microsoft DirectX SDK</a>.
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
Install
|
||||||
|
<a href="#ant">Ant</a>, set
|
||||||
|
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>.
|
||||||
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<!-- ------------------------------------------------------ -->
|
<!-- ------------------------------------------------------ -->
|
||||||
@ -736,6 +762,22 @@
|
|||||||
and the build will copy the needed files from this import area.
|
and the build will copy the needed files from this import area.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<!-- ------------------------------------------------------ -->
|
<!-- ------------------------------------------------------ -->
|
||||||
|
<h4><a name="ant">Ant</a></h4>
|
||||||
|
<blockquote>
|
||||||
|
All OpenJDK builds require access to least Ant 1.6.5.
|
||||||
|
The Ant tool is available from the
|
||||||
|
<a href="http://ant.apache.org/antlibs/bindownload.cgi" target="_blank">
|
||||||
|
Ant download site</a>.
|
||||||
|
You should always set
|
||||||
|
<tt><a href="#ANT_HOME">ANT_HOME</a></tt>
|
||||||
|
to point to the location of
|
||||||
|
the Ant installation, this is the directory pathname
|
||||||
|
that contains a <tt>bin and lib</tt>.
|
||||||
|
It's also a good idea to also place its <tt>bin</tt> directory
|
||||||
|
in the <tt>PATH</tt> environment variable, although it's
|
||||||
|
not absolutely required.
|
||||||
|
</blockquote>
|
||||||
|
<!-- ------------------------------------------------------ -->
|
||||||
<h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
|
<h4><a name="cacerts">Certificate Authority File (cacert)</a></h4>
|
||||||
<blockquote>
|
<blockquote>
|
||||||
See <a href="http://en.wikipedia.org/wiki/Certificate_Authority" target="_blank">
|
See <a href="http://en.wikipedia.org/wiki/Certificate_Authority" target="_blank">
|
||||||
@ -915,6 +957,21 @@
|
|||||||
and
|
and
|
||||||
<tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt>
|
<tt><a href="#ALT_FREETYPE_HEADERS_PATH">ALT_FREETYPE_HEADERS_PATH</a></tt>
|
||||||
to refer to place where library and header files are installed.
|
to refer to place where library and header files are installed.
|
||||||
|
<p>
|
||||||
|
Building the freetype 2 libraries from scratch is also possible,
|
||||||
|
however on Windows refer to the
|
||||||
|
<a href="http://freetype.freedesktop.org/wiki/FreeType_DLL">
|
||||||
|
Windows FreeType DLL build instructions</a>.
|
||||||
|
<p>
|
||||||
|
Note that by default FreeType is built with byte code hinting
|
||||||
|
support disabled due to licensing restrictions.
|
||||||
|
In this case, text appearance and metrics are expected to
|
||||||
|
differ from Sun's official JDK build.
|
||||||
|
See
|
||||||
|
<a href="http://freetype.sourceforge.net/freetype2/index.html">
|
||||||
|
the SourceForge FreeType2 Home Page
|
||||||
|
</a>
|
||||||
|
for more information.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<!-- ------------------------------------------------------ -->
|
<!-- ------------------------------------------------------ -->
|
||||||
<h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4>
|
<h4><a name="alsa">Advanced Linux Sound Architecture (ALSA) (Linux only)</a></h4>
|
||||||
@ -1036,7 +1093,8 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>make.exe</td>
|
<td>make.exe</td>
|
||||||
<td>Devel</td>
|
<td>Devel</td>
|
||||||
<td>make: The GNU version of the 'make' utility</td>
|
<td>make: The GNU version of the 'make' utility<br>
|
||||||
|
<b>NOTE</b>: See <a href="#gmake">the GNU make section</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>m4.exe</td>
|
<td>m4.exe</td>
|
||||||
@ -1050,7 +1108,7 @@
|
|||||||
<td>cpio: A program to manage archives of files</td>
|
<td>cpio: A program to manage archives of files</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>awk.exe</td>
|
<td>gawk.exe</td>
|
||||||
<td>Utils</td>
|
<td>Utils</td>
|
||||||
<td>awk: Pattern-directed scanning and processing language</td>
|
<td>awk: Pattern-directed scanning and processing language</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -1061,17 +1119,17 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>zip.exe</td>
|
<td>zip.exe</td>
|
||||||
<td>Utils</td>
|
<td>Archive</td>
|
||||||
<td>zip: Package and compress (archive) files</td>
|
<td>zip: Package and compress (archive) files</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>unzip.exe</td>
|
<td>unzip.exe</td>
|
||||||
<td>Utils</td>
|
<td>Archive</td>
|
||||||
<td>unzip: Extract compressed files in a ZIP archive</td>
|
<td>unzip: Extract compressed files in a ZIP archive</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>free.exe</td>
|
<td>free.exe</td>
|
||||||
<td>Utils</td>
|
<td>Procps</td>
|
||||||
<td>free: Display amount of free and used memory in the system</td>
|
<td>free: Display amount of free and used memory in the system</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@ -1224,46 +1282,6 @@
|
|||||||
document) that can impact the build are:
|
document) that can impact the build are:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><a name="path"><tt>PATH</tt></a> </dt>
|
|
||||||
<dd>Typically you want to set the <tt>PATH</tt> to include:
|
|
||||||
<ul>
|
|
||||||
<li>The location of the GNU make binary</li>
|
|
||||||
<li>The location of the Bootstrap JDK <tt>java</tt>
|
|
||||||
(see <a href="#bootjdk">Bootstrap JDK</a>)</li>
|
|
||||||
<li>The location of the C/C++ compilers
|
|
||||||
(see <a href="#compilers"><tt>compilers</tt></a>)</li>
|
|
||||||
<li>The location or locations for the Unix command utilities
|
|
||||||
(e.g. <tt>/usr/bin</tt>)</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
<dt><tt>MILESTONE</tt> </dt>
|
|
||||||
<dd>
|
|
||||||
The milestone name for the build (<i>e.g.</i>"beta").
|
|
||||||
The default value is "internal".
|
|
||||||
</dd>
|
|
||||||
<dt><tt>BUILD_NUMBER</tt> </dt>
|
|
||||||
<dd>
|
|
||||||
The build number for the build (<i>e.g.</i> "b27").
|
|
||||||
The default value is "b00".
|
|
||||||
</dd>
|
|
||||||
<dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
|
|
||||||
<dd>The <tt>ARCH_DATA_MODEL</tt> variable
|
|
||||||
is used to specify whether the build is to generate 32-bit or 64-bit
|
|
||||||
binaries.
|
|
||||||
The Solaris build supports either 32-bit or 64-bit builds, but
|
|
||||||
Windows and Linux will support only one, depending on the specific
|
|
||||||
OS being used.
|
|
||||||
Normally, setting this variable is only necessary on Solaris.
|
|
||||||
Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries,
|
|
||||||
or to <tt>64</tt> for generating 64-bit binaries.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
The location of the bootstrap JDK installation.
|
|
||||||
See <a href="#bootjdk">Bootstrap JDK</a> for more information.
|
|
||||||
You should always install your own local Bootstrap JDK and
|
|
||||||
always set <tt>ALT_BOOTDIR</tt> explicitly.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_BINARY_PLUGS_PATH"><tt>ALT_BINARY_PLUGS_PATH</tt></a></dt>
|
<dt><a name="ALT_BINARY_PLUGS_PATH"><tt>ALT_BINARY_PLUGS_PATH</tt></a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
The location of the binary plugs installation.
|
The location of the binary plugs installation.
|
||||||
@ -1272,118 +1290,12 @@
|
|||||||
recent Binary Plugs install image
|
recent Binary Plugs install image
|
||||||
and set this variable to that location.
|
and set this variable to that location.
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a name="ALT_JDK_IMPORT_PATH"><tt>ALT_JDK_IMPORT_PATH</tt></a></dt>
|
<dt><a name="ALT_BOOTDIR"><tt>ALT_BOOTDIR</tt></a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
The location of a previously built JDK installation.
|
The location of the bootstrap JDK installation.
|
||||||
See <a href="#importjdk">Optional Import JDK</a> for more information.
|
See <a href="#bootjdk">Bootstrap JDK</a> for more information.
|
||||||
</dd>
|
You should always install your own local Bootstrap JDK and
|
||||||
<dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt>
|
always set <tt>ALT_BOOTDIR</tt> explicitly.
|
||||||
<dd>
|
|
||||||
An override for specifying the (absolute) path of where the
|
|
||||||
build output is to go.
|
|
||||||
The default output directory will be build/<i>platform</i>.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
|
|
||||||
<dd>
|
|
||||||
The location of the C/C++ compiler.
|
|
||||||
The default varies depending on the platform.
|
|
||||||
</dd>
|
|
||||||
<dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
|
|
||||||
<dd>
|
|
||||||
The location of the <a href="#cacerts">cacerts</a> file.
|
|
||||||
The default will refer to
|
|
||||||
<tt>jdk/src/share/lib/security/cacerts</tt>.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
|
|
||||||
<dd>
|
|
||||||
The location of the CUPS header files.
|
|
||||||
See <a href="#cups">CUPS information</a> for more information.
|
|
||||||
If this path does not exist the fallback path is
|
|
||||||
<tt>/usr/include</tt>.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
The location of the FreeType shared library.
|
|
||||||
See <a href="#freetype">FreeType information</a> for details.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
The location of the FreeType header files.
|
|
||||||
See <a href="#freetype">FreeType information</a> for details.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_JDK_DEVTOOLS_PATH"><tt>ALT_JDK_DEVTOOLS_PATH</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
The default root location of the devtools.
|
|
||||||
The default value is
|
|
||||||
<tt>$(ALT_SLASH_JAVA)/devtools</tt>.
|
|
||||||
</dd>
|
|
||||||
<dt><tt><a name="ALT_DEVTOOLS_PATH">ALT_DEVTOOLS_PATH</a></tt> </dt>
|
|
||||||
<dd>
|
|
||||||
The location of tools like the
|
|
||||||
<a href="#zip"><tt>zip</tt> and <tt>unzip</tt></a>
|
|
||||||
binaries, but might also contain the GNU make utility
|
|
||||||
(<tt><i>gmake</i></tt>).
|
|
||||||
So this area is a bit of a grab bag, especially on Windows.
|
|
||||||
The default value depends on the platform and
|
|
||||||
Unix Commands being used.
|
|
||||||
On Linux the default will be
|
|
||||||
<tt>$(ALT_JDK_DEVTOOLS_PATH)/linux/bin</tt>,
|
|
||||||
on Solaris
|
|
||||||
<tt>$(ALT_JDK_DEVTOOLS_PATH)/<i>{sparc,i386}</i>/bin</tt>,
|
|
||||||
on Windows with MKS
|
|
||||||
<tt>%SYSTEMDRIVE%/UTILS</tt>,
|
|
||||||
and on Windows with CYGWIN
|
|
||||||
<tt>/usr/bin</tt>.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_UNIXCOMMAND_PATH"><tt>ALT_UNIXCOMMAND_PATH</tt></a> </dt>
|
|
||||||
<dd>
|
|
||||||
An override for specifying where the
|
|
||||||
Unix command set are located.
|
|
||||||
The default location varies depending on the platform,
|
|
||||||
<tt>"%SYSTEMDRIVE%/MKSNT"</tt> or
|
|
||||||
<tt>$(ROOTDIR)</tt> on Windows with MKS, otherwise it's
|
|
||||||
<tt>"/bin"</tt> or <tt>/usr/bin</tt>.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
<strong>Solaris only:</strong>
|
|
||||||
An override for specifying where the Unix CCS
|
|
||||||
command set are located.
|
|
||||||
The default location is <tt>/usr/ccs/bin</tt>
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_USRBIN_PATH"><tt>ALT_USRBIN_PATH</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
An override for specifying where the
|
|
||||||
Unix <tt>/usr/bin</tt> commands are located. You usually do not need
|
|
||||||
to set this variable: the default location is <tt>/usr/bin</tt>)
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_SLASHJAVA"><tt>ALT_SLASHJAVA</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
The default root location for many of the ALT path locations
|
|
||||||
of the following ALT variables.
|
|
||||||
The default value is
|
|
||||||
<tt>"/java"</tt> on Solaris and Linux,
|
|
||||||
<tt>"J:"</tt> on Windows.
|
|
||||||
</dd>
|
|
||||||
<dt><a name="ALT_BUILD_JDK_IMPORT_PATH"><tt>ALT_BUILD_JDK_IMPORT_PATH</tt></a></dt>
|
|
||||||
<dd>
|
|
||||||
These are useful in managing builds on multiple platforms.
|
|
||||||
The default network location for all of the import JDK images
|
|
||||||
for all platforms.
|
|
||||||
If <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
|
|
||||||
is not set, this directory will be used and should contain
|
|
||||||
the following directories:
|
|
||||||
<tt>solaris-sparc</tt>,
|
|
||||||
<tt>solaris-i586</tt>,
|
|
||||||
<tt>solaris-sparcv9</tt>,
|
|
||||||
<tt>solaris-amd64</tt>,
|
|
||||||
<tt>linux-i586</tt>,
|
|
||||||
<tt>linux-amd64</tt>,
|
|
||||||
<tt>windows-i586</tt>,
|
|
||||||
and
|
|
||||||
<tt>windows-amd64</tt>.
|
|
||||||
Where each of these directories contain the import JDK image
|
|
||||||
for that platform.
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt><a name="ALT_BUILD_BINARY_PLUGS_PATH"><tt>ALT_BUILD_BINARY_PLUGS_PATH</tt></a></dt>
|
<dt><a name="ALT_BUILD_BINARY_PLUGS_PATH"><tt>ALT_BUILD_BINARY_PLUGS_PATH</tt></a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
@ -1405,36 +1317,186 @@
|
|||||||
Where each of these directories contain the binary plugs image
|
Where each of these directories contain the binary plugs image
|
||||||
for that platform.
|
for that platform.
|
||||||
</dd>
|
</dd>
|
||||||
<dt><strong>Windows specific:</strong></dt>
|
<dt><a name="ALT_BUILD_JDK_IMPORT_PATH"><tt>ALT_BUILD_JDK_IMPORT_PATH</tt></a></dt>
|
||||||
<dd>
|
<dd>
|
||||||
<dl>
|
These are useful in managing builds on multiple platforms.
|
||||||
<dt><a name="ALT_MSDEVTOOLS_PATH"><tt>ALT_MSDEVTOOLS_PATH</tt></a> </dt>
|
The default network location for all of the import JDK images
|
||||||
<dd>
|
for all platforms.
|
||||||
The location of the Microsoft Visual Studio .NET 2003
|
If <tt><a href="#ALT_JDK_IMPORT_PATH">ALT_JDK_IMPORT_PATH</a></tt>
|
||||||
tools 'bin' directory.
|
is not set, this directory will be used and should contain
|
||||||
The default is usually derived from
|
the following directories:
|
||||||
<a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
|
<tt>solaris-sparc</tt>,
|
||||||
</dd>
|
<tt>solaris-i586</tt>,
|
||||||
<dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
|
<tt>solaris-sparcv9</tt>,
|
||||||
<dd>
|
<tt>solaris-amd64</tt>,
|
||||||
The location of the
|
<tt>linux-i586</tt>,
|
||||||
<a href="#dxsdk">Microsoft DirectX 9 SDK</a>.
|
<tt>linux-amd64</tt>,
|
||||||
The default will be to try and use the DirectX environment
|
<tt>windows-i586</tt>,
|
||||||
variable <tt>DXSDK_DIR</tt>,
|
and
|
||||||
failing that, look in <tt>C:/DXSDK</tt>.
|
<tt>windows-amd64</tt>.
|
||||||
</dd>
|
Where each of these directories contain the import JDK image
|
||||||
<dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt>
|
for that platform.
|
||||||
<dd>
|
</dd>
|
||||||
The location of the
|
<dt><tt><a name="ALT_CACERTS_FILE">ALT_CACERTS_FILE</a></tt></dt>
|
||||||
<a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>.
|
<dd>
|
||||||
</dd>
|
The location of the <a href="#cacerts">cacerts</a> file.
|
||||||
<dt><tt><a name="ALT_MSVCR71_DLL_PATH">ALT_MSVCR71_DLL_PATH</a></tt> </dt>
|
The default will refer to
|
||||||
<dd>
|
<tt>jdk/src/share/lib/security/cacerts</tt>.
|
||||||
<strong>i586 only:</strong>
|
</dd>
|
||||||
The location of the
|
<dt><a name="ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> </dt>
|
||||||
<a href="#msvcr71"><tt>MSVCR71.DLL</tt></a>.
|
<dd>
|
||||||
</dd>
|
The location of the C/C++ compiler.
|
||||||
</dl>
|
The default varies depending on the platform.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_CUPS_HEADERS_PATH"><tt>ALT_CUPS_HEADERS_PATH</tt></a> </dt>
|
||||||
|
<dd>
|
||||||
|
The location of the CUPS header files.
|
||||||
|
See <a href="#cups">CUPS information</a> for more information.
|
||||||
|
If this path does not exist the fallback path is
|
||||||
|
<tt>/usr/include</tt>.
|
||||||
|
</dd>
|
||||||
|
<dt><tt><a name="ALT_DEVTOOLS_PATH">ALT_DEVTOOLS_PATH</a></tt> </dt>
|
||||||
|
<dd>
|
||||||
|
The location of tools like the
|
||||||
|
<a href="#zip"><tt>zip</tt> and <tt>unzip</tt></a>
|
||||||
|
binaries, but might also contain the GNU make utility
|
||||||
|
(<tt><i>gmake</i></tt>).
|
||||||
|
So this area is a bit of a grab bag, especially on Windows.
|
||||||
|
The default value depends on the platform and
|
||||||
|
Unix Commands being used.
|
||||||
|
On Linux the default will be
|
||||||
|
<tt>$(ALT_JDK_DEVTOOLS_PATH)/linux/bin</tt>,
|
||||||
|
on Solaris
|
||||||
|
<tt>$(ALT_JDK_DEVTOOLS_PATH)/<i>{sparc,i386}</i>/bin</tt>,
|
||||||
|
on Windows with MKS
|
||||||
|
<tt>%SYSTEMDRIVE%/UTILS</tt>,
|
||||||
|
and on Windows with CYGWIN
|
||||||
|
<tt>/usr/bin</tt>.
|
||||||
|
</dd>
|
||||||
|
<dt><tt><a name="ALT_DXSDK_PATH">ALT_DXSDK_PATH</a></tt> </dt>
|
||||||
|
<dd>
|
||||||
|
<strong>Windows Only:</strong>
|
||||||
|
The location of the
|
||||||
|
<a href="#dxsdk">Microsoft DirectX 9 SDK</a>.
|
||||||
|
The default will be to try and use the DirectX environment
|
||||||
|
variable <tt>DXSDK_DIR</tt>,
|
||||||
|
failing that, look in <tt>C:/DXSDK</tt>.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_FREETYPE_HEADERS_PATH"><tt>ALT_FREETYPE_HEADERS_PATH</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
The location of the FreeType header files.
|
||||||
|
See <a href="#freetype">FreeType information</a> for details.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_FREETYPE_LIB_PATH"><tt>ALT_FREETYPE_LIB_PATH</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
The location of the FreeType shared library.
|
||||||
|
See <a href="#freetype">FreeType information</a> for details.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_JDK_DEVTOOLS_PATH"><tt>ALT_JDK_DEVTOOLS_PATH</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
The default root location of the devtools.
|
||||||
|
The default value is
|
||||||
|
<tt>$(ALT_SLASH_JAVA)/devtools</tt>.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_JDK_IMPORT_PATH"><tt>ALT_JDK_IMPORT_PATH</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
The location of a previously built JDK installation.
|
||||||
|
See <a href="#importjdk">Optional Import JDK</a> for more information.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_MSDEVTOOLS_PATH"><tt>ALT_MSDEVTOOLS_PATH</tt></a> </dt>
|
||||||
|
<dd>
|
||||||
|
<strong>Windows Only:</strong>
|
||||||
|
The location of the Microsoft Visual Studio .NET 2003
|
||||||
|
tools 'bin' directory.
|
||||||
|
The default is usually derived from
|
||||||
|
<a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a>.
|
||||||
|
</dd>
|
||||||
|
<dt><tt><a name="ALT_MSVCR71_DLL_PATH">ALT_MSVCR71_DLL_PATH</a></tt> </dt>
|
||||||
|
<dd>
|
||||||
|
<strong>Windows i586 only:</strong>
|
||||||
|
The location of the
|
||||||
|
<a href="#msvcr71"><tt>MSVCR71.DLL</tt></a>.
|
||||||
|
</dd>
|
||||||
|
<dt><tt><a name="ALT_MSVCRT_DLL_PATH">ALT_MSVCRT_DLL_PATH</a></tt> </dt>
|
||||||
|
<dd>
|
||||||
|
<strong>Windows Only:</strong>
|
||||||
|
The location of the
|
||||||
|
<a href="#msvcrt"><tt>MSVCRT.DLL</tt></a>.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_OUTPUTDIR"><tt>ALT_OUTPUTDIR</tt></a> </dt>
|
||||||
|
<dd>
|
||||||
|
An override for specifying the (absolute) path of where the
|
||||||
|
build output is to go.
|
||||||
|
The default output directory will be build/<i>platform</i>.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_SLASHJAVA"><tt>ALT_SLASHJAVA</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
The default root location for many of the ALT path locations
|
||||||
|
of the following ALT variables.
|
||||||
|
The default value is
|
||||||
|
<tt>"/java"</tt> on Solaris and Linux,
|
||||||
|
<tt>"J:"</tt> on Windows.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_UNIXCCS_PATH"><tt>ALT_UNIXCCS_PATH</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
<strong>Solaris only:</strong>
|
||||||
|
An override for specifying where the Unix CCS
|
||||||
|
command set are located.
|
||||||
|
The default location is <tt>/usr/ccs/bin</tt>
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_UNIXCOMMAND_PATH"><tt>ALT_UNIXCOMMAND_PATH</tt></a> </dt>
|
||||||
|
<dd>
|
||||||
|
An override for specifying where the
|
||||||
|
Unix command set are located.
|
||||||
|
The default location varies depending on the platform,
|
||||||
|
<tt>"%SYSTEMDRIVE%/MKSNT"</tt> or
|
||||||
|
<tt>$(ROOTDIR)</tt> on Windows with MKS, otherwise it's
|
||||||
|
<tt>"/bin"</tt> or <tt>/usr/bin</tt>.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ALT_USRBIN_PATH"><tt>ALT_USRBIN_PATH</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
An override for specifying where the
|
||||||
|
Unix <tt>/usr/bin</tt> commands are located. You usually do not need
|
||||||
|
to set this variable: the default location is <tt>/usr/bin</tt>)
|
||||||
|
</dd>
|
||||||
|
<dt><a name="ANT_HOME"><tt>ANT_HOME</tt></a></dt>
|
||||||
|
<dd>
|
||||||
|
The location of the Ant installation.
|
||||||
|
See <a href="#ant">Ant</a> for more information.
|
||||||
|
You should always set <tt>ANT_HOME</tt> explicitly.
|
||||||
|
</dd>
|
||||||
|
<dt><a name="arch_data_model"><tt>ARCH_DATA_MODEL</tt></a></dt>
|
||||||
|
<dd>The <tt>ARCH_DATA_MODEL</tt> variable
|
||||||
|
is used to specify whether the build is to generate 32-bit or 64-bit
|
||||||
|
binaries.
|
||||||
|
The Solaris build supports either 32-bit or 64-bit builds, but
|
||||||
|
Windows and Linux will support only one, depending on the specific
|
||||||
|
OS being used.
|
||||||
|
Normally, setting this variable is only necessary on Solaris.
|
||||||
|
Set <tt>ARCH_DATA_MODEL</tt> to <tt>32</tt> for generating 32-bit binaries,
|
||||||
|
or to <tt>64</tt> for generating 64-bit binaries.
|
||||||
|
</dd>
|
||||||
|
<dt><tt>BUILD_NUMBER</tt> </dt>
|
||||||
|
<dd>
|
||||||
|
The build number for the build (<i>e.g.</i> "b27").
|
||||||
|
The default value is "b00".
|
||||||
|
</dd>
|
||||||
|
<dt><tt>MILESTONE</tt> </dt>
|
||||||
|
<dd>
|
||||||
|
The milestone name for the build (<i>e.g.</i>"beta").
|
||||||
|
The default value is "internal".
|
||||||
|
</dd>
|
||||||
|
<dt><a name="path"><tt>PATH</tt></a> </dt>
|
||||||
|
<dd>Typically you want to set the <tt>PATH</tt> to include:
|
||||||
|
<ul>
|
||||||
|
<li>The location of the GNU make binary</li>
|
||||||
|
<li>The location of the Bootstrap JDK <tt>java</tt>
|
||||||
|
(see <a href="#bootjdk">Bootstrap JDK</a>)</li>
|
||||||
|
<li>The location of the C/C++ compilers
|
||||||
|
(see <a href="#compilers"><tt>compilers</tt></a>)</li>
|
||||||
|
<li>The location or locations for the Unix command utilities
|
||||||
|
(e.g. <tt>/usr/bin</tt>)</li>
|
||||||
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
@ -5,3 +5,4 @@ e3d2692f8442e2d951166dc9bd9a330684754438 jdk7-b27
|
|||||||
c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28
|
c14dab40ed9bf45ad21150bd70c9c80cdf655415 jdk7-b28
|
||||||
4f91c08b3e4498213a9c5a24898f7d9c38cf86fb jdk7-b29
|
4f91c08b3e4498213a9c5a24898f7d9c38cf86fb jdk7-b29
|
||||||
d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30
|
d1605aabd0a15ecf93787c47de63073c33fba52d jdk7-b30
|
||||||
|
9c2ecc2ffb125f14fab3857fe7689598956348a0 jdk7-b31
|
||||||
|
@ -2414,8 +2414,20 @@ static bool linux_mprotect(char* addr, size_t size, int prot) {
|
|||||||
return ::mprotect(bottom, size, prot) == 0;
|
return ::mprotect(bottom, size, prot) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::protect_memory(char* addr, size_t size) {
|
// Set protections specified
|
||||||
return linux_mprotect(addr, size, PROT_READ);
|
bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
|
||||||
|
bool is_committed) {
|
||||||
|
unsigned int p = 0;
|
||||||
|
switch (prot) {
|
||||||
|
case MEM_PROT_NONE: p = PROT_NONE; break;
|
||||||
|
case MEM_PROT_READ: p = PROT_READ; break;
|
||||||
|
case MEM_PROT_RW: p = PROT_READ|PROT_WRITE; break;
|
||||||
|
case MEM_PROT_RWX: p = PROT_READ|PROT_WRITE|PROT_EXEC; break;
|
||||||
|
default:
|
||||||
|
ShouldNotReachHere();
|
||||||
|
}
|
||||||
|
// is_committed is unused.
|
||||||
|
return linux_mprotect(addr, bytes, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::guard_memory(char* addr, size_t size) {
|
bool os::guard_memory(char* addr, size_t size) {
|
||||||
@ -3704,8 +3716,9 @@ void os::make_polling_page_unreadable(void) {
|
|||||||
|
|
||||||
// Mark the polling page as readable
|
// Mark the polling page as readable
|
||||||
void os::make_polling_page_readable(void) {
|
void os::make_polling_page_readable(void) {
|
||||||
if( !protect_memory((char *)_polling_page, Linux::page_size()) )
|
if( !linux_mprotect((char *)_polling_page, Linux::page_size(), PROT_READ)) {
|
||||||
fatal("Could not enable polling page");
|
fatal("Could not enable polling page");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
int os::active_processor_count() {
|
int os::active_processor_count() {
|
||||||
|
@ -2965,10 +2965,21 @@ static bool solaris_mprotect(char* addr, size_t bytes, int prot) {
|
|||||||
return retVal == 0;
|
return retVal == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Protect memory (make it read-only. (Used to pass readonly pages through
|
// Protect memory (Used to pass readonly pages through
|
||||||
// JNI GetArray<type>Elements with empty arrays.)
|
// JNI GetArray<type>Elements with empty arrays.)
|
||||||
bool os::protect_memory(char* addr, size_t bytes) {
|
bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
|
||||||
return solaris_mprotect(addr, bytes, PROT_READ);
|
bool is_committed) {
|
||||||
|
unsigned int p = 0;
|
||||||
|
switch (prot) {
|
||||||
|
case MEM_PROT_NONE: p = PROT_NONE; break;
|
||||||
|
case MEM_PROT_READ: p = PROT_READ; break;
|
||||||
|
case MEM_PROT_RW: p = PROT_READ|PROT_WRITE; break;
|
||||||
|
case MEM_PROT_RWX: p = PROT_READ|PROT_WRITE|PROT_EXEC; break;
|
||||||
|
default:
|
||||||
|
ShouldNotReachHere();
|
||||||
|
}
|
||||||
|
// is_committed is unused.
|
||||||
|
return solaris_mprotect(addr, bytes, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// guard_memory and unguard_memory only happens within stack guard pages.
|
// guard_memory and unguard_memory only happens within stack guard pages.
|
||||||
|
@ -2170,6 +2170,7 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
|
|||||||
// Windows 98 reports faulting addresses incorrectly
|
// Windows 98 reports faulting addresses incorrectly
|
||||||
if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) ||
|
if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr) ||
|
||||||
!os::win32::is_nt()) {
|
!os::win32::is_nt()) {
|
||||||
|
|
||||||
return Handle_Exception(exceptionInfo,
|
return Handle_Exception(exceptionInfo,
|
||||||
SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL));
|
SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL));
|
||||||
}
|
}
|
||||||
@ -2563,9 +2564,33 @@ bool os::release_memory(char* addr, size_t bytes) {
|
|||||||
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
|
return VirtualFree(addr, 0, MEM_RELEASE) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::protect_memory(char* addr, size_t bytes) {
|
// Set protections specified
|
||||||
|
bool os::protect_memory(char* addr, size_t bytes, ProtType prot,
|
||||||
|
bool is_committed) {
|
||||||
|
unsigned int p = 0;
|
||||||
|
switch (prot) {
|
||||||
|
case MEM_PROT_NONE: p = PAGE_NOACCESS; break;
|
||||||
|
case MEM_PROT_READ: p = PAGE_READONLY; break;
|
||||||
|
case MEM_PROT_RW: p = PAGE_READWRITE; break;
|
||||||
|
case MEM_PROT_RWX: p = PAGE_EXECUTE_READWRITE; break;
|
||||||
|
default:
|
||||||
|
ShouldNotReachHere();
|
||||||
|
}
|
||||||
|
|
||||||
DWORD old_status;
|
DWORD old_status;
|
||||||
return VirtualProtect(addr, bytes, PAGE_READONLY, &old_status) != 0;
|
|
||||||
|
// Strange enough, but on Win32 one can change protection only for committed
|
||||||
|
// memory, not a big deal anyway, as bytes less or equal than 64K
|
||||||
|
if (!is_committed && !commit_memory(addr, bytes)) {
|
||||||
|
fatal("cannot commit protection page");
|
||||||
|
}
|
||||||
|
// One cannot use os::guard_memory() here, as on Win32 guard page
|
||||||
|
// have different (one-shot) semantics, from MSDN on PAGE_GUARD:
|
||||||
|
//
|
||||||
|
// Pages in the region become guard pages. Any attempt to access a guard page
|
||||||
|
// causes the system to raise a STATUS_GUARD_PAGE exception and turn off
|
||||||
|
// the guard page status. Guard pages thus act as a one-time access alarm.
|
||||||
|
return VirtualProtect(addr, bytes, p, &old_status) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool os::guard_memory(char* addr, size_t bytes) {
|
bool os::guard_memory(char* addr, size_t bytes) {
|
||||||
|
@ -27,12 +27,6 @@
|
|||||||
|
|
||||||
#include <asm-sparc/traps.h>
|
#include <asm-sparc/traps.h>
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// Since the linux kernel resides at the low end of
|
|
||||||
// user address space, no null pointer check is needed.
|
|
||||||
return offset < 0 || offset >= 0x100000;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroAssembler::read_ccr_trap(Register ccr_save) {
|
void MacroAssembler::read_ccr_trap(Register ccr_save) {
|
||||||
// No implementation
|
// No implementation
|
||||||
breakpoint_trap();
|
breakpoint_trap();
|
||||||
|
@ -39,10 +39,3 @@ void MacroAssembler::get_thread(Register thread) {
|
|||||||
|
|
||||||
movptr(thread, tls);
|
movptr(thread, tls);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// Linux kernel guarantees that the first page is always unmapped. Don't
|
|
||||||
// assume anything more than that.
|
|
||||||
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
|
|
||||||
return !offset_in_first_page;
|
|
||||||
}
|
|
||||||
|
@ -65,22 +65,3 @@ void MacroAssembler::get_thread(Register thread) {
|
|||||||
popq(rax);
|
popq(rax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// Exception handler checks the nmethod's implicit null checks table
|
|
||||||
// only when this method returns false.
|
|
||||||
if (UseCompressedOops) {
|
|
||||||
// The first page after heap_base is unmapped and
|
|
||||||
// the 'offset' is equal to [heap_base + offset] for
|
|
||||||
// narrow oop implicit null checks.
|
|
||||||
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
|
|
||||||
if ((uintptr_t)offset >= heap_base) {
|
|
||||||
// Normalize offset for the next check.
|
|
||||||
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Linux kernel guarantees that the first page is always unmapped. Don't
|
|
||||||
// assume anything more than that.
|
|
||||||
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
|
|
||||||
return !offset_in_first_page;
|
|
||||||
}
|
|
||||||
|
@ -28,18 +28,6 @@
|
|||||||
#include <sys/trap.h> // For trap numbers
|
#include <sys/trap.h> // For trap numbers
|
||||||
#include <v9/sys/psr_compat.h> // For V8 compatibility
|
#include <v9/sys/psr_compat.h> // For V8 compatibility
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// The first page of virtual addresses is unmapped on SPARC.
|
|
||||||
// Thus, any access the VM makes through a null pointer with an offset of
|
|
||||||
// less than 4K will get a recognizable SIGSEGV, which the signal handler
|
|
||||||
// will transform into a NullPointerException.
|
|
||||||
// (Actually, the first 64K or so is unmapped, but it's simpler
|
|
||||||
// to depend only on the first 4K or so.)
|
|
||||||
|
|
||||||
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
|
|
||||||
return !offset_in_first_page;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MacroAssembler::read_ccr_trap(Register ccr_save) {
|
void MacroAssembler::read_ccr_trap(Register ccr_save) {
|
||||||
// Execute a trap to get the PSR, mask and shift
|
// Execute a trap to get the PSR, mask and shift
|
||||||
// to get the condition codes.
|
// to get the condition codes.
|
||||||
|
@ -79,9 +79,3 @@ void MacroAssembler::get_thread(Register thread) {
|
|||||||
if (thread != rax) popl(rax);
|
if (thread != rax) popl(rax);
|
||||||
popl(thread);
|
popl(thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// Identical to Sparc/Solaris code
|
|
||||||
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
|
|
||||||
return !offset_in_first_page;
|
|
||||||
}
|
|
||||||
|
@ -85,22 +85,3 @@ void MacroAssembler::get_thread(Register thread) {
|
|||||||
popq(rax);
|
popq(rax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// Identical to Sparc/Solaris code
|
|
||||||
|
|
||||||
// Exception handler checks the nmethod's implicit null checks table
|
|
||||||
// only when this method returns false.
|
|
||||||
if (UseCompressedOops) {
|
|
||||||
// The first page after heap_base is unmapped and
|
|
||||||
// the 'offset' is equal to [heap_base + offset] for
|
|
||||||
// narrow oop implicit null checks.
|
|
||||||
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
|
|
||||||
if ((uintptr_t)offset >= heap_base) {
|
|
||||||
// Normalize offset for the next check.
|
|
||||||
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bool offset_in_first_page = 0 <= offset && offset < os::vm_page_size();
|
|
||||||
return !offset_in_first_page;
|
|
||||||
}
|
|
||||||
|
@ -58,7 +58,3 @@ void MacroAssembler::get_thread(Register thread) {
|
|||||||
"Thread Pointer Offset has not been initialized");
|
"Thread Pointer Offset has not been initialized");
|
||||||
movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset()));
|
movl(thread, Address(thread, ThreadLocalStorage::get_thread_ptr_offset()));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
return offset < 0 || (int)os::vm_page_size() <= offset;
|
|
||||||
}
|
|
||||||
|
@ -65,19 +65,3 @@ void MacroAssembler::get_thread(Register thread) {
|
|||||||
popq(rax);
|
popq(rax);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
|
||||||
// Exception handler checks the nmethod's implicit null checks table
|
|
||||||
// only when this method returns false.
|
|
||||||
if (UseCompressedOops) {
|
|
||||||
// The first page after heap_base is unmapped and
|
|
||||||
// the 'offset' is equal to [heap_base + offset] for
|
|
||||||
// narrow oop implicit null checks.
|
|
||||||
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
|
|
||||||
if ((uintptr_t)offset >= heap_base) {
|
|
||||||
// Normalize offset for the next check.
|
|
||||||
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return offset < 0 || os::vm_page_size() <= offset;
|
|
||||||
}
|
|
||||||
|
@ -246,6 +246,24 @@ void AbstractAssembler::block_comment(const char* comment) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
||||||
|
// Exception handler checks the nmethod's implicit null checks table
|
||||||
|
// only when this method returns false.
|
||||||
|
#ifndef SPARC
|
||||||
|
// Sparc does not have based addressing
|
||||||
|
if (UseCompressedOops) {
|
||||||
|
// The first page after heap_base is unmapped and
|
||||||
|
// the 'offset' is equal to [heap_base + offset] for
|
||||||
|
// narrow oop implicit null checks.
|
||||||
|
uintptr_t heap_base = (uintptr_t)Universe::heap_base();
|
||||||
|
if ((uintptr_t)offset >= heap_base) {
|
||||||
|
// Normalize offset for the next check.
|
||||||
|
offset = (intptr_t)(pointer_delta((void*)offset, (void*)heap_base, 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // SPARC
|
||||||
|
return offset < 0 || os::vm_page_size() <= offset;
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
void Label::print_instructions(MacroAssembler* masm) const {
|
void Label::print_instructions(MacroAssembler* masm) const {
|
||||||
|
@ -61,6 +61,8 @@ ParMarkBitMap::initialize(MemRegion covered_region)
|
|||||||
if (_virtual_space != NULL) {
|
if (_virtual_space != NULL) {
|
||||||
delete _virtual_space;
|
delete _virtual_space;
|
||||||
_virtual_space = NULL;
|
_virtual_space = NULL;
|
||||||
|
// Release memory reserved in the space.
|
||||||
|
rs.release();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -108,8 +108,8 @@ jint ParallelScavengeHeap::initialize() {
|
|||||||
// size than is needed or wanted for the perm gen. Use the "compound
|
// size than is needed or wanted for the perm gen. Use the "compound
|
||||||
// alignment" ReservedSpace ctor to avoid having to use the same page size for
|
// alignment" ReservedSpace ctor to avoid having to use the same page size for
|
||||||
// all gens.
|
// all gens.
|
||||||
ReservedSpace heap_rs(pg_max_size, pg_align, og_max_size + yg_max_size,
|
ReservedHeapSpace heap_rs(pg_max_size, pg_align, og_max_size + yg_max_size,
|
||||||
og_align);
|
og_align);
|
||||||
os::trace_page_sizes("ps perm", pg_min_size, pg_max_size, pg_page_sz,
|
os::trace_page_sizes("ps perm", pg_min_size, pg_max_size, pg_page_sz,
|
||||||
heap_rs.base(), pg_max_size);
|
heap_rs.base(), pg_max_size);
|
||||||
os::trace_page_sizes("ps main", og_min_size + yg_min_size,
|
os::trace_page_sizes("ps main", og_min_size + yg_min_size,
|
||||||
|
@ -422,6 +422,8 @@ ParallelCompactData::create_vspace(size_t count, size_t element_size)
|
|||||||
return vspace;
|
return vspace;
|
||||||
}
|
}
|
||||||
delete vspace;
|
delete vspace;
|
||||||
|
// Release memory reserved in the space.
|
||||||
|
rs.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -71,13 +71,8 @@ bool PSVirtualSpace::contains(void* p) const {
|
|||||||
|
|
||||||
void PSVirtualSpace::release() {
|
void PSVirtualSpace::release() {
|
||||||
DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this));
|
DEBUG_ONLY(PSVirtualSpaceVerifier this_verifier(this));
|
||||||
if (reserved_low_addr() != NULL) {
|
// This may not release memory it didn't reserve.
|
||||||
if (special()) {
|
// Use rs.release() to release the underlying memory instead.
|
||||||
os::release_memory_special(reserved_low_addr(), reserved_size());
|
|
||||||
} else {
|
|
||||||
(void)os::release_memory(reserved_low_addr(), reserved_size());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
_reserved_low_addr = _reserved_high_addr = NULL;
|
_reserved_low_addr = _reserved_high_addr = NULL;
|
||||||
_committed_low_addr = _committed_high_addr = NULL;
|
_committed_low_addr = _committed_high_addr = NULL;
|
||||||
_special = false;
|
_special = false;
|
||||||
|
@ -222,8 +222,8 @@ char* GenCollectedHeap::allocate(size_t alignment,
|
|||||||
|
|
||||||
*_total_reserved = total_reserved;
|
*_total_reserved = total_reserved;
|
||||||
*_n_covered_regions = n_covered_regions;
|
*_n_covered_regions = n_covered_regions;
|
||||||
*heap_rs = ReservedSpace(total_reserved, alignment,
|
*heap_rs = ReservedHeapSpace(total_reserved, alignment,
|
||||||
UseLargePages, heap_address);
|
UseLargePages, heap_address);
|
||||||
|
|
||||||
return heap_address;
|
return heap_address;
|
||||||
}
|
}
|
||||||
|
@ -2173,8 +2173,7 @@ static char* get_bad_address() {
|
|||||||
size_t size = os::vm_allocation_granularity();
|
size_t size = os::vm_allocation_granularity();
|
||||||
bad_address = os::reserve_memory(size);
|
bad_address = os::reserve_memory(size);
|
||||||
if (bad_address != NULL) {
|
if (bad_address != NULL) {
|
||||||
os::commit_memory(bad_address, size);
|
os::protect_memory(bad_address, size, os::MEM_PROT_READ);
|
||||||
os::protect_memory(bad_address, size);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return bad_address;
|
return bad_address;
|
||||||
|
@ -1176,8 +1176,7 @@ void Arguments::set_ergonomics_flags() {
|
|||||||
// by ergonomics.
|
// by ergonomics.
|
||||||
if (MaxHeapSize <= max_heap_for_compressed_oops()) {
|
if (MaxHeapSize <= max_heap_for_compressed_oops()) {
|
||||||
if (FLAG_IS_DEFAULT(UseCompressedOops)) {
|
if (FLAG_IS_DEFAULT(UseCompressedOops)) {
|
||||||
// Leave compressed oops off by default. Uncomment
|
// Turn off until bug is fixed.
|
||||||
// the following line to return it to default status.
|
|
||||||
// FLAG_SET_ERGO(bool, UseCompressedOops, true);
|
// FLAG_SET_ERGO(bool, UseCompressedOops, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -922,8 +922,9 @@ void os::serialize_thread_states() {
|
|||||||
// time and expensive page trap spinning, 'SerializePageLock' is used to block
|
// time and expensive page trap spinning, 'SerializePageLock' is used to block
|
||||||
// the mutator thread if such case is encountered. See bug 6546278 for details.
|
// the mutator thread if such case is encountered. See bug 6546278 for details.
|
||||||
Thread::muxAcquire(&SerializePageLock, "serialize_thread_states");
|
Thread::muxAcquire(&SerializePageLock, "serialize_thread_states");
|
||||||
os::protect_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() );
|
os::protect_memory((char *)os::get_memory_serialize_page(),
|
||||||
os::unguard_memory( (char *)os::get_memory_serialize_page(), os::vm_page_size() );
|
os::vm_page_size(), MEM_PROT_READ, /*is_committed*/true );
|
||||||
|
os::unguard_memory((char *)os::get_memory_serialize_page(), os::vm_page_size());
|
||||||
Thread::muxRelease(&SerializePageLock);
|
Thread::muxRelease(&SerializePageLock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -193,7 +193,11 @@ class os: AllStatic {
|
|||||||
static bool commit_memory(char* addr, size_t size, size_t alignment_hint);
|
static bool commit_memory(char* addr, size_t size, size_t alignment_hint);
|
||||||
static bool uncommit_memory(char* addr, size_t bytes);
|
static bool uncommit_memory(char* addr, size_t bytes);
|
||||||
static bool release_memory(char* addr, size_t bytes);
|
static bool release_memory(char* addr, size_t bytes);
|
||||||
static bool protect_memory(char* addr, size_t bytes);
|
|
||||||
|
enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
|
||||||
|
static bool protect_memory(char* addr, size_t bytes, ProtType prot,
|
||||||
|
bool is_committed = false);
|
||||||
|
|
||||||
static bool guard_memory(char* addr, size_t bytes);
|
static bool guard_memory(char* addr, size_t bytes);
|
||||||
static bool unguard_memory(char* addr, size_t bytes);
|
static bool unguard_memory(char* addr, size_t bytes);
|
||||||
static char* map_memory(int fd, const char* file_name, size_t file_offset,
|
static char* map_memory(int fd, const char* file_name, size_t file_offset,
|
||||||
|
@ -28,12 +28,15 @@
|
|||||||
|
|
||||||
// ReservedSpace
|
// ReservedSpace
|
||||||
ReservedSpace::ReservedSpace(size_t size) {
|
ReservedSpace::ReservedSpace(size_t size) {
|
||||||
initialize(size, 0, false, NULL);
|
initialize(size, 0, false, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReservedSpace::ReservedSpace(size_t size, size_t alignment,
|
ReservedSpace::ReservedSpace(size_t size, size_t alignment,
|
||||||
bool large, char* requested_address) {
|
bool large,
|
||||||
initialize(size, alignment, large, requested_address);
|
char* requested_address,
|
||||||
|
const size_t noaccess_prefix) {
|
||||||
|
initialize(size+noaccess_prefix, alignment, large, requested_address,
|
||||||
|
noaccess_prefix);
|
||||||
}
|
}
|
||||||
|
|
||||||
char *
|
char *
|
||||||
@ -105,7 +108,8 @@ char* ReservedSpace::reserve_and_align(const size_t reserve_size,
|
|||||||
ReservedSpace::ReservedSpace(const size_t prefix_size,
|
ReservedSpace::ReservedSpace(const size_t prefix_size,
|
||||||
const size_t prefix_align,
|
const size_t prefix_align,
|
||||||
const size_t suffix_size,
|
const size_t suffix_size,
|
||||||
const size_t suffix_align)
|
const size_t suffix_align,
|
||||||
|
const size_t noaccess_prefix)
|
||||||
{
|
{
|
||||||
assert(prefix_size != 0, "sanity");
|
assert(prefix_size != 0, "sanity");
|
||||||
assert(prefix_align != 0, "sanity");
|
assert(prefix_align != 0, "sanity");
|
||||||
@ -118,12 +122,16 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
|
|||||||
assert((suffix_align & prefix_align - 1) == 0,
|
assert((suffix_align & prefix_align - 1) == 0,
|
||||||
"suffix_align not divisible by prefix_align");
|
"suffix_align not divisible by prefix_align");
|
||||||
|
|
||||||
|
// Add in noaccess_prefix to prefix_size;
|
||||||
|
const size_t adjusted_prefix_size = prefix_size + noaccess_prefix;
|
||||||
|
const size_t size = adjusted_prefix_size + suffix_size;
|
||||||
|
|
||||||
// On systems where the entire region has to be reserved and committed up
|
// On systems where the entire region has to be reserved and committed up
|
||||||
// front, the compound alignment normally done by this method is unnecessary.
|
// front, the compound alignment normally done by this method is unnecessary.
|
||||||
const bool try_reserve_special = UseLargePages &&
|
const bool try_reserve_special = UseLargePages &&
|
||||||
prefix_align == os::large_page_size();
|
prefix_align == os::large_page_size();
|
||||||
if (!os::can_commit_large_page_memory() && try_reserve_special) {
|
if (!os::can_commit_large_page_memory() && try_reserve_special) {
|
||||||
initialize(prefix_size + suffix_size, prefix_align, true);
|
initialize(size, prefix_align, true, NULL, noaccess_prefix);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,15 +139,19 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
|
|||||||
_size = 0;
|
_size = 0;
|
||||||
_alignment = 0;
|
_alignment = 0;
|
||||||
_special = false;
|
_special = false;
|
||||||
|
_noaccess_prefix = 0;
|
||||||
|
|
||||||
|
// Assert that if noaccess_prefix is used, it is the same as prefix_align.
|
||||||
|
assert(noaccess_prefix == 0 ||
|
||||||
|
noaccess_prefix == prefix_align, "noaccess prefix wrong");
|
||||||
|
|
||||||
// Optimistically try to reserve the exact size needed.
|
// Optimistically try to reserve the exact size needed.
|
||||||
const size_t size = prefix_size + suffix_size;
|
|
||||||
char* addr = os::reserve_memory(size, NULL, prefix_align);
|
char* addr = os::reserve_memory(size, NULL, prefix_align);
|
||||||
if (addr == NULL) return;
|
if (addr == NULL) return;
|
||||||
|
|
||||||
// Check whether the result has the needed alignment (unlikely unless
|
// Check whether the result has the needed alignment (unlikely unless
|
||||||
// prefix_align == suffix_align).
|
// prefix_align == suffix_align).
|
||||||
const size_t ofs = size_t(addr) + prefix_size & suffix_align - 1;
|
const size_t ofs = size_t(addr) + adjusted_prefix_size & suffix_align - 1;
|
||||||
if (ofs != 0) {
|
if (ofs != 0) {
|
||||||
// Wrong alignment. Release, allocate more space and do manual alignment.
|
// Wrong alignment. Release, allocate more space and do manual alignment.
|
||||||
//
|
//
|
||||||
@ -153,11 +165,11 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
|
|||||||
}
|
}
|
||||||
|
|
||||||
const size_t extra = MAX2(ofs, suffix_align - ofs);
|
const size_t extra = MAX2(ofs, suffix_align - ofs);
|
||||||
addr = reserve_and_align(size + extra, prefix_size, prefix_align,
|
addr = reserve_and_align(size + extra, adjusted_prefix_size, prefix_align,
|
||||||
suffix_size, suffix_align);
|
suffix_size, suffix_align);
|
||||||
if (addr == NULL) {
|
if (addr == NULL) {
|
||||||
// Try an even larger region. If this fails, address space is exhausted.
|
// Try an even larger region. If this fails, address space is exhausted.
|
||||||
addr = reserve_and_align(size + suffix_align, prefix_size,
|
addr = reserve_and_align(size + suffix_align, adjusted_prefix_size,
|
||||||
prefix_align, suffix_size, suffix_align);
|
prefix_align, suffix_size, suffix_align);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -165,10 +177,12 @@ ReservedSpace::ReservedSpace(const size_t prefix_size,
|
|||||||
_base = addr;
|
_base = addr;
|
||||||
_size = size;
|
_size = size;
|
||||||
_alignment = prefix_align;
|
_alignment = prefix_align;
|
||||||
|
_noaccess_prefix = noaccess_prefix;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
|
void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
|
||||||
char* requested_address) {
|
char* requested_address,
|
||||||
|
const size_t noaccess_prefix) {
|
||||||
const size_t granularity = os::vm_allocation_granularity();
|
const size_t granularity = os::vm_allocation_granularity();
|
||||||
assert((size & granularity - 1) == 0,
|
assert((size & granularity - 1) == 0,
|
||||||
"size not aligned to os::vm_allocation_granularity()");
|
"size not aligned to os::vm_allocation_granularity()");
|
||||||
@ -181,6 +195,7 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
|
|||||||
_size = 0;
|
_size = 0;
|
||||||
_special = false;
|
_special = false;
|
||||||
_alignment = 0;
|
_alignment = 0;
|
||||||
|
_noaccess_prefix = 0;
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -220,7 +235,8 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
|
|||||||
// important. If available space is not detected, return NULL.
|
// important. If available space is not detected, return NULL.
|
||||||
|
|
||||||
if (requested_address != 0) {
|
if (requested_address != 0) {
|
||||||
base = os::attempt_reserve_memory_at(size, requested_address);
|
base = os::attempt_reserve_memory_at(size,
|
||||||
|
requested_address-noaccess_prefix);
|
||||||
} else {
|
} else {
|
||||||
base = os::reserve_memory(size, NULL, alignment);
|
base = os::reserve_memory(size, NULL, alignment);
|
||||||
}
|
}
|
||||||
@ -259,6 +275,11 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large,
|
|||||||
_base = base;
|
_base = base;
|
||||||
_size = size;
|
_size = size;
|
||||||
_alignment = MAX2(alignment, (size_t) os::vm_page_size());
|
_alignment = MAX2(alignment, (size_t) os::vm_page_size());
|
||||||
|
_noaccess_prefix = noaccess_prefix;
|
||||||
|
|
||||||
|
// Assert that if noaccess_prefix is used, it is the same as alignment.
|
||||||
|
assert(noaccess_prefix == 0 ||
|
||||||
|
noaccess_prefix == _alignment, "noaccess prefix wrong");
|
||||||
|
|
||||||
assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base,
|
assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base,
|
||||||
"area must be distinguisable from marks for mark-sweep");
|
"area must be distinguisable from marks for mark-sweep");
|
||||||
@ -274,6 +295,7 @@ ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment,
|
|||||||
_base = base;
|
_base = base;
|
||||||
_size = size;
|
_size = size;
|
||||||
_alignment = alignment;
|
_alignment = alignment;
|
||||||
|
_noaccess_prefix = 0;
|
||||||
_special = special;
|
_special = special;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,17 +342,58 @@ size_t ReservedSpace::allocation_align_size_down(size_t size) {
|
|||||||
|
|
||||||
void ReservedSpace::release() {
|
void ReservedSpace::release() {
|
||||||
if (is_reserved()) {
|
if (is_reserved()) {
|
||||||
|
char *real_base = _base - _noaccess_prefix;
|
||||||
|
const size_t real_size = _size + _noaccess_prefix;
|
||||||
if (special()) {
|
if (special()) {
|
||||||
os::release_memory_special(_base, _size);
|
os::release_memory_special(real_base, real_size);
|
||||||
} else{
|
} else{
|
||||||
os::release_memory(_base, _size);
|
os::release_memory(real_base, real_size);
|
||||||
}
|
}
|
||||||
_base = NULL;
|
_base = NULL;
|
||||||
_size = 0;
|
_size = 0;
|
||||||
|
_noaccess_prefix = 0;
|
||||||
_special = false;
|
_special = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReservedSpace::protect_noaccess_prefix(const size_t size) {
|
||||||
|
// If there is noaccess prefix, return.
|
||||||
|
if (_noaccess_prefix == 0) return;
|
||||||
|
|
||||||
|
assert(_noaccess_prefix >= (size_t)os::vm_page_size(),
|
||||||
|
"must be at least page size big");
|
||||||
|
|
||||||
|
// Protect memory at the base of the allocated region.
|
||||||
|
// If special, the page was committed (only matters on windows)
|
||||||
|
if (!os::protect_memory(_base, _noaccess_prefix, os::MEM_PROT_NONE,
|
||||||
|
_special)) {
|
||||||
|
fatal("cannot protect protection page");
|
||||||
|
}
|
||||||
|
|
||||||
|
_base += _noaccess_prefix;
|
||||||
|
_size -= _noaccess_prefix;
|
||||||
|
assert((size == _size) && ((uintptr_t)_base % _alignment == 0),
|
||||||
|
"must be exactly of required size and alignment");
|
||||||
|
}
|
||||||
|
|
||||||
|
ReservedHeapSpace::ReservedHeapSpace(size_t size, size_t alignment,
|
||||||
|
bool large, char* requested_address) :
|
||||||
|
ReservedSpace(size, alignment, large,
|
||||||
|
requested_address,
|
||||||
|
UseCompressedOops ? lcm(os::vm_page_size(), alignment) : 0) {
|
||||||
|
// Only reserved space for the java heap should have a noaccess_prefix
|
||||||
|
// if using compressed oops.
|
||||||
|
protect_noaccess_prefix(size);
|
||||||
|
}
|
||||||
|
|
||||||
|
ReservedHeapSpace::ReservedHeapSpace(const size_t prefix_size,
|
||||||
|
const size_t prefix_align,
|
||||||
|
const size_t suffix_size,
|
||||||
|
const size_t suffix_align) :
|
||||||
|
ReservedSpace(prefix_size, prefix_align, suffix_size, suffix_align,
|
||||||
|
UseCompressedOops ? lcm(os::vm_page_size(), prefix_align) : 0) {
|
||||||
|
protect_noaccess_prefix(prefix_size+suffix_size);
|
||||||
|
}
|
||||||
|
|
||||||
// VirtualSpace
|
// VirtualSpace
|
||||||
|
|
||||||
@ -348,6 +411,7 @@ VirtualSpace::VirtualSpace() {
|
|||||||
_lower_alignment = 0;
|
_lower_alignment = 0;
|
||||||
_middle_alignment = 0;
|
_middle_alignment = 0;
|
||||||
_upper_alignment = 0;
|
_upper_alignment = 0;
|
||||||
|
_special = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -402,7 +466,8 @@ VirtualSpace::~VirtualSpace() {
|
|||||||
|
|
||||||
|
|
||||||
void VirtualSpace::release() {
|
void VirtualSpace::release() {
|
||||||
(void)os::release_memory(low_boundary(), reserved_size());
|
// This does not release memory it never reserved.
|
||||||
|
// Caller must release via rs.release();
|
||||||
_low_boundary = NULL;
|
_low_boundary = NULL;
|
||||||
_high_boundary = NULL;
|
_high_boundary = NULL;
|
||||||
_low = NULL;
|
_low = NULL;
|
||||||
|
@ -29,13 +29,15 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
|
|||||||
private:
|
private:
|
||||||
char* _base;
|
char* _base;
|
||||||
size_t _size;
|
size_t _size;
|
||||||
|
size_t _noaccess_prefix;
|
||||||
size_t _alignment;
|
size_t _alignment;
|
||||||
bool _special;
|
bool _special;
|
||||||
|
|
||||||
// ReservedSpace
|
// ReservedSpace
|
||||||
ReservedSpace(char* base, size_t size, size_t alignment, bool special);
|
ReservedSpace(char* base, size_t size, size_t alignment, bool special);
|
||||||
void initialize(size_t size, size_t alignment, bool large,
|
void initialize(size_t size, size_t alignment, bool large,
|
||||||
char* requested_address = NULL);
|
char* requested_address,
|
||||||
|
const size_t noaccess_prefix);
|
||||||
|
|
||||||
// Release parts of an already-reserved memory region [addr, addr + len) to
|
// Release parts of an already-reserved memory region [addr, addr + len) to
|
||||||
// get a new region that has "compound alignment." Return the start of the
|
// get a new region that has "compound alignment." Return the start of the
|
||||||
@ -59,13 +61,19 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
|
|||||||
const size_t suffix_size,
|
const size_t suffix_size,
|
||||||
const size_t suffix_align);
|
const size_t suffix_align);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Create protection page at the beginning of the space.
|
||||||
|
void protect_noaccess_prefix(const size_t size);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Constructor
|
// Constructor
|
||||||
ReservedSpace(size_t size);
|
ReservedSpace(size_t size);
|
||||||
ReservedSpace(size_t size, size_t alignment, bool large,
|
ReservedSpace(size_t size, size_t alignment, bool large,
|
||||||
char* requested_address = NULL);
|
char* requested_address = NULL,
|
||||||
|
const size_t noaccess_prefix = 0);
|
||||||
ReservedSpace(const size_t prefix_size, const size_t prefix_align,
|
ReservedSpace(const size_t prefix_size, const size_t prefix_align,
|
||||||
const size_t suffix_size, const size_t suffix_align);
|
const size_t suffix_size, const size_t suffix_align,
|
||||||
|
const size_t noaccess_prefix);
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
char* base() const { return _base; }
|
char* base() const { return _base; }
|
||||||
@ -73,6 +81,8 @@ class ReservedSpace VALUE_OBJ_CLASS_SPEC {
|
|||||||
size_t alignment() const { return _alignment; }
|
size_t alignment() const { return _alignment; }
|
||||||
bool special() const { return _special; }
|
bool special() const { return _special; }
|
||||||
|
|
||||||
|
size_t noaccess_prefix() const { return _noaccess_prefix; }
|
||||||
|
|
||||||
bool is_reserved() const { return _base != NULL; }
|
bool is_reserved() const { return _base != NULL; }
|
||||||
void release();
|
void release();
|
||||||
|
|
||||||
@ -104,6 +114,16 @@ ReservedSpace ReservedSpace::last_part(size_t partition_size)
|
|||||||
return last_part(partition_size, alignment());
|
return last_part(partition_size, alignment());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Class encapsulating behavior specific of memory space reserved for Java heap
|
||||||
|
class ReservedHeapSpace : public ReservedSpace {
|
||||||
|
public:
|
||||||
|
// Constructor
|
||||||
|
ReservedHeapSpace(size_t size, size_t forced_base_alignment,
|
||||||
|
bool large, char* requested_address);
|
||||||
|
ReservedHeapSpace(const size_t prefix_size, const size_t prefix_align,
|
||||||
|
const size_t suffix_size, const size_t suffix_align);
|
||||||
|
};
|
||||||
|
|
||||||
// VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
|
// VirtualSpace is data structure for committing a previously reserved address range in smaller chunks.
|
||||||
|
|
||||||
class VirtualSpace VALUE_OBJ_CLASS_SPEC {
|
class VirtualSpace VALUE_OBJ_CLASS_SPEC {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user