This commit is contained in:
Abhijit Saha 2012-10-26 09:27:25 -07:00
commit d936c96d3b
2099 changed files with 109334 additions and 115495 deletions

View File

@ -178,3 +178,8 @@ c7aa5cca1c01689a7b1a92411daf83684af05a33 jdk8-b53
7c6aa31ff1b2ae48c1c686ebe1aadf0c3da5be15 jdk8-b54
319f583f66db47395fa86127dd3ddb729eb7c64f jdk8-b55
ffe6bce5a521be40146af2ac03c509b7bac30595 jdk8-b56
2c21c080b11b93efb3851e39e1363e45da805943 jdk8-b57
479d3302a26d7607ba271d66973e59ebf58825b6 jdk8-b58
3bd874584fc01aae92fbc8827e2bd04d8b6ace04 jdk8-b59
5e3adc681779037a2d33b7be6f75680619085492 jdk8-b60
cdaa6122185f9bf512dcd6600f56bfccc4824e8c jdk8-b61

View File

@ -178,3 +178,8 @@ febd7ff5280067ca482faaeb9418ae88764c1a35 jdk8-b53
c1a277c6022affbc6855bdfb039511e73fbe2395 jdk8-b54
b85b44cced2406792cfb9baab1377ff03e7001d8 jdk8-b55
76844579fa4b30929731115b237e477181a82394 jdk8-b56
522dfac8ca4d07c0b74025d4ac3b6e5feefbb829 jdk8-b57
9367024804874faf8e958adeb333682bab1c0c47 jdk8-b58
dae9821589ccd2611bdf7084269b98e819091770 jdk8-b59
e07f499b9dccb529ecf74172cf6ac11a195ec57a jdk8-b60
20ff117b509075c3aec4ee3a57990ecd5db5df9c jdk8-b61

View File

@ -96,7 +96,8 @@
</li>
<li>Windows only:
<ul>
<li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>)</li>
<li>Unix Command Tools (<a href="#cygwin">CYGWIN</a>) <strong>or</strong></li>
<li>Minimalist GNU for Windows (<a href="#msys">MinGW/MSYS</a>)</li>
<li><a href="#dxsdk">DirectX 9.0 SDK</a> </li>
</ul>
</li>
@ -161,7 +162,7 @@
<blockquote>
This file often describes specific requirements for what we call the
"minimum build environments" (MBE) for this
specific release of the JDK,
specific release of the JDK,
Building with the MBE will generate the most compatible
bits that install on, and run correctly on, the most variations
of the same base OS and hardware architecture.
@ -241,16 +242,16 @@
</tbody>
</table>
<p>
These same sources do indeed build on many more systems than the
above older generation systems, again the above is just a minimum.
These same sources do indeed build on many more systems than the
above older generation systems, again the above is just a minimum.
<p>
Compilation problems with newer or different C/C++ compilers is a
common problem.
Similarly, compilation problems related to changes to the
Compilation problems with newer or different C/C++ compilers is a
common problem.
Similarly, compilation problems related to changes to the
<tt>/usr/include</tt> or system header files is also a
common problem with newer or unreleased OS versions.
Please report these types of problems as bugs so that they
can be dealt with accordingly.
common problem with newer or unreleased OS versions.
Please report these types of problems as bugs so that they
can be dealt with accordingly.
</blockquote>
<!-- ------------------------------------------------------ -->
<hr>
@ -266,15 +267,15 @@
<p>
<blockquote>
After installing <a href="http://fedoraproject.org">Fedora</a> 9
you need to install several build dependencies. The simplest
way to do it is to execute the following commands as user
you need to install several build dependencies. The simplest
way to do it is to execute the following commands as user
<tt>root</tt>:
<p/>
<code>yum-builddep java-1.6.0-openjdk</code>
<p/>
<code>yum install gcc gcc-c++</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
@ -283,15 +284,15 @@
<p>
<blockquote>
After installing <a href="http://fedoraproject.org">Fedora</a> 10
you need to install several build dependencies. The simplest
way to do it is to execute the following commands as user
you need to install several build dependencies. The simplest
way to do it is to execute the following commands as user
<tt>root</tt>:
<p/>
<code>yum-builddep java-1.6.0-openjdk</code>
<p/>
<code>yum install gcc gcc-c++</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
@ -300,15 +301,15 @@
<p>
<blockquote>
After installing <a href="http://fedoraproject.org">Fedora</a> 11
you need to install several build dependencies. The simplest
way to do it is to execute the following commands as user
you need to install several build dependencies. The simplest
way to do it is to execute the following commands as user
<tt>root</tt>:
<p/>
<code>yum-builddep java-1.6.0-openjdk</code>
<p/>
<code>yum install gcc gcc-c++</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-openjdk</code>
@ -360,16 +361,16 @@
<h4>Debian 5.0 (Lenny)</h4>
<p>
<blockquote>
After installing <a href="http://debian.org">Debian</a> 5
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands as user <tt>root</tt>:
After installing <a href="http://debian.org">Debian</a> 5
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands as user <tt>root</tt>:
<p/>
<code>aptitude build-dep openjdk-6</code>
<p/>
<code>aptitude install openjdk-6-jdk libmotif-dev</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
@ -380,52 +381,52 @@
<h4>Ubuntu 8.04</h4>
<p>
<blockquote>
After installing <a href="http://ubuntu.org">Ubuntu</a> 8.04
you need to install several build dependencies.
After installing <a href="http://ubuntu.org">Ubuntu</a> 8.04
you need to install several build dependencies.
<p/>
First, you need to enable the universe repository in the
Software Sources application and reload the repository
information. The Software Sources application is available
under the System/Administration menu.
First, you need to enable the universe repository in the
Software Sources application and reload the repository
information. The Software Sources application is available
under the System/Administration menu.
<p/>
The simplest way to install the build dependencies is to
execute the following commands:
The simplest way to install the build dependencies is to
execute the following commands:
<p/>
<code>sudo aptitude build-dep openjdk-6</code>
<p/>
<code>sudo aptitude install openjdk-6-jdk</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
<h4>Ubuntu 8.10</h4>
<p>
<blockquote>
After installing <a href="http://ubuntu.org">Ubuntu</a> 8.10
you need to install several build dependencies. The simplest
way to do it is to execute the following commands:
After installing <a href="http://ubuntu.org">Ubuntu</a> 8.10
you need to install several build dependencies. The simplest
way to do it is to execute the following commands:
<p/>
<code>sudo aptitude build-dep openjdk-6</code>
<p/>
<code>sudo aptitude install openjdk-6-jdk</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
<h4>Ubuntu 9.04</h4>
<p>
<blockquote>
After installing <a href="http://ubuntu.org">Ubuntu</a> 9.04
you need to install several build dependencies. The simplest
way to do it is to execute the following commands:
After installing <a href="http://ubuntu.org">Ubuntu</a> 9.04
you need to install several build dependencies. The simplest
way to do it is to execute the following commands:
<p/>
<code>sudo aptitude build-dep openjdk-6</code>
<p/>
<code>sudo aptitude install openjdk-6-jdk</code>
<p/>
In addition, it's necessary to set a few environment variables for the build:
In addition, it's necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-6-openjdk</code>
</blockquote>
@ -436,20 +437,20 @@
<h4>OpenSUSE 11.1</h4>
<p>
<blockquote>
After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands:
After installing <a href="http://opensuse.org">OpenSUSE</a> 11.1
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands:
<p/>
<code>sudo zypper source-install -d java-1_6_0-openjdk</code>
<p/>
<code>sudo zypper install make</code>
<p/>
In addition, it is necessary to set a few environment variables for the build:
In addition, it is necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk</code>
<p/>
Finally, you need to unset the <code>JAVA_HOME</code> environment variable:
Finally, you need to unset the <code>JAVA_HOME</code> environment variable:
<p/>
<code>export -n JAVA_HOME</code>
</blockquote>
@ -460,14 +461,14 @@
<h4>Mandriva Linux One 2009 Spring</h4>
<p>
<blockquote>
After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands as user <tt>root</tt>:
After installing <a href="http://mandriva.org">Mandriva</a> Linux One 2009 Spring
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands as user <tt>root</tt>:
<p/>
<code>urpmi java-1.6.0-openjdk-devel ant make gcc gcc-c++ freetype-devel zip unzip libcups2-devel libxrender1-devel libalsa2-devel libstc++-static-devel libxtst6-devel libxi-devel</code>
<p/>
In addition, it is necessary to set a few environment variables for the build:
In addition, it is necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_BOOTDIR=/usr/lib/jvm/java-1.6.0-openjdk</code>
</blockquote>
@ -478,18 +479,18 @@
<h4>OpenSolaris 2009.06</h4>
<p>
<blockquote>
After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands:
After installing <a href="http://opensolaris.org">OpenSolaris</a> 2009.06
you need to install several build dependencies.
The simplest way to install the build dependencies is to
execute the following commands:
<p/>
<code>pfexec pkg install SUNWgmake SUNWj6dev SUNWant sunstudioexpress SUNWcups SUNWzip SUNWunzip SUNWxwhl SUNWxorg-headers SUNWaudh SUNWfreetype2</code>
<p/>
In addition, it is necessary to set a few environment variables for the build:
In addition, it is necessary to set a few environment variables for the build:
<p/>
<code>export LANG=C ALT_COMPILER_PATH=/opt/SunStudioExpress/bin/ ALT_CUPS_HEADERS_PATH=/usr/include/</code>
<p/>
Finally, you need to make sure that the build process can find the Sun Studio compilers:
Finally, you need to make sure that the build process can find the Sun Studio compilers:
<p/>
<code>export PATH=$PATH:/opt/SunStudioExpress/bin/</code>
</blockquote>
@ -687,31 +688,20 @@
</li>
<li>
<strong>Windows:</strong>
Make sure you start your build inside a bash/sh/ksh shell
and are using a <tt>make.exe</tt> utility built for that
environment (a cygwin <tt>make.exe</tt> is not the same
as a <tt>make.exe</tt> built for something like
<a href="http://www.mkssoftware.com/">MKS</a>).
<br>
<b>WARNING:</b> Watch out on some make 3.81 versions, it may
not work due to a lack of support for MS-DOS drive letter paths
like <tt>C:/</tt> or <tt>C:\</tt>.
<br>
You may be able to use the information at the
<a href="http://developer.mozilla.org/en/docs/Windows_build_prerequisites_using_cygwin#make" target="_blank">
mozilla developer center</a>
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.
<br>
It may be possible to download the version at
<a href="http://www.cmake.org/files/cygwin/make.exe">
www.cmake.org make.exe</a>.
<br>
It might be necessary for you to build your own GNU make 3.81,
see the <a href="#buildgmake">"Building GNU make"</a> section
in that case.
Make sure you start your build inside a bash/sh/ksh shell and are
using a <tt>make.exe</tt> utility built for that environment.<br/>
<strong>MKS</strong> builds need a native Windows version of GNU make
(see <a href="#buildgmake">Building GNU make</a>).<br/>
<strong>Cygwin</strong> builds need
a make version which was specially compiled for the Cygwin environment
(see <a href="#buildgmake">Building GNU make</a>). <strong>WARNING:</strong>
the OpenJDK build with the make utility provided by Cygwin will <strong>not</strong>
work because it does not support drive letters in paths. Make sure that
your version of make will be found before the Cygwins default make by
setting an appropriate <tt>PATH</tt> environment variable or by removing
Cygwin's make after you built your own make version.<br/>
<strong>MinGW/MSYS</strong> builds can use the default make which
comes with the environment.
</li>
</ul>
<p>
@ -727,7 +717,7 @@
<!-- ------------------------------------------------------ -->
<h4><a name="buildgmake">Building GNU make</a></h4>
<blockquote>
First step is to get the GNU make 3.81 source from
First step is to get the GNU make 3.81 (or newer) source from
<a href="http://ftp.gnu.org/pub/gnu/make/" target="_blank">
ftp.gnu.org/pub/gnu/make/</a>.
Building is a little different depending on the OS and unix toolset
@ -742,12 +732,24 @@
<tt>./configure && gmake CC=gcc</tt>
</li>
<li>
<strong>Windows for CYGWIN:</strong>
<tt>./configure && make</tt>
<strong>Windows for CYGWIN:</strong><br/>
<tt>./configure</tt><br/>
Add the line <tt>#define HAVE_CYGWIN_SHELL 1</tt> to the end of <tt>config.h</tt><br/>
<tt>make</tt><br/>
<br/>
This should produce <tt>make.exe</tt> in the current directory.
</li>
<li>
<strong>Windows for MKS: (CYGWIN is recommended)</strong>
<tt>./configure && make -f Makefile.win32</tt>
<strong>Windows for MKS:</strong><br/>
Edit <tt>config.h.W32</tt> and uncomment the line <tt>#define HAVE_MKS_SHELL 1</tt><br/>
Set the environment for your native compiler (e.g. by calling:<br/>
<tt>"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /Release /xp /x64)</tt>
<tt>nmake -f NMakefile.win32</tt>
<br/>
This should produce <tt>WinDebug/make.exe</tt> and <tt>WinRel/make.exe</tt>
<br/>
If you get the error: <tt>NMAKE : fatal error U1045: spawn failed : Permission denied</tt>
you have to set the <tt>Read &amp; execute</tt> permission for the file <tt>subproc.bat</tt>.
</li>
</ul>
</blockquote>
@ -894,39 +896,135 @@
<h4><a name="paths">Windows Paths</a></h4>
<blockquote>
<strong>Windows:</strong>
Note that GNU make is a historic utility and is based very
heavily on shell scripting, so it does not tolerate the Windows habit
Note that GNU make, the shell and other Unix-tools required during the build
do not tolerate the Windows habit
of having spaces in pathnames or the use of the <tt>\</tt>characters in pathnames.
Luckily on most Windows systems, you can use <tt>/</tt>instead of \, and
there is always a 'short' pathname without spaces for any path that
contains spaces.
Unfortunately, this short pathname can be somewhat dynamic and the
formula is difficult to explain.
You can use <tt>cygpath</tt> utility to map pathnames with spaces
or the <tt>\</tt>character into the <tt>C:/</tt> style of pathname
(called 'mixed'), e.g.
<tt>cygpath -s -m "<i>path</i>"</tt>.
Luckily on most Windows systems, you can use <tt>/</tt>instead of <tt>\</tt>, and
there is always a short <a href="http://en.wikipedia.org/wiki/8.3_filename">
"8.3" pathname</a> without spaces for any path that contains spaces.
Unfortunately, this short pathname is somewhat dynamic (i.e. dependant on the
other files and directories inside a given directory) and can not be
algorithmicly calculated by only looking at a specific path name.
<p>
The makefiles will try to translate any pathnames supplied
to it into the <tt>C:/</tt> style automatically.
</p>
<p>
Note that use of CYGWIN creates a unique problem with regards to
Special care has to be taken if native Windows applications
like <tt>nmake</tt> or <tt>cl</tt> are called with file arguments processed
by Unix-tools like <tt>make</tt> or <tt>sh</tt>!
</p>
</blockquote>
<!-- ------------------------------------------------------ -->
<h4><a name="paths">Windows build environments</a></h4>
<blockquote>
Building on Windows requires a Unix-like environment, notably a Unix-like shell.
There are several such environments available of which
<a href="http://www.mkssoftware.com/products/tk/ds_tkdev.asp">MKS</a>,
<a href="http://www.cygwin.com/">Cygwin</a> and
<a href="http://www.mingw.org/wiki/MSYS">MinGW/MSYS</a> are currently supported for
the OpenJDK build. One of the differences of these three systems is the way
they handle Windows path names, particularly path names which contain
spaces, backslashes as path separators and possibly drive letters. Depending
on the use case and the specifics of each environment these path problems can
be solved by a combination of quoting whole paths, translating backslashes to
forward slashes, escaping backslashes with additional backslashes and
translating the path names to their <a href="http://en.wikipedia.org/wiki/8.3_filename">
"8.3" version</a>.
<p>
As of this writing (MKS ver. 9.4, Cygwin ver. 1.7.9, MinGW/MSYS 1.0.17),
MKS builds are known to be the fastest Windows builds while MingGW/MSYS
builds are slightly slower (about 10%) than MKS builds and Cygwin builds
require nearly twice the time (about 180%) of MKS builds (e.g. on a
DualCore i7 notebook with 8GB of RAM, HDD and 64-bit Windows 7 operating system
the complete OpenJDK 8 product build takes about 49min with MKS, 54min with
MinGW/MSYS and 88min with Cygwin).
</p>
<p>
Mixing tools from the different Unix emulation environments is not a good
idea and will probably not work!
</p>
<p>
<strong>MKS:</strong> is a commercial product which includes
all the Unix utilities which are required to build the OpenJDK except GNU
make. In pre-OpenJDK times it was the only supported build environment on
Windows. The MKS tools support Windows paths with drive letters and
forward slashes as path separator. Paths in environment variables like (for
example) <tt>PATH</tt> are separated by semicolon '<tt>;</tt>'.
</p>
<p>
Recent versions of MKS provide the <tt>dosname</tt> utility to convert paths
with spaces to short (8.3) path names,e .g.
<tt>dosname -s "<i>path</i>"</tt>.
</p>
<p>
If you are using the MKS environment, you need a native Windows version
of Gnu make <a href="#buildgmake">which you can easily build yourself</a>.
</p>
<p>
<strong>Cygwin:</strong>
is an open source, Linux-like environment which tries to emulate
a complete POSIX layer on Windows. It tries to be smart about path names
and can usually handle all kinds of paths if they are correctly quoted
or escaped although internally it maps drive letters <tt>&lt;drive&gt;:</tt>
to a virtual directory <tt>/cygdrive/&lt;drive&gt;</tt>.
</p>
<p>
You can always use the <tt>cygpath</tt> utility to map pathnames with spaces
or the backslash character into the <tt>C:/</tt> style of pathname
(called 'mixed'), e.g. <tt>cygpath -s -m "<i>path</i>"</tt>.
</p>
<p>
Note that the use of CYGWIN creates a unique problem with regards to
setting <a href="#path"><tt>PATH</tt></a>. Normally on Windows
the <tt>PATH</tt> variable contains directories
separated with the ";" character (Solaris and Linux uses ":").
separated with the ";" character (Solaris and Linux use ":").
With CYGWIN, it uses ":", but that means that paths like "C:/path"
cannot be placed in the CYGWIN version of <tt>PATH</tt> and
instead CYGWIN uses something like <tt>/cygdrive/c/path</tt>
which CYGWIN understands, but only CYGWIN understands.
So be careful with paths on Windows.
</p>
<p>
If you are using the Cygwin environment, you need to
<a href="#buildgmake">compile your own version</a>
of GNU make because the default Cygwin make can not handle drive letters in paths.
</p>
<p>
<strong>MinGW/MSYS:</strong>
MinGW ("Minimalist GNU for Windows") is a collection of free Windows
specific header files and import libraries combined with GNU toolsets that
allow one to produce native Windows programs that do not rely on any
3rd-party C runtime DLLs. MSYS is a supplement to MinGW which allows building
applications and programs which rely on traditional UNIX tools to
be present. Among others this includes tools like <tt>bash</tt> and <tt>make</tt>.
</p>
<p>
Like Cygwin, MinGW/MSYS can handle different types of path formats. They
are internally converted to paths with forward slashes and drive letters
<tt>&lt;drive&gt;:</tt> replaced by a virtual
directory <tt>/&lt;drive&gt;</tt>. Additionally, MSYS automatically
detects binaries compiled for the MSYS environment and feeds them with the
internal, Unix-style path names. If native Windows applications are called
from within MSYS programs their path arguments are automatically converted
back to Windows style path names with drive letters and backslashes as
path separators. This may cause problems for Windows applications which
use forward slashes as parameter separator (e.g. <tt>cl /nologo /I</tt>)
because MSYS may wrongly <a href="http://mingw.org/wiki/Posix_path_conversion">
replace such parameters by drive letters</a>.
</p>
<p>
If you are using the MinGW/MSYS system you can use the default make
version supplied by the environment.
</p>
</blockquote>
<!-- ------------------------------------------------------ -->
<h4><a name="windows_checklist">Basic Windows Check List</a></h4>
<blockquote>
<ol>
<li>
Install the
<a href="#cygwin">CYGWIN product</a>.
Install one of the
<a href="#cygwin">CYGWIN</a>, <a href="#msys">MinGW/MSYS</a> or
<a href="http://www.mkssoftware.com/products/tk/ds_tkdev.asp">MKS</a> environments.
</li>
<li>
Install the
@ -1097,9 +1195,9 @@
<a href="http://www.oracle.com/technetwork/server-storage/solarisstudio/downloads/index.htm" target="_blank">
Sun Studio 12 Update 1 Compilers</a>
(containing version 5.10 of the C and C++ compilers) is required,
including specific patches.
including specific patches.
<p>
The Solaris SPARC patch list is:
The Solaris SPARC patch list is:
<ul>
<li>
118683-05: SunOS 5.10: Patch for profiling libraries and assembler
@ -1286,7 +1384,8 @@
The XRender header file is included with the other X11 header files
in the package <strong>SFWxwinc</strong> on new enough versions of
Solaris and will be installed in
<tt>/usr/X11/include/X11/extensions/Xrender.h</tt>
<tt>/usr/X11/include/X11/extensions/Xrender.h</tt> or
<tt>/usr/openwin/share/include/X11/extensions/Xrender.h</tt>
</p><p>
<strong>Linux:</strong>
XRender header files are required for building the
@ -1456,7 +1555,9 @@
<td>Devel</td>
<td>make</td>
<td>The GNU version of the 'make' utility built for CYGWIN.<br>
<b>NOTE</b>: See <a href="#gmake">the GNU make section</a></td>
<b>NOTE</b>: the Cygwin make can not be used to build the
OpenJDK. You only need it to build your own version of make
(see <a href="#gmake">the GNU make section</a>)</td>
</tr>
<tr>
<td>m4.exe</td>
@ -1521,6 +1622,21 @@
So it's important that the Visual Studio paths in PATH preceed
the CYGWIN path <tt>/usr/bin</tt>.
</blockquote>
<strong> Minimalist GNU for Windows (<a name="msys">MinGW/MSYS</a>)</strong>
<blockquote>
Alternatively, the set of unix command tools for the OpenJDK build on
Windows can be supplied by
<a href="http://www.mingw.org/wiki/MSYS" target="_blank">MinGW/MSYS</a>.
<p>
In addition to the tools which will be installed by default, you have
to manually install the <tt>msys-zip</tt> and <tt>msys-unzip</tt> packages.
This can be easily done with the MinGW command line installer:<br/>
<tt><br/>
mingw-get.exe install msys-zip<br/>
mingw-get.exe install msys-unzip<br/>
</tt>
</p>
</blockquote>
<strong><a name="dxsdk">Microsoft DirectX 9.0 SDK header files and libraries</a></strong>
<blockquote>
Microsoft DirectX 9.0 SDK (Summer 2004)
@ -1781,10 +1897,10 @@
</dd>
<dt><a name="ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a></dt>
<dd>
The top-level directory of the libraries and include files for the platform's
graphical programming environment. The default location is platform specific.
For example, on Linux it defaults to <tt>/usr/X11R6/</tt>.
</dd>
The top-level directory of the libraries and include files for the platform's
graphical programming environment. The default location is platform specific.
For example, on Linux it defaults to <tt>/usr/X11R6/</tt>.
</dd>
<dt><strong>Windows specific:</strong></dt>
<dd>
<dl>
@ -1792,9 +1908,9 @@
<dd>
The location of the
Microsoft Windows SDK where some tools will be
located.
The default is whatever WINDOWSSDKDIR is set to
(or WindowsSdkDir) or the path
located.
The default is whatever WINDOWSSDKDIR is set to
(or WindowsSdkDir) or the path
<br>
<tt>c:\Program Files\Microsoft SDKs\Windows\v7.0a</tt>
</dd>
@ -1823,17 +1939,17 @@
is that <a href="#ALT_COMPILER_PATH"><tt>ALT_COMPILER_PATH</tt></a> is set
to point to the cross-compiler and that any cross-compilation specific flags
are passed using <a href="#EXTRA_CFLAGS"><tt>EXTRA_CFLAGS</tt></a>.
The <a href="#ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a> variable should
also be set to point to the graphical header files (e.g. X11) provided with
the cross-compiler.
The <a href="#ALT_OPENWIN_HOME"><tt>ALT_OPENWIN_HOME</tt></a> variable should
also be set to point to the graphical header files (e.g. X11) provided with
the cross-compiler.
When cross-compiling we skip execution of any demos etc that may be built, and
also skip binary-file verification.
</dd>
<dt><tt><a name="EXTRA_CFLAGS">EXTRA_CFLAGS</a></tt> </dt>
<dd>
Used to pass cross-compilation options to the cross-compiler.
Used to pass cross-compilation options to the cross-compiler.
These are added to the <tt>CFLAGS</tt> and <tt>CXXFLAGS</tt> variables.
</dd>
</dd>
<dt><tt><a name="USE_ONLY_BOOTDIR_TOOLS">USE_ONLY_BOOTDIR_TOOLS</a></tt> </dt>
<dd>
Used primarily for cross-compilation builds (and always set in that case)
@ -1868,23 +1984,23 @@
<dt><tt><a name="BUILD_HEADLESS_ONLY"></a>BUILD_HEADLESS_ONLY</tt> </dt>
<dd>
Used when the build environment has no graphical capabilities at all. This
excludes building anything that requires graphical libraries to be available.
excludes building anything that requires graphical libraries to be available.
</dd>
<dt><tt><a name="JAVASE_EMBEDDED"></a>JAVASE_EMBEDDED</tt> </dt>
<dd>
Used to indicate this is a build of the Oracle Java SE Embedded product.
This will enable the directives included in the SE-Embedded specific build
files.
Used to indicate this is a build of the Oracle Java SE Embedded product.
This will enable the directives included in the SE-Embedded specific build
files.
</dd>
<dt><tt><a name="LIBZIP_CAN_USE_MMAP">LIBZIP_CAN_USE_MMAP</a></tt> </dt>
<dd>
If set to false, disables the use of mmap by the zip utility. Otherwise,
mmap will be used.
If set to false, disables the use of mmap by the zip utility. Otherwise,
mmap will be used.
</dd>
<dt><tt><a name="COMPRESS_JARS"></a>COMPRESS_JARS</tt> </dt>
<dd>
If set to true, causes certain jar files that would otherwise be built without
compression, to use compression.
If set to true, causes certain jar files that would otherwise be built without
compression, to use compression.
</dd>
</dl>
</dd>

View File

@ -178,3 +178,8 @@ d20d9eb9f093adbf392918c703960ad24c93a331 jdk8-b50
16c82fc74695bab9b9e0fb05c086a5a08ba0082f jdk8-b54
e8a0e84383d6fbd303ce44bd355fb25972b13286 jdk8-b55
bf1bb47414e178beff67dc255fc3b97bf401f679 jdk8-b56
f3ab4163ae012965fc8acdfc25ce0fece8d6906d jdk8-b57
18462a19f7bd66d38015f61ea549a5e0c0c889a3 jdk8-b58
d54dc53e223ed9ce7d5f4d2cd02ad9d5def3c2db jdk8-b59
207ef43ba69ead6cbbab415d81834545e4d46747 jdk8-b60
0e08ba7648fb3faa0986cb217887d7c4990977f3 jdk8-b61

View File

@ -151,16 +151,26 @@ CD = cd # intrinsic unix command
ifeq ($(PLATFORM),windows)
ifdef USING_CYGWIN
# Intrinsic unix command, with backslash-escaped character interpretation
ECHO = $(UNIXCOMMAND_PATH)echo -e
ZIPEXE = $(UNIXCOMMAND_PATH)zip
UNZIP = $(UNIXCOMMAND_PATH)unzip
ECHO = $(UNIXCOMMAND_PATH)echo -e
ZIPEXE = $(UNIXCOMMAND_PATH)zip
UNZIP = $(UNIXCOMMAND_PATH)unzip
# Some CYGWIN nawk versions require BINMODE=w for proper '\r' interpretation
NAWK = $(UNIXCOMMAND_PATH)awk -v BINMODE=w
else
ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
UNZIP = $(UTILS_DEVTOOL_PATH)unzip
ifdef USING_MSYS
ECHO = $(UTILS_COMMAND_PATH)echo -e
ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
UNZIP = $(UTILS_DEVTOOL_PATH)unzip
NAWK = $(UNIXCOMMAND_PATH)awk
else
ZIPEXE = $(UTILS_DEVTOOL_PATH)zip
UNZIP = $(UTILS_DEVTOOL_PATH)unzip
NAWK = $(UNIXCOMMAND_PATH)awk
endif
endif
# Re-define some utilities
LEX =# override GNU Make intrinsic: no lex on windows
NAWK = $(UNIXCOMMAND_PATH)awk
SHA1SUM = $(UNIXCOMMAND_PATH)openssl sha1
endif
# Linux specific

View File

@ -91,6 +91,15 @@ define OptFullPath
$(shell if [ "$1" != "" -a -d "$1" ]; then $(CYGPATH_CMD) "$1"; else echo "$1"; fi)
endef
else
ifdef USING_MSYS
DOSPATH_CMD:=$(shell cd $(JDK_TOPDIR) 2> $(DEV_NULL) && pwd)/make/tools/msys_build_scripts/dospath.sh
define FullPath
$(subst \,/,$(shell $(DOSPATH_CMD) $1))
endef
define OptFullPath
$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
endef
else
# Temporary until we upgrade to MKS 8.7, MKS pwd returns mixed mode path
define FullPath
$(shell cd $1 2> $(DEV_NULL) && pwd)
@ -99,6 +108,7 @@ define OptFullPath
$(shell if [ "$1" != "" -a -d "$1" ]; then (cd $1 && pwd); else echo "$1"; fi)
endef
endif
endif
# System drive
ifdef SYSTEMDRIVE
@ -112,14 +122,21 @@ _system_drive:=$(call CheckValue,_system_drive,C:)
# UNIXCOMMAND_PATH: path to where the most common Unix commands are.
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifndef UNIXCOMMAND_PATH
ifdef ALT_UNIXCOMMAND_PATH
# With cygwin, use this as is; don't use FullPath on it.
ifdef ALT_UNIXCOMMAND_PATH
ifdef USING_CYGWIN
UNIXCOMMAND_PATH :=$(call PrefixPath,$(ALT_UNIXCOMMAND_PATH))
else
xALT_UNIXCOMMAND_PATH :="$(subst \,/,$(ALT_UNIXCOMMAND_PATH))"
fxALT_UNIXCOMMAND_PATH :=$(call FullPath,$(xALT_UNIXCOMMAND_PATH))
UNIXCOMMAND_PATH :=$(call PrefixPath,$(fxALT_UNIXCOMMAND_PATH))
endif
else
ifdef USING_CYGWIN
UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
else
ifdef USING_CYGWIN
UNIXCOMMAND_PATH :=$(call PrefixPath,/usr/bin)
ifdef USING_MSYS
UNIXCOMMAND_PATH :=$(call PrefixPath,/bin)
else
ifdef ROOTDIR
xROOTDIR :="$(subst \,/,$(ROOTDIR))"
@ -131,41 +148,35 @@ ifndef UNIXCOMMAND_PATH
ifneq ($(_rootdir),)
UNIXCOMMAND_PATH :=$(call PrefixPath,$(_rootdir)/mksnt)
endif
endif
endif
UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
export UNIXCOMMAND_PATH
endif # USING_MSYS
endif # USING_CYGWIN
endif
UNIXCOMMAND_PATH:=$(call AltCheckSpaces,UNIXCOMMAND_PATH)
export UNIXCOMMAND_PATH
# Get version of MKS or CYGWIN
ifdef USING_CYGWIN
ifndef CYGWIN_VER
_CYGWIN_VER :=$(shell $(UNAME))
CYGWIN_VER :=$(call GetVersion,$(_CYGWIN_VER))
export CYGWIN_VER
ifdef USING_MKS
_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
MKS_VER :=$(call GetVersion,$(_MKS_VER))
# At this point, we can re-define FullPath to use DOSNAME_CMD
CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
TRY_DOSNAME:=false
ifeq ($(CHECK_MKS87),same)
TRY_DOSNAME:=true
endif
else # MKS
_MKS_VER :=$(shell $(MKSINFO) 2>&1 | $(GREP) Release | $(TAIL) -1 | $(SED) -e 's@.*\(Release.*\)@\1@')
MKS_VER :=$(call GetVersion,$(_MKS_VER))
# At this point, we can re-define FullPath to use DOSNAME_CMD
CHECK_MKS87:=$(call CheckVersions,$(MKS_VER),8.7)
TRY_DOSNAME:=false
ifeq ($(CHECK_MKS87),same)
TRY_DOSNAME:=true
endif
# Newer should be ok
ifeq ($(CHECK_MKS87),newer)
TRY_DOSNAME:=true
endif
ifeq ($(TRY_DOSNAME),true)
ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
_DOSNAME=$(UNIXCOMMAND_PATH)dosname
DOSNAME_CMD:=$(_DOSNAME) -s
# Newer should be ok
ifeq ($(CHECK_MKS87),newer)
TRY_DOSNAME:=true
endif
ifeq ($(TRY_DOSNAME),true)
ifeq ($(shell $(UNIXCOMMAND_PATH)dosname -s $(_system_drive)/ 2> $(DEV_NULL)),$(_system_drive)/)
_DOSNAME=$(UNIXCOMMAND_PATH)dosname
DOSNAME_CMD:=$(_DOSNAME) -s
define FullPath
$(subst //,/,$(shell echo $1 | $(DOSNAME_CMD) 2> $(DEV_NULL)))
endef
endif # test dosname -s
endif # TRY_DOSNAME
endif # test dosname -s
endif # TRY_DOSNAME
endif # MKS
# We try to get references to what we need via the default component
@ -240,6 +251,8 @@ endif
# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifndef DEVTOOLS_PATH
# DEVTOOLS_PATH: for other tools required for building (such as zip, etc.)
# NOTE: Must end with / so that it could be empty, allowing PATH usage.
ifdef ALT_DEVTOOLS_PATH
xALT_DEVTOOLS_PATH :="$(subst \,/,$(ALT_DEVTOOLS_PATH))"
fxALT_DEVTOOLS_PATH :=$(call FullPath,$(xALT_DEVTOOLS_PATH))
@ -248,10 +261,14 @@ ifndef DEVTOOLS_PATH
ifdef USING_CYGWIN
DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
else
xDEVTOOLS_PATH :="$(_system_drive)/utils"
fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
DEVTOOLS_PATH :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
endif
ifdef USING_MSYS
DEVTOOLS_PATH :=$(UNIXCOMMAND_PATH)
else
xDEVTOOLS_PATH :="$(_system_drive)/utils"
fxDEVTOOLS_PATH :=$(call FullPath,$(xDEVTOOLS_PATH))
DEVTOOLS_PATH :=$(call PrefixPath,$(fxDEVTOOLS_PATH))
endif # USING_MSYS
endif # USING_CYGWIN
endif
DEVTOOLS_PATH:=$(call AltCheckSpaces,DEVTOOLS_PATH)
export DEVTOOLS_PATH

View File

@ -65,6 +65,8 @@ PLATFORM_SHARED=done
# REQUIRED_WINDOWS_NAME windows only: basic name of windows
# REQUIRED_WINDOWS_VERSION windows only: specific version of windows
# USING_CYGWIN windows only: true or false
# USING_MSYS windows only: true or false
# USING_MKS windows only: true or false
# WINDOWS_NT_VERSION_STRING windows only: long version name
# REQUIRED_OS_VERSION required OS version, e.g. 5.10, 2.4
# REQUIRED_FREE_SPACE minimum disk space needed for outputdir
@ -327,6 +329,8 @@ endif
# Windows with and without CYGWIN will be slightly different
ifeq ($(SYSTEM_UNAME), Windows_NT)
PLATFORM = windows
USING_MKS = true
export USING_MKS
OS_VERSION := $(shell uname -r)
WINDOWS_NT_VERSION_STRING=Windows_NT
REQUIRED_MKS_VER=6.1
@ -339,6 +343,11 @@ ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME)))
WINDOWS_NT_VERSION_STRING=CYGWIN_NT
REQUIRED_CYGWIN_VER=4.0
endif
ifneq (,$(findstring MINGW,$(SYSTEM_UNAME)))
PLATFORM = windows
USING_MSYS = true
export USING_MSYS
endif
# Platform settings specific to Windows
ifeq ($(PLATFORM), windows)

View File

@ -1631,7 +1631,7 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
// Write data members...
p.pln();
p.pln("private " + getName(theType) + " target = null;");
p.pln("volatile private " + getName(theType) + " target = null;");
p.pln();
// Write the ids...
@ -1695,6 +1695,10 @@ public class StubGenerator extends sun.rmi.rmic.iiop.Generator {
if (remoteMethods.length > 0) {
p.plnI("try {");
p.pln(getName(theType) + " target = this.target;");
p.plnI("if (target == null) {");
p.pln("throw new java.io.IOException();");
p.pOln("}");
p.plnI(idExtInputStream + " "+in+" = ");
p.pln("(" + idExtInputStream + ") "+_in+";");
p.pO();

View File

@ -276,4 +276,15 @@ e8fb566b94667f88462164defa654203f0ab6820 jdk8-b54
09ea7e0752b306b8ae74713aeb4eb6263e1c6836 hs24-b22
af0c8a0808516317333dcf9af15567cdd52761ce jdk8-b55
6124ff4218296c91e4a72f1a76c064892d39d61b jdk8-b56
9b076bc3ab67d42d1d02144ef8dcd6006a7fc0d6 hs25-b01
d70102c4cb73158902acaa6016f47c7bc14e0d67 jdk8-b57
5f54277c67f755a377999bff904ab48aa63ddaf9 hs25-b02
6bb378c50828e9d76fb2653d1712c66ea8fc47db jdk8-b58
f2e12eb74117c917c0bb264694c02de4a6a15a10 hs25-b03
8a1a6b9b4f20fd2f6a12441d638e51f19a82db19 jdk8-b59
1cc7a2a11d00832e3d07f81f3744a6883422db7e hs25-b04
3cfd05b2219a29649741a52637696f06acf24a4e jdk8-b60
b261523fe66c40a02968f0aa7e73602491bb3386 hs25-b05
4547dc71db765276e027b0c2780b724bae0a07d3 jdk8-b61
d0337c31c8be7716369b4e7c3bd5f352983c6a06 hs25-b06
dccd40de8db1fa96f186e6179907818d75320440 jdk8-b62

View File

@ -38,10 +38,10 @@ Available commands:
assert true | false <font color="red">turn on/off asserts in SA code</font>
attach pid | exec core <font color="red">attach SA to a process or core</font>
class name <font color="red">find a Java class from debuggee and print oop</font>
classes <font color="red">print all loaded Java classes with klassOop</font>
classes <font color="red">print all loaded Java classes with Klass*</font>
detach <font color="red">detach SA from current target</font>
dis address [ length ] <font color="red">disassemble (sparc/x86) specified number of instructions from given address</font>
dumpclass { address | name } [ directory ] <font color="red">dump .class file for given klassOop or class name</font>
dumpclass { address | name } [ directory ] <font color="red">dump .class file for given Klass* or class name</font>
dumpheap [ file ] <font color="red">dump heap in hprof binary format</font>
echo [ true | false ] <font color="red">turn on/off command echo mode</font>
examine [ address/count ] | [ address,address] <font color="red">show contents of memory from given address</font>
@ -51,7 +51,7 @@ Available commands:
help [ command ] <font color="red">print help message for all commands or just given command</font>
history <font color="red">show command history. usual !command-number syntax works.</font>
inspect expression <font color="red">inspect a given oop</font>
jdis address <font color="red">show bytecode disassembly of a given methodOop</font>
jdis address <font color="red">show bytecode disassembly of a given Method*</font>
jhisto <font color="red">show Java heap histogram</font>
jseval script <font color="red">evaluate a given string as JavaScript code</font>
jsload file <font color="red">load and evaluate a JavaScript file</font>
@ -59,7 +59,7 @@ Available commands:
livenmethods <font color="red">show all live nmethods</font>
mem address [ length ] <font color="red">show contents of memory -- also shows closest ELF/COFF symbol if found</font>
pmap <font color="red">show Solaris pmap-like output</font>
print expression <font color="red">print given klassOop, methodOop or arbitrary address</font>
print expression <font color="red">print given Klass*, Method* or arbitrary address</font>
printas type expression <font color="red">print given address as given HotSpot type. eg. print JavaThread &lt;address&gt;</font>
printstatics [ type ] <font color="red">print static fields of given HotSpot type (or all types if none specified)</font>
pstack [-v] <font color="red">show mixed mode stack trace for all Java, non-Java threads. -v is verbose mode</font>

View File

@ -1,254 +0,0 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
import java.io.*;
import java.util.*;
/**
<p> This class finds transitive closure of dependencies from a given
root set of classes. If your project has lots of .class files and you
want to ship only those .class files which are used (transitively)
from a root set of classes, then you can use this utility. </p> <p>
How does it work?</p>
<p> We walk through all constant pool entries of a given class and
find all modified UTF-8 entries. Anything that looks like a class name is
considered as a class and we search for that class in the given
classpath. If we find a .class of that name, then we add that class to
list.</p>
<p> We could have used CONSTANT_ClassInfo type constants only. But
that will miss classes used through Class.forName or xyz.class
construct. But, if you refer to a class name in some other string we
would include it as dependency :(. But this is quite unlikely
anyway. To look for exact Class.forName argument(s) would involve
bytecode analysis. Also, we handle only simple reflection. If you
accept name of a class from externally (for eg properties file or
command line args for example, this utility will not be able to find
that dependency. In such cases, include those classes in the root set.
</p>
*/
public class ClosureFinder {
private Collection roots; // root class names Collection<String>
private Map visitedClasses; // set of all dependencies as a Map
private String classPath; // classpath to look for .class files
private String[] pathComponents; // classpath components
private static final boolean isWindows = File.separatorChar != '/';
public ClosureFinder(Collection roots, String classPath) {
this.roots = roots;
this.classPath = classPath;
parseClassPath();
}
// parse classPath into pathComponents array
private void parseClassPath() {
List paths = new ArrayList();
StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator);
while (st.hasMoreTokens())
paths.add(st.nextToken());
Object[] arr = paths.toArray();
pathComponents = new String[arr.length];
System.arraycopy(arr, 0, pathComponents, 0, arr.length);
}
// if output is aleady not computed, compute it now
// result is a map from class file name to base path where the .class was found
public Map find() {
if (visitedClasses == null) {
visitedClasses = new HashMap();
computeClosure();
}
return visitedClasses;
}
// compute closure for all given root classes
private void computeClosure() {
for (Iterator rootsItr = roots.iterator(); rootsItr.hasNext();) {
String name = (String) rootsItr.next();
name = name.substring(0, name.indexOf(".class"));
computeClosure(name);
}
}
// looks up for .class in pathComponents and returns
// base path if found, else returns null
private String lookupClassFile(String classNameAsPath) {
for (int i = 0; i < pathComponents.length; i++) {
File f = new File(pathComponents[i] + File.separator +
classNameAsPath + ".class");
if (f.exists()) {
if (isWindows) {
String name = f.getName();
// Windows reports special devices AUX,NUL,CON as files
// under any directory. It does not care about file extention :-(
if (name.compareToIgnoreCase("AUX.class") == 0 ||
name.compareToIgnoreCase("NUL.class") == 0 ||
name.compareToIgnoreCase("CON.class") == 0) {
return null;
}
}
return pathComponents[i];
}
}
return null;
}
// from JVM spec. 2'nd edition section 4.4
private static final int CONSTANT_Class = 7;
private static final int CONSTANT_FieldRef = 9;
private static final int CONSTANT_MethodRef = 10;
private static final int CONSTANT_InterfaceMethodRef = 11;
private static final int CONSTANT_String = 8;
private static final int CONSTANT_Integer = 3;
private static final int CONSTANT_Float = 4;
private static final int CONSTANT_Long = 5;
private static final int CONSTANT_Double = 6;
private static final int CONSTANT_NameAndType = 12;
private static final int CONSTANT_Utf8 = 1;
// whether a given string may be a class name?
private boolean mayBeClassName(String internalClassName) {
int len = internalClassName.length();
for (int s = 0; s < len; s++) {
char c = internalClassName.charAt(s);
if (!Character.isJavaIdentifierPart(c) && c != '/')
return false;
}
return true;
}
// compute closure for a given class
private void computeClosure(String className) {
if (visitedClasses.get(className) != null) return;
String basePath = lookupClassFile(className);
if (basePath != null) {
visitedClasses.put(className, basePath);
try {
File classFile = new File(basePath + File.separator + className + ".class");
FileInputStream fis = new FileInputStream(classFile);
DataInputStream dis = new DataInputStream(fis);
// look for .class signature
if (dis.readInt() != 0xcafebabe) {
System.err.println(classFile.getAbsolutePath() + " is not a valid .class file");
return;
}
// ignore major and minor version numbers
dis.readShort();
dis.readShort();
// read number of constant pool constants
int numConsts = (int) dis.readShort();
String[] strings = new String[numConsts];
// zero'th entry is unused
for (int cpIndex = 1; cpIndex < numConsts; cpIndex++) {
int constType = (int) dis.readByte();
switch (constType) {
case CONSTANT_Class:
case CONSTANT_String:
dis.readShort(); // string name index;
break;
case CONSTANT_FieldRef:
case CONSTANT_MethodRef:
case CONSTANT_InterfaceMethodRef:
case CONSTANT_NameAndType:
case CONSTANT_Integer:
case CONSTANT_Float:
// all these are 4 byte constants
dis.readInt();
break;
case CONSTANT_Long:
case CONSTANT_Double:
// 8 byte constants
dis.readLong();
// occupies 2 cp entries
cpIndex++;
break;
case CONSTANT_Utf8: {
strings[cpIndex] = dis.readUTF();
break;
}
default:
System.err.println("invalid constant pool entry");
return;
}
}
// now walk thru the string constants and look for class names
for (int s = 0; s < numConsts; s++) {
if (strings[s] != null && mayBeClassName(strings[s]))
computeClosure(strings[s].replace('/', File.separatorChar));
}
} catch (IOException exp) {
// ignore for now
}
}
}
// a sample main that accepts roots classes in a file and classpath as args
public static void main(String[] args) {
if (args.length != 2) {
System.err.println("Usage: ClosureFinder <root class file> <class path>");
System.exit(1);
}
List roots = new ArrayList();
try {
FileInputStream fis = new FileInputStream(args[0]);
DataInputStream dis = new DataInputStream(fis);
String line = null;
while ((line = dis.readLine()) != null) {
if (isWindows) {
line = line.replace('/', File.separatorChar);
}
roots.add(line);
}
} catch (IOException exp) {
System.err.println(exp.getMessage());
System.exit(2);
}
ClosureFinder cf = new ClosureFinder(roots, args[1]);
Map out = cf.find();
Iterator res = out.keySet().iterator();
for(; res.hasNext(); ) {
String className = (String) res.next();
System.out.println(className + ".class");
}
}
}

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -41,10 +41,7 @@ endif
PKGLIST = \
sun.jvm.hotspot \
sun.jvm.hotspot.asm \
sun.jvm.hotspot.asm.amd64 \
sun.jvm.hotspot.asm.ia64 \
sun.jvm.hotspot.asm.sparc \
sun.jvm.hotspot.asm.x86 \
sun.jvm.hotspot.bugspot \
sun.jvm.hotspot.bugspot.tree \
sun.jvm.hotspot.c1 \
@ -138,10 +135,7 @@ com.sun.java.swing.ui
FILELIST = \
sun/jvm/hotspot/*.java \
sun/jvm/hotspot/asm/*.java \
sun/jvm/hotspot/asm/amd64/*.java \
sun/jvm/hotspot/asm/ia64/*.java \
sun/jvm/hotspot/asm/sparc/*.java \
sun/jvm/hotspot/asm/x86/*.java \
sun/jvm/hotspot/bugspot/*.java \
sun/jvm/hotspot/bugspot/tree/*.java \
sun/jvm/hotspot/c1/*.java \

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it

View File

@ -1,6 +1,6 @@
#!/bin/sh
#
# Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2007, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -31,7 +31,13 @@
#import <mach/mach.h>
#import <mach/mach_types.h>
#import <sys/sysctl.h>
#import <stdio.h>
#import <stdarg.h>
#import <stdlib.h>
#import <strings.h>
#import <dlfcn.h>
#import <limits.h>
#import <errno.h>
jboolean debug = JNI_FALSE;
@ -60,6 +66,9 @@ static task_t getTask(JNIEnv *env, jobject this_obj) {
#define CHECK_EXCEPTION if ((*env)->ExceptionOccurred(env)) { return;}
#define THROW_NEW_DEBUGGER_EXCEPTION_(str, value) { throw_new_debugger_exception(env, str); return value; }
#define THROW_NEW_DEBUGGER_EXCEPTION(str) { throw_new_debugger_exception(env, str); return;}
#define CHECK_EXCEPTION_CLEAR if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); }
#define CHECK_EXCEPTION_CLEAR_VOID if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return; }
#define CHECK_EXCEPTION_CLEAR_(value) if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return value; }
static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) {
(*env)->ThrowNew(env, (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException"), errMsg);
@ -404,3 +413,164 @@ JNF_COCOA_ENTER(env);
}
JNF_COCOA_EXIT(env);
}
/*
* Class: sun_jvm_hotspot_asm_Disassembler
* Method: load_library
* Signature: (Ljava/lang/String;)L
*/
JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_asm_Disassembler_load_1library(JNIEnv * env,
jclass disclass,
jstring jrepath_s,
jstring libname_s) {
uintptr_t func = 0;
const char* error_message = NULL;
const char* java_home;
jboolean isCopy;
uintptr_t *handle = NULL;
const char * jrepath = (*env)->GetStringUTFChars(env, jrepath_s, &isCopy); // like $JAVA_HOME/jre/lib/sparc/
const char * libname = (*env)->GetStringUTFChars(env, libname_s, &isCopy);
char buffer[128];
/* Load the hsdis library */
void* hsdis_handle;
hsdis_handle = dlopen(libname, RTLD_LAZY | RTLD_GLOBAL);
if (hsdis_handle == NULL) {
snprintf(buffer, sizeof(buffer), "%s%s", jrepath, libname);
hsdis_handle = dlopen(buffer, RTLD_LAZY | RTLD_GLOBAL);
}
if (hsdis_handle != NULL) {
func = (uintptr_t)dlsym(hsdis_handle, "decode_instructions_virtual");
}
if (func == 0) {
error_message = dlerror();
fprintf(stderr, "%s\n", error_message);
}
(*env)->ReleaseStringUTFChars(env, libname_s, libname);
(*env)->ReleaseStringUTFChars(env, jrepath_s, jrepath);
if (func == 0) {
/* Couldn't find entry point. error_message should contain some
* platform dependent error message.
*/
THROW_NEW_DEBUGGER_EXCEPTION(error_message);
}
return (jlong)func;
}
/* signature of decode_instructions_virtual from hsdis.h */
typedef void* (*decode_func)(uintptr_t start_va, uintptr_t end_va,
unsigned char* start, uintptr_t length,
void* (*event_callback)(void*, const char*, void*),
void* event_stream,
int (*printf_callback)(void*, const char*, ...),
void* printf_stream,
const char* options);
/* container for call back state when decoding instructions */
typedef struct {
JNIEnv* env;
jobject dis;
jobject visitor;
jmethodID handle_event;
jmethodID raw_print;
char buffer[4096];
} decode_env;
/* event callback binding to Disassembler.handleEvent */
static void* event_to_env(void* env_pv, const char* event, void* arg) {
decode_env* denv = (decode_env*)env_pv;
JNIEnv* env = denv->env;
jstring event_string = (*env)->NewStringUTF(env, event);
jlong result = (*env)->CallLongMethod(env, denv->dis, denv->handle_event, denv->visitor,
event_string, (jlong) (uintptr_t)arg);
/* ignore exceptions for now */
CHECK_EXCEPTION_CLEAR_((void *)0);
return (void*)(uintptr_t)result;
}
/* printing callback binding to Disassembler.rawPrint */
static int printf_to_env(void* env_pv, const char* format, ...) {
jstring output;
va_list ap;
int cnt;
decode_env* denv = (decode_env*)env_pv;
JNIEnv* env = denv->env;
size_t flen = strlen(format);
const char* raw = NULL;
if (flen == 0) return 0;
if (flen < 2 ||
strchr(format, '%') == NULL) {
raw = format;
} else if (format[0] == '%' && format[1] == '%' &&
strchr(format+2, '%') == NULL) {
// happens a lot on machines with names like %foo
flen--;
raw = format+1;
}
if (raw != NULL) {
jstring output = (*env)->NewStringUTF(env, raw);
(*env)->CallVoidMethod(env, denv->dis, denv->raw_print, denv->visitor, output);
CHECK_EXCEPTION_CLEAR;
return (int) flen;
}
va_start(ap, format);
cnt = vsnprintf(denv->buffer, sizeof(denv->buffer), format, ap);
va_end(ap);
output = (*env)->NewStringUTF(env, denv->buffer);
(*env)->CallVoidMethod(env, denv->dis, denv->raw_print, denv->visitor, output);
CHECK_EXCEPTION_CLEAR;
return cnt;
}
/*
* Class: sun_jvm_hotspot_asm_Disassembler
* Method: decode
* Signature: (Lsun/jvm/hotspot/asm/InstructionVisitor;J[BLjava/lang/String;J)V
*/
JNIEXPORT void JNICALL Java_sun_jvm_hotspot_asm_Disassembler_decode(JNIEnv * env,
jobject dis,
jobject visitor,
jlong startPc,
jbyteArray code,
jstring options_s,
jlong decode_instructions_virtual) {
jboolean isCopy;
jbyte* start = (*env)->GetByteArrayElements(env, code, &isCopy);
jbyte* end = start + (*env)->GetArrayLength(env, code);
const char * options = (*env)->GetStringUTFChars(env, options_s, &isCopy);
jclass disclass = (*env)->GetObjectClass(env, dis);
decode_env denv;
denv.env = env;
denv.dis = dis;
denv.visitor = visitor;
/* find Disassembler.handleEvent callback */
denv.handle_event = (*env)->GetMethodID(env, disclass, "handleEvent",
"(Lsun/jvm/hotspot/asm/InstructionVisitor;Ljava/lang/String;J)J");
CHECK_EXCEPTION_CLEAR_VOID
/* find Disassembler.rawPrint callback */
denv.raw_print = (*env)->GetMethodID(env, disclass, "rawPrint",
"(Lsun/jvm/hotspot/asm/InstructionVisitor;Ljava/lang/String;)V");
CHECK_EXCEPTION_CLEAR_VOID
/* decode the buffer */
(*(decode_func)(uintptr_t)decode_instructions_virtual)(startPc,
startPc + end - start,
(unsigned char*)start,
end - start,
&event_to_env, (void*) &denv,
&printf_to_env, (void*) &denv,
options);
/* cleanup */
(*env)->ReleaseByteArrayElements(env, code, start, JNI_ABORT);
(*env)->ReleaseStringUTFChars(env, options_s, options);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -210,7 +210,6 @@ static map_info* core_lookup(struct ps_prochandle *ph, uintptr_t addr)
// mapped. This structure gets written to a file. It is not a class,
// so that the compilers don't add any compiler-private data to it.
// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
#define NUM_SHARED_MAPS 4
// Refer to FileMapInfo::_current_version in filemap.hpp
@ -234,7 +233,7 @@ struct FileMapHeader {
char _read_only; // read only space?
char _allow_exec; // executable code in space?
} _space[NUM_SHARED_MAPS]; // was _space[CompactingPermGenGen::n_regions];
} _space[NUM_SHARED_MAPS];
// Ignore the rest of the FileMapHeader. We don't need those fields here.
};

View File

@ -36,25 +36,33 @@ SOURCES = salibelf.c \
INCLUDES = -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux
OBJS = $(SOURCES:.c=.o)
OBJS = $(SOURCES:%.c=$(ARCH)/%.o) $(ARCH)/sadis.o
LIBS = -lthread_db
CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -D_FILE_OFFSET_BITS=64
CFLAGS = -c -fPIC -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) -I$(ARCH)
LIBSA = $(ARCH)/libsaproc.so
all: $(LIBSA)
LinuxDebuggerLocal.o: LinuxDebuggerLocal.c
$(JAVAH) -jni -classpath ../../../build/classes \
$(ARCH):
mkdir $(ARCH)
$(ARCH)/LinuxDebuggerLocal.o: LinuxDebuggerLocal.c
$(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \
sun.jvm.hotspot.debugger.x86.X86ThreadContext \
sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \
sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
$(GCC) $(CFLAGS) $<
$(GCC) $(CFLAGS) $< -o $@
.c.obj:
$(GCC) $(CFLAGS)
$(ARCH)/sadis.o: ../../share/native/sadis.c
$(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \
sun.jvm.hotspot.asm.Disassembler
$(GCC) $(CFLAGS) $< -o $@
$(ARCH)/%.o: %.c
$(GCC) $(CFLAGS) $< -o $@
ifndef LDNOMAP
LFLAGS_LIBSA = -Xlinker --version-script=mapfile
@ -68,9 +76,8 @@ ifneq ($(_HAS_HASH_STYLE_GNU),)
endif
LFLAGS_LIBSA += $(LDFLAGS_HASH_STYLE)
$(LIBSA): $(OBJS) mapfile
if [ ! -d $(ARCH) ] ; then mkdir $(ARCH) ; fi
$(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
$(LIBSA): $(ARCH) $(OBJS) mapfile
$(GCC) -shared $(LFLAGS_LIBSA) -o $(LIBSA) $(OBJS) $(LIBS)
test.o: test.c
$(GCC) -c -o test.o -g -D_GNU_SOURCE -D$(ARCH) $(INCLUDES) test.c
@ -79,7 +86,4 @@ test: test.o
$(GCC) -o test test.o -L$(ARCH) -lsaproc $(LIBS)
clean:
rm -rf $(LIBSA)
rm -rf $(OBJS)
rmdir $(ARCH)
rm -fr $(ARCH)

View File

@ -1,7 +1,5 @@
#
#
# Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -22,7 +20,6 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Define public interface.
@ -40,6 +37,10 @@ SUNWprivate_1.1 {
Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_readBytesFromProcess0;
Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0;
# Disassembler interface
Java_sun_jvm_hotspot_asm_Disassembler_decode;
Java_sun_jvm_hotspot_asm_Disassembler_load_1library;
# proc_service.h functions - to be used by libthread_db
ps_getpid;
ps_pglobal_lookup;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -209,7 +209,6 @@ static map_info* core_lookup(struct ps_prochandle *ph, uintptr_t addr)
// mapped. This structure gets written to a file. It is not a class,
// so that the compilers don't add any compiler-private data to it.
// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
#define NUM_SHARED_MAPS 4
// Refer to FileMapInfo::_current_version in filemap.hpp
@ -233,7 +232,7 @@ struct FileMapHeader {
char _read_only; // read only space?
char _allow_exec; // executable code in space?
} _space[NUM_SHARED_MAPS]; // was _space[CompactingPermGenGen::n_regions];
} _space[NUM_SHARED_MAPS];
// Ignore the rest of the FileMapHeader. We don't need those fields here.
};

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -27,7 +27,7 @@
# sparcv9: Build the 64 bit sparcv9 version in ./sparcv9
# i386: Build the 32 bit i386 version in ./i386
.PHONY: sparc sparcv9 i386
.PHONY: sparc sparcv9 i386 amd64
ARCH_ORIG = $(shell uname -p)
@ -36,6 +36,8 @@ RM := /usr/bin/rm
MKDIRS := /usr/bin/mkdir -p
CLASSES_DIR = ../../../../build/classes
SAPROC_INCLUDES=-I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris
SADIS=../../../share/native/sadis.c
ifeq "$(ARCH_ORIG)" "i386"
ALL_TARGET = i386 $(filter amd64,$(shell isalist))
@ -43,6 +45,11 @@ else
ALL_TARGET = sparc sparcv9
endif
CFLAGS/i386 =
CFLAGS/amd64 = -xarch=amd64
CFLAGS/sparc = -xarch=v8
CFLAGS/sparv9 = -xarch=v9
all:: $(ALL_TARGET)
javahomecheck::
@ -51,34 +58,13 @@ javahomecheck::
exit 1 ; \
fi
i386:: javahomecheck
i386 amd64 sparc sparcv9:: javahomecheck
$(MKDIRS) $@
@javah -classpath $(CLASSES_DIR) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
CC -G -KPIC -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris saproc.cpp \
-M mapfile -o $@/libsaproc.so -ldemangle
CC -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc
amd64:: javahomecheck
$(MKDIRS) $@
@javah -classpath $(CLASSES_DIR) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
CC -G -KPIC -xarch=amd64 -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris saproc.cpp \
-M mapfile -o $@/libsaproc.so -ldemangle
CC -xarch=amd64 -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc
sparc:: javahomecheck
$(MKDIRS) $@
@javah -classpath $(CLASSES_DIR) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
CC -G -KPIC -xarch=v8 -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris saproc.cpp \
-M mapfile -o $@/libsaproc.so -ldemangle
CC -xarch=v8 -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc
sparcv9:: javahomecheck
$(MKDIRS) $@
@javah -classpath $(CLASSES_DIR) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
CC -G -KPIC -xarch=v9 -I${JAVA_HOME}/include -I${JAVA_HOME}/include/solaris saproc.cpp \
-M mapfile -o $@/libsaproc.so -ldemangle
CC -xarch=v9 -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc
@$(JAVA_HOME)/bin/javah -classpath $(CLASSES_DIR) -d $@ -jni sun.jvm.hotspot.asm.Disassembler sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
CC $(CFLAGS/$@) -c -g -Kpic ${SAPROC_INCLUDES} -I$@ saproc.cpp -o $@/saproc.o
cc $(CFLAGS/$@) -c -g -Kpic ${SAPROC_INCLUDES} -I$@ $(SADIS) -o $@/sadis.o
CC $(CFLAGS/$@) -g -G -Kpic $@/saproc.o $@/sadis.o -M mapfile -o $@/libsaproc.so -ldemangle
CC $(CFLAGS/$@) -o $@/libsaproc_audit.so -G -Kpic -z defs saproc_audit.cpp -lmapmalloc -ldl -lc
clean::
$(RM) -rf sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal.h
$(RM) -rf sparc sparcv9 i386
$(RM) -rf sparc sparcv9 i386 amd64

View File

@ -1,7 +1,5 @@
#
#
# Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -22,10 +20,8 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
#
# Define public interface.
SUNWprivate_1.1 {
global:
Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_attach0__Ljava_lang_String_2;
@ -47,6 +43,9 @@ SUNWprivate_1.1 {
Java_sun_jvm_hotspot_debugger_proc_ProcDebuggerLocal_writeBytesToProcess0;
# this is needed by saproc_audit.c to redirect opens in libproc.so
libsaproc_open;
local:
# Disassembler interface
Java_sun_jvm_hotspot_asm_Disassembler_decode;
Java_sun_jvm_hotspot_asm_Disassembler_load_1library;
local:
*;
};

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -510,7 +510,6 @@ wrapper_fill_cframe_list(void *cd, const prgregset_t regs, uint_t argc,
// mapped. This structure gets written to a file. It is not a class, so
// that the compilers don't add any compiler-private data to it.
// Refer to CompactingPermGenGen::n_regions in compactingPermGenGen.hpp
const int NUM_SHARED_MAPS = 4;
// Refer to FileMapInfo::_current_version in filemap.hpp
@ -531,7 +530,7 @@ struct FileMapHeader {
bool _read_only; // read only space?
bool _allow_exec; // executable code in space?
} _space[NUM_SHARED_MAPS]; // was _space[CompactingPermGenGen::n_regions];
} _space[NUM_SHARED_MAPS];
// Ignore the rest of the FileMapHeader. We don't need those fields here.
};

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -35,6 +35,8 @@ WINDBG_LIB32=$(WINDBG_HOME)/sdk/lib/i386
WINDBG_LIB_IA64=$(WINDBG_HOME)/sdk/lib/ia64
WINDBG_LIB_AMD64=$(WINDBG_HOME)/sdk/lib/amd64
SADIS=../../../share/native/sadis.c
# These do not need to be optimized (don't run a lot of code) and it
# will be useful to have the assertion checks in place
@ -57,23 +59,29 @@ ia64: ia64/$(SAWINDBGDLL)
amd64: amd64/$(SAWINDBGDLL)
i386/$(SAWINDBGDLL) : sawindbg.cpp
i386/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS)
@ mkdir -p i386
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.x86.X86ThreadContext
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.x86.X86ThreadContext
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler
@ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sawindbg.pch" /Fo"i386/" /Fd"i386/" /c sawindbg.cpp
$(LINK32) /out:$@ /DLL i386/sawindbg.obj $(LIBS32)
@ $(CPP32) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS32) /Fp"i386/sadis.pch" /Fo"i386/" /Fd"i386/" /c $(SADIS)
$(LINK32) /out:$@ /DLL i386/sawindbg.obj i386/sadis.obj $(LIBS32)
ia64/$(SAWINDBGDLL) : sawindbg.cpp
ia64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS)
@ mkdir -p ia64
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler
@ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sawindbg.pch" /Fo"ia64/" /Fd"ia64/" /c sawindbg.cpp
$(LINK64) /out:$@ /DLL ia64/sawindbg.obj $(LIBS_IA64)
@ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"ia64/sadis.pch" /Fo"ia64/" /Fd"ia64/" /c $(SADIS)
$(LINK64) /out:$@ /DLL ia64/sawindbg.obj ia64/sadis.obj $(LIBS_IA64)
amd64/$(SAWINDBGDLL) : sawindbg.cpp
amd64/$(SAWINDBGDLL) : sawindbg.cpp $(SADIS)
@ mkdir -p amd64
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
@ $(JAVAH) -jni -classpath ../../../../build/classes sun.jvm.hotspot.asm.Disassembler
@ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sawindbg.pch" /Fo"amd64/" /Fd"amd64/" /c sawindbg.cpp
$(LINK64) /out:$@ /DLL amd64/sawindbg.obj $(LIBS_AMD64)
@ $(CPP64) /I$(JAVA_HOME)/include /I$(JAVA_HOME)/include/win32 /I$(WINDBG_INCLUDE) $(CFLAGS64) /Fp"amd64/sadis.pch" /Fo"amd64/" /Fd"amd64/" /c $(SADIS)
$(LINK64) /out:$@ /DLL amd64/sawindbg.obj amd64/sadis.obj $(LIBS_AMD64)
clean:
rm *.h

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -42,6 +42,7 @@ import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.opto.*;
import sun.jvm.hotspot.ci.*;
import sun.jvm.hotspot.asm.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.utilities.*;
import sun.jvm.hotspot.utilities.soql.*;
@ -564,6 +565,71 @@ public class CommandProcessor {
}
}
},
// decode raw address
new Command("dis", "dis address [length]", false) {
public void doit(Tokens t) {
int tokens = t.countTokens();
if (tokens != 1 && tokens != 2) {
usage();
return;
}
String name = t.nextToken();
Address addr = null;
int len = 0x10; // default length
try {
addr = VM.getVM().getDebugger().parseAddress(name);
} catch (NumberFormatException e) {
out.println(e);
return;
}
if (tokens == 2) {
try {
len = Integer.parseInt(t.nextToken());
} catch (NumberFormatException e) {
out.println(e);
return;
}
}
HTMLGenerator generator = new HTMLGenerator(false);
out.println(generator.genHTMLForRawDisassembly(addr, len));
}
},
// decode codeblob or nmethod
new Command("disassemble", "disassemble address", false) {
public void doit(Tokens t) {
int tokens = t.countTokens();
if (tokens != 1) {
usage();
return;
}
String name = t.nextToken();
Address addr = null;
try {
addr = VM.getVM().getDebugger().parseAddress(name);
} catch (NumberFormatException e) {
out.println(e);
return;
}
HTMLGenerator generator = new HTMLGenerator(false);
out.println(generator.genHTML(addr));
}
},
// print Java bytecode disassembly
new Command("jdis", "jdis address", false) {
public void doit(Tokens t) {
int tokens = t.countTokens();
if (tokens != 1) {
usage();
return;
}
Address a = VM.getVM().getDebugger().parseAddress(t.nextToken());
Method m = (Method)Metadata.instantiateWrapperFor(a);
HTMLGenerator html = new HTMLGenerator(false);
out.println(html.genHTML(m));
}
},
new Command("revptrs", "revptrs address", false) {
public void doit(Tokens t) {
int tokens = t.countTokens();
@ -634,29 +700,57 @@ public class CommandProcessor {
} else {
String s = t.nextToken();
if (s.equals("-a")) {
HeapVisitor iterator = new DefaultHeapVisitor() {
public boolean doObj(Oop obj) {
if (obj instanceof MethodData) {
Method m = ((MethodData)obj).getMethod();
out.println("MethodData " + obj.getHandle() + " for " +
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
public void visit(Klass k) {
if (k instanceof InstanceKlass) {
MethodArray methods = ((InstanceKlass)k).getMethods();
for (int i = 0; i < methods.length(); i++) {
Method m = methods.at(i);
MethodData mdo = m.getMethodData();
if (mdo != null) {
out.println("MethodData " + mdo.getAddress() + " for " +
"method " + m.getMethodHolder().getName().asString() + "." +
m.getName().asString() +
m.getSignature().asString() + "@" + m.getHandle());
((MethodData)obj).printDataOn(out);
m.getSignature().asString() + "@" + m.getAddress());
mdo.printDataOn(out);
}
return false;
}
};
VM.getVM().getObjectHeap().iteratePerm(iterator);
}
}
}
);
} else {
Address a = VM.getVM().getDebugger().parseAddress(s);
OopHandle handle = a.addOffsetToAsOopHandle(0);
MethodData mdo = (MethodData)VM.getVM().getObjectHeap().newOop(handle);
MethodData mdo = (MethodData) Metadata.instantiateWrapperFor(a);
mdo.printDataOn(out);
}
}
}
},
new Command("printall", "printall", false) {
// Print every MDO in the heap or the one referenced by expression.
public void doit(Tokens t) {
if (t.countTokens() != 0) {
usage();
} else {
SystemDictionary sysDict = VM.getVM().getSystemDictionary();
sysDict.allClassesDo(new SystemDictionary.ClassVisitor() {
public void visit(Klass k) {
if (k instanceof InstanceKlass && ((InstanceKlass)k).getConstants().getCache() != null) {
MethodArray methods = ((InstanceKlass)k).getMethods();
for (int i = 0; i < methods.length(); i++) {
Method m = methods.at(i);
HTMLGenerator gen = new HTMLGenerator(false);
out.println(gen.genHTML(m));
}
}
}
}
);
}
}
},
new Command("dumpideal", "dumpideal { -a | id }", false) {
// Do a full dump of the nodes reachabile from root in each compiler thread.
public void doit(Tokens t) {
@ -1229,7 +1323,7 @@ public class CommandProcessor {
}
};
VM.getVM().getObjectHeap().iterateRaw(iterator);
} else if (type.equals("heap") || type.equals("perm")) {
} else if (type.equals("heap")) {
HeapVisitor iterator = new DefaultHeapVisitor() {
public boolean doObj(Oop obj) {
int index = 0;
@ -1246,11 +1340,7 @@ public class CommandProcessor {
return false;
}
};
if (type.equals("heap")) {
VM.getVM().getObjectHeap().iterate(iterator);
} else {
VM.getVM().getObjectHeap().iteratePerm(iterator);
}
} else if (type.equals("codecache")) {
CodeCacheVisitor v = new CodeCacheVisitor() {
public void prologue(Address start, Address end) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -998,7 +998,7 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
curFrame.addressOfInterpreterFrameLocal((int) interpreterFrameMethod.getMaxLocals() + offset),
"Interpreter locals area for frame with SP = " + curFrame.getSP()));
}
String methodAnno = "Interpreter frame methodOop";
String methodAnno = "Interpreter frame Method*";
if (interpreterFrameMethod == null) {
methodAnno += " (BAD OOP)";
}
@ -1054,13 +1054,6 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
}
}
if (bad) {
// Try perm gen
if (heap.permGen().isIn(handle)) {
anno = "PermGen ";
bad = false;
}
}
} else if (collHeap instanceof ParallelScavengeHeap) {
ParallelScavengeHeap heap = (ParallelScavengeHeap) collHeap;
if (heap.youngGen().isIn(handle)) {
@ -1069,9 +1062,6 @@ public class HSDB implements ObjectHistogramPanel.Listener, SAListener {
} else if (heap.oldGen().isIn(handle)) {
anno = "PSOldGen ";
bad = false;
} else if (heap.permGen().isIn(handle)) {
anno = "PSPermGen ";
bad = false;
}
} else {
// Optimistically assume the oop isn't bad

View File

@ -43,10 +43,6 @@ import sun.jvm.hotspot.utilities.*;
* highest-level factory for VM data structures. It makes it simple
* to start up the debugging system. </P>
*
* <P> FIXME: need to add a way to configure the paths to dbx and the
* DSO from the outside. However, this should work for now for
* internal use. </P>
*
* <P> FIXME: especially with the addition of remote debugging, this
* has turned into a mess; needs rethinking. </P>
*/
@ -87,30 +83,7 @@ public class HotSpotAgent {
private String[] jvmLibNames;
// FIXME: make these configurable, i.e., via a dotfile; also
// consider searching within the JDK from which this Java executable
// comes to find them
private static final String defaultDbxPathPrefix = "/net/jano.sfbay/export/disk05/hotspot/sa";
private static final String defaultDbxSvcAgentDSOPathPrefix = "/net/jano.sfbay/export/disk05/hotspot/sa";
static void showUsage() {
System.out.println(" You can also pass these -D options to java to specify where to find dbx and the \n" +
" Serviceability Agent plugin for dbx:");
System.out.println(" -DdbxPathName=<path-to-dbx-executable>\n" +
" Default is derived from dbxPathPrefix");
System.out.println(" or");
System.out.println(" -DdbxPathPrefix=<xxx>\n" +
" where xxx is the path name of a dir structure that contains:\n" +
" <os>/<arch>/bin/dbx\n" +
" The default is " + defaultDbxPathPrefix);
System.out.println(" and");
System.out.println(" -DdbxSvcAgentDSOPathName=<path-to-dbx-serviceability-agent-module>\n" +
" Default is determined from dbxSvcAgentDSOPathPrefix");
System.out.println(" or");
System.out.println(" -DdbxSvcAgentDSOPathPrefix=<xxx>\n" +
" where xxx is the pathname of a dir structure that contains:\n" +
" <os>/<arch>/bin/lib/libsvc_agent_dbx.so\n" +
" The default is " + defaultDbxSvcAgentDSOPathPrefix);
}
public HotSpotAgent() {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -50,6 +50,7 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
private static final int C_INT8_SIZE = 1;
private static final int C_INT32_SIZE = 4;
private static final int C_INT64_SIZE = 8;
private static int pointerSize = UNINITIALIZED_SIZE;
private static final boolean DEBUG;
static {
@ -185,6 +186,9 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
long size = entryAddr.getCIntegerAt(typeEntrySizeOffset, C_INT64_SIZE, true);
createType(typeName, superclassName, isOopType, isIntegerType, isUnsigned, size);
if (pointerSize == UNINITIALIZED_SIZE && typeName.equals("void*")) {
pointerSize = (int)size;
}
}
entryAddr = entryAddr.addOffsetTo(typeEntryArrayStride);
@ -678,7 +682,11 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
}
}
result = new BasicPointerType(this, typeName, targetType);
result.setSize(UNINITIALIZED_SIZE);
if (pointerSize == UNINITIALIZED_SIZE && !typeName.equals("void*")) {
// void* must be declared early so that other pointer types can use that to set their size.
throw new InternalError("void* type hasn't been seen when parsing " + typeName);
}
result.setSize(pointerSize);
addType(result);
return result;
}
@ -731,9 +739,11 @@ public class HotSpotTypeDataBase extends BasicTypeDataBase {
"had its size redefined (old was " + curType.getSize() + ", new is " + size + ").");
}
if (!typeNameIsPointerType(typeName)) {
System.err.println("Warning: the type \"" + typeName + "\" (declared in the remote VM in VMStructs::localHotSpotVMTypes) " +
"had its size declared as " + size + " twice. Continuing.");
}
}
}

View File

@ -1,207 +0,0 @@
/*
* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.debugger.proc.*;
// A test of the debugger backend. This should be used to connect to
// the helloWorld.cpp program.
public class TestDebugger {
private static void usage() {
System.out.println("usage: java TestDebugger [pid]");
System.out.println("pid must be the process ID of the helloWorld process");
System.exit(1);
}
public static void main(String[] args) {
try {
if (args.length != 1) {
usage();
}
int pid = 0;
try {
pid = Integer.parseInt(args[0]);
}
catch (NumberFormatException e) {
usage();
}
JVMDebugger debugger = new ProcDebuggerLocal(null, true);
try {
debugger.attach(pid);
}
catch (DebuggerException e) {
System.err.print("Error attaching to process ID " + pid + ": ");
if (e.getMessage() != null) {
System.err.print(e.getMessage());
}
System.err.println();
System.exit(1);
}
// HACK: configure debugger with primitive type sizes to get
// Java types going
debugger.configureJavaPrimitiveTypeSizes(1, 1, 2, 8, 4, 4, 8, 2);
// FIXME: figure out how to canonicalize and/or eliminate
// loadobject specification
String loadObjectName = "-";
// long strAddr = debugger.lookup("helloWorld", "helloWorldString");
Address addr = debugger.lookup(loadObjectName, "helloWorldString");
if (addr == null) {
System.err.println("Error looking up symbol \"helloWorldString\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
// This is a pointer which points to the start of storage.
// Dereference it.
addr = addr.getAddressAt(0);
// Read the number of bytes we know we need
int helloWorldLen = 13;
byte[] data = new byte[helloWorldLen];
for (int i = 0; i < helloWorldLen; ++i) {
data[i] = (byte) addr.getCIntegerAt(i, 1, false);
}
// Convert to characters
char[] chars = new char[data.length];
for (int i = 0; i < data.length; ++i) {
chars[i] = (char) data[i];
}
String helloWorldStr = new String(chars);
System.out.println("Successfully read string \"" + helloWorldStr + "\" from target process\n");
// Test all Java data types (see helloWorld.cpp)
byte expectedByteValue = (byte) 132;
short expectedShortValue = (short) 27890;
int expectedIntValue = 1020304050;
long expectedLongValue = 102030405060708090L;
float expectedFloatValue = 35.4F;
double expectedDoubleValue = 1.23456789;
byte byteValue = 0;
short shortValue = 0;
int intValue = 0;
long longValue = 0;
float floatValue = 0;
double doubleValue = 0;
addr = debugger.lookup(loadObjectName, "testByte");
if (addr == null) {
System.err.println("Error looking up symbol \"testByte\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
byteValue = addr.getJByteAt(0);
if (byteValue != expectedByteValue) {
System.err.println("Error: unexpected byte value (got " +
byteValue + ", expected " + expectedByteValue + ")");
System.exit(1);
}
addr = debugger.lookup(loadObjectName, "testShort");
if (addr == null) {
System.err.println("Error looking up symbol \"testShort\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
shortValue = addr.getJShortAt(0);
if (shortValue != expectedShortValue) {
System.err.println("Error: unexpected short value (got " +
shortValue + ", expected " + expectedShortValue + ")");
System.exit(1);
}
addr = debugger.lookup(loadObjectName, "testInt");
if (addr == null) {
System.err.println("Error looking up symbol \"testInt\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
intValue = addr.getJIntAt(0);
if (intValue != expectedIntValue) {
System.err.println("Error: unexpected int value (got " +
intValue + ", expected " + expectedIntValue + ")");
System.exit(1);
}
addr = debugger.lookup(loadObjectName, "testLong");
if (addr == null) {
System.err.println("Error looking up symbol \"testLong\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
longValue = addr.getJLongAt(0);
if (longValue != expectedLongValue) {
System.err.println("Error: unexpected long value (got " +
longValue + ", expected " + expectedLongValue + ")");
System.exit(1);
}
addr = debugger.lookup(loadObjectName, "testFloat");
if (addr == null) {
System.err.println("Error looking up symbol \"testFloat\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
floatValue = addr.getJFloatAt(0);
if (floatValue != expectedFloatValue) {
System.err.println("Error: unexpected float value (got " +
floatValue + ", expected " + expectedFloatValue + ")");
System.exit(1);
}
addr = debugger.lookup(loadObjectName, "testDouble");
if (addr == null) {
System.err.println("Error looking up symbol \"testDouble\" in context \"" +
loadObjectName + "\"");
System.exit(1);
}
doubleValue = addr.getJDoubleAt(0);
if (doubleValue != expectedDoubleValue) {
System.err.println("Error: unexpected double value (got " +
doubleValue + ", expected " + expectedDoubleValue + ")");
System.exit(1);
}
System.err.println("All tests passed successfully.");
debugger.detach();
}
catch (AddressException e) {
System.err.println("Error occurred during test:");
e.printStackTrace();
System.exit(1);
}
}
}

View File

@ -1,97 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public abstract class AbstractInstruction implements Instruction {
protected final String name;
public AbstractInstruction(String name) {
this.name = name;
}
public String getName() {
return name;
}
// some type testers
public boolean isIllegal() {
return false;
}
public boolean isArithmetic() {
return false;
}
public boolean isLogical() {
return false;
}
public boolean isShift() {
return false;
}
public boolean isMove() {
return false;
}
public boolean isBranch() {
return false;
}
public boolean isCall() {
return false;
}
public boolean isReturn() {
return false;
}
public boolean isLoad() {
return false;
}
public boolean isStore() {
return false;
}
public boolean isFloat() {
return false;
}
public boolean isTrap() {
return false;
}
public boolean isNoop() {
return false;
}
// convert the instruction as String given currentPc
// and SymbolFinder
public String asString(long currentPc, SymbolFinder symFinder) {
return name;
}
}

View File

@ -1,31 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface ArithmeticInstruction extends Instruction, RTLOperations {
public Operand[] getArithmeticSources();
public Operand getArithmeticDestination();
public int getOperation(); // one of RTLOperations
}

View File

@ -1,88 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
// address is calculated as (base + (index * scale) + displacement)
// optionally index is auto incremented or decremented
public abstract class BaseIndexScaleDispAddress extends IndirectAddress {
private final Register base, index;
private final int scale;
private final long disp;
private boolean isAutoIncr;
private boolean isAutoDecr;
public BaseIndexScaleDispAddress(Register base, Register index, long disp, int scale) {
this.base = base;
this.index = index;
this.disp = disp;
this.scale = scale;
}
public BaseIndexScaleDispAddress(Register base, Register index, long disp) {
this(base, index, disp, 1);
}
public BaseIndexScaleDispAddress(Register base, Register index) {
this(base, index, 0L, 1);
}
public BaseIndexScaleDispAddress(Register base, long disp) {
this(base, null, disp, 1);
}
public Register getBase() {
return base;
}
public Register getIndex() {
return index;
}
public int getScale() {
return scale;
}
public long getDisplacement() {
return disp;
}
// is the index auto decremented or incremented?
public boolean isAutoIncrement() {
return isAutoIncr;
}
public void setAutoIncrement(boolean value) {
isAutoIncr = value;
}
public boolean isAutoDecrement() {
return isAutoDecr;
}
public void setAutoDecrement(boolean value) {
isAutoDecr = value;
}
}

View File

@ -1,33 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface CPUHelper {
public Disassembler createDisassembler(long startPc, byte[] code);
public Register getIntegerRegister(int num);
public Register getFloatRegister(int num);
public Register getStackPointer();
public Register getFramePointer();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -24,22 +24,134 @@
package sun.jvm.hotspot.asm;
public abstract class Disassembler {
protected long startPc;
protected byte[] code;
import java.io.PrintStream;
import java.util.Observer;
import java.util.Observable;
import sun.jvm.hotspot.code.CodeBlob;
import sun.jvm.hotspot.code.NMethod;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
public Disassembler(long startPc, byte[] code) {
public class Disassembler {
private static String options = "";
private static long decode_function;
protected long startPc;
protected byte[] code;
private CodeBlob blob;
private NMethod nmethod;
public static void decode(InstructionVisitor visitor, CodeBlob blob) {
decode(visitor, blob, blob.codeBegin(), blob.codeEnd());
}
public static void decode(InstructionVisitor visitor, CodeBlob blob, Address begin, Address end) {
int codeSize = (int)end.minus(begin);
long startPc = VM.getAddressValue(begin);
byte[] code = new byte[codeSize];
for (int i = 0; i < code.length; i++)
code[i] = begin.getJByteAt(i);
Disassembler dis = new Disassembler(startPc, code);
dis.decode(visitor);
}
private Disassembler(long startPc, byte[] code) {
this.startPc = startPc;
this.code = code;
// Lazily load hsdis
if (decode_function == 0) {
StringBuilder path = new StringBuilder(System.getProperty("java.home"));
String sep = System.getProperty("file.separator");
String os = System.getProperty("os.name");
String libname = "hsdis";
String arch = System.getProperty("os.arch");
if (os.lastIndexOf("Windows", 0) != -1) {
path.append(sep + "bin" + sep);
libname += ".dll";
} else if (os.lastIndexOf("SunOS", 0) != -1) {
if (arch.equals("x86") || arch.equals("i386")) {
path.append(sep + "lib" + sep + "i386" + sep);
libname += "-i386" + ".so";
} else if (arch.equals("amd64")) {
path.append(sep + "lib" + sep + "amd64" + sep);
libname += "-amd64" + ".so";
} else {
path.append(sep + "lib" + sep + arch + sep);
libname += "-" + arch + ".so";
}
} else if (os.lastIndexOf("Linux", 0) != -1) {
if (arch.equals("x86") || arch.equals("i386")) {
path.append(sep + "lib" + sep + "i386" + sep);
libname += "-i386.so";
} else if (arch.equals("amd64") || arch.equals("x86_64")) {
path.append(sep + "lib" + sep + "amd64" + sep);
libname += "-amd64.so";
} else {
path.append(sep + "lib" + sep + arch + sep);
libname += "-" + arch + ".so";
}
} else if (os.lastIndexOf("Mac OS X", 0) != -1) {
path.append(sep + "lib" + sep);
libname += "-amd64" + ".dylib"; // x86_64 => amd64
} else {
path.append(sep + "lib" + sep + "arch" + sep);
libname += "-" + arch + ".so";
}
decode_function = load_library(path.toString(), libname);
}
}
public long getStartPC() {
return startPc;
private static native long load_library(String installed_jrepath, String hsdis_library_name);
private native void decode(InstructionVisitor visitor, long pc, byte[] code,
String options, long decode_function);
private void decode(InstructionVisitor visitor) {
visitor.prologue();
decode(visitor, startPc, code, options, decode_function);
visitor.epilogue();
}
public byte[] getCode() {
return code;
private boolean match(String event, String tag) {
if (!event.startsWith(tag))
return false;
int taglen = tag.length();
if (taglen == event.length()) return true;
char delim = event.charAt(taglen);
return delim == ' ' || delim == '/' || delim == '=';
}
public abstract void decode(InstructionVisitor visitor);
// This is called from the native code to process various markers
// in the dissassembly.
private long handleEvent(InstructionVisitor visitor, String event, long arg) {
if (match(event, "insn")) {
try {
visitor.beginInstruction(arg);
} catch (Throwable e) {
e.printStackTrace();
}
} else if (match(event, "/insn")) {
try {
visitor.endInstruction(arg);
} catch (Throwable e) {
e.printStackTrace();
}
} else if (match(event, "addr")) {
if (arg != 0) {
visitor.printAddress(arg);
}
return arg;
} else if (match(event, "mach")) {
// output().printf("[Disassembling for mach='%s']\n", arg);
} else {
// ignore unrecognized markup
}
return 0;
}
// This called from the native code to perform printing
private void rawPrint(InstructionVisitor visitor, String s) {
visitor.print(s);
}
}

View File

@ -1,53 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface Instruction {
public String getName();
// total size in bytes (operands + opcode).
// for eg. in sparc it is always 4 (= 32bits)
public int getSize();
// some type testers
public boolean isIllegal();
public boolean isArithmetic();
public boolean isLogical();
public boolean isShift();
public boolean isMove();
public boolean isBranch();
public boolean isCall();
public boolean isReturn();
public boolean isLoad();
public boolean isStore();
public boolean isFloat();
public boolean isTrap();
public boolean isNoop();
// convert the instruction as String given currentPc
// and SymbolFinder
public String asString(long currentPc, SymbolFinder symFinder);
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -26,6 +26,9 @@ package sun.jvm.hotspot.asm;
public interface InstructionVisitor {
public void prologue();
public void visit(long currentPc, Instruction instr);
public void beginInstruction(long currentPc);
public void printAddress(long address);
public void print(String format);
public void endInstruction(long endPc);
public void epilogue();
}

View File

@ -1,30 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface LoadInstruction extends MemoryInstruction {
public Address getLoadSource();
public Register[] getLoadDestinations();
}

View File

@ -1,31 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface LogicInstruction extends Instruction, RTLOperations {
public Operand[] getLogicSources();
public Operand getLogicDestination();
public int getOperation(); // one of RTLOperations
}

View File

@ -1,30 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface MemoryInstruction extends RTLDataTypes {
public int getDataType(); // one of the RTLDataTypes.
public boolean isConditional(); // conditional store like swap or v9 like non-faulting loads
}

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface MoveInstruction extends Instruction {
public ImmediateOrRegister getMoveSource();
public Register getMoveDestination();
// for condition moves
public boolean isConditional();
}

View File

@ -1,43 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
// address is specified as an offset from current PC
public class PCRelativeAddress extends IndirectAddress {
private final long disp;
public PCRelativeAddress(long disp) {
this.disp = disp;
}
public String toString() {
return new Long(disp).toString();
}
public long getDisplacement() {
return disp;
}
}

View File

@ -1,53 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface RTLDataTypes {
// HALF = 16 bits, WORD = 32 bits, DWORD = 64 bits and QWORD = 128 bits.
public static final int RTLDT_SIGNED_BYTE = 0;
public static final int RTLDT_UNSIGNED_BYTE = 1;
public static final int RTLDT_SIGNED_HALF = 2;
public static final int RTLDT_UNSIGNED_HALF = 3;
public static final int RTLDT_SIGNED_WORD = 4;
public static final int RTLDT_UNSIGNED_WORD = 5;
public static final int RTLDT_SIGNED_DWORD = 6;
public static final int RTLDT_UNSIGNED_DWORD = 7;
public static final int RTLDT_SIGNED_QWORD = 8;
public static final int RTLDT_UNSIGNED_QWORD = 9;
// float is 4 bytes, double is 8 bytes, extended double is 10 bytes
// and quad is 16 bytes.
public static final int RTLDT_FL_SINGLE = 10;
public static final int RTLDT_FL_DOUBLE = 11;
public static final int RTLDT_FL_EXT_DOUBLE = 12;
public static final int RTLDT_FL_QUAD = 13;
public static final int RTLDT_STRING = 14;
public static final int RTLDT_UNKNOWN = Integer.MAX_VALUE;
}

View File

@ -1,62 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface RTLOperations {
// arithmetic operations
public static final int RTLOP_ADD = 0;
// with carry
public static final int RTLOP_ADDC = 1;
public static final int RTLOP_SUB = 2;
// with carry
public static final int RTLOP_SUBC = 3;
public static final int RTLOP_SMUL = 4;
public static final int RTLOP_UMUL = 5;
public static final int RTLOP_SDIV = 6;
public static final int RTLOP_UDIV = 7;
public static final int RTLOP_MAX_ARITHMETIC = RTLOP_UDIV;
// logical operations
public static final int RTLOP_AND = 8;
public static final int RTLOP_OR = 9;
public static final int RTLOP_NOT = 10;
public static final int RTLOP_NAND = 11;
public static final int RTLOP_NOR = 12;
public static final int RTLOP_XOR = 13;
public static final int RTLOP_XNOR = 14;
public static final int RTLOP_MAX_LOGICAL = RTLOP_XNOR;
// shift operations
public static final int RTLOP_SRL = 15;
public static final int RTLOP_SRA = 16;
public static final int RTLOP_SLL = 17;
public static final int RTLOP_MAX_SHIFT = RTLOP_SLL;
public static final int RTLOP_UNKNOWN = Integer.MAX_VALUE;
}

View File

@ -1,28 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface ReturnInstruction extends BranchInstruction {
}

View File

@ -1,31 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface ShiftInstruction extends Instruction, RTLOperations {
public Operand getShiftSource();
public Operand getShiftLength(); // number of bits to shift
public Operand getShiftDestination();
}

View File

@ -1,30 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm;
public interface StoreInstruction extends MemoryInstruction {
public Register[] getStoreSources();
public Address getStoreDestination();
}

View File

@ -1,90 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.amd64;
import sun.jvm.hotspot.utilities.Assert;
public class AMD64FloatRegisters {
public static int getNumRegisters() {
return NUM_REGIXMMERS;
}
public static AMD64FloatRegister getRegister(int regNum) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(regNum > -1 && regNum < NUM_REGIXMMERS, "invalid float register number!");
}
return registers[regNum];
}
public static String getRegisterName(int i) {
return "XMM(" + i + ")";
}
public static final AMD64FloatRegister XMM0;
public static final AMD64FloatRegister XMM1;
public static final AMD64FloatRegister XMM2;
public static final AMD64FloatRegister XMM3;
public static final AMD64FloatRegister XMM4;
public static final AMD64FloatRegister XMM5;
public static final AMD64FloatRegister XMM6;
public static final AMD64FloatRegister XMM7;
public static final AMD64FloatRegister XMM8;
public static final AMD64FloatRegister XMM9;
public static final AMD64FloatRegister XMM10;
public static final AMD64FloatRegister XMM11;
public static final AMD64FloatRegister XMM12;
public static final AMD64FloatRegister XMM13;
public static final AMD64FloatRegister XMM14;
public static final AMD64FloatRegister XMM15;
public static final int NUM_REGIXMMERS = 16;
private static final AMD64FloatRegister[] registers;
static {
XMM0 = new AMD64FloatRegister(0);
XMM1 = new AMD64FloatRegister(1);
XMM2 = new AMD64FloatRegister(2);
XMM3 = new AMD64FloatRegister(3);
XMM4 = new AMD64FloatRegister(4);
XMM5 = new AMD64FloatRegister(5);
XMM6 = new AMD64FloatRegister(6);
XMM7 = new AMD64FloatRegister(7);
XMM8 = new AMD64FloatRegister(8);
XMM9 = new AMD64FloatRegister(9);
XMM10 = new AMD64FloatRegister(10);
XMM11 = new AMD64FloatRegister(11);
XMM12 = new AMD64FloatRegister(12);
XMM13 = new AMD64FloatRegister(13);
XMM14 = new AMD64FloatRegister(14);
XMM15 = new AMD64FloatRegister(15);
registers = new AMD64FloatRegister[] {
XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7,
XMM8, XMM9, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15
};
}
}

View File

@ -1,51 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.amd64;
import sun.jvm.hotspot.asm.*;
public class AMD64Helper implements CPUHelper {
public Disassembler createDisassembler(long startPc, byte[] code) {
// FIXME: no disassembler yet
return null;
}
public Register getIntegerRegister(int num) {
return AMD64Registers.getRegister(num);
}
public Register getFloatRegister(int num) {
return AMD64FloatRegisters.getRegister(num);
}
public Register getStackPointer() {
return AMD64Registers.RSP;
}
public Register getFramePointer() {
return AMD64Registers.RBP;
}
}

View File

@ -1,53 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.amd64;
import sun.jvm.hotspot.asm.*;
public class AMD64Register extends Register {
protected String name;
public AMD64Register(int num, String name) {
super(num);
this.name = name;
}
public int getNumberOfRegisters() {
return AMD64Registers.getNumberOfRegisters();
}
public String toString() {
return name;
}
public boolean isFramePointer() {
return number == 5; //rbp
}
public boolean isStackPointer() {
return number == 4; //rsp
}
public boolean isFloat() {
return false;
}
public boolean isSegmentPointer() {
return false;
}
}

View File

@ -1,92 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.amd64;
import sun.jvm.hotspot.utilities.*;
public class AMD64Registers {
public static final int NUM_REGISTERS = 16;
public static final AMD64Register RAX;
public static final AMD64Register RCX;
public static final AMD64Register RDX;
public static final AMD64Register RBX;
public static final AMD64Register RSP;
public static final AMD64Register RBP;
public static final AMD64Register RSI;
public static final AMD64Register RDI;
public static final AMD64Register R8;
public static final AMD64Register R9;
public static final AMD64Register R10;
public static final AMD64Register R11;
public static final AMD64Register R12;
public static final AMD64Register R13;
public static final AMD64Register R14;
public static final AMD64Register R15;
private static final AMD64Register[] registers;
static {
RAX = new AMD64Register(0, "rax");
RCX = new AMD64Register(1, "rcx");
RDX = new AMD64Register(2, "rdx");
RBX = new AMD64Register(3, "rbx");
RSP = new AMD64Register(4, "rsp");
RBP = new AMD64Register(5, "rbp");
RSI = new AMD64Register(6, "rsi");
RDI = new AMD64Register(7, "rdi");
R8 = new AMD64Register(8, "r8" );
R9 = new AMD64Register(9, "r9" );
R10 = new AMD64Register(10,"r10");
R11 = new AMD64Register(11,"r11");
R12 = new AMD64Register(12,"r12");
R13 = new AMD64Register(13,"r13");
R14 = new AMD64Register(14,"r14");
R15 = new AMD64Register(15,"r15");
registers = new AMD64Register[] {
RAX, RCX, RDX, RBX, RSP, RBP, RSI, RDI,
R8, R9, R10, R11, R12, R13, R14, R15
};
}
public static int getNumberOfRegisters() {
return NUM_REGISTERS;
}
public static AMD64Register getRegister(int regNum) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
}
return registers[regNum];
}
//Return the register name
public static String getRegisterName(int regNum) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
}
return registers[regNum].toString();
}
}

View File

@ -1,320 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.ia64;
import sun.jvm.hotspot.utilities.Assert;
public class IA64FloatRegisters {
public static int getNumRegisters() {
return 128;
}
public static IA64FloatRegister getRegister(int i) {
Assert.that(i >= 0 && i < 128, "float register number is invalid");
return registers[i];
}
public static String getRegisterName(int i) {
return "%f" + i;
}
public static final IA64FloatRegister F0;
public static final IA64FloatRegister F1;
public static final IA64FloatRegister F2;
public static final IA64FloatRegister F3;
public static final IA64FloatRegister F4;
public static final IA64FloatRegister F5;
public static final IA64FloatRegister F6;
public static final IA64FloatRegister F7;
public static final IA64FloatRegister F8;
public static final IA64FloatRegister F9;
public static final IA64FloatRegister F10;
public static final IA64FloatRegister F11;
public static final IA64FloatRegister F12;
public static final IA64FloatRegister F13;
public static final IA64FloatRegister F14;
public static final IA64FloatRegister F15;
public static final IA64FloatRegister F16;
public static final IA64FloatRegister F17;
public static final IA64FloatRegister F18;
public static final IA64FloatRegister F19;
public static final IA64FloatRegister F20;
public static final IA64FloatRegister F21;
public static final IA64FloatRegister F22;
public static final IA64FloatRegister F23;
public static final IA64FloatRegister F24;
public static final IA64FloatRegister F25;
public static final IA64FloatRegister F26;
public static final IA64FloatRegister F27;
public static final IA64FloatRegister F28;
public static final IA64FloatRegister F29;
public static final IA64FloatRegister F30;
public static final IA64FloatRegister F31;
public static final IA64FloatRegister F32;
public static final IA64FloatRegister F33;
public static final IA64FloatRegister F34;
public static final IA64FloatRegister F35;
public static final IA64FloatRegister F36;
public static final IA64FloatRegister F37;
public static final IA64FloatRegister F38;
public static final IA64FloatRegister F39;
public static final IA64FloatRegister F40;
public static final IA64FloatRegister F41;
public static final IA64FloatRegister F42;
public static final IA64FloatRegister F43;
public static final IA64FloatRegister F44;
public static final IA64FloatRegister F45;
public static final IA64FloatRegister F46;
public static final IA64FloatRegister F47;
public static final IA64FloatRegister F48;
public static final IA64FloatRegister F49;
public static final IA64FloatRegister F50;
public static final IA64FloatRegister F51;
public static final IA64FloatRegister F52;
public static final IA64FloatRegister F53;
public static final IA64FloatRegister F54;
public static final IA64FloatRegister F55;
public static final IA64FloatRegister F56;
public static final IA64FloatRegister F57;
public static final IA64FloatRegister F58;
public static final IA64FloatRegister F59;
public static final IA64FloatRegister F60;
public static final IA64FloatRegister F61;
public static final IA64FloatRegister F62;
public static final IA64FloatRegister F63;
public static final IA64FloatRegister F64;
public static final IA64FloatRegister F65;
public static final IA64FloatRegister F66;
public static final IA64FloatRegister F67;
public static final IA64FloatRegister F68;
public static final IA64FloatRegister F69;
public static final IA64FloatRegister F70;
public static final IA64FloatRegister F71;
public static final IA64FloatRegister F72;
public static final IA64FloatRegister F73;
public static final IA64FloatRegister F74;
public static final IA64FloatRegister F75;
public static final IA64FloatRegister F76;
public static final IA64FloatRegister F77;
public static final IA64FloatRegister F78;
public static final IA64FloatRegister F79;
public static final IA64FloatRegister F80;
public static final IA64FloatRegister F81;
public static final IA64FloatRegister F82;
public static final IA64FloatRegister F83;
public static final IA64FloatRegister F84;
public static final IA64FloatRegister F85;
public static final IA64FloatRegister F86;
public static final IA64FloatRegister F87;
public static final IA64FloatRegister F88;
public static final IA64FloatRegister F89;
public static final IA64FloatRegister F90;
public static final IA64FloatRegister F91;
public static final IA64FloatRegister F92;
public static final IA64FloatRegister F93;
public static final IA64FloatRegister F94;
public static final IA64FloatRegister F95;
public static final IA64FloatRegister F96;
public static final IA64FloatRegister F97;
public static final IA64FloatRegister F98;
public static final IA64FloatRegister F99;
public static final IA64FloatRegister F100;
public static final IA64FloatRegister F101;
public static final IA64FloatRegister F102;
public static final IA64FloatRegister F103;
public static final IA64FloatRegister F104;
public static final IA64FloatRegister F105;
public static final IA64FloatRegister F106;
public static final IA64FloatRegister F107;
public static final IA64FloatRegister F108;
public static final IA64FloatRegister F109;
public static final IA64FloatRegister F110;
public static final IA64FloatRegister F111;
public static final IA64FloatRegister F112;
public static final IA64FloatRegister F113;
public static final IA64FloatRegister F114;
public static final IA64FloatRegister F115;
public static final IA64FloatRegister F116;
public static final IA64FloatRegister F117;
public static final IA64FloatRegister F118;
public static final IA64FloatRegister F119;
public static final IA64FloatRegister F120;
public static final IA64FloatRegister F121;
public static final IA64FloatRegister F122;
public static final IA64FloatRegister F123;
public static final IA64FloatRegister F124;
public static final IA64FloatRegister F125;
public static final IA64FloatRegister F126;
public static final IA64FloatRegister F127;
public static final int NUM_REGISTERS = 128;
private static final IA64FloatRegister registers[];
static {
F0 = new IA64FloatRegister(0);
F1 = new IA64FloatRegister(1);
F2 = new IA64FloatRegister(2);
F3 = new IA64FloatRegister(3);
F4 = new IA64FloatRegister(4);
F5 = new IA64FloatRegister(5);
F6 = new IA64FloatRegister(6);
F7 = new IA64FloatRegister(7);
F8 = new IA64FloatRegister(8);
F9 = new IA64FloatRegister(9);
F10 = new IA64FloatRegister(10);
F11 = new IA64FloatRegister(11);
F12 = new IA64FloatRegister(12);
F13 = new IA64FloatRegister(13);
F14 = new IA64FloatRegister(14);
F15 = new IA64FloatRegister(15);
F16 = new IA64FloatRegister(16);
F17 = new IA64FloatRegister(17);
F18 = new IA64FloatRegister(18);
F19 = new IA64FloatRegister(19);
F20 = new IA64FloatRegister(20);
F21 = new IA64FloatRegister(21);
F22 = new IA64FloatRegister(22);
F23 = new IA64FloatRegister(23);
F24 = new IA64FloatRegister(24);
F25 = new IA64FloatRegister(25);
F26 = new IA64FloatRegister(26);
F27 = new IA64FloatRegister(27);
F28 = new IA64FloatRegister(28);
F29 = new IA64FloatRegister(29);
F30 = new IA64FloatRegister(30);
F31 = new IA64FloatRegister(31);
F32 = new IA64FloatRegister(32);
F33 = new IA64FloatRegister(33);
F34 = new IA64FloatRegister(34);
F35 = new IA64FloatRegister(35);
F36 = new IA64FloatRegister(36);
F37 = new IA64FloatRegister(37);
F38 = new IA64FloatRegister(38);
F39 = new IA64FloatRegister(39);
F40 = new IA64FloatRegister(40);
F41 = new IA64FloatRegister(41);
F42 = new IA64FloatRegister(42);
F43 = new IA64FloatRegister(43);
F44 = new IA64FloatRegister(44);
F45 = new IA64FloatRegister(45);
F46 = new IA64FloatRegister(46);
F47 = new IA64FloatRegister(47);
F48 = new IA64FloatRegister(48);
F49 = new IA64FloatRegister(49);
F50 = new IA64FloatRegister(50);
F51 = new IA64FloatRegister(51);
F52 = new IA64FloatRegister(52);
F53 = new IA64FloatRegister(53);
F54 = new IA64FloatRegister(54);
F55 = new IA64FloatRegister(55);
F56 = new IA64FloatRegister(56);
F57 = new IA64FloatRegister(57);
F58 = new IA64FloatRegister(58);
F59 = new IA64FloatRegister(59);
F60 = new IA64FloatRegister(60);
F61 = new IA64FloatRegister(61);
F62 = new IA64FloatRegister(62);
F63 = new IA64FloatRegister(63);
F64 = new IA64FloatRegister(64);
F65 = new IA64FloatRegister(65);
F66 = new IA64FloatRegister(66);
F67 = new IA64FloatRegister(67);
F68 = new IA64FloatRegister(68);
F69 = new IA64FloatRegister(69);
F70 = new IA64FloatRegister(70);
F71 = new IA64FloatRegister(71);
F72 = new IA64FloatRegister(72);
F73 = new IA64FloatRegister(73);
F74 = new IA64FloatRegister(74);
F75 = new IA64FloatRegister(75);
F76 = new IA64FloatRegister(76);
F77 = new IA64FloatRegister(77);
F78 = new IA64FloatRegister(78);
F79 = new IA64FloatRegister(79);
F80 = new IA64FloatRegister(80);
F81 = new IA64FloatRegister(81);
F82 = new IA64FloatRegister(82);
F83 = new IA64FloatRegister(83);
F84 = new IA64FloatRegister(84);
F85 = new IA64FloatRegister(85);
F86 = new IA64FloatRegister(86);
F87 = new IA64FloatRegister(87);
F88 = new IA64FloatRegister(88);
F89 = new IA64FloatRegister(89);
F90 = new IA64FloatRegister(90);
F91 = new IA64FloatRegister(91);
F92 = new IA64FloatRegister(92);
F93 = new IA64FloatRegister(93);
F94 = new IA64FloatRegister(94);
F95 = new IA64FloatRegister(95);
F96 = new IA64FloatRegister(96);
F97 = new IA64FloatRegister(97);
F98 = new IA64FloatRegister(98);
F99 = new IA64FloatRegister(99);
F100 = new IA64FloatRegister(100);
F101 = new IA64FloatRegister(101);
F102 = new IA64FloatRegister(102);
F103 = new IA64FloatRegister(103);
F104 = new IA64FloatRegister(104);
F105 = new IA64FloatRegister(105);
F106 = new IA64FloatRegister(106);
F107 = new IA64FloatRegister(107);
F108 = new IA64FloatRegister(108);
F109 = new IA64FloatRegister(109);
F110 = new IA64FloatRegister(110);
F111 = new IA64FloatRegister(111);
F112 = new IA64FloatRegister(112);
F113 = new IA64FloatRegister(113);
F114 = new IA64FloatRegister(114);
F115 = new IA64FloatRegister(115);
F116 = new IA64FloatRegister(116);
F117 = new IA64FloatRegister(117);
F118 = new IA64FloatRegister(118);
F119 = new IA64FloatRegister(119);
F120 = new IA64FloatRegister(120);
F121 = new IA64FloatRegister(121);
F122 = new IA64FloatRegister(122);
F123 = new IA64FloatRegister(123);
F124 = new IA64FloatRegister(124);
F125 = new IA64FloatRegister(125);
F126 = new IA64FloatRegister(126);
F127 = new IA64FloatRegister(127);
registers = (new IA64FloatRegister[] {
F0, F1, F2, F3, F4, F5, F6, F7, F8, F9,
F10, F11, F12, F13, F14, F15, F16, F17, F18, F19,
F20, F21, F22, F23, F24, F25, F26, F27, F28, F29,
F30, F31, F32, F33, F34, F35, F36, F37, F38, F39,
F40, F41, F42, F43, F44, F45, F46, F47, F48, F49,
F50, F51, F52, F53, F54, F55, F56, F57, F58, F59,
F60, F61, F62, F63, F64, F65, F66, F67, F68, F69,
F70, F71, F72, F73, F74, F75, F76, F77, F78, F79,
F80, F81, F82, F83, F84, F85, F86, F87, F88, F89,
F90, F91, F92, F93, F94, F95, F96, F97, F98, F99,
F100, F101, F102, F103, F104, F105, F106, F107, F108, F109,
F110, F111, F112, F113, F114, F115, F116, F117, F118, F119,
F120, F121, F122, F123, F124, F125, F126, F127
});
}
}

View File

@ -1,54 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.ia64;
import sun.jvm.hotspot.asm.*;
public class IA64Helper implements CPUHelper {
public Disassembler createDisassembler(long startPc, byte[] code) {
// FIXME: IA64 disassembler not implemented
return null;
}
public Register getIntegerRegister(int num) {
// FIXME: IA64 disassembler not implemented
return null;
}
public Register getFloatRegister(int num) {
// FIXME: IA64 disassembler not implemented
return null;
}
public Register getStackPointer() {
// FIXME: IA64 disassembler not implemented
return null;
}
public Register getFramePointer() {
// FIXME: IA64 disassembler not implemented
return null;
}
}

View File

@ -1,76 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.ia64;
import sun.jvm.hotspot.asm.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.utilities.*;
public class IA64Register extends Register {
//
private static final int STACKED_BASE = 32;
private static final int STACKED_END = 127;
// We put application registers here too rather than separate types
private static final int APPL_BASE = 128;
private static final int nofRegisters = 129; // total number of registers
/** Constructor for an explicitly numbered register */
public IA64Register(int number) {
super(number);
}
public int getNumberOfRegisters() {
return nofRegisters;
}
public boolean isStacked() {
return (32 <= getNumber());
}
/** NOTE: this returns an offset in BYTES in this system! */
public long spOffsetInSavedWindow() {
return 0;
}
public String toString() {
return IA64Registers.getRegisterName(number);
}
public boolean isFramePointer() {
return number == APPL_BASE;
}
public boolean isStackPointer() {
return number == 12;
}
public boolean isFloat() {
return false;
}
}

View File

@ -1,353 +0,0 @@
/*
* Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.ia64;
import sun.jvm.hotspot.utilities.*;
public class IA64Registers {
public static final IA64Register GR0;
public static final IA64Register GR1;
public static final IA64Register GR2;
public static final IA64Register GR3;
public static final IA64Register GR4;
public static final IA64Register GR5;
public static final IA64Register GR6;
public static final IA64Register GR7;
public static final IA64Register GR8;
public static final IA64Register GR9;
public static final IA64Register GR10;
public static final IA64Register GR11;
public static final IA64Register GR12;
public static final IA64Register GR13;
public static final IA64Register GR14;
public static final IA64Register GR15;
public static final IA64Register GR16;
public static final IA64Register GR17;
public static final IA64Register GR18;
public static final IA64Register GR19;
public static final IA64Register GR20;
public static final IA64Register GR21;
public static final IA64Register GR22;
public static final IA64Register GR23;
public static final IA64Register GR24;
public static final IA64Register GR25;
public static final IA64Register GR26;
public static final IA64Register GR27;
public static final IA64Register GR28;
public static final IA64Register GR29;
public static final IA64Register GR30;
public static final IA64Register GR31;
public static final IA64Register GR32;
public static final IA64Register GR33;
public static final IA64Register GR34;
public static final IA64Register GR35;
public static final IA64Register GR36;
public static final IA64Register GR37;
public static final IA64Register GR38;
public static final IA64Register GR39;
public static final IA64Register GR40;
public static final IA64Register GR41;
public static final IA64Register GR42;
public static final IA64Register GR43;
public static final IA64Register GR44;
public static final IA64Register GR45;
public static final IA64Register GR46;
public static final IA64Register GR47;
public static final IA64Register GR48;
public static final IA64Register GR49;
public static final IA64Register GR50;
public static final IA64Register GR51;
public static final IA64Register GR52;
public static final IA64Register GR53;
public static final IA64Register GR54;
public static final IA64Register GR55;
public static final IA64Register GR56;
public static final IA64Register GR57;
public static final IA64Register GR58;
public static final IA64Register GR59;
public static final IA64Register GR60;
public static final IA64Register GR61;
public static final IA64Register GR62;
public static final IA64Register GR63;
public static final IA64Register GR64;
public static final IA64Register GR65;
public static final IA64Register GR66;
public static final IA64Register GR67;
public static final IA64Register GR68;
public static final IA64Register GR69;
public static final IA64Register GR70;
public static final IA64Register GR71;
public static final IA64Register GR72;
public static final IA64Register GR73;
public static final IA64Register GR74;
public static final IA64Register GR75;
public static final IA64Register GR76;
public static final IA64Register GR77;
public static final IA64Register GR78;
public static final IA64Register GR79;
public static final IA64Register GR80;
public static final IA64Register GR81;
public static final IA64Register GR82;
public static final IA64Register GR83;
public static final IA64Register GR84;
public static final IA64Register GR85;
public static final IA64Register GR86;
public static final IA64Register GR87;
public static final IA64Register GR88;
public static final IA64Register GR89;
public static final IA64Register GR90;
public static final IA64Register GR91;
public static final IA64Register GR92;
public static final IA64Register GR93;
public static final IA64Register GR94;
public static final IA64Register GR95;
public static final IA64Register GR96;
public static final IA64Register GR97;
public static final IA64Register GR98;
public static final IA64Register GR99;
public static final IA64Register GR100;
public static final IA64Register GR101;
public static final IA64Register GR102;
public static final IA64Register GR103;
public static final IA64Register GR104;
public static final IA64Register GR105;
public static final IA64Register GR106;
public static final IA64Register GR107;
public static final IA64Register GR108;
public static final IA64Register GR109;
public static final IA64Register GR110;
public static final IA64Register GR111;
public static final IA64Register GR112;
public static final IA64Register GR113;
public static final IA64Register GR114;
public static final IA64Register GR115;
public static final IA64Register GR116;
public static final IA64Register GR117;
public static final IA64Register GR118;
public static final IA64Register GR119;
public static final IA64Register GR120;
public static final IA64Register GR121;
public static final IA64Register GR122;
public static final IA64Register GR123;
public static final IA64Register GR124;
public static final IA64Register GR125;
public static final IA64Register GR126;
public static final IA64Register GR127;
public static final IA64Register AR_BSP;
public static final int NUM_REGISTERS = 129;
private static final IA64Register registers[];
static {
GR0 = new IA64Register(0);
GR1 = new IA64Register(1);
GR2 = new IA64Register(2);
GR3 = new IA64Register(3);
GR4 = new IA64Register(4);
GR5 = new IA64Register(5);
GR6 = new IA64Register(6);
GR7 = new IA64Register(7);
GR8 = new IA64Register(8);
GR9 = new IA64Register(9);
GR10 = new IA64Register(10);
GR11 = new IA64Register(11);
GR12 = new IA64Register(12);
GR13 = new IA64Register(13);
GR14 = new IA64Register(14);
GR15 = new IA64Register(15);
GR16 = new IA64Register(16);
GR17 = new IA64Register(17);
GR18 = new IA64Register(18);
GR19 = new IA64Register(19);
GR20 = new IA64Register(20);
GR21 = new IA64Register(21);
GR22 = new IA64Register(22);
GR23 = new IA64Register(23);
GR24 = new IA64Register(24);
GR25 = new IA64Register(25);
GR26 = new IA64Register(26);
GR27 = new IA64Register(27);
GR28 = new IA64Register(28);
GR29 = new IA64Register(29);
GR30 = new IA64Register(30);
GR31 = new IA64Register(31);
GR32 = new IA64Register(32);
GR33 = new IA64Register(33);
GR34 = new IA64Register(34);
GR35 = new IA64Register(35);
GR36 = new IA64Register(36);
GR37 = new IA64Register(37);
GR38 = new IA64Register(38);
GR39 = new IA64Register(39);
GR40 = new IA64Register(40);
GR41 = new IA64Register(41);
GR42 = new IA64Register(42);
GR43 = new IA64Register(43);
GR44 = new IA64Register(44);
GR45 = new IA64Register(45);
GR46 = new IA64Register(46);
GR47 = new IA64Register(47);
GR48 = new IA64Register(48);
GR49 = new IA64Register(49);
GR50 = new IA64Register(50);
GR51 = new IA64Register(51);
GR52 = new IA64Register(52);
GR53 = new IA64Register(53);
GR54 = new IA64Register(54);
GR55 = new IA64Register(55);
GR56 = new IA64Register(56);
GR57 = new IA64Register(57);
GR58 = new IA64Register(58);
GR59 = new IA64Register(59);
GR60 = new IA64Register(60);
GR61 = new IA64Register(61);
GR62 = new IA64Register(62);
GR63 = new IA64Register(63);
GR64 = new IA64Register(64);
GR65 = new IA64Register(65);
GR66 = new IA64Register(66);
GR67 = new IA64Register(67);
GR68 = new IA64Register(68);
GR69 = new IA64Register(69);
GR70 = new IA64Register(70);
GR71 = new IA64Register(71);
GR72 = new IA64Register(72);
GR73 = new IA64Register(73);
GR74 = new IA64Register(74);
GR75 = new IA64Register(75);
GR76 = new IA64Register(76);
GR77 = new IA64Register(77);
GR78 = new IA64Register(78);
GR79 = new IA64Register(79);
GR80 = new IA64Register(80);
GR81 = new IA64Register(81);
GR82 = new IA64Register(82);
GR83 = new IA64Register(83);
GR84 = new IA64Register(84);
GR85 = new IA64Register(85);
GR86 = new IA64Register(86);
GR87 = new IA64Register(87);
GR88 = new IA64Register(88);
GR89 = new IA64Register(89);
GR90 = new IA64Register(90);
GR91 = new IA64Register(91);
GR92 = new IA64Register(92);
GR93 = new IA64Register(93);
GR94 = new IA64Register(94);
GR95 = new IA64Register(95);
GR96 = new IA64Register(96);
GR97 = new IA64Register(97);
GR98 = new IA64Register(98);
GR99 = new IA64Register(99);
GR100 = new IA64Register(100);
GR101 = new IA64Register(101);
GR102 = new IA64Register(102);
GR103 = new IA64Register(103);
GR104 = new IA64Register(104);
GR105 = new IA64Register(105);
GR106 = new IA64Register(106);
GR107 = new IA64Register(107);
GR108 = new IA64Register(108);
GR109 = new IA64Register(109);
GR110 = new IA64Register(110);
GR111 = new IA64Register(111);
GR112 = new IA64Register(112);
GR113 = new IA64Register(113);
GR114 = new IA64Register(114);
GR115 = new IA64Register(115);
GR116 = new IA64Register(116);
GR117 = new IA64Register(117);
GR118 = new IA64Register(118);
GR119 = new IA64Register(119);
GR120 = new IA64Register(120);
GR121 = new IA64Register(121);
GR122 = new IA64Register(122);
GR123 = new IA64Register(123);
GR124 = new IA64Register(124);
GR125 = new IA64Register(125);
GR126 = new IA64Register(126);
GR127 = new IA64Register(127);
AR_BSP = new IA64Register(128);
registers = (new IA64Register[] {
GR0, GR1, GR2, GR3, GR4, GR5, GR6, GR7, GR8, GR9,
GR10, GR11, GR12, GR13, GR14, GR15, GR16, GR17, GR18, GR19,
GR20, GR21, GR22, GR23, GR24, GR25, GR26, GR27, GR28, GR29,
GR30, GR31, GR32, GR33, GR34, GR35, GR36, GR37, GR38, GR39,
GR40, GR41, GR42, GR43, GR44, GR45, GR46, GR47, GR48, GR49,
GR50, GR51, GR52, GR53, GR54, GR55, GR56, GR57, GR58, GR59,
GR60, GR61, GR62, GR63, GR64, GR65, GR66, GR67, GR68, GR69,
GR70, GR71, GR72, GR73, GR74, GR75, GR76, GR77, GR78, GR79,
GR80, GR81, GR82, GR83, GR84, GR85, GR86, GR87, GR88, GR89,
GR90, GR91, GR92, GR93, GR94, GR95, GR96, GR97, GR98, GR99,
GR100, GR101, GR102, GR103, GR104, GR105, GR106, GR107, GR108, GR109,
GR110, GR111, GR112, GR113, GR114, GR115, GR116, GR117, GR118, GR119,
GR120, GR121, GR122, GR123, GR124, GR125, GR126, GR127, AR_BSP
});
}
public static final IA64Register FP = AR_BSP;
public static final IA64Register SP = GR12;
/** Prefer to use this instead of the constant above */
public static int getNumRegisters() {
return NUM_REGISTERS;
}
public static String getRegisterName(int regNum) {
if (regNum < 0 || regNum >= NUM_REGISTERS) {
return "[Illegal register " + regNum + "]";
}
if (Assert.ASSERTS_ENABLED) {
Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
}
if (regNum == 128 ) {
return "BSP";
}
if (regNum == 12) {
return "SP";
}
return "R" + regNum;
}
public static IA64Register getRegister(int regNum) {
if (Assert.ASSERTS_ENABLED) {
Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid register number!");
}
return registers[regNum];
}
}

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class AlternateSpaceLdstubDecoder extends LdstubDecoder {
AlternateSpaceLdstubDecoder(int op3, String name, int dataType) {
super(op3, name, dataType);
}
Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd,
SPARCInstructionFactory factory) {
setAddressSpace(instruction, addr);
return factory.newLdstubInstruction(name, addr, rd);
}
}

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class AlternateSpaceLoadDecoder extends LoadDecoder {
AlternateSpaceLoadDecoder(int op3, String name, int dataType) {
super(op3, name, dataType);
}
Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd,
SPARCInstructionFactory factory) {
setAddressSpace(instruction, addr);
return factory.newLoadInstruction(name, op3, addr, rd, dataType);
}
}

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class AlternateSpaceStoreDecoder extends StoreDecoder {
AlternateSpaceStoreDecoder(int op3, String name, int dataType) {
super(op3, name, dataType);
}
protected Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd,
SPARCInstructionFactory factory) {
setAddressSpace(instruction, addr);
return factory.newStoreInstruction(name, op3, addr, rd, dataType);
}
}

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class AlternateSpaceSwapDecoder extends SwapDecoder {
AlternateSpaceSwapDecoder(int op3, String name, int dataType) {
super(op3, name, dataType);
}
Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd,
SPARCInstructionFactory factory) {
setAddressSpace(instruction, addr);
return factory.newSwapInstruction(name, addr, rd);
}
}

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class ArithmeticDecoder extends Format3ADecoder {
ArithmeticDecoder(int op3, String name, int rtlOperation) {
super(op3, name, rtlOperation);
}
Instruction decodeFormat3AInstruction(int instruction,
SPARCRegister rs1,
ImmediateOrRegister operand2,
SPARCRegister rd,
SPARCInstructionFactory factory) {
return factory.newArithmeticInstruction(name, op3, rtlOperation, rs1, operand2, rd);
}
}

View File

@ -1,71 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
abstract class BranchDecoder extends InstructionDecoder {
// format 2 - condition code names.
// Appendix F - Opcodes and Condition Codes - Page 231 - Table F-7.
static final String integerConditionNames[] = {
"bn", "be", "ble", "bl", "bleu", "bcs", "bneg", "bvs",
"ba", "bne", "bg", "bge", "bgu", "bcc", "bpos", "bvc"
};
static final String integerAnnuledConditionNames[] = {
"bn,a", "be,a", "ble,a", "bl,a", "bleu,a", "bcs,a", "bneg,a", "bvs,a",
"ba,a", "bne,a", "bg,a", "bge,a", "bgu,a", "bcc,a", "bpos,a", "bvc,a"
};
// format 2 - condition code names.
// Appendix F - Opcodes and Condition Codes - Page 231 - Table F-7.
static final String floatConditionNames[] = {
"fbn", "fbne", "fblg", "fbul", "fbl", "fbug", "fbg", "fbu",
"fba", "fbe", "fbue", "fbge", "fbuge", "fble", "fbule", "fbo"
};
static final String floatAnnuledConditionNames[] = {
"fbn,a", "fbne,a", "fblg,a", "fbul,a", "fbl,a", "fbug,a", "fbg,a", "fbu,a",
"fba,a", "fbe,a", "fbue,a", "fbge,a", "fbuge,a", "fble,a", "fbule,a", "fbo,a"
};
static boolean getAnnuledBit(int instruction) {
return (instruction & ANNUL_MASK) != 0;
}
Instruction decode(int instruction, SPARCInstructionFactory factory) {
boolean isAnnuled = getAnnuledBit(instruction);
int conditionCode = getConditionCode(instruction);
String conditionName = getConditionName(conditionCode, isAnnuled);
int offset = extractSignedIntFromNBits(instruction, 22);
// word align the offset by right shifting 2 bits
offset <<= 2;
PCRelativeAddress addr = new PCRelativeAddress(offset);
return factory.newBranchInstruction(conditionName, addr, isAnnuled, conditionCode);
}
abstract String getConditionName(int conditionCode, boolean isAnnuled);
}

View File

@ -1,35 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class CallDecoder extends InstructionDecoder {
Instruction decode(int instruction, SPARCInstructionFactory factory) {
// sign extend, word align the offset
int offset = (instruction & DISP_30_MASK) << 2;
return factory.newCallInstruction(new PCRelativeAddress(offset));
}
}

View File

@ -1,45 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
// format 2 - condition code names.
// Appendix F - Opcodes and Condition Codes - Page 231 - Table F-7.
class CoprocessorBranchDecoder extends BranchDecoder {
private static final String coprocessorConditionNames[] = {
"cbn", "cb123", "cb12", "cb13", "cb1", "cb23", "cb2", "cb3",
"cba", "cb0", "cb03", "cb02", "cb023", "cb01", "cb013", "cb012"
};
private static final String coprocessorAnnuledConditionNames[] = {
"cbn,a", "cb123,a", "cb12,a", "cb13,a", "cb1,a", "cb23,a", "cb2,a", "cb3,a",
"cba,a", "cb0,a", "cb03,a", "cb02,a", "cb023,a", "cb01,a", "cb013,a", "cb012,a"
};
String getConditionName(int conditionCode, boolean isAnnuled) {
return isAnnuled ? coprocessorAnnuledConditionNames[conditionCode]
: coprocessorConditionNames[conditionCode];
}
}

View File

@ -1,44 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class CoprocessorDecoder extends InstructionDecoder {
private int op3;
CoprocessorDecoder(int op3) {
this.op3 = op3;
}
Instruction decode(int instruction, SPARCInstructionFactory factory) {
int rs1Num = getSourceRegister1(instruction);
int rs2Num = getSourceRegister2(instruction);
int rdNum = getDestinationRegister(instruction);
return factory.newCoprocessorInstruction(instruction, op3,
(instruction & OPC_MASK) >> OPF_START_BIT,
rs1Num, rs2Num, rdNum);
}
}

View File

@ -1,45 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
import sun.jvm.hotspot.utilities.Assert;
class FP2RegisterDecoder extends FloatDecoder {
FP2RegisterDecoder(int opf, String name, int srcType, int resultType) {
super(opf, name, srcType, resultType);
}
Instruction decodeFloatInstruction(int instruction,
SPARCRegister rs1, SPARCRegister rs2,
SPARCRegister rd,
SPARCInstructionFactory factory) {
if (Assert.ASSERTS_ENABLED)
Assert.that(rs2.isFloat() && rd.isFloat(), "rs2, rd have to be float registers");
return factory.newFP2RegisterInstruction(name, opf, (SPARCFloatRegister)rs2, (SPARCFloatRegister)rd);
}
}

View File

@ -1,50 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
import sun.jvm.hotspot.utilities.Assert;
class FPArithmeticDecoder extends FloatDecoder {
private final int rtlOperation;
FPArithmeticDecoder(int opf, String name, int rtlOperation,
int src1Type, int src2Type, int resultType) {
super(opf, name, src1Type, src2Type, resultType);
this.rtlOperation = rtlOperation;
}
Instruction decodeFloatInstruction(int instruction,
SPARCRegister rs1, SPARCRegister rs2,
SPARCRegister rd,
SPARCInstructionFactory factory) {
if (Assert.ASSERTS_ENABLED)
Assert.that(rs1.isFloat() && rs2.isFloat() && rd.isFloat(), "rs1, rs2 and rd must be floats");
return factory.newFPArithmeticInstruction(name, opf, rtlOperation,
(SPARCFloatRegister)rs1,
(SPARCFloatRegister)rs2,
(SPARCFloatRegister)rd);
}
}

View File

@ -1,45 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
import sun.jvm.hotspot.utilities.Assert;
class FPMoveDecoder extends FloatDecoder {
FPMoveDecoder(int opf, String name, int srcType, int resultType) {
super(opf, name, srcType, resultType);
}
Instruction decodeFloatInstruction(int instruction,
SPARCRegister rs1, SPARCRegister rs2,
SPARCRegister rd,
SPARCInstructionFactory factory) {
if (Assert.ASSERTS_ENABLED)
Assert.that(rs2.isFloat() && rd.isFloat(), "rs2, rd have to be float registers");
return factory.newFPMoveInstruction(name, opf, (SPARCFloatRegister)rs2, (SPARCFloatRegister)rd);
}
}

View File

@ -1,38 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
abstract class FPopDecoder extends InstructionDecoder {
abstract InstructionDecoder getOpfDecoder(int opf);
Instruction decode(int instruction, SPARCInstructionFactory factory) {
int opf = getOpf(instruction);
InstructionDecoder decoder = getOpfDecoder(opf);
return (decoder == null) ? factory.newIllegalInstruction(instruction)
: decoder.decode(instruction, factory);
}
}

View File

@ -1,32 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
class FloatBranchDecoder extends BranchDecoder {
String getConditionName(int conditionCode, boolean isAnnuled) {
return isAnnuled ? floatAnnuledConditionNames[conditionCode]
: floatConditionNames[conditionCode];
}
}

View File

@ -1,80 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
abstract class FloatDecoder extends InstructionDecoder {
final int opf;
final String name;
final int numSources; // 1 or 2;
final int src1Type; // RTLDT_FL_SINGLE, _DOUBLE, _QUAD
final int src2Type; // RTLDT_FL_SINGLE, _DOUBLE, _QUAD
final int resultType; // RTLDT_FL_SINGLE, _DOUBLE, _QUAD
FloatDecoder(int opf, String name, int src1Type, int src2Type, int resultType) {
this.opf = opf;
this.name = name;
numSources = 2;
this.src1Type = src1Type;
this.src2Type = src2Type;
this.resultType = resultType;
}
FloatDecoder(int opf, String name, int src2Type, int resultType) {
this.opf = opf;
this.name = name;
numSources = 1;
this.src1Type = RTLOP_UNKNOWN;
this.src2Type = src2Type;
this.resultType = resultType;
}
abstract Instruction decodeFloatInstruction(int instruction,
SPARCRegister rs1, SPARCRegister rs2, SPARCRegister rd,
SPARCInstructionFactory factory);
Instruction decode(int instruction, SPARCInstructionFactory factory) {
int rs1Num = getSourceRegister1(instruction);
int rs2Num = getSourceRegister2(instruction);
int rdNum = getDestinationRegister(instruction);
SPARCRegister rs1 = null;
if (numSources == 2) {
rs1 = RegisterDecoder.decode(src1Type, rs1Num);
if (rs1 == null) {
return factory.newIllegalInstruction(instruction);
}
}
SPARCRegister rd = RegisterDecoder.decode(resultType, rdNum);
SPARCRegister rs2 = RegisterDecoder.decode(src2Type, rs2Num);
if (rd == null || rs2 == null) {
return factory.newIllegalInstruction(instruction);
}
return decodeFloatInstruction(instruction, rs1, rs2, rd, factory);
}
}

View File

@ -1,53 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
abstract class Format3ADecoder extends InstructionDecoder
implements /* imports */ RTLOperations {
final int op3;
final String name;
final int rtlOperation;
Format3ADecoder(int op3, String name, int rtlOperation) {
this.op3 = op3;
this.name = name;
this.rtlOperation = rtlOperation;
}
Instruction decode(int instruction, SPARCInstructionFactory factory) {
SPARCRegister rs1 = SPARCRegisters.getRegister(getSourceRegister1(instruction));
SPARCRegister rd = SPARCRegisters.getRegister(getDestinationRegister(instruction));
ImmediateOrRegister operand2 = getOperand2(instruction);
return decodeFormat3AInstruction(instruction, rs1, operand2, rd, factory);
}
abstract Instruction decodeFormat3AInstruction(int instruction,
SPARCRegister rs1,
ImmediateOrRegister operand2,
SPARCRegister rd,
SPARCInstructionFactory factory);
}

View File

@ -1,80 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
// basic instruction decoder class
abstract class InstructionDecoder implements /* imports */ SPARCOpcodes , RTLDataTypes, RTLOperations {
// some general utility functions - for format 2, 3 & 3A instructions
static int extractSignedIntFromNBits(int value, int num_bits) {
return (value << (32 - num_bits)) >> (32 - num_bits);
}
// "rs1"
static int getSourceRegister1(int instruction) {
return (instruction & RS1_MASK) >>> RS1_START_BIT;
}
// "rs2"
static int getSourceRegister2(int instruction) {
return (instruction & RS2_MASK);
}
// "rd"
static int getDestinationRegister(int instruction) {
return (instruction & RD_MASK) >>> RD_START_BIT;
}
static int getConditionCode(int instruction) {
return (instruction & CONDITION_CODE_MASK) >>> CONDITION_CODE_START_BIT;
}
// "i" bit - used to indicate whether second component in an indirect
// address is immediate value or a register. (format 3 & 3A).
static boolean isIBitSet(int instruction) {
return (instruction & I_MASK) != 0;
}
static ImmediateOrRegister getOperand2(int instruction) {
boolean iBit = isIBitSet(instruction);
ImmediateOrRegister operand2 = null;
if (iBit) {
operand2 = new Immediate(new Short((short)extractSignedIntFromNBits(instruction, 13)));
} else {
operand2 = SPARCRegisters.getRegister(getSourceRegister2(instruction));
}
return operand2;
}
// "opf" - floating point operation code.
static int getOpf(int instruction) {
return (instruction & OPF_MASK) >>> OPF_START_BIT;
}
abstract Instruction decode(int instruction, SPARCInstructionFactory factory);
}

View File

@ -1,55 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class JmplDecoder extends MemoryInstructionDecoder {
JmplDecoder() {
super(JMPL, "jmpl", RTLDT_UNSIGNED_WORD);
}
Instruction decodeMemoryInstruction(int instruction, SPARCRegisterIndirectAddress addr,
SPARCRegister rd, SPARCInstructionFactory factory) {
// this may be most probably indirect call or ret or retl
Instruction instr = null;
if (rd == SPARCRegisters.O7) {
instr = factory.newIndirectCallInstruction(addr, rd);
} else if (rd == SPARCRegisters.G0) {
int disp = (int) addr.getDisplacement();
Register base = addr.getBase();
if (base == SPARCRegisters.I7 && disp == 8) {
instr = factory.newReturnInstruction(addr, rd, false /* not leaf */);
} else if (base == SPARCRegisters.O7 && disp == 8) {
instr = factory.newReturnInstruction(addr, rd, true /* leaf */);
} else {
instr = factory.newJmplInstruction(addr, rd);
}
} else {
instr = factory.newJmplInstruction(addr, rd);
}
return instr;
}
}

View File

@ -1,40 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class LdstubDecoder extends MemoryInstructionDecoder {
LdstubDecoder(int op3, String name, int dataType) {
super(op3, name, dataType);
}
Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd,
SPARCInstructionFactory factory) {
return factory.newLdstubInstruction(name, addr, rd);
}
}

View File

@ -1,40 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class LoadDecoder extends MemoryInstructionDecoder {
LoadDecoder(int op3, String name, int dataType) {
super(op3, name, dataType);
}
Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd,
SPARCInstructionFactory factory) {
return factory.newLoadInstruction(name, op3, addr, rd, dataType);
}
}

View File

@ -1,47 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class LogicDecoder extends Format3ADecoder {
LogicDecoder(int op3, String name, int rtlOperation) {
super(op3, name, rtlOperation);
}
Instruction decodeFormat3AInstruction(int instruction,
SPARCRegister rs1,
ImmediateOrRegister operand2,
SPARCRegister rd,
SPARCInstructionFactory factory) {
Instruction instr = null;
if (op3 == OR && rs1 == SPARCRegisters.G0 && rd != SPARCRegisters.G0) {
instr = factory.newMoveInstruction(name, op3, operand2, rd);
} else {
instr = factory.newLogicInstruction(name, op3, rtlOperation, rs1, operand2, rd);
}
return instr;
}
}

View File

@ -1,86 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
abstract class MemoryInstructionDecoder extends InstructionDecoder {
final int op3;
final String name;
final int dataType;
SPARCRegisterIndirectAddress newRegisterIndirectAddress(SPARCRegister rs1, SPARCRegister rs2) {
return new SPARCRegisterIndirectAddress(rs1, rs2);
}
SPARCRegisterIndirectAddress newRegisterIndirectAddress(SPARCRegister rs1, int offset) {
return new SPARCRegisterIndirectAddress(rs1, offset);
}
static void setAddressSpace(int instruction, SPARCRegisterIndirectAddress addr) {
int asi = (instruction & ASI_MASK) >>> ASI_START_BIT;
addr.setAddressSpace(asi);
}
SPARCRegisterIndirectAddress getRegisterIndirectAddress(int instruction) {
SPARCRegister rs1 = SPARCRegisters.getRegister(getSourceRegister1(instruction));
boolean iBit = isIBitSet(instruction);
SPARCRegisterIndirectAddress addr = null;
if (iBit) {
int simm13 = extractSignedIntFromNBits(instruction, 13);
addr = newRegisterIndirectAddress(rs1,simm13);
} else {
SPARCRegister rs2 = SPARCRegisters.getRegister(getSourceRegister2(instruction));
addr = newRegisterIndirectAddress(rs1,rs2);
}
return addr;
}
MemoryInstructionDecoder(int op3, String name, int dataType) {
this.op3 = op3;
this.name = name;
this.dataType = dataType;
}
Instruction decode(int instruction, SPARCInstructionFactory factory) {
SPARCRegisterIndirectAddress addr = getRegisterIndirectAddress(instruction);
SPARCRegister rd = getDestination(instruction);
boolean isV9Okay = (factory instanceof SPARCV9InstructionFactory);
if ( (rd == null) || (! isV9Okay && rd.isV9Only()) )
return factory.newIllegalInstruction(instruction);
return decodeMemoryInstruction(instruction, addr, rd, factory);
}
SPARCRegister getDestination(int instruction) {
int rdNum = getDestinationRegister(instruction);
SPARCRegister rd = RegisterDecoder.decode(dataType, rdNum);
return rd;
}
abstract Instruction decodeMemoryInstruction(int instruction,
SPARCRegisterIndirectAddress addr,
SPARCRegister rd, SPARCInstructionFactory factory);
}

View File

@ -1,48 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class ReadDecoder extends ReadWriteDecoder {
ReadDecoder(int specialRegNum) {
super(specialRegNum);
}
Instruction decodeReadWrite(int instruction, SPARCInstructionFactory factory,
int rs1Num, int rdNum) {
Instruction instr = null;
int specialReg = specialRegNum;
if (rs1Num == 0)
specialReg = SPARCSpecialRegisters.Y;
if (rs1Num == 15 && rdNum == 0) {
instr = factory.newStbarInstruction();
} else {
instr = factory.newReadInstruction(specialReg, rs1Num,
SPARCRegisters.getRegister(rdNum));
}
return instr;
}
}

View File

@ -1,46 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
abstract class ReadWriteDecoder extends InstructionDecoder {
final int specialRegNum;
abstract Instruction decodeReadWrite(int instruction,
SPARCInstructionFactory factory,
int rs1Num, int rdNum);
ReadWriteDecoder(int specialRegNum) {
this.specialRegNum = specialRegNum;
}
Instruction decode(int instruction, SPARCInstructionFactory factory) {
Instruction instr = null;
int rs1Num = getSourceRegister1(instruction);
int rdNum = getDestinationRegister(instruction);
return decodeReadWrite(instruction, factory, rs1Num, rdNum);
}
}

View File

@ -1,85 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.RTLDataTypes;
class RegisterDecoder implements /* imports */ RTLDataTypes {
// refer to page 40 - section 5.1.4.1 - Floating-point Register Number Encoding
private static SPARCFloatRegister decodeDouble(int num) {
// 6 bit double precision registers are encoded in 5 bits as
// b<4> b<3> b<2> b<1> b<5>.
boolean lsb = (0x1 & num) != 0;
if (lsb)
num |= 0x20; // 10000b
if ((num % 2) != 0)
return null;
return SPARCFloatRegisters.getRegister(num);
}
private static SPARCFloatRegister decodeQuad(int num) {
// 6 bit quad precision registers are encoded in 5 bits as
// b<4> b<3> b<2> 0 b<5>
boolean lsb = (0x1 & num) != 0;
if (lsb)
num |= 0x20; // 10000b
if ((num % 4) != 0)
return null;
return SPARCFloatRegisters.getRegister(num);
}
static SPARCRegister decode(int dataType, int regNum) {
regNum &= 0x1F; // mask out all but lsb 5 bits
SPARCRegister result = null;
switch (dataType) {
case RTLDT_FL_SINGLE:
result = SPARCFloatRegisters.getRegister(regNum);
break;
case RTLDT_FL_DOUBLE:
result = decodeDouble(regNum);
break;
case RTLDT_FL_QUAD:
result = decodeQuad(regNum);
break;
case RTLDT_UNKNOWN:
result = null;
break;
default: // some integer register
result = SPARCRegisters.getRegister(regNum);
break;
}
return result;
}
}

View File

@ -1,41 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class RestoreDecoder extends Format3ADecoder {
RestoreDecoder() {
super(RESTORE, "restore", RTLOP_UNKNOWN);
}
Instruction decodeFormat3AInstruction(int instruction,
SPARCRegister rs1,
ImmediateOrRegister operand2,
SPARCRegister rd,
SPARCInstructionFactory factory) {
return factory.newRestoreInstruction(rs1, operand2, rd);
}
}

View File

@ -1,38 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
class RettDecoder extends MemoryInstructionDecoder {
RettDecoder() {
super(RETT, "rett", RTLDT_UNKNOWN);
}
Instruction decodeMemoryInstruction(int instruction, SPARCRegisterIndirectAddress addr,
SPARCRegister rd, SPARCInstructionFactory factory) {
return factory.newRettInstruction(addr);
}
}

View File

@ -1,103 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCArithmeticInstruction extends SPARCFormat3AInstruction
implements ArithmeticInstruction {
final private int operation;
public SPARCArithmeticInstruction(String name, int opcode, int operation, SPARCRegister rs1,
ImmediateOrRegister operand2, SPARCRegister rd) {
super(name, opcode, rs1, operand2, rd);
this.operation = operation;
}
protected String getDescription() {
if (rd == rs1 && operand2.isImmediate()) {
int value = ((Immediate)operand2).getNumber().intValue();
StringBuffer buf = new StringBuffer();
switch (opcode) {
case ADD:
buf.append("inc");
break;
case ADDcc:
buf.append("inccc");
break;
case SUB:
buf.append("dec");
break;
case SUBcc:
buf.append("deccc");
break;
default:
return super.getDescription();
}
buf.append(spaces);
if (value != 1) {
buf.append(getOperand2String()); buf.append(comma);
}
buf.append(rd.toString());
return buf.toString();
} else if (rd == SPARCRegisters.G0 && opcode == SUBcc) {
StringBuffer buf = new StringBuffer();
buf.append("cmp");
buf.append(spaces);
buf.append(rs1.toString());
buf.append(comma);
buf.append(getOperand2String());
return buf.toString();
} else if (rs1 == SPARCRegisters.G0 && opcode == SUB && operand2.isRegister()) {
StringBuffer buf = new StringBuffer();
buf.append("neg");
buf.append(spaces);
buf.append(operand2.toString());
if (operand2 != rd) {
buf.append(comma);
buf.append(rd.toString());
}
return buf.toString();
}
return super.getDescription();
}
public Operand getArithmeticDestination() {
return getDestinationRegister();
}
public Operand[] getArithmeticSources() {
return (new Operand[] { rs1, operand2 });
}
public int getOperation() {
return operation;
}
public boolean isArithmetic() {
return true;
}
}

View File

@ -1,81 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public abstract class SPARCAtomicLoadStoreInstruction extends SPARCInstruction
implements LoadInstruction, StoreInstruction {
final protected SPARCRegisterIndirectAddress addr;
final protected SPARCRegister rd;
final protected Register[] regs = new Register[1];
final protected String description;
public SPARCAtomicLoadStoreInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
super(name);
this.addr = addr;
this.rd = rd;
regs[0] = rd;
description = initDescription();
}
private String initDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(addr.toString());
buf.append(comma);
buf.append(rd.toString());
return buf.toString();
}
public Address getLoadSource() {
return addr;
}
public Address getStoreDestination() {
return addr;
}
public Register[] getLoadDestinations() {
return regs;
}
public Register[] getStoreSources() {
return regs;
}
public boolean isLoad() {
return true;
}
public boolean isStore() {
return true;
}
public String asString(long currentPc, SymbolFinder symFinder) {
return description;
}
}

View File

@ -1,70 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCBranchInstruction extends SPARCInstruction
implements BranchInstruction {
final protected PCRelativeAddress addr;
final protected int conditionCode;
final protected boolean isAnnuled;
public SPARCBranchInstruction(String name, PCRelativeAddress addr, boolean isAnnuled, int conditionCode) {
super(name);
this.addr = addr;
this.conditionCode = conditionCode;
this.isAnnuled = isAnnuled;
}
public String asString(long currentPc, SymbolFinder symFinder) {
long address = addr.getDisplacement() + currentPc;
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(symFinder.getSymbolFor(address));
return buf.toString();
}
public Address getBranchDestination() {
return addr;
}
public int getConditionCode() {
return conditionCode;
}
public boolean isAnnuledBranch() {
return isAnnuled;
}
public boolean isBranch() {
return true;
}
public boolean isConditional() {
return conditionCode != CONDITION_BN && conditionCode != CONDITION_BA;
}
}

View File

@ -1,58 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCCallInstruction extends SPARCInstruction
implements CallInstruction {
final private PCRelativeAddress addr;
public SPARCCallInstruction(PCRelativeAddress addr) {
super("call");
this.addr = addr;
}
public String asString(long currentPc, SymbolFinder symFinder) {
long address = addr.getDisplacement() + currentPc;
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(symFinder.getSymbolFor(address));
return buf.toString();
}
public Address getBranchDestination() {
return addr;
}
public boolean isCall() {
return true;
}
public boolean isConditional() {
return false;
}
}

View File

@ -1,144 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
import java.io.*;
import java.util.*;
public abstract class SPARCDisassembler extends Disassembler
implements /* imports */ SPARCOpcodes, RTLDataTypes, RTLOperations {
// instruction cache - Map<Integer, Instruction>.
protected static Map instructionCache = new HashMap();
protected final SPARCInstructionFactory factory;
public SPARCDisassembler(long startPc, byte[] code, SPARCInstructionFactory factory) {
super(startPc, code);
this.factory = factory;
}
protected static InstructionDecoder illegalDecoder = new IllegalInstructionDecoder();
protected static InstructionDecoder callDecoder = new CallDecoder();
// direct call instruction
protected Instruction decodeFormat1Instruction(int instruction) {
return callDecoder.decode(instruction, factory);
}
protected abstract InstructionDecoder getFormat2Decoder(int op2);
protected Instruction decodeFormat2Instruction(int instruction) {
int op2 = (instruction & OP_2_MASK) >>> OP_2_START_BIT;
InstructionDecoder decoder = getFormat2Decoder(op2);
return decoder.decode(instruction, factory);
}
// "op3" - used in format 3 & 3A instructions - 6 bits width
protected static int getOp3(int instruction) {
return (instruction & OP_3_MASK) >>> OP_3_START_BIT;
}
// op3 opcodes is broken up into column and row. MSB 2 bits form column.
// LSB 4 bits form row number.
protected static int getOp3Row(int op3) {
return op3 & 0xF;
}
protected static int getOp3Column(int op3) {
return (op3 >>> 4) & 0x3;
}
protected abstract InstructionDecoder getFormat3Decoder(int row, int column);
// memory instructions
protected Instruction decodeFormat3Instruction(int instruction) {
int op3 = getOp3(instruction);
int row = getOp3Row(op3);
int column = getOp3Column(op3);
return getFormat3Decoder(row, column).decode(instruction, factory);
}
protected abstract InstructionDecoder getFormat3ADecoder(int row, int column);
// arithmetic, logic, shift and the rest
protected Instruction decodeFormat3AInstruction(int instruction) {
int op3 = getOp3(instruction);
int row = getOp3Row(op3);
int column = getOp3Column(op3);
return getFormat3ADecoder(row, column).decode(instruction, factory);
}
public void decode(InstructionVisitor visitor) {
visitor.prologue();
try {
DataInputStream dis = new DataInputStream(new ByteArrayInputStream(code));
int instruction = -1;
int format = -1;
Instruction instr = null;
int len = 0;
while (len < code.length) {
instr = null;
instruction = dis.readInt();
// check whether we have this in cache.
instr = (Instruction) instructionCache.get(new Integer(instruction));
if (instr == null) {
format = (instruction & FORMAT_MASK) >>> FORMAT_START_BIT;
switch (format) {
case FORMAT_2: // 0
instr = decodeFormat2Instruction(instruction);
break;
case FORMAT_1: // 1
instr = decodeFormat1Instruction(instruction);
break;
case FORMAT_3A: // 2
instr = decodeFormat3AInstruction(instruction);
break;
case FORMAT_3: // 3
instr = decodeFormat3Instruction(instruction);
break;
}
// add the new instruction to cache.
instructionCache.put(new Integer(instruction), instr);
}
visitor.visit(startPc + len, instr);
len += 4;
}
} catch (IOException ioExp) {
// ignore, can't happen
} finally {
visitor.epilogue();
}
}
}

View File

@ -1,59 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCFP2RegisterInstruction extends SPARCInstruction {
final SPARCFloatRegister rs;
final SPARCFloatRegister rd;
final int opf;
public SPARCFP2RegisterInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
super(name);
this.rs = rs;
this.rd = rd;
this.opf = opf;
}
public String asString(long currentPc, SymbolFinder symFinder) {
return getDescription();
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(rs.toString());
buf.append(comma);
buf.append(rd.toString());
return buf.toString();
}
public boolean isFloat() {
return true;
}
}

View File

@ -1,69 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCFPArithmeticInstruction extends SPARCFormat3AInstruction
implements ArithmeticInstruction {
final private SPARCRegister rs2;
final private int rtlOperation;
public SPARCFPArithmeticInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, SPARCRegister rs2,
SPARCRegister rd) {
super(name, opcode, rs1, rs2, rd);
this.rs2 = rs2;
this.rtlOperation = rtlOperation;
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(rs1.toString());
buf.append(comma);
buf.append(rs2.toString());
buf.append(comma);
buf.append(rd.toString());
return buf.toString();
}
public int getOperation() {
return rtlOperation;
}
public Operand[] getArithmeticSources() {
return new Operand[] { rs1, rs2 };
}
public Operand getArithmeticDestination() {
return rd;
}
public boolean isFloat() {
return true;
}
}

View File

@ -1,90 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.Register;
import sun.jvm.hotspot.utilities.Assert;
public class SPARCFloatRegister extends SPARCRegister {
public SPARCFloatRegister(int number) {
super(number);
}
public int getNumber() {
return number;
}
public static final int SINGLE_PRECISION = 1;
public static final int DOUBLE_PRECISION = 2;
public static final int QUAD_PRECISION = 3;
public int getNumber(int width) {
switch (width) {
case SINGLE_PRECISION:
Assert.that(number < 32, "bad single-prec fp register");
return number;
case DOUBLE_PRECISION:
Assert.that(number < 64 && (number & 1) == 0, "bad double-prec fp register");
return number & 0x1e | (number & 0x20) >> 5;
case QUAD_PRECISION:
Assert.that(number < 64 && (number & 3) == 0, "bad quad-prec fp register");
return number & 0x1c | (number & 0x20) >> 5;
}
throw new RuntimeException("Invalid floating point width supplied");
}
private static final int nofRegisters = 63;
public int getNumberOfRegisters() {
return nofRegisters;
}
public boolean isFloat() {
return true;
}
public boolean isFramePointer() {
return false;
}
public boolean isStackPointer() {
return false;
}
public boolean isV9Only() {
return number > 31;
}
public boolean isValid() {
return number >= 0 && number < nofRegisters;
}
public String toString() {
return SPARCFloatRegisters.getRegisterName(number);
}
}

View File

@ -1,153 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.utilities.Assert;
public class SPARCFloatRegisters {
public static int getNumRegisters() {
return 64;
}
public static SPARCFloatRegister getRegister(int i) {
Assert.that(i >= 0 && i < 64, "float register number is invalid");
return registers[i];
}
public static String getRegisterName(int i) {
return "%f" + i;
}
public static final SPARCFloatRegister F0;
public static final SPARCFloatRegister F1;
public static final SPARCFloatRegister F2;
public static final SPARCFloatRegister F3;
public static final SPARCFloatRegister F4;
public static final SPARCFloatRegister F5;
public static final SPARCFloatRegister F6;
public static final SPARCFloatRegister F7;
public static final SPARCFloatRegister F8;
public static final SPARCFloatRegister F9;
public static final SPARCFloatRegister F10;
public static final SPARCFloatRegister F11;
public static final SPARCFloatRegister F12;
public static final SPARCFloatRegister F13;
public static final SPARCFloatRegister F14;
public static final SPARCFloatRegister F15;
public static final SPARCFloatRegister F16;
public static final SPARCFloatRegister F17;
public static final SPARCFloatRegister F18;
public static final SPARCFloatRegister F19;
public static final SPARCFloatRegister F20;
public static final SPARCFloatRegister F21;
public static final SPARCFloatRegister F22;
public static final SPARCFloatRegister F23;
public static final SPARCFloatRegister F24;
public static final SPARCFloatRegister F25;
public static final SPARCFloatRegister F26;
public static final SPARCFloatRegister F27;
public static final SPARCFloatRegister F28;
public static final SPARCFloatRegister F29;
public static final SPARCFloatRegister F30;
public static final SPARCFloatRegister F31;
public static final SPARCFloatRegister F32;
public static final SPARCFloatRegister F34;
public static final SPARCFloatRegister F36;
public static final SPARCFloatRegister F38;
public static final SPARCFloatRegister F40;
public static final SPARCFloatRegister F42;
public static final SPARCFloatRegister F44;
public static final SPARCFloatRegister F46;
public static final SPARCFloatRegister F48;
public static final SPARCFloatRegister F50;
public static final SPARCFloatRegister F52;
public static final SPARCFloatRegister F54;
public static final SPARCFloatRegister F56;
public static final SPARCFloatRegister F58;
public static final SPARCFloatRegister F60;
public static final SPARCFloatRegister F62;
public static final int NUM_REGISTERS = 64;
private static final SPARCFloatRegister registers[];
static {
F0 = new SPARCFloatRegister(0);
F1 = new SPARCFloatRegister(1);
F2 = new SPARCFloatRegister(2);
F3 = new SPARCFloatRegister(3);
F4 = new SPARCFloatRegister(4);
F5 = new SPARCFloatRegister(5);
F6 = new SPARCFloatRegister(6);
F7 = new SPARCFloatRegister(7);
F8 = new SPARCFloatRegister(8);
F9 = new SPARCFloatRegister(9);
F10 = new SPARCFloatRegister(10);
F11 = new SPARCFloatRegister(11);
F12 = new SPARCFloatRegister(12);
F13 = new SPARCFloatRegister(13);
F14 = new SPARCFloatRegister(14);
F15 = new SPARCFloatRegister(15);
F16 = new SPARCFloatRegister(16);
F17 = new SPARCFloatRegister(17);
F18 = new SPARCFloatRegister(18);
F19 = new SPARCFloatRegister(19);
F20 = new SPARCFloatRegister(20);
F21 = new SPARCFloatRegister(21);
F22 = new SPARCFloatRegister(22);
F23 = new SPARCFloatRegister(23);
F24 = new SPARCFloatRegister(24);
F25 = new SPARCFloatRegister(25);
F26 = new SPARCFloatRegister(26);
F27 = new SPARCFloatRegister(27);
F28 = new SPARCFloatRegister(28);
F29 = new SPARCFloatRegister(29);
F30 = new SPARCFloatRegister(30);
F31 = new SPARCFloatRegister(31);
F32 = new SPARCFloatRegister(32);
F34 = new SPARCFloatRegister(34);
F36 = new SPARCFloatRegister(36);
F38 = new SPARCFloatRegister(38);
F40 = new SPARCFloatRegister(40);
F42 = new SPARCFloatRegister(42);
F44 = new SPARCFloatRegister(44);
F46 = new SPARCFloatRegister(46);
F48 = new SPARCFloatRegister(48);
F50 = new SPARCFloatRegister(50);
F52 = new SPARCFloatRegister(52);
F54 = new SPARCFloatRegister(54);
F56 = new SPARCFloatRegister(56);
F58 = new SPARCFloatRegister(58);
F60 = new SPARCFloatRegister(60);
F62 = new SPARCFloatRegister(62);
registers = (new SPARCFloatRegister[] {
F0, F2, F3, F4, F5, F6, F7, F8, F9, F10,
F11, F12, F13, F14, F15, F16, F17, F18, F19, F20,
F21, F22, F23, F24, F25, F26, F27, F28, F29, F30,
F31, F32, null, F34, null, F36, null, F38, null, F40,
null, F42, null, F44, null, F46, null, F48, null, F50,
null, F52, null, F54, null, F56, null, F58, null, F60,
null, F62, null
});
}
}

View File

@ -1,50 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCFlushInstruction extends SPARCInstruction {
final protected SPARCRegisterIndirectAddress addr;
final String description;
public SPARCFlushInstruction(SPARCRegisterIndirectAddress addr) {
super("flush");
this.addr = addr;
description = initDescription();
}
private String initDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(addr.toString());
return buf.toString();
}
public String asString(long currentPc, SymbolFinder symFinder) {
return description;
}
}

View File

@ -1,87 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public abstract class SPARCFormat3AInstruction extends SPARCInstruction {
final protected int opcode;
final protected SPARCRegister rs1;
final protected ImmediateOrRegister operand2;
final protected SPARCRegister rd;
public SPARCFormat3AInstruction(String name, int opcode, SPARCRegister rs1,
ImmediateOrRegister operand2, SPARCRegister rd) {
super(name);
this.opcode = opcode;
this.rs1 = rs1;
this.operand2 = operand2;
this.rd = rd;
}
protected String getOperand2String() {
StringBuffer buf = new StringBuffer();
if (operand2.isRegister()) {
buf.append(operand2.toString());
} else {
Number number = ((Immediate)operand2).getNumber();
buf.append("0x");
buf.append(Integer.toHexString(number.intValue()));
}
return buf.toString();
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(rs1.toString());
buf.append(comma);
buf.append(getOperand2String());
buf.append(comma);
buf.append(rd.toString());
return buf.toString();
}
public String asString(long currentPc, SymbolFinder symFinder) {
return getDescription();
}
public int getOpcode() {
return opcode;
}
public SPARCRegister getDestinationRegister() {
return rd;
}
public ImmediateOrRegister getOperand2() {
return operand2;
}
public SPARCRegister getSourceRegister1() {
return rs1;
}
}

View File

@ -1,49 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCHelper implements CPUHelper {
public Disassembler createDisassembler(long startPc, byte[] code) {
return new SPARCV9Disassembler(startPc, code);
}
public Register getIntegerRegister(int num) {
return SPARCRegisters.getRegister(num);
}
public Register getFloatRegister(int num) {
return SPARCFloatRegisters.getRegister(num);
}
public Register getStackPointer() {
return SPARCRegisters.O7;
}
public Register getFramePointer() {
return SPARCRegisters.I7;
}
}

View File

@ -1,45 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCIndirectCallInstruction extends SPARCJmplInstruction
implements CallInstruction {
public SPARCIndirectCallInstruction(SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
super("call", addr, rd);
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
// remove '[' & ']' from jmp address
String addrStr = addr.toString();
buf.append(addrStr.substring(1, addrStr.length() - 1));
return buf.toString();
}
}

View File

@ -1,110 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public interface SPARCInstructionFactory {
public SPARCInstruction newCallInstruction(PCRelativeAddress addr);
public SPARCInstruction newNoopInstruction();
public SPARCInstruction newSethiInstruction(int imm22, SPARCRegister rd);
public SPARCInstruction newUnimpInstruction(int const22);
public SPARCInstruction newBranchInstruction(String name, PCRelativeAddress addr, boolean isAnnuled, int conditionCode);
public SPARCInstruction newSpecialLoadInstruction(String name, int specialReg, int cregNum,
SPARCRegisterIndirectAddress addr);
public SPARCInstruction newSpecialStoreInstruction(String name, int specialReg, int cregNum,
SPARCRegisterIndirectAddress addr);
public SPARCInstruction newLoadInstruction(String name, int opcode,
SPARCRegisterIndirectAddress addr, SPARCRegister rd,
int dataType);
public SPARCInstruction newStoreInstruction(String name, int opcode,
SPARCRegisterIndirectAddress addr, SPARCRegister rd,
int dataType);
public SPARCInstruction newStbarInstruction();
public SPARCInstruction newReadInstruction(int specialReg, int asrRegNum, SPARCRegister rd);
public SPARCInstruction newWriteInstruction(int specialReg, int asrRegNum, SPARCRegister rs1,
ImmediateOrRegister operand2);
public SPARCInstruction newIllegalInstruction(int instruction);
public SPARCInstruction newIndirectCallInstruction(SPARCRegisterIndirectAddress addr,
SPARCRegister rd);
public SPARCInstruction newReturnInstruction(SPARCRegisterIndirectAddress addr,
SPARCRegister rd, boolean isLeaf);
public SPARCInstruction newJmplInstruction(SPARCRegisterIndirectAddress addr,
SPARCRegister rd);
public SPARCInstruction newFP2RegisterInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd);
public SPARCInstruction newFPMoveInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd);
public SPARCInstruction newFPArithmeticInstruction(String name, int opf, int rtlOperation,
SPARCFloatRegister rs1, SPARCFloatRegister rs2,
SPARCFloatRegister rd);
public SPARCInstruction newFlushInstruction(SPARCRegisterIndirectAddress addr);
public SPARCInstruction newSaveInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd);
public SPARCInstruction newRestoreInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd);
public SPARCInstruction newTrapInstruction(String name, int conditionCode);
public SPARCInstruction newRettInstruction(SPARCRegisterIndirectAddress addr);
public SPARCInstruction newArithmeticInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, ImmediateOrRegister operand2,
SPARCRegister rd);
public SPARCInstruction newLogicInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, ImmediateOrRegister operand2,
SPARCRegister rd);
public SPARCInstruction newMoveInstruction(String name, int opcode,
ImmediateOrRegister operand2,
SPARCRegister rd);
public SPARCInstruction newShiftInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, ImmediateOrRegister operand2,
SPARCRegister rd);
public SPARCInstruction newCoprocessorInstruction(int instruction, int cpopcode, int opc,
int rs1Num, int rs2Num, int rdNum);
public SPARCInstruction newSwapInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd);
public SPARCInstruction newLdstubInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd);
}

View File

@ -1,176 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCInstructionFactoryImpl implements SPARCInstructionFactory {
public SPARCInstruction newCallInstruction(PCRelativeAddress addr) {
return new SPARCCallInstruction(addr);
}
public SPARCInstruction newNoopInstruction() {
return new SPARCNoopInstruction();
}
public SPARCInstruction newSethiInstruction(int imm22, SPARCRegister rd) {
return new SPARCSethiInstruction(imm22, rd);
}
public SPARCInstruction newUnimpInstruction(int const22) {
return new SPARCUnimpInstruction(const22);
}
public SPARCInstruction newBranchInstruction(String name, PCRelativeAddress addr, boolean isAnnuled, int conditionCode) {
return new SPARCBranchInstruction(name, addr, isAnnuled, conditionCode);
}
public SPARCInstruction newSpecialLoadInstruction(String name, int specialReg, int cregNum,
SPARCRegisterIndirectAddress addr) {
return new SPARCSpecialLoadInstruction(name, specialReg, cregNum, addr);
}
public SPARCInstruction newSpecialStoreInstruction(String name, int specialReg, int cregNum,
SPARCRegisterIndirectAddress addr) {
return new SPARCSpecialStoreInstruction(name, specialReg, cregNum, addr);
}
public SPARCInstruction newLoadInstruction(String name, int opcode,
SPARCRegisterIndirectAddress addr, SPARCRegister rd,
int dataType) {
return new SPARCLoadInstruction(name, opcode, addr, rd, dataType);
}
public SPARCInstruction newStoreInstruction(String name, int opcode,
SPARCRegisterIndirectAddress addr, SPARCRegister rd,
int dataType) {
return new SPARCStoreInstruction(name, opcode, addr, rd, dataType);
}
public SPARCInstruction newStbarInstruction() {
return new SPARCStbarInstruction();
}
public SPARCInstruction newReadInstruction(int specialReg, int asrRegNum, SPARCRegister rd) {
return new SPARCReadInstruction(specialReg, asrRegNum, rd);
}
public SPARCInstruction newWriteInstruction(int specialReg, int asrRegNum, SPARCRegister rs1,
ImmediateOrRegister operand2) {
return new SPARCWriteInstruction(specialReg, asrRegNum, rs1,operand2);
}
public SPARCInstruction newIllegalInstruction(int instruction) {
return new SPARCIllegalInstruction(instruction);
}
public SPARCInstruction newIndirectCallInstruction(SPARCRegisterIndirectAddress addr,
SPARCRegister rd) {
return new SPARCIndirectCallInstruction(addr, rd);
}
public SPARCInstruction newReturnInstruction(SPARCRegisterIndirectAddress addr,
SPARCRegister rd, boolean isLeaf) {
return new SPARCReturnInstruction(addr, rd, isLeaf);
}
public SPARCInstruction newJmplInstruction(SPARCRegisterIndirectAddress addr,
SPARCRegister rd) {
return new SPARCJmplInstruction(addr, rd);
}
public SPARCInstruction newFPArithmeticInstruction(String name, int opf, int rtlOperation,
SPARCFloatRegister rs1, SPARCFloatRegister rs2,
SPARCFloatRegister rd) {
return new SPARCFPArithmeticInstruction(name, opf, rtlOperation, rs1, rs2, rd);
}
public SPARCInstruction newFPMoveInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
return new SPARCFPMoveInstruction(name, opf, rs, rd);
}
public SPARCInstruction newFP2RegisterInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
return new SPARCFP2RegisterInstruction(name, opf, rs, rd);
}
public SPARCInstruction newFlushInstruction(SPARCRegisterIndirectAddress addr) {
return new SPARCFlushInstruction(addr);
}
public SPARCInstruction newSaveInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
return new SPARCSaveInstruction(rs1, operand2, rd);
}
public SPARCInstruction newRestoreInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
return new SPARCRestoreInstruction(rs1, operand2, rd);
}
public SPARCInstruction newTrapInstruction(String name, int conditionCode) {
return new SPARCTrapInstruction(name, conditionCode);
}
public SPARCInstruction newRettInstruction(SPARCRegisterIndirectAddress addr) {
return new SPARCRettInstruction(addr);
}
public SPARCInstruction newArithmeticInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, ImmediateOrRegister operand2,
SPARCRegister rd) {
return new SPARCArithmeticInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
}
public SPARCInstruction newLogicInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, ImmediateOrRegister operand2,
SPARCRegister rd) {
return new SPARCLogicInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
}
public SPARCInstruction newMoveInstruction(String name, int opcode,
ImmediateOrRegister operand2,
SPARCRegister rd) {
return new SPARCMoveInstruction(name, opcode, operand2, rd);
}
public SPARCInstruction newShiftInstruction(String name, int opcode, int rtlOperation,
SPARCRegister rs1, ImmediateOrRegister operand2,
SPARCRegister rd) {
return new SPARCShiftInstruction(name, opcode, rtlOperation, rs1, operand2, rd);
}
public SPARCInstruction newCoprocessorInstruction(int instruction, int cpopcode, int opcode,
int rs1Num, int rs2Num, int rd) {
return new SPARCIllegalInstruction(instruction);
}
public SPARCInstruction newSwapInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
return new SPARCSwapInstruction(name, addr, rd);
}
public SPARCInstruction newLdstubInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
return new SPARCLdstubInstruction(name, addr, rd);
}
}

View File

@ -1,87 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCJmplInstruction extends SPARCInstruction
implements BranchInstruction {
final protected SPARCRegisterIndirectAddress addr;
final protected SPARCRegister rd;
protected SPARCJmplInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
super(name);
this.addr = addr;
this.rd = rd;
}
public SPARCJmplInstruction(SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
this("jmpl", addr, rd);
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
String addrStr = addr.toString();
// remove '[' & ']' from address
addrStr = addrStr.substring(1, addrStr.length() - 1);
if (rd == SPARCRegisters.G0) {
buf.append("jmp");
buf.append(spaces);
buf.append(addrStr);
} else {
buf.append(getName());
buf.append(spaces);
buf.append(addrStr);
buf.append(comma);
buf.append(rd.toString());
}
return buf.toString();
}
public String asString(long currentPc, SymbolFinder symFinder) {
return getDescription();
}
public Address getBranchDestination() {
return addr;
}
public SPARCRegister getReturnAddressRegister() {
return rd;
}
public boolean isAnnuledBranch() {
return false;
}
public boolean isBranch() {
return true;
}
public boolean isConditional() {
return false;
}
}

View File

@ -1,70 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCLoadInstruction extends SPARCMemoryInstruction
implements LoadInstruction {
final protected SPARCRegister register2; // used for double word load instructions
final protected Register[] loadDestinations;
public SPARCLoadInstruction(String name, int opcode, SPARCRegisterIndirectAddress address, SPARCRegister register, int dataType) {
super(name, opcode,address, register, dataType);
if (opcode == LDD || opcode == LDDA) {
int nextRegNum = (register.getNumber() + 1) % SPARCRegisters.NUM_REGISTERS;
register2 = SPARCRegisters.getRegister(nextRegNum);
loadDestinations = new Register[2];
loadDestinations[0] = register;
loadDestinations[1] = register2;
} else {
register2 = null;
loadDestinations = new Register[1];
loadDestinations[0] = register;
}
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(address.toString());
buf.append(comma);
buf.append(register.toString());
return buf.toString();
}
public Register[] getLoadDestinations() {
return loadDestinations;
}
public Address getLoadSource() {
return address;
}
public boolean isLoad() {
return true;
}
}

View File

@ -1,105 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCLogicInstruction extends SPARCFormat3AInstruction
implements LogicInstruction {
final private int operation;
public SPARCLogicInstruction(String name, int opcode, int operation, SPARCRegister rs1,
ImmediateOrRegister operand2, SPARCRegister rd) {
super(name, opcode, rs1, operand2, rd);
this.operation = operation;
}
protected String getDescription() {
SPARCRegister G0 = SPARCRegisters.G0;
if (opcode == ORcc && rd == G0 && rd == operand2) {
StringBuffer buf = new StringBuffer();
buf.append("tst");
buf.append(spaces);
buf.append(getOperand2String());
return buf.toString();
} else if (opcode == XNOR && G0 == operand2) {
StringBuffer buf = new StringBuffer();
buf.append("not");
buf.append(spaces);
buf.append(rs1.toString());
if (rs1 != rd) {
buf.append(comma);
buf.append(rd.toString());
}
return buf.toString();
} else if (opcode == ANDcc && rd == G0) {
StringBuffer buf = new StringBuffer();
buf.append("btst");
buf.append(spaces);
buf.append(getOperand2String());
buf.append(comma);
buf.append(rd.toString());
return buf.toString();
} else if (rs1 == rd) {
StringBuffer buf = new StringBuffer();
switch (opcode) {
case OR:
buf.append("bset");
break;
case ANDN:
buf.append("bclr");
break;
case XOR:
buf.append("btog");
break;
default:
return super.getDescription();
}
buf.append(spaces);
buf.append(getOperand2String());
buf.append(comma);
buf.append(rd.toString());
return buf.toString();
} else {
return super.getDescription();
}
}
public Operand getLogicDestination() {
return getDestinationRegister();
}
public Operand[] getLogicSources() {
return (new Operand[] { rs1, operand2 });
}
public int getOperation() {
return operation;
}
public boolean isLogic() {
return true;
}
}

View File

@ -1,70 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.MemoryInstruction;
import sun.jvm.hotspot.asm.SymbolFinder;
public abstract class SPARCMemoryInstruction extends SPARCInstruction
implements MemoryInstruction {
final protected SPARCRegisterIndirectAddress address;
final protected SPARCRegister register;
final protected int dataType;
final protected int opcode;
public SPARCMemoryInstruction(String name, int opcode, SPARCRegisterIndirectAddress address, SPARCRegister register, int dataType) {
super(name);
this.address = address;
this.register = register;
this.dataType = dataType;
this.opcode = opcode;
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
buf.append(getName());
buf.append(spaces);
buf.append(address.toString());
buf.append(comma);
buf.append(register.toString());
return buf.toString();
}
public String asString(long currentPc, SymbolFinder symFinder) {
return getDescription();
}
public int getDataType() {
return dataType;
}
public boolean isConditional() {
return false;
}
public int getOpcode() {
return opcode;
}
}

View File

@ -1,68 +0,0 @@
/*
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package sun.jvm.hotspot.asm.sparc;
import sun.jvm.hotspot.asm.*;
public class SPARCMoveInstruction extends SPARCFormat3AInstruction
implements MoveInstruction, RTLOperations {
public SPARCMoveInstruction(String name, int opcode, ImmediateOrRegister operand2, SPARCRegister rd) {
super(name, opcode, null, operand2, rd);
}
protected String getDescription() {
StringBuffer buf = new StringBuffer();
if (operand2 == SPARCRegisters.G0) {
buf.append("clr");
buf.append(spaces);
buf.append(rd.toString());
} else {
buf.append("mov");
buf.append(spaces);
buf.append(getOperand2String());
buf.append(comma);
buf.append(rd.toString());
}
return buf.toString();
}
public Register getMoveDestination() {
return getDestinationRegister();
}
public ImmediateOrRegister getMoveSource() {
return operand2;
}
public boolean isConditional() {
return false;
}
public boolean isMove() {
return true;
}
}

Some files were not shown because too many files have changed in this diff Show More