diff --git a/.hgtags b/.hgtags
index 78c11849563..fde585f8bbb 100644
--- a/.hgtags
+++ b/.hgtags
@@ -179,3 +179,6 @@ c7aa5cca1c01689a7b1a92411daf83684af05a33 jdk8-b53
319f583f66db47395fa86127dd3ddb729eb7c64f jdk8-b55
ffe6bce5a521be40146af2ac03c509b7bac30595 jdk8-b56
2c21c080b11b93efb3851e39e1363e45da805943 jdk8-b57
+479d3302a26d7607ba271d66973e59ebf58825b6 jdk8-b58
+3bd874584fc01aae92fbc8827e2bd04d8b6ace04 jdk8-b59
+5e3adc681779037a2d33b7be6f75680619085492 jdk8-b60
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index 1f4c7f1203a..dba7899a1e6 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -179,3 +179,6 @@ c1a277c6022affbc6855bdfb039511e73fbe2395 jdk8-b54
b85b44cced2406792cfb9baab1377ff03e7001d8 jdk8-b55
76844579fa4b30929731115b237e477181a82394 jdk8-b56
522dfac8ca4d07c0b74025d4ac3b6e5feefbb829 jdk8-b57
+9367024804874faf8e958adeb333682bab1c0c47 jdk8-b58
+dae9821589ccd2611bdf7084269b98e819091770 jdk8-b59
+e07f499b9dccb529ecf74172cf6ac11a195ec57a jdk8-b60
diff --git a/corba/.hgtags b/corba/.hgtags
index 07435fcbc5b..8f91b19e721 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -179,3 +179,6 @@ d20d9eb9f093adbf392918c703960ad24c93a331 jdk8-b50
e8a0e84383d6fbd303ce44bd355fb25972b13286 jdk8-b55
bf1bb47414e178beff67dc255fc3b97bf401f679 jdk8-b56
f3ab4163ae012965fc8acdfc25ce0fece8d6906d jdk8-b57
+18462a19f7bd66d38015f61ea549a5e0c0c889a3 jdk8-b58
+d54dc53e223ed9ce7d5f4d2cd02ad9d5def3c2db jdk8-b59
+207ef43ba69ead6cbbab415d81834545e4d46747 jdk8-b60
diff --git a/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java b/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
index 143beefc8e1..aa3c6bea2f5 100644
--- a/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
+++ b/corba/src/share/classes/sun/rmi/rmic/iiop/StubGenerator.java
@@ -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();
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index af51d13d195..4f1b3692f38 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -279,3 +279,9 @@ af0c8a0808516317333dcf9af15567cdd52761ce jdk8-b55
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
diff --git a/hotspot/agent/make/ClosureFinder.java b/hotspot/agent/make/ClosureFinder.java
deleted file mode 100644
index 939a68561b7..00000000000
--- a/hotspot/agent/make/ClosureFinder.java
+++ /dev/null
@@ -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.*;
-
-
-/**
-
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.
-How does it work?
-
-
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.
-
-
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.
-
-*/
-
-public class ClosureFinder {
- private Collection roots; // root class names Collection
- 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 ");
- 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");
- }
- }
-}
diff --git a/hotspot/agent/make/Makefile b/hotspot/agent/make/Makefile
index fd5499367a0..c0183f17bc7 100644
--- a/hotspot/agent/make/Makefile
+++ b/hotspot/agent/make/Makefile
@@ -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 \
diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh
index dcecd5187a8..ab9a0a431c4 100644
--- a/hotspot/agent/make/saenv.sh
+++ b/hotspot/agent/make/saenv.sh
@@ -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
diff --git a/hotspot/agent/make/start-debug-server-proc.sh b/hotspot/agent/make/start-debug-server-proc.sh
index d538daf43f6..73152e3404d 100644
--- a/hotspot/agent/make/start-debug-server-proc.sh
+++ b/hotspot/agent/make/start-debug-server-proc.sh
@@ -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
diff --git a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m b/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m
index 04eaf9429cc..435262c4513 100644
--- a/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m
+++ b/hotspot/agent/src/os/bsd/MacosxDebuggerLocal.m
@@ -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
#import
#import
+#import
+#import
#import
+#import
+#import
+#import
+#import
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);
+}
diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile
index b79effe952c..dfbb0b9ebd5 100644
--- a/hotspot/agent/src/os/linux/Makefile
+++ b/hotspot/agent/src/os/linux/Makefile
@@ -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)
diff --git a/hotspot/agent/src/os/linux/mapfile b/hotspot/agent/src/os/linux/mapfile
index b71e43da9d8..d81696d4db4 100644
--- a/hotspot/agent/src/os/linux/mapfile
+++ b/hotspot/agent/src/os/linux/mapfile
@@ -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;
diff --git a/hotspot/agent/src/os/solaris/proc/Makefile b/hotspot/agent/src/os/solaris/proc/Makefile
index f7319c08839..60ba88eb47b 100644
--- a/hotspot/agent/src/os/solaris/proc/Makefile
+++ b/hotspot/agent/src/os/solaris/proc/Makefile
@@ -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
diff --git a/hotspot/agent/src/os/solaris/proc/mapfile b/hotspot/agent/src/os/solaris/proc/mapfile
index 5d43bc90580..2144c48ed0b 100644
--- a/hotspot/agent/src/os/solaris/proc/mapfile
+++ b/hotspot/agent/src/os/solaris/proc/mapfile
@@ -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:
*;
};
diff --git a/hotspot/agent/src/os/win32/windbg/Makefile b/hotspot/agent/src/os/win32/windbg/Makefile
index 773cd6f57a4..877913a478d 100644
--- a/hotspot/agent/src/os/win32/windbg/Makefile
+++ b/hotspot/agent/src/os/win32/windbg/Makefile
@@ -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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
index 1421037356f..c640e4ecc72 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
@@ -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();
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java
index 2526a325aaa..bb718d9f78b 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java
@@ -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.
*
- *
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.
- *
*
FIXME: especially with the addition of remote debugging, this
* has turned into a mess; needs rethinking.
*/
@@ -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=\n" +
- " Default is derived from dbxPathPrefix");
- System.out.println(" or");
- System.out.println(" -DdbxPathPrefix=\n" +
- " where xxx is the path name of a dir structure that contains:\n" +
- " //bin/dbx\n" +
- " The default is " + defaultDbxPathPrefix);
- System.out.println(" and");
- System.out.println(" -DdbxSvcAgentDSOPathName=\n" +
- " Default is determined from dbxSvcAgentDSOPathPrefix");
- System.out.println(" or");
- System.out.println(" -DdbxSvcAgentDSOPathPrefix=\n" +
- " where xxx is the pathname of a dir structure that contains:\n" +
- " //bin/lib/libsvc_agent_dbx.so\n" +
- " The default is " + defaultDbxSvcAgentDSOPathPrefix);
}
public HotSpotAgent() {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/TestDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/TestDebugger.java
deleted file mode 100644
index a0b0a993654..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/TestDebugger.java
+++ /dev/null
@@ -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);
- }
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/AbstractInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/AbstractInstruction.java
deleted file mode 100644
index 7b30640771b..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/AbstractInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Address.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Address.java
deleted file mode 100644
index 506a0b8ba14..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Address.java
+++ /dev/null
@@ -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 abstract class Address extends Operand {
- public boolean isAddress() {
- return true;
- }
-
- public abstract String toString();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Arithmetic.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Arithmetic.java
deleted file mode 100644
index d5456890024..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Arithmetic.java
+++ /dev/null
@@ -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 Arithmetic extends Instruction, RTLOperations {
- public Operand[] getArithmeticSources();
- public Operand getArithmeticDestination();
- public int getOperation(); // one of RTLOperations
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ArithmeticInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ArithmeticInstruction.java
deleted file mode 100644
index aabce38afc4..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ArithmeticInstruction.java
+++ /dev/null
@@ -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
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/BaseIndexScaleDispAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/BaseIndexScaleDispAddress.java
deleted file mode 100644
index a3c89223234..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/BaseIndexScaleDispAddress.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/BranchInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/BranchInstruction.java
deleted file mode 100644
index 3a9c376f005..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/BranchInstruction.java
+++ /dev/null
@@ -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 BranchInstruction extends Instruction {
- public boolean isConditional();
- public Address getBranchDestination();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/CPUHelper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/CPUHelper.java
deleted file mode 100644
index 51e82e6b21a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/CPUHelper.java
+++ /dev/null
@@ -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();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/CallInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/CallInstruction.java
deleted file mode 100644
index 01517c3d884..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/CallInstruction.java
+++ /dev/null
@@ -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 CallInstruction extends BranchInstruction {
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DirectAddress.java
deleted file mode 100644
index ba3d01acb3f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/DirectAddress.java
+++ /dev/null
@@ -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;
-
-public class DirectAddress extends Address {
- private long value;
- public DirectAddress(long value) {
- this.value = value;
- }
-
- public long getValue() {
- return value;
- }
-
- public String toString() {
- return Long.toHexString(value);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java
index cc62b6db193..f6a279dee88 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java
@@ -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);
+ }
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Immediate.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Immediate.java
deleted file mode 100644
index bb1378aab3b..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Immediate.java
+++ /dev/null
@@ -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;
-
-// Immediate is a Number operand
-
-public class Immediate extends ImmediateOrRegister {
- private final Number value;
-
- public Immediate(Number value) {
- this.value = value;
- }
-
- public Number getNumber() {
- return value;
- }
-
- public boolean isImmediate() {
- return true;
- }
-
- public String toString() {
- return value.toString();
- }
-
- public int hashCode() {
- return value.hashCode();
- }
-
- public boolean equals(Object obj) {
- if (obj == null)
- return false;
-
- if (getClass() != obj.getClass())
- return false;
-
- Immediate other = (Immediate) obj;
- return value.equals(other.value);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/IndirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/IndirectAddress.java
deleted file mode 100644
index c0984131772..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/IndirectAddress.java
+++ /dev/null
@@ -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 abstract class IndirectAddress extends Address {
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Instruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Instruction.java
deleted file mode 100644
index b26b7398957..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Instruction.java
+++ /dev/null
@@ -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);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java
index 37964cd9a7d..cf302bfa7dd 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/InstructionVisitor.java
@@ -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();
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/LoadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/LoadInstruction.java
deleted file mode 100644
index ac6e0fe7a11..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/LoadInstruction.java
+++ /dev/null
@@ -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();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/LogicInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/LogicInstruction.java
deleted file mode 100644
index 8f5efa3f77d..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/LogicInstruction.java
+++ /dev/null
@@ -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
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/MemoryInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/MemoryInstruction.java
deleted file mode 100644
index 127700b007f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/MemoryInstruction.java
+++ /dev/null
@@ -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
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/MoveInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/MoveInstruction.java
deleted file mode 100644
index 7d3d515f87e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/MoveInstruction.java
+++ /dev/null
@@ -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();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/PCRelativeAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/PCRelativeAddress.java
deleted file mode 100644
index 25b0a91b67c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/PCRelativeAddress.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/RTLDataTypes.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/RTLDataTypes.java
deleted file mode 100644
index 26785e80906..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/RTLDataTypes.java
+++ /dev/null
@@ -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;
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/RTLOperations.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/RTLOperations.java
deleted file mode 100644
index 80c278dcb5a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/RTLOperations.java
+++ /dev/null
@@ -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;
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ReturnInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ReturnInstruction.java
deleted file mode 100644
index 5093e928a81..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ReturnInstruction.java
+++ /dev/null
@@ -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 {
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ShiftInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ShiftInstruction.java
deleted file mode 100644
index 197d169c410..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ShiftInstruction.java
+++ /dev/null
@@ -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();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/StoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/StoreInstruction.java
deleted file mode 100644
index dde9049d4f1..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/StoreInstruction.java
+++ /dev/null
@@ -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();
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64FloatRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64FloatRegisters.java
deleted file mode 100644
index 8588d4985db..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64FloatRegisters.java
+++ /dev/null
@@ -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
- };
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Helper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Helper.java
deleted file mode 100644
index 98ce46b3686..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Helper.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Register.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Register.java
deleted file mode 100644
index f0b19baff65..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Register.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Registers.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Registers.java
deleted file mode 100644
index 52b35ab8b66..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/amd64/AMD64Registers.java
+++ /dev/null
@@ -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();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64FloatRegister.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64FloatRegister.java
deleted file mode 100644
index e7a42703d57..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64FloatRegister.java
+++ /dev/null
@@ -1,73 +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.Register;
-import sun.jvm.hotspot.utilities.Assert;
-
-public class IA64FloatRegister extends IA64Register {
-
- public IA64FloatRegister(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) {
- return number;
- }
-
- private static final int nofRegisters = 128;
- public int getNumberOfRegisters() {
- return nofRegisters;
- }
-
- public boolean isFloat() {
- return true;
- }
-
- public boolean isFramePointer() {
- return false;
- }
-
- public boolean isStackPointer() {
- return false;
- }
-
- public boolean isValid() {
- return number >= 0 && number < nofRegisters;
- }
-
- public String toString() {
- return IA64FloatRegisters.getRegisterName(number);
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64FloatRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64FloatRegisters.java
deleted file mode 100644
index 995eb0e18e7..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64FloatRegisters.java
+++ /dev/null
@@ -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
- });
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Helper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Helper.java
deleted file mode 100644
index fc9bf69c2e8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Helper.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Register.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Register.java
deleted file mode 100644
index 370930014ea..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Register.java
+++ /dev/null
@@ -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;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Registers.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Registers.java
deleted file mode 100644
index 258b8e1af81..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/ia64/IA64Registers.java
+++ /dev/null
@@ -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];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceLdstubDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceLdstubDecoder.java
deleted file mode 100644
index 9397151dfe6..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceLdstubDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceLoadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceLoadDecoder.java
deleted file mode 100644
index 5d7c7be1745..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceLoadDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceStoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceStoreDecoder.java
deleted file mode 100644
index 3c0535d27c7..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceStoreDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceSwapDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceSwapDecoder.java
deleted file mode 100644
index 9c9fcd5181a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/AlternateSpaceSwapDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ArithmeticDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ArithmeticDecoder.java
deleted file mode 100644
index 0e92383cf07..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ArithmeticDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/BranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/BranchDecoder.java
deleted file mode 100644
index 06ec0e4ddca..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/BranchDecoder.java
+++ /dev/null
@@ -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);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/CoprocessorBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/CoprocessorBranchDecoder.java
deleted file mode 100644
index c28861b8061..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/CoprocessorBranchDecoder.java
+++ /dev/null
@@ -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];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/CoprocessorDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/CoprocessorDecoder.java
deleted file mode 100644
index f76a0931072..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/CoprocessorDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FP2RegisterDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FP2RegisterDecoder.java
deleted file mode 100644
index e0bfc9ed067..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FP2RegisterDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPArithmeticDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPArithmeticDecoder.java
deleted file mode 100644
index 46cf4fb3768..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPArithmeticDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPMoveDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPMoveDecoder.java
deleted file mode 100644
index 09a80f37e95..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPMoveDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPopDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPopDecoder.java
deleted file mode 100644
index 3265d5e640c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FPopDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FloatBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FloatBranchDecoder.java
deleted file mode 100644
index 1612425545b..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FloatBranchDecoder.java
+++ /dev/null
@@ -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];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FloatDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FloatDecoder.java
deleted file mode 100644
index 656aca50f89..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/FloatDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/Format3ADecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/Format3ADecoder.java
deleted file mode 100644
index a72de3b190f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/Format3ADecoder.java
+++ /dev/null
@@ -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);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/IllegalInstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/IllegalInstructionDecoder.java
deleted file mode 100644
index 00af2dda90f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/IllegalInstructionDecoder.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-class IllegalInstructionDecoder extends InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- return factory.newIllegalInstruction(instruction);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/InstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/InstructionDecoder.java
deleted file mode 100644
index 81bb262a7fc..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/InstructionDecoder.java
+++ /dev/null
@@ -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);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/IntegerBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/IntegerBranchDecoder.java
deleted file mode 100644
index f5efc7b2168..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/IntegerBranchDecoder.java
+++ /dev/null
@@ -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 IntegerBranchDecoder extends BranchDecoder {
- String getConditionName(int conditionCode, boolean isAnnuled) {
- return isAnnuled ? integerAnnuledConditionNames[conditionCode]
- : integerConditionNames[conditionCode];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/JmplDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/JmplDecoder.java
deleted file mode 100644
index a58f73b3d74..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/JmplDecoder.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LdstubDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LdstubDecoder.java
deleted file mode 100644
index f5311dcd087..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LdstubDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LoadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LoadDecoder.java
deleted file mode 100644
index 25a270a8742..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LoadDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LogicDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LogicDecoder.java
deleted file mode 100644
index ab9aa9da29d..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/LogicDecoder.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/MemoryInstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/MemoryInstructionDecoder.java
deleted file mode 100644
index b8c86ab3a99..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/MemoryInstructionDecoder.java
+++ /dev/null
@@ -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);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ReadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ReadDecoder.java
deleted file mode 100644
index fcf99ff7501..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ReadDecoder.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ReadWriteDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ReadWriteDecoder.java
deleted file mode 100644
index 05b75fc1081..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ReadWriteDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RegisterDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RegisterDecoder.java
deleted file mode 100644
index ba36497bcc8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RegisterDecoder.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RestoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RestoreDecoder.java
deleted file mode 100644
index 9edd88046b4..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RestoreDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RettDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RettDecoder.java
deleted file mode 100644
index c5ae0d476f7..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/RettDecoder.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArithmeticInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArithmeticInstruction.java
deleted file mode 100644
index ad8a3d69cca..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCArithmeticInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCAtomicLoadStoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCAtomicLoadStoreInstruction.java
deleted file mode 100644
index 320d79a1495..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCAtomicLoadStoreInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCBranchInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCBranchInstruction.java
deleted file mode 100644
index aef30427325..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCBranchInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCCallInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCCallInstruction.java
deleted file mode 100644
index ca26f51a36c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCCallInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCDisassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCDisassembler.java
deleted file mode 100644
index 1fb8cbfefeb..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCDisassembler.java
+++ /dev/null
@@ -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.
- 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();
- }
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFP2RegisterInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFP2RegisterInstruction.java
deleted file mode 100644
index bf40446856e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFP2RegisterInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFPArithmeticInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFPArithmeticInstruction.java
deleted file mode 100644
index cedf49afd1a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFPArithmeticInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFPMoveInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFPMoveInstruction.java
deleted file mode 100644
index fd9317ae2a1..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFPMoveInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCFPMoveInstruction extends SPARCFP2RegisterInstruction
- implements MoveInstruction {
-
- public SPARCFPMoveInstruction(String name, int opf, SPARCFloatRegister rs, SPARCFloatRegister rd) {
- super(name, opf, rs, rd);
- }
-
- public Register getMoveDestination() {
- return rd;
- }
-
- public ImmediateOrRegister getMoveSource() {
- return rs;
- }
-
- public int getMoveOpcode() {
- return opf;
- }
-
- public boolean isConditional() {
- return false;
- }
-
- public boolean isMove() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFloatRegister.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFloatRegister.java
deleted file mode 100644
index 7b7f0c9c4f4..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFloatRegister.java
+++ /dev/null
@@ -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);
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFloatRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFloatRegisters.java
deleted file mode 100644
index ab5a391824c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFloatRegisters.java
+++ /dev/null
@@ -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
- });
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFlushInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFlushInstruction.java
deleted file mode 100644
index 107ecd64cb2..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFlushInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFormat3AInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFormat3AInstruction.java
deleted file mode 100644
index 4348788e247..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCFormat3AInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCHelper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCHelper.java
deleted file mode 100644
index 20af919309e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCHelper.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCIllegalInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCIllegalInstruction.java
deleted file mode 100644
index c5af3072a02..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCIllegalInstruction.java
+++ /dev/null
@@ -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.SymbolFinder;
-
-public final class SPARCIllegalInstruction extends SPARCInstruction {
- final private int instruction;
- final private String description;
-
- public SPARCIllegalInstruction(int instruction) {
- super("illegal");
- this.instruction = instruction;
- description = "bad opcode - " + Integer.toHexString(instruction);
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public int getInstruction() {
- return instruction;
- }
-
- public boolean isIllegal() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCIndirectCallInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCIndirectCallInstruction.java
deleted file mode 100644
index 486eff02ad1..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCIndirectCallInstruction.java
+++ /dev/null
@@ -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();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactory.java
deleted file mode 100644
index f2e3cb0d1a7..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactory.java
+++ /dev/null
@@ -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);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactoryImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactoryImpl.java
deleted file mode 100644
index 7c53ac6ce42..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstructionFactoryImpl.java
+++ /dev/null
@@ -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);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCJmplInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCJmplInstruction.java
deleted file mode 100644
index 81dbb82d8aa..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCJmplInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLdstubInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLdstubInstruction.java
deleted file mode 100644
index 724d8104613..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLdstubInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCLdstubInstruction extends SPARCAtomicLoadStoreInstruction {
- public SPARCLdstubInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
- super(name, addr, rd);
- }
-
- public int getDataType() {
- return RTLDT_UNSIGNED_BYTE;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLoadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLoadInstruction.java
deleted file mode 100644
index 6cb407bab25..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLoadInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLogicInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLogicInstruction.java
deleted file mode 100644
index d6414a9850e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCLogicInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCMemoryInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCMemoryInstruction.java
deleted file mode 100644
index 4744c856d4f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCMemoryInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCMoveInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCMoveInstruction.java
deleted file mode 100644
index 8b7d3b7e485..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCMoveInstruction.java
+++ /dev/null
@@ -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;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCNoopInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCNoopInstruction.java
deleted file mode 100644
index f2c96861c48..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCNoopInstruction.java
+++ /dev/null
@@ -1,37 +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 SPARCNoopInstruction extends SPARCInstruction {
- public SPARCNoopInstruction() {
- super("nop");
- }
-
- public boolean isNoop() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCOpcodes.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCOpcodes.java
deleted file mode 100644
index 554d329fcea..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCOpcodes.java
+++ /dev/null
@@ -1,354 +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.*;
-
-// Please refer to "The SPARC Architecture Manual - Version 8"
-
-public interface SPARCOpcodes {
-
- // format type is coded in 2 bits - primary opcode - "op"
- public static final int FORMAT_START_BIT = 30;
- public static final int FORMAT_MASK = 3 << FORMAT_START_BIT;
-
- // sparc instruction formats
-
- // PC Relative CALL
- public static final int FORMAT_1 = 1;
-
- // Bicc, FBfcc, CBccc, SETHI
- public static final int FORMAT_2 = 0;
-
- // memory instructions
- public static final int FORMAT_3 = 3;
-
- // arithmetic, logical, shift and remaining
- public static final int FORMAT_3A = 2;
-
- // disp 30 - used in pc relative call
- public static final int DISP_30_MASK = 0x3FFFFFFF;
-
- // secondary opcode "op2" used in FORMAT_2 instructions - 3 bits.
- public static final int OP_2_START_BIT = 22;
- public static final int OP_2_MASK = 7 << OP_2_START_BIT;
-
- // various "op2" masks
- public static final int OP_2_UNIMP = 0;
- public static final int OP_2_Bicc = 2;
- public static final int OP_2_SETHI = 4;
- public static final int OP_2_FBfcc = 6;
- public static final int OP_2_CBccc = 7;
-
- // condition codes are encoded in 4 bits.
- public static final int CONDITION_CODE_START_BIT = 25;
- public static final int CONDITION_CODE_MASK = 0xF << CONDITION_CODE_START_BIT;
-
- // branch condition codes
- public static final int CONDITION_BN = 0;
- public static final int CONDITION_FBN = CONDITION_BN;
- public static final int CONDITION_CBN = CONDITION_BN;
- public static final int CONDITION_TN = CONDITION_BN;
-
- public static final int CONDITION_BE = 1;
- public static final int CONDITION_FBNE = CONDITION_BE;
- public static final int CONDITION_CB123= CONDITION_BE;
- public static final int CONDITION_TE = CONDITION_BE;
-
- public static final int CONDITION_BLE = 2;
- public static final int CONDITION_FBLG = CONDITION_BLE;
- public static final int CONDITION_CB12 = CONDITION_BLE;
- public static final int CONDITION_TLE = CONDITION_BLE;
-
- public static final int CONDITION_BL = 3;
- public static final int CONDITION_FBUL = CONDITION_BL;
- public static final int CONDITION_CB13 = CONDITION_BL;
- public static final int CONDITION_TL = CONDITION_BL;
-
- public static final int CONDITION_BLEU = 4;
- public static final int CONDITION_FBL = CONDITION_BLEU;
- public static final int CONDITION_CB1 = CONDITION_BLEU;
- public static final int CONDITION_TLEU = CONDITION_BLEU;
-
- public static final int CONDITION_BCS = 5;
- public static final int CONDITION_FBUG = CONDITION_BCS;
- public static final int CONDITION_CB23 = CONDITION_BCS;
- public static final int CONDITION_TCS = CONDITION_BCS;
-
- public static final int CONDITION_BNEG = 6;
- public static final int CONDITION_FBG = CONDITION_BNEG;
- public static final int CONDITION_CB2 = CONDITION_BNEG;
- public static final int CONDITION_TNEG = CONDITION_BNEG;
-
- public static final int CONDITION_BVS = 7;
- public static final int CONDITION_FBU = CONDITION_BVS;
- public static final int CONDITION_CB3 = CONDITION_BVS;
- public static final int CONDITION_TVS = CONDITION_BVS;
-
- public static final int CONDITION_BA = 8;
- public static final int CONDITION_FBA = CONDITION_BA;
- public static final int CONDITION_CBA = CONDITION_BA;
- public static final int CONDITION_TA = CONDITION_BA;
-
- public static final int CONDITION_BNE = 9;
- public static final int CONDITION_FBE = CONDITION_BNE;
- public static final int CONDITION_CB0 = CONDITION_BNE;
- public static final int CONDITION_TNE = CONDITION_BNE;
-
- public static final int CONDITION_BG = 0xA;
- public static final int CONDITION_FBUE = CONDITION_BG;
- public static final int CONDITION_CB03 = CONDITION_BG;
- public static final int CONDITION_TG = CONDITION_BG;
-
- public static final int CONDITION_BGE = 0xB;
- public static final int CONDITION_FBGE = CONDITION_BGE;
- public static final int CONDITION_CB02 = CONDITION_BGE;
- public static final int CONDITION_TGE = CONDITION_BGE;
-
- public static final int CONDITION_BGU = 0xC;
- public static final int CONDITION_FBUGE= CONDITION_BGU;
- public static final int CONDITION_CB023= CONDITION_BGU;
- public static final int CONDITION_TGU = CONDITION_BGU;
-
- public static final int CONDITION_BCC = 0xD;
- public static final int CONDITION_FBLE = CONDITION_BCC;
- public static final int CONDITION_CB01 = CONDITION_BCC;
- public static final int CONDITION_TCC = CONDITION_BCC;
-
- public static final int CONDITION_BPOS = 0xE;
- public static final int CONDITION_FBULE= CONDITION_BPOS;
- public static final int CONDITION_CB013= CONDITION_BPOS;
- public static final int CONDITION_TPOS = CONDITION_BPOS;
-
- public static final int CONDITION_BVC = 0xF;
- public static final int CONDITION_FBO = CONDITION_BVC;
- public static final int CONDITION_CB012= CONDITION_BVC;
- public static final int CONDITION_TVC = CONDITION_BVC;
-
- // annul bit mask
- public static final int ANNUL_MASK = 1 << 29;
-
- // 22 bit displacement or immediate value - used in FORMAT_2 instructions.
- public static final int DISP_22_MASK = 0x3FFFFF;
- public static final int IMM_22_MASK = DISP_22_MASK;
-
- // second operand mask, called "i" bit
- public static final int I_START_BIT = 13;
- public static final int I_MASK = 1 << I_START_BIT;
-
- // address space identifier - "asi" - 8 bits
- public static final int ASI_START_BIT = 5;
- public static final int ASI_MASK = 0xFF << ASI_START_BIT;
-
- // signed immediate value 13 bits - "simm13"
- public static final int SIMM_13_MASK = 0x1FFF;
-
- // co-processor or floating point opcode field - "ocf/opf" - 9 bits
- public static final int OPF_START_BIT = 5;
- public static final int OPF_MASK = 0x1FF << OPF_START_BIT;
- public static final int OPC_MASK = OPF_MASK;
-
- // opcode part 3 - used in FORMAT_3 and FORMAT_3A instructions
- // "op3" - 6 bits
- public static final int OP_3_START_BIT = 19;
- public static final int OP_3_MASK = 0x3F << OP_3_START_BIT;
-
- // register masks
- public static final int RD_START_BIT = 25;
- public static final int RD_MASK = 0x1F << RD_START_BIT; // "rd"
- public static final int RS1_START_BIT = 14;
- public static final int RS1_MASK = 0x1F << RS1_START_BIT; // "rs1"
- public static final int RS2_MASK = 0x1F; // "rs2"
-
- // load/store instructions - op3 values - used with op=3 (FORMAT_3)
- public static final int LD = 0;
- public static final int LDA = (1 << 4);
- public static final int LDF = (2 << 4);
- public static final int LDC = (3 << 4);
-
- public static final int LDUB = 1;
- public static final int LDUBA = (1 << 4) | 1;
- public static final int LDFSR = (2 << 4) | 1;
- public static final int LDCSR = (3 << 4) | 1;
-
- public static final int LDUH = 2;
- public static final int LDUHA = (1 << 4) | 2;
-
- public static final int LDD = 3;
- public static final int LDDA = (1 << 4) | 3;
- public static final int LDDF = (2 << 4) | 3;
- public static final int LDDC = (3 << 4) | 3;
-
- public static final int ST = 4;
- public static final int STA = (1 << 4) | 4;
- public static final int STF = (2 << 4) | 4;
- public static final int STC = (3 << 4) | 4;
-
- public static final int STB = 5;
- public static final int STBA = (1 << 4) | 5;
- public static final int STFSR = (2 << 4) | 5;
- public static final int STCSR = (3 << 4) | 5;
-
- public static final int STH = 6;
- public static final int STHA = (1 << 4) | 6;
- public static final int STDFQ = (2 << 4) | 6;
- public static final int STDCQ = (3 << 4) | 6;
-
- public static final int STD = 7;
- public static final int STDA = (1 << 4) | 7;
- public static final int STDF = (2 << 4) | 7;
- public static final int STDC = (3 << 4) | 7;
-
- public static final int LDSB = 9;
- public static final int LDSBA = (1 << 4) | 9;
-
- public static final int LDSH = 0xA;
- public static final int LDSHA = (1 << 4) | 0xA;
-
- public static final int LDSTUB = 0xD;
- public static final int LDSTUBA = (1 << 4) | 0xD;
-
- public static final int SWAP = 0xF;
- public static final int SWAPA = (1 << 4) | 0xF;
-
- // arithmetic, logic remaining - op3 with op=2 (FORMAT_3A)
- public static final int ADD = 0;
- public static final int ADDcc = (1 << 4);
- public static final int TADDcc = (2 << 4);
- public static final int WRASR = (3 << 4);
- public static final int WRY = WRASR;
-
- public static final int AND = 1;
- public static final int ANDcc = (1 << 4) | 1;
- public static final int TSUBcc = (2 << 4) | 1;
- public static final int WRPSR = (3 << 4) | 1;
-
- public static final int OR = 2;
- public static final int ORcc = (1 << 4) | 2;
- public static final int TADDccTV = (2 << 4) | 2;
- public static final int WRWIM = (3 << 4) | 2;
-
- public static final int XOR = 3;
- public static final int XORcc = (1 << 4) | 3;
- public static final int TSUBccTV = (2 << 4) | 3;
- public static final int WRTBR = (3 << 4) | 3;
-
- public static final int SUB = 4;
- public static final int SUBcc = (1 << 4) | 4;
- public static final int MULScc = (2 << 4) | 4;
- public static final int FPop1 = (3 << 4) | 4;
-
- public static final int ANDN = 5;
- public static final int ANDNcc = (1 << 4) | 5;
- public static final int SLL = (2 << 4) | 5;
- public static final int FPop2 = (3 << 4) | 5;
-
- public static final int ORN = 6;
- public static final int ORNcc = (1 << 4) | 6;
- public static final int SRL = (2 << 4) | 6;
- public static final int CPop1 = (3 << 4) | 6;
-
- public static final int XNOR = 7;
- public static final int XNORcc = (1 << 4) | 7;
- public static final int SRA = (2 << 4) | 7;
- public static final int CPop2 = (3 << 4) | 7;
-
- public static final int ADDX = 8;
- public static final int ADDXcc = (1 << 4) | 8;
- public static final int RDASR = (2 << 4) | 8;
- public static final int RDY = RDASR;
- public static final int STBAR = RDASR;
- public static final int JMPL = (3 << 4) | 8;
-
- public static final int RDPSR = (2 << 4) | 9;
- public static final int RETT = (3 << 4) | 9;
-
- public static final int UMUL = 0xA;
- public static final int UMULcc = (1 << 4) | 0xA;
- public static final int RDWIM = (2 << 4) | 0xA;
- public static final int Ticc = (3 << 4) | 0xA;
-
- public static final int SMUL = 0xB;
- public static final int SMULcc = (1 << 4) | 0xB;
- public static final int RDTBR = (2 << 4) | 0xB;
- public static final int FLUSH = (3 << 4) | 0xB;
-
- public static final int SUBX = 0xC;
- public static final int SUBXcc = (1 << 4) | 0xC;
- public static final int SAVE = (3 << 4) | 0xC;
-
- public static final int RESTORE = (3 << 4) | 0xD;
-
- public static final int UDIV = 0xE;
- public static final int UDIVcc = (1 << 4) | 0xE;
-
- public static final int SDIV = 0xF;
- public static final int SDIVcc = (1 << 4) | 0xF;
-
- // opf - 9 bits (op=2, op3=0x34=FPop1) - floating point arithmetic
- public static final int FMOVs = 0x01;
- public static final int FNEGs = 0x05;
- public static final int FABSs = 0x09;
- public static final int FSQRTs = 0x29;
- public static final int FSQRTd = 0x2A;
- public static final int FSQRTq = 0x2B;
- public static final int FADDs = 0x41;
- public static final int FADDd = 0x42;
- public static final int FADDq = 0x43;
- public static final int FSUBs = 0x45;
- public static final int FSUBd = 0x46;
- public static final int FSUBq = 0x47;
- public static final int FMULs = 0x49;
- public static final int FMULd = 0x4A;
- public static final int FMULq = 0x4B;
- public static final int FDIVs = 0x4D;
- public static final int FDIVd = 0x4E;
- public static final int FDIVq = 0x4F;
- public static final int FsMULd = 0x69;
- public static final int FdMULq = 0x6E;
- public static final int FiTOs = 0xC4;
- public static final int FdTOs = 0xC6;
- public static final int FqTOs = 0xC7;
- public static final int FiTOd = 0xC8;
- public static final int FsTOd = 0xC9;
- public static final int FqTOd = 0xCB;
- public static final int FiTOq = 0xCC;
- public static final int FsTOq = 0xCD;
- public static final int FdTOq = 0xCE;
- public static final int FsTOi = 0xD1;
- public static final int FdTOi = 0xD2;
- public static final int FqTOi = 0xD3;
-
- // opf - 9 bits (op=2, op3=0x35=FPop2) - floating point comparisons
- public static final int FCMPs = 0x51;
- public static final int FCMPd = 0x52;
- public static final int FCMPq = 0x53;
- public static final int FCMPEs = 0x55;
- public static final int FCMPEd = 0x56;
- public static final int FCMPEq = 0x57;
-
- // 5 bit shift count mask
- public static final int SHIFT_COUNT_5_MASK = 0x1F;
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCReadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCReadInstruction.java
deleted file mode 100644
index dc9d7b73f6c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCReadInstruction.java
+++ /dev/null
@@ -1,64 +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.SymbolFinder;
-import sun.jvm.hotspot.utilities.Assert;
-
-public class SPARCReadInstruction extends SPARCSpecialRegisterInstruction {
- final private int specialReg;
- final private int asrRegNum;
- final private SPARCRegister rd;
-
- public SPARCReadInstruction(int specialReg, int asrRegNum, SPARCRegister rd) {
- super("rd");
- this.specialReg = specialReg;
- this.asrRegNum = asrRegNum;
- this.rd = rd;
- }
-
- public int getSpecialRegister() {
- return specialReg;
- }
-
- public int getAncillaryRegister() {
- if (Assert.ASSERTS_ENABLED)
- Assert.that(specialReg == ASR, "not an ancillary register");
- return asrRegNum;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- if(specialReg == ASR)
- buf.append("%asr" + asrRegNum);
- else
- buf.append(getSpecialRegisterName(specialReg));
- buf.append(comma);
- buf.append(rd.toString());
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterIndirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterIndirectAddress.java
deleted file mode 100644
index 66480c5a246..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRegisterIndirectAddress.java
+++ /dev/null
@@ -1,78 +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.Address;
-import sun.jvm.hotspot.asm.BaseIndexScaleDispAddress;
-
-public class SPARCRegisterIndirectAddress extends BaseIndexScaleDispAddress {
- protected int addressSpace = -1;
-
- public SPARCRegisterIndirectAddress(SPARCRegister register, int offset) {
- super(register, offset);
- }
-
- public SPARCRegisterIndirectAddress(SPARCRegister base, SPARCRegister index) {
- super(base, index);
- }
-
- public int getAddressSpace() {
- return addressSpace;
- }
-
- public void setAddressSpace(int addressSpace) {
- this.addressSpace = addressSpace;
- }
-
- public String getAddressWithoutAsi() {
- StringBuffer buf = new StringBuffer();
- buf.append('[');
- buf.append(getBase().toString());
- sun.jvm.hotspot.asm.Register register = getIndex();
- if (register != null) {
- buf.append(" + ");
- buf.append(register.toString());
- } else {
- long disp = getDisplacement();
- if (disp < 0) {
- buf.append(" - 0x");
- disp = -disp;
- } else {
- buf.append(" + 0x");
- }
- buf.append(Long.toHexString(disp));
- }
- buf.append(']');
- return buf.toString();
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(getAddressWithoutAsi());
- if(addressSpace != -1)
- buf.append((new Integer(addressSpace)).toString());
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRestoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRestoreInstruction.java
deleted file mode 100644
index 270e2393781..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRestoreInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCRestoreInstruction extends SPARCFormat3AInstruction {
- final private boolean trivial;
- public SPARCRestoreInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
- super("restore", RESTORE, rs1, operand2, rd);
- SPARCRegister G0 = SPARCRegisters.G0;
- trivial = (rs1 == G0 && operand2 == G0 && rd == G0);
- }
-
- public boolean isTrivial() {
- return trivial;
- }
-
- protected String getDescription() {
- return (trivial) ? getName() : super.getDescription();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRettInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRettInstruction.java
deleted file mode 100644
index 1e5956b5e88..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCRettInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCRettInstruction extends SPARCInstruction
- implements BranchInstruction {
- final protected SPARCRegisterIndirectAddress addr;
- final protected String description;
-
- protected SPARCRettInstruction(String name, SPARCRegisterIndirectAddress addr) {
- super(name);
- this.addr = addr;
- description = initDescription();
- }
-
- public SPARCRettInstruction(SPARCRegisterIndirectAddress addr) {
- this("rett", addr);
- }
-
- 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;
- }
-
- public Address getBranchDestination() {
- return addr;
- }
-
- public boolean isAnnuledBranch() {
- return false;
- }
-
- public boolean isBranch() {
- return true;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCReturnInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCReturnInstruction.java
deleted file mode 100644
index d3a810a1655..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCReturnInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCReturnInstruction extends SPARCJmplInstruction
- implements ReturnInstruction {
-
- private final boolean leaf;
-
- public SPARCReturnInstruction(SPARCRegisterIndirectAddress addr, SPARCRegister rd, boolean leaf) {
- super(leaf? "retl" : "ret", addr, rd);
- this.leaf = leaf;
- }
-
- public boolean isLeaf() {
- return leaf;
- }
-
- protected String getDescription() {
- return getName();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSaveInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSaveInstruction.java
deleted file mode 100644
index 4e29e36ca15..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSaveInstruction.java
+++ /dev/null
@@ -1,63 +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 SPARCSaveInstruction extends SPARCFormat3AInstruction {
- final private boolean trivial;
- public SPARCSaveInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, SPARCRegister rd) {
- super("save", SAVE, rs1, operand2, rd);
- SPARCRegister G0 = SPARCRegisters.G0;
- trivial = (rs1 == G0 && operand2 == G0 && rd == G0);
- }
-
- public boolean isTrivial() {
- return trivial;
- }
-
- protected String getOperand2String() {
- StringBuffer buf = new StringBuffer();
- if (operand2.isRegister()) {
- buf.append(operand2.toString());
- } else {
- Number number = ((Immediate)operand2).getNumber();
- int value = number.intValue();
- if (value < 0) {
- buf.append("-0x");
- value = -value;
- } else {
- buf.append("0x");
- }
-
- buf.append(Integer.toHexString(value));
- }
- return buf.toString();
- }
-
- protected String getDescription() {
- return (trivial) ? getName() : super.getDescription();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSethiInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSethiInstruction.java
deleted file mode 100644
index 4faf2fc5093..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSethiInstruction.java
+++ /dev/null
@@ -1,74 +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 SPARCSethiInstruction extends SPARCInstruction
- implements MoveInstruction {
- final private SPARCRegister register;
- final private ImmediateOrRegister value;
- final private String description;
-
- public SPARCSethiInstruction(int value, SPARCRegister register) {
- super("sethi");
- this.register = register;
- value <<= 10;
- this.value = new Immediate(new Integer(value));
- description = initDescription(value);
- }
-
- private String initDescription(int val) {
- if (val == 0 && register == SPARCRegisters.G0) {
- return "nop";
- } else {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append("%hi(0x");
- buf.append(Integer.toHexString(val));
- buf.append(')');
- buf.append(comma);
- buf.append(register.toString());
- return buf.toString();
- }
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public Register getMoveDestination() {
- return register;
- }
-
- public ImmediateOrRegister getMoveSource() {
- return value;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCShiftInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCShiftInstruction.java
deleted file mode 100644
index 91955dbe554..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCShiftInstruction.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SPARCShiftInstruction extends SPARCFormat3AInstruction
- implements ShiftInstruction {
- final private int operation;
-
- public SPARCShiftInstruction(String name, int opcode, int operation, SPARCRegister rs1,
- ImmediateOrRegister operand2, SPARCRegister rd) {
- super(name, opcode, rs1, operand2, rd);
- this.operation = operation;
- }
-
- public int getOperation() {
- return operation;
- }
-
- public Operand getShiftDestination() {
- return getDestinationRegister();
- }
-
- public Operand getShiftLength() {
- return operand2;
- }
-
- public Operand getShiftSource() {
- return rs1;
- }
-
- public boolean isShift() {
- return true;
- }
-
- protected String getOperand2String() {
- return operand2.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialLoadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialLoadInstruction.java
deleted file mode 100644
index 33472546705..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialLoadInstruction.java
+++ /dev/null
@@ -1,76 +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;
-
-public class SPARCSpecialLoadInstruction
- extends SPARCSpecialRegisterInstruction
- implements /* imports */ SPARCSpecialRegisters {
- final private int specialReg;
- final private int cregNum;
- final private SPARCRegisterIndirectAddress addr;
-
- public SPARCSpecialLoadInstruction(String name, int specialReg, int cregNum,
- SPARCRegisterIndirectAddress addr) {
- super(name);
- this.specialReg = specialReg;
- this.cregNum = cregNum;
- this.addr = addr;
- }
-
- public SPARCSpecialLoadInstruction(String name, int specialReg, SPARCRegisterIndirectAddress addr) {
- this(name, specialReg, -1, addr);
- }
-
- public int getSpecialRegister() {
- return specialReg;
- }
-
- public int getCoprocessorRegister() {
- if (Assert.ASSERTS_ENABLED)
- Assert.that(specialReg == CREG, "not a coprocesssor register");
- return cregNum;
- }
-
- public Address getSource() {
- return addr;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(addr);
- buf.append(comma);
- if (specialReg == CREG) {
- buf.append("creg" + cregNum);
- } else {
- buf.append(getSpecialRegisterName(specialReg));
- }
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialRegisterInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialRegisterInstruction.java
deleted file mode 100644
index 12190d87e12..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialRegisterInstruction.java
+++ /dev/null
@@ -1,57 +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 SPARCSpecialRegisterInstruction
- extends SPARCInstruction
- implements /* import */ SPARCSpecialRegisters {
- protected SPARCSpecialRegisterInstruction(String name) {
- super(name);
- }
-
- protected abstract String getDescription();
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return getDescription();
- }
-
- protected static String[] specialRegNames = new String[] {
- "%y",
- "%psr",
- "%wim",
- "%tbr",
- "%asr",
- "%fsr",
- "%csr",
- "%fq",
- "%cq"
- };
-
- protected static String getSpecialRegisterName(int index) {
- return specialRegNames[index];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialRegisters.java
deleted file mode 100644
index 0df051eab75..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialRegisters.java
+++ /dev/null
@@ -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;
-
-public interface SPARCSpecialRegisters {
- public static final int Y = 0;
- public static final int PSR = 1;
- public static final int WIM = 2;
- public static final int TBR = 3;
- public static final int ASR = 4;
- public static final int FSR = 5;
- public static final int CSR = 6;
- public static final int FQ = 7;
- public static final int CQ = 8;
- public static final int CREG = 9; // co-processor reg
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialStoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialStoreInstruction.java
deleted file mode 100644
index 3c453c2e76f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSpecialStoreInstruction.java
+++ /dev/null
@@ -1,76 +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;
-
-public class SPARCSpecialStoreInstruction
- extends SPARCSpecialRegisterInstruction
- implements /* imports */ SPARCSpecialRegisters {
- final private int specialReg;
- final private int cregNum;
- final private SPARCRegisterIndirectAddress addr;
-
- public SPARCSpecialStoreInstruction(String name, int specialReg, int cregNum,
- SPARCRegisterIndirectAddress addr) {
- super(name);
- this.specialReg = specialReg;
- this.addr = addr;
- this.cregNum = cregNum;
- }
-
- public SPARCSpecialStoreInstruction(String name, int specialReg,
- SPARCRegisterIndirectAddress addr) {
- this(name, specialReg, -1, addr);
- }
-
- public int getSpecialRegister() {
- return specialReg;
- }
-
- public int getCoprocessorRegister() {
- if (Assert.ASSERTS_ENABLED)
- Assert.that(specialReg == CREG, "not a special register");
- return cregNum;
- }
-
- public Address getDestination() {
- return addr;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer(getName());
- buf.append(spaces);
- if (specialReg == CREG) {
- buf.append("creg" + cregNum);
- } else {
- buf.append(getSpecialRegisterName(specialReg));
- }
- buf.append(comma);
- buf.append(addr.toString());
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCStbarInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCStbarInstruction.java
deleted file mode 100644
index 601df4769c7..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCStbarInstruction.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.SymbolFinder;
-
-public class SPARCStbarInstruction extends SPARCInstruction {
- public SPARCStbarInstruction() {
- super("stbar");
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCStoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCStoreInstruction.java
deleted file mode 100644
index 1cefb5eba5d..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCStoreInstruction.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SPARCStoreInstruction extends SPARCMemoryInstruction
- implements StoreInstruction {
- final protected SPARCRegister register2; // used by double word store instructions
- final protected Register[] storeSources;
-
- public SPARCStoreInstruction(String name, int opcode, SPARCRegisterIndirectAddress address, SPARCRegister register, int dataType) {
- super(name, opcode, address, register, dataType);
- if (opcode == STD || opcode == STDA) {
- storeSources = new Register[2];
- storeSources[0] = register;
- int nextRegNum = (register.getNumber() + 1) % SPARCRegisters.NUM_REGISTERS;
- register2 = SPARCRegisters.getRegister(nextRegNum);
- storeSources[1] = register2;
- } else {
- storeSources = new Register[1];
- storeSources[0] = register;
- register2 = null;
- }
- }
-
- private String defaultInitDescription(StringBuffer buf) {
- buf.append(getName());
- buf.append(spaces);
- buf.append(register.toString());
- buf.append(comma);
- buf.append(address.toString());
- return buf.toString();
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- if (register == SPARCRegisters.G0) {
- switch (opcode) {
- case ST:
- buf.append("clr");
- break;
- case STH:
- buf.append("clrh");
- break;
- case STB:
- buf.append("clrb");
- break;
- default:
- return defaultInitDescription(buf);
- }
- buf.append(spaces);
- buf.append(address.toString());
- return buf.toString();
- } else {
- return defaultInitDescription(buf);
- }
- }
-
- public int getDataType() {
- return dataType;
- }
-
- public Address getStoreDestination() {
- return address;
- }
-
- public Register[] getStoreSources() {
- return storeSources;
- }
-
- public boolean isStore() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSwapInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSwapInstruction.java
deleted file mode 100644
index ea7ad5cdbe8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCSwapInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCSwapInstruction extends SPARCAtomicLoadStoreInstruction {
- public SPARCSwapInstruction(String name, SPARCRegisterIndirectAddress addr, SPARCRegister rd) {
- super(name, addr, rd);
- }
-
- public int getDataType() {
- return RTLDT_UNSIGNED_WORD;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCTrapInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCTrapInstruction.java
deleted file mode 100644
index 224e937ee87..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCTrapInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCTrapInstruction extends SPARCInstruction
- implements BranchInstruction {
- final protected int conditionCode;
-
- public SPARCTrapInstruction(String name, int conditionCode) {
- super(name);
- this.conditionCode = conditionCode;
- }
-
- public Address getBranchDestination() {
- return null;
- }
-
- public int getConditionCode() {
- return conditionCode;
- }
-
- public boolean isConditional() {
- return conditionCode != CONDITION_TN && conditionCode != CONDITION_TA;
- }
-
- public boolean isTrap() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCUnimpInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCUnimpInstruction.java
deleted file mode 100644
index 5648848a35f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCUnimpInstruction.java
+++ /dev/null
@@ -1,63 +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 SPARCUnimpInstruction extends SPARCInstruction {
- final private String description;
- final private int const22;
-
- protected SPARCUnimpInstruction(String name, int const22) {
- super(name);
- this.const22 = const22;
- description = initDescription();
- }
-
- public SPARCUnimpInstruction(int const22) {
- this("unimp", const22);
- }
-
- public int getConst22() {
- return const22;
- }
-
- public boolean isIllegal() {
- return true;
- }
-
- private String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append("0x");
- buf.append(Integer.toHexString(const22));
- return buf.toString();
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV8Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV8Disassembler.java
deleted file mode 100644
index 813bba7c09c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV8Disassembler.java
+++ /dev/null
@@ -1,205 +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.*;
-
-// Please refer to "The SPARC Architecture Manual - Version 8"
-
-public class SPARCV8Disassembler extends SPARCDisassembler {
-
- public SPARCV8Disassembler(long startPc, byte[] code, SPARCInstructionFactory factory) {
- super(startPc, code, factory);
- }
-
- public SPARCV8Disassembler(long startPc, byte[] code) {
- this(startPc, code, new SPARCInstructionFactoryImpl());
- }
-
- // decoders for format 2 instructions
- private static InstructionDecoder format2Decoders[] = {
- new UnimpDecoder(),
- illegalDecoder,
- new IntegerBranchDecoder(),
- illegalDecoder,
- new SethiDecoder(),
- illegalDecoder,
- new FloatBranchDecoder(),
- new CoprocessorBranchDecoder()
- };
-
- protected InstructionDecoder getFormat2Decoder(int op2) {
- return format2Decoders[op2];
- }
-
- // op3 decoder table for op=3 (FORMAT_3) instructions - (memory instructions)
- // Appendix F - Opcodes and Condition Codes - Page 229 - Table F-4
-
- private static final InstructionDecoder format3Decoders[][] = {
- {
- new LoadDecoder(LD, "ld", RTLDT_UNSIGNED_WORD), new AlternateSpaceLoadDecoder(LDA, "lda", RTLDT_UNSIGNED_WORD),
- new LoadDecoder(LDF,"ld", RTLDT_FL_SINGLE), new SpecialLoadDecoder(LDC,"ld", SPARCSpecialRegisters.CREG)
- },
- {
- new LoadDecoder(LDUB, "ldub", RTLDT_UNSIGNED_BYTE), new AlternateSpaceLoadDecoder(LDUBA, "lduba", RTLDT_UNSIGNED_BYTE),
- new SpecialLoadDecoder(LDFSR, "ld", SPARCSpecialRegisters.FSR), new SpecialLoadDecoder(LDCSR, "ld", SPARCSpecialRegisters.CSR)
- },
- {
- new LoadDecoder(LDUH, "lduh", RTLDT_UNSIGNED_HALF), new AlternateSpaceLoadDecoder(LDUHA, "lduha", RTLDT_UNSIGNED_HALF),
- illegalDecoder, illegalDecoder
- },
- {
- new LoadDecoder(LDD, "ldd", RTLDT_UNSIGNED_DWORD), new AlternateSpaceLoadDecoder(LDDA, "ldda", RTLDT_UNSIGNED_DWORD),
- new LoadDecoder(LDDF, "ldd", RTLDT_FL_DOUBLE), new SpecialLoadDecoder(LDDC, "ldd", SPARCSpecialRegisters.CREG)
- },
- {
- new StoreDecoder(ST, "st", RTLDT_UNSIGNED_WORD), new AlternateSpaceStoreDecoder(STA, "sta", RTLDT_UNSIGNED_WORD),
- new StoreDecoder(STF, "st", RTLDT_FL_SINGLE), new SpecialStoreDecoder(STC, "st", SPARCSpecialRegisters.CREG)
- },
- {
- new StoreDecoder(STB, "stb", RTLDT_UNSIGNED_BYTE), new AlternateSpaceStoreDecoder(STBA, "stba", RTLDT_UNSIGNED_BYTE),
- new SpecialStoreDecoder(STFSR, "st", SPARCSpecialRegisters.FSR), new SpecialStoreDecoder(STCSR, "st", SPARCSpecialRegisters.CSR),
- },
- {
- new StoreDecoder(STH, "sth", RTLDT_UNSIGNED_HALF), new AlternateSpaceStoreDecoder(STHA, "stha", RTLDT_UNSIGNED_HALF),
- new SpecialStoreDecoder(STDFQ, "std", SPARCSpecialRegisters.FQ), new SpecialStoreDecoder(STDCQ, "std", SPARCSpecialRegisters.CQ),
- },
- {
- new StoreDecoder(STD, "std", RTLDT_UNSIGNED_DWORD), new AlternateSpaceStoreDecoder(STDA, "stda", RTLDT_UNSIGNED_DWORD),
- new StoreDecoder(STDF, "std", RTLDT_FL_DOUBLE), new SpecialStoreDecoder(STDC, "std", SPARCSpecialRegisters.CREG)
- },
- {
- illegalDecoder, illegalDecoder,
- illegalDecoder, illegalDecoder
- },
- {
- new LoadDecoder(LDSB, "ldsb", RTLDT_SIGNED_BYTE), new AlternateSpaceLoadDecoder(LDSBA, "ldsba", RTLDT_UNSIGNED_BYTE),
- illegalDecoder, illegalDecoder
- },
- {
- new LoadDecoder(LDSH, "ldsh", RTLDT_SIGNED_HALF), new AlternateSpaceLoadDecoder(LDSHA, "ldsha", RTLDT_UNSIGNED_HALF),
- illegalDecoder, illegalDecoder
- },
- {
- illegalDecoder, illegalDecoder,
- illegalDecoder, illegalDecoder
- },
- {
- illegalDecoder, illegalDecoder,
- illegalDecoder, illegalDecoder
- },
- {
- new LdstubDecoder(LDSTUB, "ldstub", RTLDT_UNSIGNED_BYTE), new AlternateSpaceLdstubDecoder(LDSTUBA, "ldstuba", RTLDT_UNSIGNED_BYTE),
- illegalDecoder, illegalDecoder
- },
- {
- illegalDecoder, illegalDecoder,
- illegalDecoder, illegalDecoder
- },
- {
- new SwapDecoder(SWAP, "swap", RTLDT_UNSIGNED_WORD), new AlternateSpaceSwapDecoder(SWAPA, "swapa", RTLDT_UNSIGNED_WORD),
- illegalDecoder, illegalDecoder
- },
- };
-
- protected InstructionDecoder getFormat3Decoder(int row, int column) {
- return format3Decoders[row][column];
- }
-
- // op3 decoder table for op=2 (FORMAT_3A) instructions
- // Appendix F - Opcodes and Condition Codes - Page 228 - Table F-3
- protected static final InstructionDecoder format3ADecoders[][] = {
- {
- new ArithmeticDecoder(ADD, "add", RTLOP_ADD), new ArithmeticDecoder(ADDcc, "addcc", RTLOP_ADD),
- new ArithmeticDecoder(TADDcc, "taddcc", RTLOP_ADD), new WriteDecoder(SPARCSpecialRegisters.ASR)
- },
- {
- new LogicDecoder(AND, "and", RTLOP_AND), new LogicDecoder(ANDcc, "andcc", RTLOP_AND),
- new ArithmeticDecoder(TSUBcc, "tsubcc", RTLOP_ADD), new WriteDecoder(SPARCSpecialRegisters.PSR)
- },
- {
- new LogicDecoder(OR, "or", RTLOP_OR), new LogicDecoder(ORcc, "orcc", RTLOP_OR),
- new ArithmeticDecoder(TADDccTV, "taddcctv", RTLOP_ADD), new WriteDecoder(SPARCSpecialRegisters.WIM)
- },
- {
- new LogicDecoder(XOR, "xor", RTLOP_XOR), new LogicDecoder(XORcc, "xorcc", RTLOP_XOR),
- new ArithmeticDecoder(TSUBccTV, "tsubcctv", RTLOP_SUB), new WriteDecoder(SPARCSpecialRegisters.TBR)
- },
- {
- new ArithmeticDecoder(SUB, "sub", RTLOP_SUB), new ArithmeticDecoder(SUBcc, "subcc", RTLOP_SUB),
- new ArithmeticDecoder(MULScc, "mulscc", RTLOP_SMUL), new V8FPop1Decoder()
- },
- {
- new LogicDecoder(ANDN, "andn", RTLOP_NAND), new LogicDecoder(ANDNcc, "andncc", RTLOP_NAND),
- new ShiftDecoder(SLL, "sll", RTLOP_SLL), new V8FPop2Decoder()
- },
- {
- new LogicDecoder(ORN, "orn", RTLOP_NOR), new LogicDecoder(ORNcc, "orncc", RTLOP_NOR),
- new ShiftDecoder(SRL, "srl", RTLOP_SRL), new CoprocessorDecoder(CPop1)
- },
- {
- new LogicDecoder(XNOR, "xnor", RTLOP_XNOR), new LogicDecoder(XNORcc, "xnorcc", RTLOP_XNOR),
- new ShiftDecoder(SRA, "sra", RTLOP_SRA), new CoprocessorDecoder(CPop2)
- },
- {
- new ArithmeticDecoder(ADDX, "addx", RTLOP_ADDC), new ArithmeticDecoder(ADDXcc, "addxcc", RTLOP_ADDC),
- new ReadDecoder(SPARCSpecialRegisters.ASR), new JmplDecoder()
- },
- {
- illegalDecoder, illegalDecoder,
- new ReadDecoder(SPARCSpecialRegisters.PSR), new RettDecoder()
- },
- {
- new ArithmeticDecoder(UMUL, "umul", RTLOP_UMUL), new ArithmeticDecoder(UMULcc, "umulcc", RTLOP_UMUL),
- new ReadDecoder(SPARCSpecialRegisters.WIM), new TrapDecoder()
- },
- {
- new ArithmeticDecoder(SMUL, "smul", RTLOP_SMUL), new ArithmeticDecoder(SMULcc, "smulcc", RTLOP_SMUL),
- new ReadDecoder(SPARCSpecialRegisters.TBR), new FlushDecoder()
- },
- {
- new ArithmeticDecoder(SUBX, "subx", RTLOP_SUBC), new ArithmeticDecoder(SUBXcc, "subxcc", RTLOP_SUBC),
- illegalDecoder, new SaveDecoder()
- },
- {
- illegalDecoder, illegalDecoder,
- illegalDecoder, new RestoreDecoder()
- },
- {
- new ArithmeticDecoder(UDIV, "udiv", RTLOP_UDIV), new ArithmeticDecoder(UDIVcc, "udivcc", RTLOP_UDIV),
- illegalDecoder, illegalDecoder
- },
- {
- new ArithmeticDecoder(SDIV, "sdiv", RTLOP_SDIV), new ArithmeticDecoder(SDIVcc, "sdivcc", RTLOP_SDIV),
- illegalDecoder, illegalDecoder
- }
- };
-
- protected InstructionDecoder getFormat3ADecoder(int row, int column) {
- return format3ADecoders[row][column];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9BranchInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9BranchInstruction.java
deleted file mode 100644
index 8bd0f9edc32..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9BranchInstruction.java
+++ /dev/null
@@ -1,65 +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 SPARCV9BranchInstruction extends SPARCBranchInstruction
- implements SPARCV9Instruction {
- final private boolean predictTaken;
- final private int conditionFlag; // icc, xcc or fccn - condition bits selected
-
- public SPARCV9BranchInstruction(String name, PCRelativeAddress addr,
- boolean isAnnuled, int conditionCode, boolean predictTaken, int conditionFlag) {
- super((name += (predictTaken)? ",pt" : ",pn"), addr, isAnnuled, conditionCode);
- this.predictTaken = predictTaken;
- this.conditionFlag = conditionFlag;
- }
-
- public boolean getPredictTaken() {
- return predictTaken;
- }
-
- public String getConditionFlagName() {
- return SPARCV9ConditionFlags.getFlagName(conditionFlag);
- }
-
- public int getConditionFlag() {
- return conditionFlag;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- long address = addr.getDisplacement() + currentPc;
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
-
- // add conditionFlag bit used.
- buf.append(getConditionFlagName());
- buf.append(comma);
- buf.append(symFinder.getSymbolFor(address));
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9CasInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9CasInstruction.java
deleted file mode 100644
index 9836cc32b10..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9CasInstruction.java
+++ /dev/null
@@ -1,52 +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 SPARCV9CasInstruction extends SPARCAtomicLoadStoreInstruction
- implements SPARCV9Instruction {
- final private SPARCRegister rs2;
- final private int dataType;
-
- public SPARCV9CasInstruction(String name, SPARCRegisterIndirectAddress addr,
- SPARCRegister rs2, SPARCRegister rd, int dataType) {
- super(name, addr, rd);
- this.rs2 = rs2;
- this.dataType = dataType;
- }
-
- public int getDataType() {
- return dataType;
- }
-
- public boolean isConditional() {
- return true;
- }
-
- public SPARCRegister getComparisonRegister() {
- return rs2;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ConditionFlags.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ConditionFlags.java
deleted file mode 100644
index 9d15704dbfb..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ConditionFlags.java
+++ /dev/null
@@ -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;
-
-class SPARCV9ConditionFlags {
- private static final String ccFlagNames[] = {
- "%fcc0", "%fcc1", "%fcc2", "%fcc3", "%icc", null, "%xcc", null
- };
-
- public static String getFlagName(int index) {
- return ccFlagNames[index];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Disassembler.java
deleted file mode 100644
index 1bf675ddf02..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Disassembler.java
+++ /dev/null
@@ -1,203 +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.*;
-
-// Please refer to "The SPARC Architecture Manual - Version 9"
-
-public class SPARCV9Disassembler extends SPARCDisassembler
- implements /* imports */ SPARCV9Opcodes {
- public SPARCV9Disassembler(long startPc, byte[] code, SPARCV9InstructionFactory factory) {
- super(startPc, code, factory);
- }
-
- public SPARCV9Disassembler(long startPc, byte[] code) {
- this(startPc, code, new SPARCV9InstructionFactoryImpl());
- }
-
- // decoders for format 2 instructions
- private static InstructionDecoder format2Decoders[] = {
- new UnimpDecoder(),
- new V9IntegerBranchDecoder(),
- new IntegerBranchDecoder(),
- new V9IntRegisterBranchDecoder(),
- new SethiDecoder(),
- new V9FloatBranchDecoder(),
- new FloatBranchDecoder(),
- illegalDecoder
- };
-
- protected InstructionDecoder getFormat2Decoder(int op2) {
- return format2Decoders[op2];
- }
-
- // op3 opcode table for op=3 (FORMAT_3) instructions - (memory instructions)
- // E.2 Tables - Page 275 - Table 33.
- private static final InstructionDecoder format3Decoders[][] = {
- {
- new LoadDecoder(LDUW, "ld" /* lduw */, RTLDT_UNSIGNED_WORD), new V9AlternateSpaceLoadDecoder(LDUWA, "lduwa", RTLDT_UNSIGNED_WORD),
- new LoadDecoder(LDF,"ld", RTLDT_FL_SINGLE), new V9AlternateSpaceLoadDecoder(LDFA, "lda", RTLDT_FL_SINGLE)
- },
- {
- new LoadDecoder(LDUB, "ldub", RTLDT_UNSIGNED_BYTE), new V9AlternateSpaceLoadDecoder(LDUBA, "lduba", RTLDT_UNSIGNED_BYTE),
- new V9SpecialLoadDecoder(LDFSR), illegalDecoder
- },
- {
- new LoadDecoder(LDUH, "lduh", RTLDT_UNSIGNED_HALF), new V9AlternateSpaceLoadDecoder(LDUHA, "lduha", RTLDT_UNSIGNED_HALF),
- new LoadDecoder(LDQF, "ldq", RTLDT_FL_QUAD), new V9AlternateSpaceLoadDecoder(LDQFA, "ldqa", RTLDT_FL_QUAD)
- },
- {
- new LoadDecoder(LDD, "ldd", RTLDT_UNSIGNED_DWORD), new V9AlternateSpaceLoadDecoder(LDDA, "ldda", RTLDT_UNSIGNED_DWORD),
- new LoadDecoder(LDDF, "ldd", RTLDT_FL_DOUBLE), new LoadDecoder(LDDFA, "ldda", RTLDT_FL_DOUBLE)
- },
- {
- new StoreDecoder(STW, "st" /* stw, stuw, stsw */, RTLDT_UNSIGNED_WORD), new V9AlternateSpaceStoreDecoder(STWA, "stwa", RTLDT_UNSIGNED_WORD),
- new StoreDecoder(STF, "st", RTLDT_FL_SINGLE), new StoreDecoder(STFA, "st", RTLDT_FL_SINGLE),
- },
- {
- new StoreDecoder(STB, "stb", RTLDT_UNSIGNED_BYTE), new V9AlternateSpaceStoreDecoder(STBA, "stba", RTLDT_UNSIGNED_BYTE),
- new V9SpecialStoreDecoder(STFSR), illegalDecoder
- },
- {
- new StoreDecoder(STH, "sth", RTLDT_UNSIGNED_HALF), new V9AlternateSpaceStoreDecoder(STHA, "stha", RTLDT_UNSIGNED_HALF),
- new StoreDecoder(STQF, "stq", RTLDT_FL_QUAD), new V9AlternateSpaceStoreDecoder(STQFA, "stqa", RTLDT_FL_QUAD),
- },
- {
- new StoreDecoder(STD, "std", RTLDT_UNSIGNED_DWORD), new V9AlternateSpaceStoreDecoder(STDA, "stda", RTLDT_UNSIGNED_DWORD),
- new StoreDecoder(STDF, "std", RTLDT_FL_DOUBLE), new V9AlternateSpaceStoreDecoder(STDFA, "stda", RTLDT_FL_DOUBLE)
- },
- {
- new LoadDecoder(LDSW, "ldsw", RTLDT_SIGNED_WORD), new V9AlternateSpaceLoadDecoder(LDSWA, "ldswa", RTLDT_SIGNED_WORD),
- illegalDecoder, illegalDecoder
- },
- {
- new LoadDecoder(LDSB, "ldsb", RTLDT_SIGNED_BYTE), new V9AlternateSpaceLoadDecoder(LDSBA, "ldsba", RTLDT_UNSIGNED_BYTE),
- illegalDecoder, illegalDecoder
- },
- {
- new LoadDecoder(LDSH, "ldsh", RTLDT_SIGNED_HALF), new V9AlternateSpaceLoadDecoder(LDSHA, "ldsha", RTLDT_UNSIGNED_HALF),
- illegalDecoder, illegalDecoder
- },
- {
- new LoadDecoder(LDX, "ldx", RTLDT_UNSIGNED_DWORD), new V9AlternateSpaceLoadDecoder(LDXA, "ldxa", RTLDT_UNSIGNED_DWORD),
- illegalDecoder, illegalDecoder
- },
- {
- illegalDecoder, illegalDecoder,
- illegalDecoder, new V9CasDecoder(CASA, "casa", RTLDT_UNSIGNED_WORD)
- },
- {
- new LdstubDecoder(LDSTUB, "ldstub", RTLDT_UNSIGNED_BYTE), new V9AlternateSpaceLdstubDecoder(LDSTUBA, "ldstuba", RTLDT_UNSIGNED_BYTE),
- new V9PrefetchDecoder(), new V9AlternateSpacePrefetchDecoder()
- },
- {
- new StoreDecoder(STX, "stx", RTLDT_UNSIGNED_DWORD), new V9AlternateSpaceStoreDecoder(STXA, "stxa", RTLDT_UNSIGNED_DWORD),
- illegalDecoder, new V9CasDecoder(CASXA, "casxa", RTLDT_UNSIGNED_DWORD)
- },
- {
- new SwapDecoder(SWAP, "swap", RTLDT_UNSIGNED_WORD), new V9AlternateSpaceSwapDecoder(SWAPA, "swapa", RTLDT_UNSIGNED_WORD),
- illegalDecoder, illegalDecoder
- },
- };
-
- protected InstructionDecoder getFormat3Decoder(int row, int column) {
- return format3Decoders[row][column];
- }
-
- // op3 decoder table for op=2 (FORMAT_3A) instructions
- // E Opcode Maps - Page 274 - Table 32
-
- protected static final InstructionDecoder format3ADecoders[][] = {
- {
- new ArithmeticDecoder(ADD, "add", RTLOP_ADD), new ArithmeticDecoder(ADDcc, "addcc", RTLOP_ADD),
- new ArithmeticDecoder(TADDcc, "taddcc", RTLOP_ADD), new V9WriteDecoder()
- },
- {
- new LogicDecoder(AND, "and", RTLOP_AND), new LogicDecoder(ANDcc, "andcc", RTLOP_AND),
- new ArithmeticDecoder(TSUBcc, "tsubcc", RTLOP_ADD), new V9SavedRestoredDecoder()
- },
- {
- new LogicDecoder(OR, "or", RTLOP_OR), new LogicDecoder(ORcc, "orcc", RTLOP_OR),
- new ArithmeticDecoder(TADDccTV, "taddcctv", RTLOP_ADD), new V9WrprDecoder()
- },
- {
- new LogicDecoder(XOR, "xor", RTLOP_XOR), new LogicDecoder(XORcc, "xorcc", RTLOP_XOR),
- new ArithmeticDecoder(TSUBccTV, "tsubcctv", RTLOP_SUB), illegalDecoder
- },
- {
- new ArithmeticDecoder(SUB, "sub", RTLOP_SUB), new ArithmeticDecoder(SUBcc, "subcc", RTLOP_SUB),
- new ArithmeticDecoder(MULScc, "mulscc", RTLOP_SMUL), new V9FPop1Decoder()
- },
- {
- new LogicDecoder(ANDN, "andn", RTLOP_NAND), new LogicDecoder(ANDNcc, "andncc", RTLOP_NAND),
- new V9ShiftDecoder(SLL, "sll", RTLOP_SLL), new V9FPop2Decoder()
- },
- {
- new LogicDecoder(ORN, "orn", RTLOP_NOR), new LogicDecoder(ORNcc, "orncc", RTLOP_NOR),
- new V9ShiftDecoder(SRL, "srl", RTLOP_SRL), new CoprocessorDecoder(IMPDEP1)
- },
- {
- new LogicDecoder(XNOR, "xnor", RTLOP_XNOR), new LogicDecoder(XNORcc, "xnorcc", RTLOP_XNOR),
- new V9ShiftDecoder(SRA, "sra", RTLOP_SRA), new CoprocessorDecoder(IMPDEP2)
- },
- {
- new ArithmeticDecoder(ADDC, "addc", RTLOP_ADDC), new ArithmeticDecoder(ADDCcc, "addccc", RTLOP_ADDC),
- new V9ReadDecoder(), new JmplDecoder()
- },
- {
- new ArithmeticDecoder(MULX, "mulx", RTLOP_UMUL), illegalDecoder,
- illegalDecoder, new RettDecoder()
- },
- {
- new ArithmeticDecoder(UMUL, "umul", RTLOP_UMUL), new ArithmeticDecoder(UMULcc, "umulcc", RTLOP_UMUL),
- new V9RdprDecoder(), new TrapDecoder()
- },
- {
- new ArithmeticDecoder(SMUL, "smul", RTLOP_SMUL), new ArithmeticDecoder(SMULcc, "smulcc", RTLOP_SMUL),
- new V9FlushwDecoder(), new FlushDecoder()
- },
- {
- new ArithmeticDecoder(SUBC, "subc", RTLOP_SUBC), new ArithmeticDecoder(SUBCcc, "subccc", RTLOP_SUBC),
- new V9MOVccDecoder(), new SaveDecoder()
- },
- {
- new ArithmeticDecoder(UDIVX, "udivx", RTLOP_UDIV), illegalDecoder,
- new ArithmeticDecoder(SDIVX, "sdivx", RTLOP_SDIV), new RestoreDecoder()
- },
- {
- new ArithmeticDecoder(UDIV, "udiv", RTLOP_UDIV), new ArithmeticDecoder(UDIVcc, "udivcc", RTLOP_UDIV),
- new V9PopcDecoder(), new V9DoneRetryDecoder()
- },
- {
- new ArithmeticDecoder(SDIV, "sdiv", RTLOP_SDIV), new ArithmeticDecoder(SDIVcc, "sdivcc", RTLOP_SDIV),
- new V9MOVrDecoder(), illegalDecoder
- }
- };
-
- protected InstructionDecoder getFormat3ADecoder(int row, int column) {
- return format3ADecoders[row][column];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9DoneInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9DoneInstruction.java
deleted file mode 100644
index 947d8081e10..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9DoneInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9DoneInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- public SPARCV9DoneInstruction() {
- super("done");
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FMOVccInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FMOVccInstruction.java
deleted file mode 100644
index b173510a6df..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FMOVccInstruction.java
+++ /dev/null
@@ -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.*;
-
-public class SPARCV9FMOVccInstruction extends SPARCFPMoveInstruction
- implements MoveInstruction {
- final int conditionCode;
- final int conditionFlag;
-
- public SPARCV9FMOVccInstruction(String name, int opf, int conditionCode,
- int conditionFlag, SPARCFloatRegister rs,
- SPARCFloatRegister rd) {
- super(name, opf, rs, rd);
- this.conditionFlag = conditionFlag;
- this.conditionCode = conditionCode;
- }
-
- public int getConditionCode() {
- return conditionCode;
- }
-
- public int getConditionFlag() {
- return conditionFlag;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FMOVrInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FMOVrInstruction.java
deleted file mode 100644
index dd838e5094a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FMOVrInstruction.java
+++ /dev/null
@@ -1,65 +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 SPARCV9FMOVrInstruction extends SPARCFPMoveInstruction
- implements SPARCV9Instruction {
- final private int regConditionCode;
- final private SPARCRegister rs1;
-
- public SPARCV9FMOVrInstruction(String name, int opf, SPARCRegister rs1,
- SPARCFloatRegister rs2, SPARCFloatRegister rd,
- int regConditionCode) {
- super(name, opf, rs2, rd);
- this.regConditionCode = regConditionCode;
- this.rs1 = rs1;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(rs1.toString());
- buf.append(comma);
- buf.append(rs.toString());
- buf.append(comma);
- buf.append(rd.toString());
- return buf.toString();
- }
-
- public int getRegisterConditionCode() {
- return regConditionCode;
- }
-
- public boolean isConditional() {
- return true;
- }
-
- public Register getConditionRegister() {
- return rs1;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FlushwInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FlushwInstruction.java
deleted file mode 100644
index dda9c33faac..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9FlushwInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9FlushwInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- public SPARCV9FlushwInstruction() {
- super("flushw");
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9IlltrapInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9IlltrapInstruction.java
deleted file mode 100644
index 371bb81fca5..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9IlltrapInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9IlltrapInstruction extends SPARCUnimpInstruction
- implements SPARCV9Instruction {
- public SPARCV9IlltrapInstruction(int const22) {
- super("illtrap", const22);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ImpdepInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ImpdepInstruction.java
deleted file mode 100644
index 7a5325e7ed0..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ImpdepInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9ImpdepInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- public SPARCV9ImpdepInstruction(String name) {
- super(name);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Instruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Instruction.java
deleted file mode 100644
index 1c0dab49a83..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Instruction.java
+++ /dev/null
@@ -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.sparc;
-
-public interface SPARCV9Instruction extends SPARCV9Opcodes {
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactory.java
deleted file mode 100644
index 0e79e0a08b9..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactory.java
+++ /dev/null
@@ -1,63 +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 SPARCV9InstructionFactory extends SPARCInstructionFactory {
- public SPARCInstruction newV9BranchInstruction(String name, PCRelativeAddress addr,
- boolean isAnnuled, int conditionCode, boolean predictTaken, int conditionFlag);
- public SPARCInstruction newV9RegisterBranchInstruction(String name, PCRelativeAddress addr,
- boolean isAnnuled, int regConditionCode, SPARCRegister conditionRegister,
- boolean predictTaken);
- public SPARCInstruction newV9CasInstruction(String name, SPARCRegisterIndirectAddress addr,
- SPARCRegister rs2, SPARCRegister rd, int dataType);
- public SPARCInstruction newV9PrefetchInstruction(String name, SPARCRegisterIndirectAddress addr,
- int prefetchFcn);
- public SPARCInstruction newV9FlushwInstruction();
- public SPARCInstruction newV9MOVccInstruction(String name, int conditionCode, int conditionFlag,
- ImmediateOrRegister source, SPARCRegister rd);
- public SPARCInstruction newV9MOVrInstruction(String name, SPARCRegister rs1,
- ImmediateOrRegister operand2, SPARCRegister rd,
- int regConditionCode);
- public SPARCInstruction newV9RdprInstruction(int regNum, SPARCRegister rd);
- public SPARCInstruction newV9WrprInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, int regNum);
- public SPARCInstruction newV9PopcInstruction(ImmediateOrRegister source, SPARCRegister rd);
- public SPARCInstruction newV9DoneInstruction();
- public SPARCInstruction newV9RetryInstruction();
- public SPARCInstruction newV9SavedInstruction();
- public SPARCInstruction newV9RestoredInstruction();
- public SPARCInstruction newV9ReadInstruction(int specialRegNum, int asrRegNum, SPARCRegister rd);
- public SPARCInstruction newV9WriteInstruction(int specialRegNum, int asrRegNum, SPARCRegister rs1,
- ImmediateOrRegister operand2);
- public SPARCInstruction newV9MembarInstruction(int mmask, int cmask);
- public SPARCInstruction newV9SirInstruction();
- public SPARCInstruction newV9FMOVccInstruction(String name, int opf, int conditionCode,
- int conditionFlag, SPARCFloatRegister rs,
- SPARCFloatRegister rd);
- public SPARCInstruction newV9FMOVrInstruction(String name, int opf,
- SPARCRegister rs1, SPARCFloatRegister rs2,
- SPARCFloatRegister rd, int regConditionCode);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactoryImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactoryImpl.java
deleted file mode 100644
index 4e27f118d9b..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9InstructionFactoryImpl.java
+++ /dev/null
@@ -1,139 +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 SPARCV9InstructionFactoryImpl extends SPARCInstructionFactoryImpl
- implements SPARCV9InstructionFactory {
-
- public SPARCInstruction newUnimpInstruction(int const22) {
- return new SPARCV9IlltrapInstruction(const22);
- }
-
- public SPARCInstruction newRettInstruction(SPARCRegisterIndirectAddress addr) {
- return new SPARCV9ReturnInstruction(addr);
- }
-
- public SPARCInstruction newCoprocessorInstruction(int instruction, int cpopcode, int opc,
- int rs1Num, int rs2Num, int rdNum) {
- return new SPARCV9ImpdepInstruction(cpopcode == SPARCOpcodes.CPop1? "impdep1" : "impdep2");
- }
-
- public SPARCInstruction newV9ReadInstruction(int specialRegNum, int asrRegNum, SPARCRegister rd) {
- return new SPARCV9ReadInstruction(specialRegNum, asrRegNum, rd);
- }
-
- public SPARCInstruction newV9WriteInstruction(int specialRegNum, int asrRegNum, SPARCRegister rs1,
- ImmediateOrRegister operand2) {
- return new SPARCV9WriteInstruction(specialRegNum, asrRegNum, rs1, operand2);
- }
-
- public SPARCInstruction newV9BranchInstruction(String name, PCRelativeAddress addr,
- boolean isAnnuled, int conditionCode, boolean predictTaken, int conditionFlag) {
- return new SPARCV9BranchInstruction(name, addr, isAnnuled, conditionCode,
- predictTaken, conditionFlag);
- }
-
- public SPARCInstruction newV9RegisterBranchInstruction(String name, PCRelativeAddress addr,
- boolean isAnnuled, int regConditionCode, SPARCRegister conditionRegister,
- boolean predictTaken) {
- return new SPARCV9RegisterBranchInstruction(name, addr, isAnnuled, regConditionCode,
- conditionRegister, predictTaken);
- }
-
- public SPARCInstruction newV9CasInstruction(String name, SPARCRegisterIndirectAddress addr,
- SPARCRegister rs2, SPARCRegister rd, int dataType) {
- return new SPARCV9CasInstruction(name, addr, rs2, rd, dataType);
- }
-
- public SPARCInstruction newV9PrefetchInstruction(String name, SPARCRegisterIndirectAddress addr,
- int prefetchFcn) {
- return new SPARCV9PrefetchInstruction(name, addr, prefetchFcn);
- }
-
- public SPARCInstruction newV9FlushwInstruction() {
- return new SPARCV9FlushwInstruction();
- }
-
- public SPARCInstruction newV9MOVccInstruction(String name, int conditionCode, int conditionFlag,
- ImmediateOrRegister source, SPARCRegister rd) {
- return new SPARCV9MOVccInstruction(name, conditionCode, conditionFlag, source, rd);
- }
-
- public SPARCInstruction newV9MOVrInstruction(String name, SPARCRegister rs1,
- ImmediateOrRegister operand2, SPARCRegister rd,
- int regConditionCode) {
- return new SPARCV9MOVrInstruction(name, rs1, operand2, rd, regConditionCode);
- }
-
- public SPARCInstruction newV9RdprInstruction(int regNum, SPARCRegister rd) {
- return new SPARCV9RdprInstruction(regNum, rd);
- }
-
- public SPARCInstruction newV9WrprInstruction(SPARCRegister rs1, ImmediateOrRegister operand2, int regNum) {
- return new SPARCV9WrprInstruction(rs1, operand2, regNum);
- }
-
- public SPARCInstruction newV9PopcInstruction(ImmediateOrRegister source, SPARCRegister rd) {
- return new SPARCV9PopcInstruction(source, rd);
- }
-
- public SPARCInstruction newV9DoneInstruction() {
- return new SPARCV9DoneInstruction();
- }
-
- public SPARCInstruction newV9RetryInstruction() {
- return new SPARCV9RetryInstruction();
- }
-
- public SPARCInstruction newV9SavedInstruction() {
- return new SPARCV9SavedInstruction();
- }
-
- public SPARCInstruction newV9RestoredInstruction() {
- return new SPARCV9RestoredInstruction();
- }
-
- public SPARCInstruction newV9MembarInstruction(int mmask, int cmask) {
- return new SPARCV9MembarInstruction(mmask, cmask);
- }
-
- public SPARCInstruction newV9SirInstruction() {
- return new SPARCV9SirInstruction();
- }
-
- public SPARCInstruction newV9FMOVccInstruction(String name, int opf,
- int conditionCode, int conditionFlag,
- SPARCFloatRegister rs, SPARCFloatRegister rd) {
- return new SPARCV9FMOVccInstruction(name, opf, conditionCode, conditionFlag, rs, rd);
- }
-
- public SPARCInstruction newV9FMOVrInstruction(String name, int opf,
- SPARCRegister rs1, SPARCFloatRegister rs2,
- SPARCFloatRegister rd, int regConditionCode) {
- return new SPARCV9FMOVrInstruction(name, opf, rs1, rs2, rd, regConditionCode);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MOVccInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MOVccInstruction.java
deleted file mode 100644
index 711d584515a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MOVccInstruction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.asm.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SPARCV9MOVccInstruction extends SPARCMoveInstruction
- implements SPARCV9Instruction {
- final private int conditionFlag; // condition flag used icc, xcc, fccn etc.
- final private int conditionCode;
-
- public SPARCV9MOVccInstruction(String name, int conditionCode, int conditionFlag,
- ImmediateOrRegister source, SPARCRegister rd) {
- super(name, MOVcc, source, rd);
- this.conditionCode = conditionCode;
- this.conditionFlag = conditionFlag;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(SPARCV9ConditionFlags.getFlagName(conditionFlag));
- buf.append(comma);
- buf.append(getOperand2String());
- buf.append(comma);
- buf.append(rd.toString());
- return buf.toString();
- }
-
- public int getConditionCode() {
- return conditionCode;
- }
-
- public int getConditionFlag() {
- return conditionFlag;
- }
-
- public String getConditionFlagName() {
- return SPARCV9ConditionFlags.getFlagName(conditionFlag);
- }
-
- public boolean isConditional() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MOVrInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MOVrInstruction.java
deleted file mode 100644
index 32da90f653e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MOVrInstruction.java
+++ /dev/null
@@ -1,65 +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 SPARCV9MOVrInstruction extends SPARCMoveInstruction
- implements SPARCV9Instruction {
- final private int regConditionCode;
- final private SPARCRegister rs1;
-
- public SPARCV9MOVrInstruction(String name, SPARCRegister rs1,
- ImmediateOrRegister operand2, SPARCRegister rd,
- int regConditionCode) {
- super(name, MOVr, operand2, rd);
- this.regConditionCode = regConditionCode;
- this.rs1 = rs1;
- }
-
- 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 int getRegisterConditionCode() {
- return regConditionCode;
- }
-
- public boolean isConditional() {
- return true;
- }
-
- public Register getConditionRegister() {
- return getSourceRegister1();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MembarInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MembarInstruction.java
deleted file mode 100644
index fa2da9ee131..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9MembarInstruction.java
+++ /dev/null
@@ -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.SymbolFinder;
-import java.util.Vector;
-
-public class SPARCV9MembarInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- final private int mmask;
- final private int cmask;
- final private String description;
-
- public SPARCV9MembarInstruction(int mmask, int cmask) {
- super("membar");
- this.mmask = mmask & 0xF;
- this.cmask = cmask & 0x7;
- description = initDescription();
- }
-
- private String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
-
- Vector masks = new Vector();
- if ((mmask & 0x1) != 0)
- masks.add("#LoadLoad");
- if ((mmask & 0x2) != 0)
- masks.add("#StoreLoad");
- if ((mmask & 0x4) != 0)
- masks.add("#LoadStore");
- if ((mmask & 0x8) != 0)
- masks.add("#StoreStore");
-
- if ((cmask & 0x1) != 0)
- masks.add("#Lookaside");
- if ((cmask & 0x2) != 0)
- masks.add("#MemIssue");
- if ((cmask & 0x4) != 0)
- masks.add("#Sync");
-
- // add all masks
- Object[] tempMasks = masks.toArray();
- for (int i=0; i < tempMasks.length - 1; i++) {
- buf.append((String)tempMasks[i]);
- buf.append("| ");
- }
- buf.append((String)tempMasks[tempMasks.length - 1]);
-
- return buf.toString();
- }
-
- public int getMMask() {
- return mmask;
- }
-
- public int getCMask() {
- return cmask;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Opcodes.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Opcodes.java
deleted file mode 100644
index fbcf1d94561..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9Opcodes.java
+++ /dev/null
@@ -1,365 +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.*;
-
-// Please refer to "The SPARC Architecture Manual - Version 9"
-
-public interface SPARCV9Opcodes extends SPARCOpcodes {
- // format 2, v9 specific "op2" values.
-
- // branch on integer condition codes with prediction
- public static final int OP_2_BPcc = 1;
-
- // branch on integer register contents with prediction
- public static final int OP_2_BPr = 3;
-
- // branch on float condition codes with prediction
- public static final int OP_2_FBPfcc = 5;
-
- // "rcond" - branch on register condition
- public static final int BRANCH_RCOND_START_BIT = 25;
-
- // rcond is 3 bits length
- public static final int BRANCH_RCOND_MASK = 7 << BRANCH_RCOND_START_BIT;
-
- // "rcond" - as used in conditional moves
- public static final int CMOVE_RCOND_START_BIT = 10;
- public static final int CMOVE_RCOND_MASK = 7 << CMOVE_RCOND_START_BIT;
-
- public static final int IMPDEP1 = CPop1;
- public static final int IMPDEP2 = CPop2;
-
- // various rcond values - used in BPr, MOVr and FMOVr
-
- // reserved register condition
- public static final int BRANCH_RCOND_RESERVED1 = 0; // 000
-
- public static final int BRZ = 1;
- public static final int MOVRZ = BRZ;
- public static final int FMOVZ = BRZ;
-
- public static final int BRLEZ = 2;
- public static final int MOVRLEZ = BRLEZ;
- public static final int FMOVLEZ = BRLEZ;
-
- public static final int BRLZ = 3;
- public static final int MOVRLZ = BRLZ;
- public static final int FMOVLZ = BRLZ;
-
- // reserved register condition
- public static final int BRANCH_RCOND_RESERVED2 = 4; // 100
-
- public static final int BRNZ = 5;
- public static final int MOVRNZ = BRNZ;
- public static final int FMOVNZ = BRNZ;
-
- public static final int BRGZ = 6;
- public static final int MOVGZ = BRGZ;
- public static final int FMOVGZ = BRGZ;
-
- public static final int BRGEZ = 7;
- public static final int MOVRGEZ = BRGEZ;
- public static final int FMOVGEZ = BRGEZ;
-
- // "p" - prediction bit - predict branch taken or not taken
- public static final int PREDICTION_START_BIT = 19;
- public static final int PREDICTION_MASK = 1 << PREDICTION_START_BIT;
-
- // branch pc relative displacement - hi 2 bits of disp16.
- public static final int DISP_16_HI_START_BIT = 20;
-
- // disp 16 hi is 2 bits length
- public static final int DISP_16_HI_MASK = 3 << DISP_16_HI_START_BIT;
-
- // disp 16 low 14 bits
- public static final int DISP_16_LO_START_BIT = 0; // just for completion.
- public static final int DISP_16_LO_MASK = 0x3FFF;
- public static final int DISP_16_LO_NUMBITS = 14;
-
- // disp 19 - integer branch with prediction - displacement
- public static final int DISP_19_MASK = 0x7FFFF;
-
- /*
- * condition code selected for integer branches - cc1 & cc0.
- * condition code selected for float branches - cc1 & cc0.
- * opf_cc field - floating conditional moves - 3 bits.
- * convert 2 bit codes as 3 bit codes always and use following codes
- * uniformly.
- */
-
- // opf_cc - 3 bits
- public static final int OPF_CC_START_BIT = 11;
- public static final int OPF_CC_MASK = 7 << OPF_CC_START_BIT;
-
- public static final int fcc0 = 0; // 000
- public static final int fcc1 = 1; // 001
- public static final int fcc2 = 2; // 010
- public static final int fcc3 = 3; // 011
- public static final int icc = 4; // 100
- public static final int CFLAG_RESERVED1 = 5; // 101
- public static final int xcc = 6; // 110
- public static final int CFLAG_RESERVED2 = 7; // 111
-
- // cc0, cc1 as in integer, float predicted branches
- public static final int BPcc_CC_START_BIT = 20;
- public static final int BPcc_CC_MASK = 3 << BPcc_CC_START_BIT;
- public static final int FBPfcc_CC_START_BIT = BPcc_CC_START_BIT;
- public static final int FBPfcc_CC_MASK = BPcc_CC_MASK;
-
- // condition codes for integer branches with prediction - BPcc
- public static final int CONDITION_BPN = CONDITION_BN;
- public static final int CONDITION_BPE = CONDITION_BE;
- public static final int CONDITION_BPLE = CONDITION_BLE;
- public static final int CONDITION_BPL = CONDITION_BL;
- public static final int CONDITION_BPLEU = CONDITION_BLEU;
- public static final int CONDITION_BPCS = CONDITION_BCS;
- public static final int CONDITION_BPNEG = CONDITION_BNEG;
- public static final int CONDITION_BPVS = CONDITION_BVS;
- public static final int CONDITION_BPA = CONDITION_BA;
- public static final int CONDITION_BPNE = CONDITION_BNE;
- public static final int CONDITION_BPG = CONDITION_BG;
- public static final int CONDITION_BPGE = CONDITION_BGE;
- public static final int CONDITION_BPGU = CONDITION_BGU;
- public static final int CONDITION_BPCC = CONDITION_BCC;
- public static final int CONDITION_BPPOS = CONDITION_BPOS;
- public static final int CONDITION_BPVC = CONDITION_BVC;
-
- // condition codes for float branches with prediction
- public static final int CONDITION_FBPN = CONDITION_BN;
- public static final int CONDITION_FBPNE = CONDITION_BE;
- public static final int CONDITION_FBPLG = CONDITION_BLE;
- public static final int CONDITION_FBPUL = CONDITION_BL;
- public static final int CONDITION_FBPL = CONDITION_BLEU;
- public static final int CONDITION_FBPUG = CONDITION_BCS;
- public static final int CONDITION_FBPG = CONDITION_BNEG;
- public static final int CONDITION_FBPU = CONDITION_BVS;
- public static final int CONDITION_FBPA = CONDITION_BA;
- public static final int CONDITION_FBPE = CONDITION_BNE;
- public static final int CONDITION_FBPUE = CONDITION_BG;
- public static final int CONDITION_FBPGE = CONDITION_BGE;
- public static final int CONDITION_FBPUGE= CONDITION_BGU;
- public static final int CONDITION_FBPLE = CONDITION_BCC;
- public static final int CONDITION_FBPULE= CONDITION_BPOS;
- public static final int CONDITION_FBPO = CONDITION_BVC;
-
- // "cmask" - 3 bit mask used in membar for completion constraints
- public static final int CMASK_START_BIT = 4;
- public static final int CMASK_MASK = 7 << CMASK_START_BIT;
-
- // "mmask" - 4 bit mask used in member for ordering instruction classes.
- public static final int MMASK_START_BIT = 0;
- public static final int MMASK_MASK = 0xF; // no need to shift
-
- // v9 specific load/store instruction opcodes
- // load/store instructions - op3 values - used with op=3 (FORMAT_3)
-
- public static final int LDUW = LD;
- public static final int LDUWA = LDA;
-
- public static final int LDXFSR = LDFSR;
-
- public static final int LDFA = LDC;
- public static final int LDQF = (2 << 4) | 2;
- public static final int LDQFA = (3 << 4) | 2;
- public static final int LDDFA = LDDC;
-
- public static final int STW = ST;
- public static final int STWA = STA;
- public static final int STFA = STC;
-
- public static final int STXFSR = STFSR;
-
- public static final int STQF = STDFQ;
- public static final int STQFA = STDCQ;
- public static final int STDFA = STDC;
-
- public static final int LDSW = 8;
- public static final int LDSWA = (1 << 4) | 8;
-
- public static final int LDX = 0xB;
- public static final int LDXA = (1 << 4) | 0xB;
-
- public static final int PREFETCH = (2 << 4) | 0xD;
- public static final int PREFETCHA = (3 << 4) | 0xD;
-
- public static final int CASA = (3 << 4) | 0xC;
-
- public static final int STX = 0xE;
- public static final int STXA = (1 << 4) | 0xE;
- public static final int CASXA = (3 << 4) | 0xE;
-
- // 6 bit immediate shift count mask
- public static final int SHIFT_COUNT_6_MASK = 0x3F;
-
- // X bit mask - used to differentiate b/w 32 bit and 64 bit shifts
- public static final int X_MASK = 1 << 12;
-
- // E Opcode maps - Page 274 - Table 32 - op3 (op=2) table
- // v9 specific items
- public static final int ADDC = ADDX;
- public static final int ADDCcc = ADDXcc;
-
- public static final int SUBC = SUBX;
- public static final int SUBCcc = SUBXcc;
-
- public static final int MULX = 9;
- public static final int UDIVX = 0xD;
-
- public static final int SLLX = SLL;
- public static final int SRLX = SRL;
- public static final int SRAX = SRA;
-
- // special register reads
- public static final int RDCCR = RDY;
- public static final int RDASI = RDY;
- public static final int RDTICK = RDY;
- public static final int RDPC = RDY;
- public static final int RDFPRS = RDY;
- public static final int MEMBAR = RDY;
- public static final int STMBAR = RDY;
-
- public static final int RDPR = (2 << 4) | 0xA;
-
- public static final int FLUSHW = (2 << 4) | 0xB;
-
- public static final int MOVcc = (2 << 4) | 0xC;
-
- public static final int SDIVX = (2 << 4) | 0xD;
-
- public static final int POPC = (2 << 4) | 0xE;
-
- public static final int MOVr = (2 << 4) | 0xF;
-
- // special regitser writes
- public static final int WRCCR = WRY;
- public static final int WRASI = WRY;
- public static final int WRFPRS = WRY;
- public static final int SIR = WRY;
-
- public static final int SAVED = (3 << 4) | 0x1;
- public static final int RESTORED = SAVED;
-
- public static final int WRPR = (3 << 4) | 0x2;
-
- public static final int RETURN = RETT;
-
- public static final int DONE = (3 << 4) | 0xE;
- public static final int RETRY = DONE;
-
- // various integer condition code move instructions
- public static final int CONDITION_MOVN = CONDITION_BN;
- public static final int CONDITION_MOVE = CONDITION_BE;
- public static final int CONDITION_MOVLE = CONDITION_BLE;
- public static final int CONDITION_MOVL = CONDITION_BL;
- public static final int CONDITION_MOVLEU = CONDITION_BLEU;
- public static final int CONDITION_MOVCS = CONDITION_BCS;
- public static final int CONDITION_MOVNEG = CONDITION_BNEG;
- public static final int CONDITION_MOVVS = CONDITION_BVS;
- public static final int CONDITION_MOVA = CONDITION_BA;
- public static final int CONDITION_MOVNE = CONDITION_BNE;
- public static final int CONDITION_MOVG = CONDITION_BG;
- public static final int CONDITION_MOVGE = CONDITION_BGE;
- public static final int CONDITION_MOVGU = CONDITION_BGU;
- public static final int CONDITION_MOVCC = CONDITION_BCC;
- public static final int CONDITION_MOVPOS = CONDITION_BPOS;
- public static final int CONDITION_MOVVC = CONDITION_BVC;
-
- // cc0, cc1 & cc2 in conditional moves
- public static final int CMOVE_CC_START_BIT = 11;
- public static final int CMOVE_CC0_CC1_MASK = 3 << CMOVE_CC_START_BIT;
- public static final int CMOVE_CC2_START_BIT = 18;
- public static final int CMOVE_CC2_MASK = 1 << CMOVE_CC2_START_BIT;
-
- public static final int CMOVE_COND_START_BIT = 14;
- // condition code is 4 bits
- public static final int CMOVE_COND_MASK = 0xF << CMOVE_COND_START_BIT;
-
- // opf[8:0] (op=2,op3=0x34=FPop1) - Table 34 - Page 276 - E Opcode Maps
- // v9 specific opcodes only - remaining are in SPARCOpcodes.
-
- public static final int FMOVd = 0x2;
- public static final int FMOVq = 0x3;
- public static final int FNEGd = 0x6;
- public static final int FNEGq = 0x7;
- public static final int FABSd = 0xA;
- public static final int FABSq = 0xB;
- public static final int FsTOx = (0x8 << 4) | 0x1;
- public static final int FdTOx = (0x8 << 4) | 0x2;
- public static final int FqTOx = (0x8 << 4) | 0x3;
- public static final int FxTOs = (0x8 << 4) | 0x4;
- public static final int FxTOd = (0x8 << 4) | 0x8;
- public static final int FxTOq = (0x8 << 4) | 0xC;
-
- // opf[8:0] (op=2, op3=0x35= FPop2) - Table 35 - Page 277 - E.2 Tables
- // v9 specific opcodes only 0 remanining are in SPARCOpcodes.
-
- // fp condition moves
-
- public static final int FMOVs_fcc0 = 1;
- public static final int FMOVs_fcc1 = 1 | (0x4 << 4);
- public static final int FMOVs_fcc2 = 1 | (0x8 << 4);
- public static final int FMOVs_fcc3 = 1 | (0xC << 4);
- public static final int FMOVs_icc = 1 | (0x10 << 4);
- public static final int FMOVs_xcc = 1 | (0x18 << 4);
-
- public static final int FMOVd_fcc0 = 2;
- public static final int FMOVd_fcc1 = 2 | (0x4 << 4);
- public static final int FMOVd_fcc2 = 2 | (0x8 << 4);
- public static final int FMOVd_fcc3 = 2 | (0xC << 4);
- public static final int FMOVd_icc = 2 | (0x10 << 4);
- public static final int FMOVd_xcc = 2 | (0x18 << 4);
-
- public static final int FMOVq_fcc0 = 3;
- public static final int FMOVq_fcc1 = 3 | (0x4 << 4);
- public static final int FMOVq_fcc2 = 3 | (0x8 << 4);
- public static final int FMOVq_fcc3 = 3 | (0xC << 4);
- public static final int FMOVq_icc = 3 | (0x10 << 4);
- public static final int FMOVq_xcc = 3 | (0x18 << 4);
-
- // fp register condition moves
-
- public static final int FMOVRsZ = 5 | (0x2 << 4);
- public static final int FMOVRsLEZ = 5 | (0x4 << 4);
- public static final int FMOVRsLZ = 5 | (0x6 << 4);
- public static final int FMOVRsNZ = 5 | (0xA << 4);
- public static final int FMOVRsGZ = 5 | (0xC << 4);
- public static final int FMOVRsGEZ = 5 | (0xE << 4);
-
- public static final int FMOVRdZ = 6 | (0x2 << 4);
- public static final int FMOVRdLEZ = 6 | (0x4 << 4);
- public static final int FMOVRdLZ = 6 | (0x6 << 4);
- public static final int FMOVRdNZ = 6 | (0xA << 4);
- public static final int FMOVRdGZ = 6 | (0xC << 4);
- public static final int FMOVRdGEZ = 6 | (0xE << 4);
-
- public static final int FMOVRqZ = 7 | (0x2 << 4);
- public static final int FMOVRqLEZ = 7 | (0x4 << 4);
- public static final int FMOVRqLZ = 7 | (0x6 << 4);
- public static final int FMOVRqNZ = 7 | (0xA << 4);
- public static final int FMOVRqGZ = 7 | (0xC << 4);
- public static final int FMOVRqGEZ = 7 | (0xE << 4);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PopcInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PopcInstruction.java
deleted file mode 100644
index 4ea25d22562..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PopcInstruction.java
+++ /dev/null
@@ -1,52 +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 SPARCV9PopcInstruction extends SPARCFormat3AInstruction
- implements SPARCV9Instruction {
- public SPARCV9PopcInstruction(ImmediateOrRegister source, SPARCRegister rd) {
- super("popc", POPC, null, source, rd);
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(getOperand2String());
- buf.append(comma);
- buf.append(rd.toString());
- return buf.toString();
- }
-
- public ImmediateOrRegister getSource() {
- return operand2;
- }
-
- public SPARCRegister getDestination() {
- return rd;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrefetchInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrefetchInstruction.java
deleted file mode 100644
index c52c426fe07..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrefetchInstruction.java
+++ /dev/null
@@ -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 SPARCV9PrefetchInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- final private SPARCRegisterIndirectAddress addr;
- final private int prefetchFcn;
- final private String description;
-
- public static final int PREFETCH_MANY_READS = 0;
- public static final int PREFETCH_ONE_READ = 1;
- public static final int PREFETCH_MANY_WRITES = 2;
- public static final int PREFETCH_ONE_WRITE = 3;
- public static final int PREFETCH_PAGE = 4;
-
- public SPARCV9PrefetchInstruction(String name, SPARCRegisterIndirectAddress addr, int prefetchFcn) {
- super(name);
- this.addr = addr;
- this.prefetchFcn = prefetchFcn;
- description = initDescription();
- }
-
- private String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(addr.toString());
- buf.append(comma);
- buf.append(prefetchFcn);
- return buf.toString();
- }
-
- public int getPrefetchFunction() {
- return prefetchFcn;
- }
-
- public SPARCRegisterIndirectAddress getPrefetchAddress() {
- return addr;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrivilegedRegisterInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrivilegedRegisterInstruction.java
deleted file mode 100644
index 6f7e49883a4..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrivilegedRegisterInstruction.java
+++ /dev/null
@@ -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 abstract class SPARCV9PrivilegedRegisterInstruction extends SPARCInstruction
- implements SPARCV9Instruction, /* imports */ SPARCV9PrivilegedRegisters {
- protected static final String regNames[] = {
- "%tpc", "%tnpc", "%tstate", "%tt", "%tick", "%tba", "%pstate", "%tl",
- "%pil", "%cwp", "%cansave", "%canrestore", "%cleanwin", "%otherwin", "%wstate", "%fq"
- };
-
- protected static String getPrivilegedRegisterName(int regNum) {
- if ((regNum > 15 && regNum < 31) || regNum > 31)
- return null;
- return (regNum == 31)? "%ver" : regNames[regNum];
- }
-
- final protected int regNum;
-
- protected abstract String getDescription();
-
- protected SPARCV9PrivilegedRegisterInstruction(String name, int regNum) {
- super(name);
- this.regNum = regNum;
- }
-
- public int getPrivilegedRegisterNumber() {
- return regNum;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return getDescription();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrivilegedRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrivilegedRegisters.java
deleted file mode 100644
index 4b7674e2967..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9PrivilegedRegisters.java
+++ /dev/null
@@ -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;
-
-public interface SPARCV9PrivilegedRegisters {
- public static final int TPC = 0;
- public static final int TNPC = 1;
- public static final int TSTATE = 2;
- public static final int TT = 3;
- public static final int TICK = 4;
- public static final int TBA = 5;
- public static final int PSTATE = 6;
- public static final int TL = 7;
- public static final int PIL = 8;
- public static final int CWP = 9;
- public static final int CANSAVE = 10;
- public static final int CANRESTORE = 11;
- public static final int CLEANWIN = 12;
- public static final int OTHERWIN = 13;
- public static final int WSTATE = 14;
- public static final int FQ = 15;
- public static final int VER = 31;
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RdprInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RdprInstruction.java
deleted file mode 100644
index 8164fb81f0f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RdprInstruction.java
+++ /dev/null
@@ -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;
-
-public class SPARCV9RdprInstruction extends SPARCV9PrivilegedRegisterInstruction {
- final private SPARCRegister rd;
-
- public SPARCV9RdprInstruction(int regNum, SPARCRegister rd) {
- super("rdpr", regNum);
- this.rd = rd;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(getPrivilegedRegisterName(regNum));
- buf.append(comma);
- buf.append(rd.toString());
- return buf.toString();
- }
-
- public SPARCRegister getDestination() {
- return rd;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ReadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ReadInstruction.java
deleted file mode 100644
index ae85d12426c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ReadInstruction.java
+++ /dev/null
@@ -1,64 +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.SymbolFinder;
-import sun.jvm.hotspot.utilities.Assert;
-
-public class SPARCV9ReadInstruction extends SPARCV9SpecialRegisterInstruction {
- final private int specialReg;
- final private int asrRegNum;
- final private SPARCRegister rd;
-
- public SPARCV9ReadInstruction(int specialReg, int asrRegNum, SPARCRegister rd) {
- super("rd");
- this.specialReg = specialReg;
- this.asrRegNum = asrRegNum;
- this.rd = rd;
- }
-
- public int getSpecialRegister() {
- return specialReg;
- }
-
- public int getAncillaryRegister() {
- if (Assert.ASSERTS_ENABLED)
- Assert.that(specialReg == ASR, "not an ancillary register");
- return asrRegNum;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- if(specialReg == ASR)
- buf.append("%asr" + asrRegNum);
- else
- buf.append(getSpecialRegisterName(specialReg));
- buf.append(comma);
- buf.append(rd.toString());
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RegisterBranchInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RegisterBranchInstruction.java
deleted file mode 100644
index 23ef498c057..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RegisterBranchInstruction.java
+++ /dev/null
@@ -1,84 +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 SPARCV9RegisterBranchInstruction extends SPARCInstruction
- implements SPARCV9Instruction, BranchInstruction {
- final protected PCRelativeAddress addr;
- final protected boolean isAnnuled;
- final protected int regConditionCode;
- final protected SPARCRegister conditionRegister;
- final protected boolean predictTaken;
-
- public SPARCV9RegisterBranchInstruction(String name, PCRelativeAddress addr,
- boolean isAnnuled, int regConditionCode,
- SPARCRegister conditionRegister, boolean predictTaken) {
- super(name);
- this.addr = addr;
- this.isAnnuled = isAnnuled;
- this.regConditionCode = regConditionCode;
- this.conditionRegister = conditionRegister;
- this.predictTaken = predictTaken;
- }
-
- 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 boolean isBranch() {
- return true;
- }
-
- public Address getBranchDestination() {
- return addr;
- }
-
- public boolean isAnnuledBranch() {
- return isAnnuled;
- }
-
- public boolean isConditional() {
- return true;
- }
-
- public int getRegisterConditionCode() {
- return regConditionCode;
- }
-
- public SPARCRegister getConditionRegister() {
- return conditionRegister;
- }
-
- public boolean getPredictTaken() {
- return predictTaken;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RegisterIndirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RegisterIndirectAddress.java
deleted file mode 100644
index e0e18e8956f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RegisterIndirectAddress.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2002, 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.sparc;
-
-public class SPARCV9RegisterIndirectAddress extends SPARCRegisterIndirectAddress {
- protected boolean indirectAsi;
-
- public SPARCV9RegisterIndirectAddress(SPARCRegister register, int offset) {
- super(register, offset);
- }
-
- public SPARCV9RegisterIndirectAddress(SPARCRegister base, SPARCRegister index) {
- super(base, index);
- }
-
- public boolean getIndirectAsi() {
- return indirectAsi;
- }
-
- public void setIndirectAsi(boolean indirectAsi) {
- this.indirectAsi = indirectAsi;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(getAddressWithoutAsi());
- if (indirectAsi) {
- buf.append("%asi");
- } else if (addressSpace != -1) {
- buf.append(Integer.toString(addressSpace));
- }
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RetryInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RetryInstruction.java
deleted file mode 100644
index eedbfcc3158..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9RetryInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9RetryInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- public SPARCV9RetryInstruction() {
- super("retry");
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ReturnInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ReturnInstruction.java
deleted file mode 100644
index fb33fd8e868..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9ReturnInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9ReturnInstruction extends SPARCRettInstruction
- implements SPARCV9Instruction {
- public SPARCV9ReturnInstruction(SPARCRegisterIndirectAddress addr) {
- super("return", addr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SavedInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SavedInstruction.java
deleted file mode 100644
index 7c29cabe4fe..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SavedInstruction.java
+++ /dev/null
@@ -1,34 +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 SPARCV9SavedInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- public SPARCV9SavedInstruction() {
- super("saved");
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SirInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SirInstruction.java
deleted file mode 100644
index c1d8a5bf7ba..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SirInstruction.java
+++ /dev/null
@@ -1,34 +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.SymbolFinder;
-
-public class SPARCV9SirInstruction extends SPARCInstruction
- implements SPARCV9Instruction {
- public SPARCV9SirInstruction() {
- super("sir");
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SpecialRegisterInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SpecialRegisterInstruction.java
deleted file mode 100644
index 049fe5b466f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SpecialRegisterInstruction.java
+++ /dev/null
@@ -1,56 +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 SPARCV9SpecialRegisterInstruction
- extends SPARCInstruction
- implements /* import */ SPARCV9SpecialRegisters, SPARCV9Instruction {
- protected SPARCV9SpecialRegisterInstruction(String name) {
- super(name);
- }
-
- protected abstract String getDescription();
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return getDescription();
- }
-
- protected static String[] specialRegNames = new String[] {
- "%y",
- null,
- "%ccr",
- "%asi",
- "%tick",
- "%pc",
- "%fprs",
- "%asr",
- };
-
- protected static String getSpecialRegisterName(int index) {
- return specialRegNames[index];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SpecialRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SpecialRegisters.java
deleted file mode 100644
index 47b42cbfb9a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9SpecialRegisters.java
+++ /dev/null
@@ -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;
-
-public interface SPARCV9SpecialRegisters {
- public static final int Y = 0;
- public static final int CCR = 2;
- public static final int ASI = 3;
- public static final int TICK = 4;
- public static final int PC = 5;
- public static final int FPRS = 6;
- public static final int ASR = 7;
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9WriteInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9WriteInstruction.java
deleted file mode 100644
index 6999dd74f6c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9WriteInstruction.java
+++ /dev/null
@@ -1,75 +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;
-
-public class SPARCV9WriteInstruction extends SPARCV9SpecialRegisterInstruction {
- final private int specialReg;
- final private int asrRegNum;
- final private SPARCRegister rs1;
- final private ImmediateOrRegister operand2;
-
- public SPARCV9WriteInstruction(int specialReg, int asrRegNum, SPARCRegister rs1, ImmediateOrRegister operand2) {
- super("wr");
- this.specialReg = specialReg;
- this.asrRegNum = asrRegNum;
- this.rs1 = rs1;
- this.operand2 = operand2;
- }
-
- public int getSpecialRegister() {
- return specialReg;
- }
-
- public int getAncillaryRegister() {
- if (Assert.ASSERTS_ENABLED)
- Assert.that(specialReg == ASR, "not an ancillary register");
- return asrRegNum;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(rs1.toString());
- buf.append(comma);
- if (operand2.isRegister()) {
- buf.append(operand2.toString());
- } else {
- Number number = ((Immediate)operand2).getNumber();
- buf.append("0x");
- buf.append(Integer.toHexString(number.intValue()));
- }
- buf.append(comma);
-
- if(specialReg == ASR)
- buf.append("%asr" + asrRegNum);
- else
- buf.append(getSpecialRegisterName(specialReg));
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9WrprInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9WrprInstruction.java
deleted file mode 100644
index ecf5d1d1946..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCV9WrprInstruction.java
+++ /dev/null
@@ -1,64 +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 SPARCV9WrprInstruction extends SPARCV9PrivilegedRegisterInstruction {
- final private SPARCRegister rs1;
- final private ImmediateOrRegister operand2;
-
- public SPARCV9WrprInstruction(SPARCRegister rs1, ImmediateOrRegister operand2,
- int regNum) {
- super("wrpr", regNum);
- this.rs1 = rs1;
- this.operand2 = operand2;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(rs1.toString());
- buf.append(comma);
- if (operand2.isRegister()) {
- buf.append(operand2.toString());
- } else {
- int value = ((Immediate)operand2).getNumber().intValue();
- buf.append(Integer.toHexString(value));
- }
- buf.append(comma);
- buf.append(getPrivilegedRegisterName(regNum));
- return buf.toString();
- }
-
- public SPARCRegister getSourceRegister1() {
- return rs1;
- }
-
- public ImmediateOrRegister getOperand2() {
- return operand2;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCWriteInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCWriteInstruction.java
deleted file mode 100644
index 020ddd09161..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCWriteInstruction.java
+++ /dev/null
@@ -1,75 +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;
-
-public class SPARCWriteInstruction extends SPARCSpecialRegisterInstruction {
- final private int specialReg;
- final private int asrRegNum;
- final private SPARCRegister rs1;
- final private ImmediateOrRegister operand2;
-
- public SPARCWriteInstruction(int specialReg, int asrRegNum, SPARCRegister rs1, ImmediateOrRegister operand2) {
- super("wr");
- this.specialReg = specialReg;
- this.asrRegNum = asrRegNum;
- this.rs1 = rs1;
- this.operand2 = operand2;
- }
-
- public int getSpecialRegister() {
- return specialReg;
- }
-
- public int getAncillaryRegister() {
- if (Assert.ASSERTS_ENABLED)
- Assert.that(specialReg == ASR, "not an ancillary register");
- return asrRegNum;
- }
-
- protected String getDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getName());
- buf.append(spaces);
- buf.append(rs1.toString());
- buf.append(comma);
- if (operand2.isRegister()) {
- buf.append(operand2.toString());
- } else {
- Number number = ((Immediate)operand2).getNumber();
- buf.append("0x");
- buf.append(Integer.toHexString(number.intValue()));
- }
- buf.append(comma);
-
- if(specialReg == ASR)
- buf.append("%asr" + asrRegNum);
- else
- buf.append(getSpecialRegisterName(specialReg));
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SaveDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SaveDecoder.java
deleted file mode 100644
index 3087c74d5c6..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SaveDecoder.java
+++ /dev/null
@@ -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 SaveDecoder extends Format3ADecoder {
- SaveDecoder() {
- super(SAVE, "save", RTLOP_UNKNOWN);
- }
-
- Instruction decodeFormat3AInstruction(int instruction,
- SPARCRegister rs1,
- ImmediateOrRegister operand2,
- SPARCRegister rd,
- SPARCInstructionFactory factory) {
- return factory.newSaveInstruction(rs1, operand2, rd);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SethiDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SethiDecoder.java
deleted file mode 100644
index 331c451e1b9..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SethiDecoder.java
+++ /dev/null
@@ -1,42 +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 SethiDecoder extends InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- Instruction instr = null;
- int rdNum = getDestinationRegister(instruction);
- SPARCRegister rd = SPARCRegisters.getRegister(rdNum);
- int imm22 = (instruction & DISP_22_MASK);
- if (imm22 == 0 && rd == SPARCRegisters.G0) {
- instr = factory.newNoopInstruction();
- } else {
- instr = factory.newSethiInstruction(imm22, rd);
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ShiftDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ShiftDecoder.java
deleted file mode 100644
index 84681c0f540..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/ShiftDecoder.java
+++ /dev/null
@@ -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.*;
-
-class ShiftDecoder extends InstructionDecoder {
- final int op3;
- final String name;
- final int rtlOperation;
-
- ShiftDecoder(int op3, String name, int rtlOperation) {
- this.op3 = op3;
- this.name = name;
- this.rtlOperation = rtlOperation;
- }
-
- private ImmediateOrRegister getShiftLength(int instruction) {
- boolean iBit = isIBitSet(instruction);
- ImmediateOrRegister operand2 = null;
- if (iBit) {
- int value = instruction & SHIFT_COUNT_5_MASK;
- operand2 = new Immediate(new Short((short)value));
- } else {
- operand2 = SPARCRegisters.getRegister(getSourceRegister2(instruction));
- }
- return operand2;
- }
-
- Instruction decode(int instruction,
- SPARCInstructionFactory factory) {
- SPARCRegister rs1 = SPARCRegisters.getRegister(getSourceRegister1(instruction));
- SPARCRegister rd = SPARCRegisters.getRegister(getDestinationRegister(instruction));
- ImmediateOrRegister operand2 = getShiftLength(instruction);
- return factory.newShiftInstruction(name, op3, rtlOperation, rs1, operand2, rd);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialLoadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialLoadDecoder.java
deleted file mode 100644
index 1aed61f0f07..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialLoadDecoder.java
+++ /dev/null
@@ -1,39 +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 SpecialLoadDecoder extends SpecialLoadStoreDecoder {
- SpecialLoadDecoder(int op3, String name, int specialRegNum) {
- super(op3, name, specialRegNum);
- }
-
- Instruction decodeSpecialLoadStoreInstruction(int cregNum,
- SPARCRegisterIndirectAddress addr,
- SPARCInstructionFactory factory) {
- return factory.newSpecialLoadInstruction(name, specialRegNum, cregNum, addr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialLoadStoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialLoadStoreDecoder.java
deleted file mode 100644
index 9b9793469ee..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialLoadStoreDecoder.java
+++ /dev/null
@@ -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.*;
-
-abstract class SpecialLoadStoreDecoder extends MemoryInstructionDecoder {
- final int specialRegNum;
-
- SpecialLoadStoreDecoder(int op3, String name, int specialRegNum) {
- super(op3, name, RTLDT_UNKNOWN);
- this.specialRegNum = specialRegNum;
- }
-
- final Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd, SPARCInstructionFactory factory) {
- int cregNum = getSourceRegister1(instruction);
- return decodeSpecialLoadStoreInstruction(cregNum, addr, factory);
- }
-
- abstract Instruction decodeSpecialLoadStoreInstruction(int cregNum,
- SPARCRegisterIndirectAddress addr,
- SPARCInstructionFactory factory);
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialStoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialStoreDecoder.java
deleted file mode 100644
index e1a7d271a61..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SpecialStoreDecoder.java
+++ /dev/null
@@ -1,39 +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 SpecialStoreDecoder extends SpecialLoadStoreDecoder {
- SpecialStoreDecoder(int op3, String name, int specialRegNum) {
- super(op3, name, specialRegNum);
- }
-
- Instruction decodeSpecialLoadStoreInstruction(int cregNum,
- SPARCRegisterIndirectAddress addr,
- SPARCInstructionFactory factory) {
- return factory.newSpecialStoreInstruction(name, specialRegNum, cregNum, addr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/StoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/StoreDecoder.java
deleted file mode 100644
index 492aa155e9b..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/StoreDecoder.java
+++ /dev/null
@@ -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 StoreDecoder extends MemoryInstructionDecoder {
- StoreDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCInstructionFactory factory) {
- return factory.newStoreInstruction(name, op3, addr, rd, dataType);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SwapDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SwapDecoder.java
deleted file mode 100644
index 349c4462c15..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SwapDecoder.java
+++ /dev/null
@@ -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 SwapDecoder extends MemoryInstructionDecoder {
- SwapDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCInstructionFactory factory) {
- return factory.newSwapInstruction(name, addr, rd);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/TrapDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/TrapDecoder.java
deleted file mode 100644
index e71843ed939..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/TrapDecoder.java
+++ /dev/null
@@ -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 TrapDecoder extends InstructionDecoder {
- private static final String trapConditionNames[] = {
- "tn", "te", "tle", "tl", "tleu", "tcs", "tneg", "tvs",
- "ta", "tne", "tg", "tge", "tgu" , "tcc", "tpos", "tvc"
- };
-
- static String getTrapConditionName(int index) {
- return trapConditionNames[index];
- }
-
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- int conditionCode = getConditionCode(instruction);
- return factory.newTrapInstruction(getTrapConditionName(conditionCode),
- conditionCode);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/UnimpDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/UnimpDecoder.java
deleted file mode 100644
index 07e98ac4057..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/UnimpDecoder.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-class UnimpDecoder extends InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- return factory.newUnimpInstruction(instruction & DISP_22_MASK);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V8FPop1Decoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V8FPop1Decoder.java
deleted file mode 100644
index a5a38405938..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V8FPop1Decoder.java
+++ /dev/null
@@ -1,75 +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.util.*;
-
-class V8FPop1Decoder extends FPopDecoder {
- static Map opfDecoders = new HashMap(); // Map
- static void addOpfDecoder(int fpOpcode, InstructionDecoder decoder) {
- opfDecoders.put(new Integer(fpOpcode), decoder);
- }
-
- // opf (op=2, op3=0x34=FPop1) - Table F -5 - Page 230.
- static {
- addOpfDecoder(FMOVs, new FPMoveDecoder(FMOVs, "fmovs", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FNEGs, new FP2RegisterDecoder(FNEGs, "fnegs", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FABSs, new FP2RegisterDecoder(FABSs, "fabss", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FSQRTs, new FP2RegisterDecoder(FSQRTs, "fsqrts", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FSQRTd, new FP2RegisterDecoder(FSQRTd, "fsqrtd", RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FSQRTq, new FP2RegisterDecoder(FSQRTq, "fsqrtq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addOpfDecoder(FADDs, new FPArithmeticDecoder(FADDs, "fadds", RTLOP_ADD, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FADDd, new FPArithmeticDecoder(FADDd, "faddd", RTLOP_ADD, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FADDq, new FPArithmeticDecoder(FADDq, "faddq", RTLOP_ADD, RTLDT_FL_QUAD, RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addOpfDecoder(FSUBs, new FPArithmeticDecoder(FSUBs, "fsubs", RTLOP_SUB, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FSUBd, new FPArithmeticDecoder(FSUBd, "fsubd", RTLOP_SUB, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FSUBq, new FPArithmeticDecoder(FSUBq, "fsubq", RTLOP_SUB, RTLDT_FL_QUAD, RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addOpfDecoder(FMULs, new FPArithmeticDecoder(FMULs, "fmuls", RTLOP_SMUL, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FMULd, new FPArithmeticDecoder(FMULd, "fmuld", RTLOP_SMUL, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FMULq, new FPArithmeticDecoder(FMULq, "fmulq",RTLOP_SMUL, RTLDT_FL_QUAD, RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addOpfDecoder(FsMULd, new FPArithmeticDecoder(FsMULd, "fsmuld", RTLOP_SMUL, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FdMULq, new FPArithmeticDecoder(FdMULq, "fdmulq",RTLOP_SMUL, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE, RTLDT_FL_QUAD));
- addOpfDecoder(FDIVs, new FPArithmeticDecoder(FDIVs, "fdivs", RTLOP_SDIV, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FDIVd, new FPArithmeticDecoder(FDIVd, "fdivd", RTLOP_SDIV,RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FDIVq, new FPArithmeticDecoder(FDIVq, "fdivq", RTLOP_SDIV,RTLDT_FL_QUAD, RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addOpfDecoder(FiTOs, new FP2RegisterDecoder(FiTOs, "fitos", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FiTOd, new FP2RegisterDecoder(FiTOd, "fitod", RTLDT_FL_SINGLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FiTOq, new FP2RegisterDecoder(FiTOq, "fitoq", RTLDT_FL_SINGLE, RTLDT_FL_QUAD));
- addOpfDecoder(FsTOi, new FP2RegisterDecoder(FsTOi, "fstoi", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FdTOi, new FP2RegisterDecoder(FdTOi, "fdtoi", RTLDT_FL_DOUBLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FqTOi, new FP2RegisterDecoder(FqTOi, "fqtoi", RTLDT_FL_QUAD, RTLDT_FL_SINGLE));
- addOpfDecoder(FsTOd, new FP2RegisterDecoder(FsTOd, "fstod", RTLDT_FL_SINGLE, RTLDT_FL_DOUBLE));
- addOpfDecoder(FsTOq, new FP2RegisterDecoder(FsTOq, "fstoq", RTLDT_FL_SINGLE, RTLDT_FL_QUAD));
- addOpfDecoder(FdTOs, new FP2RegisterDecoder(FdTOs, "fdtos", RTLDT_FL_DOUBLE, RTLDT_FL_SINGLE));
- addOpfDecoder(FdTOq, new FP2RegisterDecoder(FdTOq, "fdtoq", RTLDT_FL_DOUBLE, RTLDT_FL_QUAD));
- addOpfDecoder(FqTOs, new FP2RegisterDecoder(FqTOs, "fqtos", RTLDT_FL_QUAD, RTLDT_FL_SINGLE));
- addOpfDecoder(FqTOd, new FP2RegisterDecoder(FqTOd, "fqtod", RTLDT_FL_QUAD, RTLDT_FL_DOUBLE));
- }
-
- InstructionDecoder getOpfDecoder(int opf) {
- return (InstructionDecoder) opfDecoders.get(new Integer(opf));
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V8FPop2Decoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V8FPop2Decoder.java
deleted file mode 100644
index e40fefbd8e8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V8FPop2Decoder.java
+++ /dev/null
@@ -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.*;
-import java.util.*;
-
-class V8FPop2Decoder extends FPopDecoder {
- static Map fpop2Decoders = new HashMap(); // Map
- static void addFPop2Decoder(int fpOpcode, InstructionDecoder decoder) {
- fpop2Decoders.put(new Integer(fpOpcode), decoder);
- }
-
- // opf (op=2, op3=0x35=FPop2 - Table F-6 page 231
- static {
- addFPop2Decoder(FCMPs, new FP2RegisterDecoder(FCMPs, "fcmps", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addFPop2Decoder(FCMPd, new FP2RegisterDecoder(FCMPd, "fcmpd", RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addFPop2Decoder(FCMPq, new FP2RegisterDecoder(FCMPq, "fcmpq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addFPop2Decoder(FCMPEs, new FP2RegisterDecoder(FCMPEs, "fcmpes", RTLDT_FL_SINGLE, RTLDT_FL_SINGLE));
- addFPop2Decoder(FCMPEd, new FP2RegisterDecoder(FCMPEd, "fcmped", RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addFPop2Decoder(FCMPEq, new FP2RegisterDecoder(FCMPEq, "fcmpeq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- }
-
- InstructionDecoder getOpfDecoder(int opf) {
- return (InstructionDecoder) fpop2Decoders.get(new Integer(opf));
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceDecoder.java
deleted file mode 100644
index 0b3a2864ffb..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceDecoder.java
+++ /dev/null
@@ -1,63 +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 V9AlternateSpaceDecoder extends MemoryInstructionDecoder
- implements V9InstructionDecoder {
- V9AlternateSpaceDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- SPARCRegisterIndirectAddress newRegisterIndirectAddress(SPARCRegister rs1, SPARCRegister rs2) {
- return new SPARCV9RegisterIndirectAddress(rs1, rs2);
- }
-
- SPARCRegisterIndirectAddress newRegisterIndirectAddress(SPARCRegister rs1, int offset) {
- return new SPARCV9RegisterIndirectAddress(rs1, offset);
- }
-
- abstract Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory);
-
- Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd, SPARCInstructionFactory factory) {
- SPARCV9RegisterIndirectAddress v9addr = (SPARCV9RegisterIndirectAddress) addr;
- if (isIBitSet(instruction)) {
- // indirect asi
- v9addr.setIndirectAsi(true);
- } else {
- // immediate asi
- int asi = (instruction & ASI_MASK) >>> ASI_START_BIT;
- v9addr.setAddressSpace(asi);
- }
- return decodeV9AsiLoadStore(instruction, v9addr, rd,
- (SPARCV9InstructionFactory) factory);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceLdstubDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceLdstubDecoder.java
deleted file mode 100644
index be49877d1bb..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceLdstubDecoder.java
+++ /dev/null
@@ -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 V9AlternateSpaceLdstubDecoder extends V9AlternateSpaceDecoder {
- V9AlternateSpaceLdstubDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory) {
- return factory.newLdstubInstruction(name, addr, rd);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceLoadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceLoadDecoder.java
deleted file mode 100644
index 8aa2da4cc12..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceLoadDecoder.java
+++ /dev/null
@@ -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 V9AlternateSpaceLoadDecoder extends V9AlternateSpaceDecoder {
- V9AlternateSpaceLoadDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory) {
- return factory.newLoadInstruction(name, op3, addr, rd, dataType);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpacePrefetchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpacePrefetchDecoder.java
deleted file mode 100644
index c5a7ec3b1ff..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpacePrefetchDecoder.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2002, 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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-class V9AlternateSpacePrefetchDecoder extends V9AlternateSpaceDecoder {
- V9AlternateSpacePrefetchDecoder() {
- // Fake the destination with an integer type so we can get fcn from rd
- super(PREFETCHA, "prefetcha", RTLDT_SIGNED_WORD);
- }
-
- Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- return v9factory.newV9PrefetchInstruction(name, addr, rd.getNumber());
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceStoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceStoreDecoder.java
deleted file mode 100644
index 678c362f4b5..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceStoreDecoder.java
+++ /dev/null
@@ -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 V9AlternateSpaceStoreDecoder extends V9AlternateSpaceDecoder {
- V9AlternateSpaceStoreDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory) {
- return factory.newStoreInstruction(name, op3, addr, rd, dataType);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceSwapDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceSwapDecoder.java
deleted file mode 100644
index 9b1e4263d1d..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9AlternateSpaceSwapDecoder.java
+++ /dev/null
@@ -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 V9AlternateSpaceSwapDecoder extends V9AlternateSpaceDecoder {
- V9AlternateSpaceSwapDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory) {
- return factory.newSwapInstruction(name, addr, rd);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9BranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9BranchDecoder.java
deleted file mode 100644
index 23b1dcd0cd5..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9BranchDecoder.java
+++ /dev/null
@@ -1,34 +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 V9BranchDecoder extends BranchDecoder
- implements /* imports */ V9InstructionDecoder {
- static boolean getPredictTaken(int instruction) {
- return (PREDICTION_MASK & instruction) != 0;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CCBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CCBranchDecoder.java
deleted file mode 100644
index 0b0146e5962..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CCBranchDecoder.java
+++ /dev/null
@@ -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.*;
-
-abstract class V9CCBranchDecoder extends V9BranchDecoder {
- abstract int getConditionFlag(int instruction);
-
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- int conditionFlag = getConditionFlag(instruction);
- boolean predictTaken = getPredictTaken(instruction);
- int conditionCode = getConditionCode(instruction);
- boolean annuled = getAnnuledBit(instruction);
- String name = getConditionName(conditionCode, annuled);
- // signed word aligned 19 bit
- PCRelativeAddress addr = new PCRelativeAddress(extractSignedIntFromNBits(instruction, 19) << 2);
- return v9factory.newV9BranchInstruction(name, addr, annuled, conditionCode,
- predictTaken, conditionFlag);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CMoveDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CMoveDecoder.java
deleted file mode 100644
index 7daeac05a94..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CMoveDecoder.java
+++ /dev/null
@@ -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.*;
-import sun.jvm.hotspot.utilities.Assert;
-
-abstract class V9CMoveDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- static private final String iccConditionNames[] = {
- "n", "e", "le", "l", "leu", "cs", "neg", "vs",
- "a", "ne", "g", "ge", "gu", "cc", "pos", "vc"
- };
-
- static private final String fccConditionNames[] = {
- "fn", "fne", "flg", "ful", "fl", "fug", "fg", "fu",
- "fa", "fe", "fue", "fge", "fuge", "fle", "fule", "fo"
- };
-
- static String getConditionName(int conditionCode, int conditionFlag) {
- return (conditionFlag == icc || conditionFlag == xcc) ?
- iccConditionNames[conditionCode]
- : fccConditionNames[conditionCode];
- }
-
- static int getMoveConditionCode(int instruction) {
- return (instruction & CMOVE_COND_MASK) >>> CMOVE_COND_START_BIT;
- }
-
- static int getRegisterConditionCode(int instruction) {
- return (instruction & CMOVE_RCOND_MASK) >>> CMOVE_RCOND_START_BIT;
- }
-
- static ImmediateOrRegister getCMoveSource(int instruction, int numBits) {
- ImmediateOrRegister source = null;
- if (isIBitSet(instruction)) {
- source = new Immediate(new Short((short) extractSignedIntFromNBits(instruction, numBits)));
- } else {
- source = SPARCRegisters.getRegister(getSourceRegister2(instruction));
- }
- return source;
- }
-
- static String getFloatTypeCode(int dataType) {
- String result = null;
- switch(dataType) {
- case RTLDT_FL_SINGLE:
- result = "s";
- break;
-
- case RTLDT_FL_DOUBLE:
- result = "d";
- break;
-
- case RTLDT_FL_QUAD:
- result = "q";
- break;
-
- default:
- if (Assert.ASSERTS_ENABLED)
- Assert.that(false, "should not reach here");
- }
- return result;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CasDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CasDecoder.java
deleted file mode 100644
index 6b5e195b30d..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9CasDecoder.java
+++ /dev/null
@@ -1,42 +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 V9CasDecoder extends V9AlternateSpaceDecoder {
- V9CasDecoder(int op3, String name, int dataType) {
- super(op3, name, dataType);
- }
-
- Instruction decodeV9AsiLoadStore(int instruction,
- SPARCV9RegisterIndirectAddress addr,
- SPARCRegister rd,
- SPARCV9InstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- SPARCRegister rs2 = SPARCRegisters.getRegister(getSourceRegister2(instruction));
- return v9factory.newV9CasInstruction(name, addr, rs2, rd, dataType);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9DoneRetryDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9DoneRetryDecoder.java
deleted file mode 100644
index bff2580e157..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9DoneRetryDecoder.java
+++ /dev/null
@@ -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.*;
-
-class V9DoneRetryDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int rdNum = getDestinationRegister(instruction);
- // "rd" field is "fcn". Only values 0 and 1 are defined.
- // see page 157 - A.11 Done and Retry
- switch (rdNum) {
- case 0:
- instr = v9factory.newV9DoneInstruction();
- break;
- case 1:
- instr = v9factory.newV9RetryInstruction();
- break;
- default:
- instr = v9factory.newIllegalInstruction(instruction);
- break;
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FMOVccDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FMOVccDecoder.java
deleted file mode 100644
index 19b472ff882..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FMOVccDecoder.java
+++ /dev/null
@@ -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.*;
-import sun.jvm.hotspot.utilities.Assert;
-
-class V9FMOVccDecoder extends V9CMoveDecoder implements /* imports */ RTLDataTypes {
- private final int opf;
- private final int dataType;
-
- V9FMOVccDecoder(int opf, int dataType) {
- this.opf = opf;
- this.dataType = dataType;
- }
-
- private static String getFMoveCCName(int conditionCode, int conditionFlag, int dataType) {
- StringBuffer buf = new StringBuffer("fmov");
- buf.append(getFloatTypeCode(dataType));
- buf.append(getConditionName(conditionCode, conditionFlag));
- return buf.toString();
- }
-
- private static int getFMoveConditionFlag(int instruction) {
- return (instruction & OPF_CC_MASK) >>> OPF_CC_START_BIT;
- }
-
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int conditionFlag = getFMoveConditionFlag(instruction);
- if (conditionFlag == CFLAG_RESERVED1 || conditionFlag == CFLAG_RESERVED2) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- int rdNum = getDestinationRegister(instruction);
- int rs1Num = getSourceRegister1(instruction);
- SPARCRegister rd = RegisterDecoder.decode(dataType, rdNum);
- int conditionCode = getMoveConditionCode(instruction);
- SPARCRegister rs = RegisterDecoder.decode(dataType, rs1Num);
- String name = getFMoveCCName(conditionCode, conditionFlag, dataType);
- instr = v9factory.newV9FMOVccInstruction(name,opf, conditionCode, conditionFlag,
- (SPARCFloatRegister)rs, (SPARCFloatRegister)rd);
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FMOVrDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FMOVrDecoder.java
deleted file mode 100644
index 3febc84c579..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FMOVrDecoder.java
+++ /dev/null
@@ -1,52 +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 V9FMOVrDecoder extends V9CMoveDecoder {
- private final int opf;
- private final String name;
- private final int dataType;
-
- V9FMOVrDecoder(int opf, String name, int dataType) {
- this.opf = opf;
- this.name = name;
- this.dataType = dataType;
- }
-
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- int regConditionCode = getRegisterConditionCode(instruction);
- int rdNum = getDestinationRegister(instruction);
- int rs1Num = getSourceRegister1(instruction);
- int rs2Num = getSourceRegister2(instruction);
- SPARCRegister rd = RegisterDecoder.decode(dataType, rdNum);
- SPARCRegister rs2 = RegisterDecoder.decode(dataType, rs2Num);
- SPARCRegister rs1 = SPARCRegisters.getRegister(rs1Num);
- return v9factory.newV9FMOVrInstruction(name, opf, rs1, (SPARCFloatRegister)rs2,
- (SPARCFloatRegister)rd, regConditionCode);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FPop1Decoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FPop1Decoder.java
deleted file mode 100644
index db39073e04a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FPop1Decoder.java
+++ /dev/null
@@ -1,56 +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.util.*;
-
-class V9FPop1Decoder extends FPopDecoder
- implements V9InstructionDecoder {
- static Map v9opfDecoders = new HashMap(); // Map
- static void addV9OpfDecoder(int fpOpcode, InstructionDecoder decoder) {
- v9opfDecoders.put(new Integer(fpOpcode), decoder);
- }
-
- static {
- addV9OpfDecoder(FMOVd, new FPMoveDecoder(FMOVd, "fmovd", RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addV9OpfDecoder(FMOVq, new FPMoveDecoder(FMOVq, "fmovq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addV9OpfDecoder(FNEGd, new FP2RegisterDecoder(FNEGd, "fnegd", RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addV9OpfDecoder(FNEGq, new FP2RegisterDecoder(FNEGq, "fnegq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addV9OpfDecoder(FABSd, new FP2RegisterDecoder(FABSd, "fabsd", RTLDT_FL_DOUBLE, RTLDT_FL_DOUBLE));
- addV9OpfDecoder(FABSq, new FP2RegisterDecoder(FABSq, "fabsq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addV9OpfDecoder(FsTOx, new FP2RegisterDecoder(FsTOx, "fstox", RTLDT_FL_SINGLE, RTLDT_FL_QUAD));
- addV9OpfDecoder(FdTOx, new FP2RegisterDecoder(FdTOx, "fdtox", RTLDT_FL_DOUBLE, RTLDT_FL_QUAD));
- addV9OpfDecoder(FqTOx, new FP2RegisterDecoder(FqTOx, "fqtox", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- addV9OpfDecoder(FxTOs, new FP2RegisterDecoder(FxTOs, "fxtos", RTLDT_FL_QUAD, RTLDT_FL_SINGLE));
- addV9OpfDecoder(FxTOd, new FP2RegisterDecoder(FxTOd, "fxtod", RTLDT_FL_QUAD, RTLDT_FL_SINGLE));
- addV9OpfDecoder(FxTOq, new FP2RegisterDecoder(FxTOq, "fxtoq", RTLDT_FL_QUAD, RTLDT_FL_QUAD));
- }
-
- InstructionDecoder getOpfDecoder(int opf) {
- InstructionDecoder decoder = (InstructionDecoder) V8FPop1Decoder.opfDecoders.get(new Integer(opf));
- return (decoder !=null)? decoder : (InstructionDecoder) v9opfDecoders.get(new Integer(opf));
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FPop2Decoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FPop2Decoder.java
deleted file mode 100644
index 033d5dc55cc..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FPop2Decoder.java
+++ /dev/null
@@ -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.*;
-import java.util.*;
-
-class V9FPop2Decoder extends FPopDecoder
- implements V9InstructionDecoder {
- static Map v9fpop2Decoders = new HashMap(); // Map
- static void addV9FPop2Decoder(int fpOpcode, InstructionDecoder decoder) {
- v9fpop2Decoders.put(new Integer(fpOpcode), decoder);
- }
-
- static {
- // flag conditional moves
-
- addV9FPop2Decoder(FMOVs_fcc0, new V9FMOVccDecoder(FMOVs_fcc0, RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVs_fcc1, new V9FMOVccDecoder(FMOVs_fcc1, RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVs_fcc2, new V9FMOVccDecoder(FMOVs_fcc2, RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVs_fcc3, new V9FMOVccDecoder(FMOVs_fcc3, RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVs_icc, new V9FMOVccDecoder(FMOVs_icc, RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVs_xcc, new V9FMOVccDecoder(FMOVs_xcc, RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVd_fcc0, new V9FMOVccDecoder(FMOVd_fcc0, RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVd_fcc1, new V9FMOVccDecoder(FMOVd_fcc1, RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVd_fcc2, new V9FMOVccDecoder(FMOVd_fcc2, RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVd_fcc3, new V9FMOVccDecoder(FMOVd_fcc3, RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVd_icc, new V9FMOVccDecoder(FMOVd_icc, RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVd_xcc, new V9FMOVccDecoder(FMOVd_xcc, RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVq_fcc0, new V9FMOVccDecoder(FMOVq_fcc0, RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVq_fcc1, new V9FMOVccDecoder(FMOVq_fcc1, RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVq_fcc2, new V9FMOVccDecoder(FMOVq_fcc2, RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVq_fcc3, new V9FMOVccDecoder(FMOVq_fcc3, RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVq_icc, new V9FMOVccDecoder(FMOVq_icc, RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVq_xcc, new V9FMOVccDecoder(FMOVq_xcc, RTLDT_FL_QUAD));
-
- // register conditional moves
-
- addV9FPop2Decoder(FMOVRsZ, new V9FMOVrDecoder(FMOVRsZ, "fmovrsz", RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVRsLEZ, new V9FMOVrDecoder(FMOVRsLEZ, "fmovrslez", RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVRsLZ, new V9FMOVrDecoder(FMOVRsLZ, "fmovrslz", RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVRsNZ, new V9FMOVrDecoder(FMOVRsNZ, "fmovrsnz", RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVRsGZ, new V9FMOVrDecoder(FMOVRsGZ, "fmovrsgz", RTLDT_FL_SINGLE));
- addV9FPop2Decoder(FMOVRsGEZ, new V9FMOVrDecoder(FMOVRsGEZ, "fmovrsgez", RTLDT_FL_SINGLE));
-
- addV9FPop2Decoder(FMOVRdZ, new V9FMOVrDecoder(FMOVRdZ, "fmovrdz", RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVRdLEZ, new V9FMOVrDecoder(FMOVRdLEZ, "fmovrdlez", RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVRdLZ, new V9FMOVrDecoder(FMOVRdLZ, "fmovrdlz", RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVRdNZ, new V9FMOVrDecoder(FMOVRdNZ, "fmovrdnz", RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVRdGZ, new V9FMOVrDecoder(FMOVRdGZ, "fmovrdgz", RTLDT_FL_DOUBLE));
- addV9FPop2Decoder(FMOVRdGEZ, new V9FMOVrDecoder(FMOVRdGEZ, "fmovrdgez", RTLDT_FL_DOUBLE));
-
- addV9FPop2Decoder(FMOVRqZ, new V9FMOVrDecoder(FMOVRqZ, "fmovrqz", RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVRqLEZ, new V9FMOVrDecoder(FMOVRqLEZ, "fmovrqlez", RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVRqLZ, new V9FMOVrDecoder(FMOVRqLZ, "fmovrqlz", RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVRqNZ, new V9FMOVrDecoder(FMOVRqNZ, "fmovrqnz", RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVRqGZ, new V9FMOVrDecoder(FMOVRqGZ, "fmovrqgz", RTLDT_FL_QUAD));
- addV9FPop2Decoder(FMOVRqGEZ, new V9FMOVrDecoder(FMOVRqGEZ, "fmovrqgez", RTLDT_FL_QUAD));
- }
-
- InstructionDecoder getOpfDecoder(int opf) {
- InstructionDecoder decoder = (InstructionDecoder) V8FPop2Decoder.fpop2Decoders.get(new Integer(opf));
- return (decoder != null) ? decoder : (InstructionDecoder) v9fpop2Decoders.get(new Integer(opf));
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FloatBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FloatBranchDecoder.java
deleted file mode 100644
index 870769a0afc..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FloatBranchDecoder.java
+++ /dev/null
@@ -1,36 +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 V9FloatBranchDecoder extends V9CCBranchDecoder {
- String getConditionName(int conditionCode, boolean isAnnuled) {
- return isAnnuled ? floatAnnuledConditionNames[conditionCode]
- : floatConditionNames[conditionCode];
- }
-
- int getConditionFlag(int instruction) {
- return (FBPfcc_CC_MASK & instruction) >>> FBPfcc_CC_START_BIT;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FlushwDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FlushwDecoder.java
deleted file mode 100644
index b33377644a6..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9FlushwDecoder.java
+++ /dev/null
@@ -1,42 +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 V9FlushwDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- // "i" bit has to be zero. see page 169 - A.21 Flush Register Windows.
- if (isIBitSet(instruction)) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- instr = v9factory.newV9FlushwInstruction();
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9InstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9InstructionDecoder.java
deleted file mode 100644
index f7213977316..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9InstructionDecoder.java
+++ /dev/null
@@ -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.sparc;
-
-interface V9InstructionDecoder extends /* imports */ SPARCV9Opcodes {
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9IntRegisterBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9IntRegisterBranchDecoder.java
deleted file mode 100644
index ad8057316b7..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9IntRegisterBranchDecoder.java
+++ /dev/null
@@ -1,37 +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 V9IntRegisterBranchDecoder extends V9RegisterBranchDecoder {
- static final String integerRegisterConditionNames[] = {
- null, "brz", "brlez", "brlz", null, "brnz", "brgz", "brgez"
- };
-
- String getRegisterConditionName(int index) {
- return integerRegisterConditionNames[index];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9IntegerBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9IntegerBranchDecoder.java
deleted file mode 100644
index f4a70170b81..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9IntegerBranchDecoder.java
+++ /dev/null
@@ -1,36 +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 V9IntegerBranchDecoder extends V9CCBranchDecoder {
- String getConditionName(int conditionCode, boolean isAnnuled) {
- return isAnnuled ? integerAnnuledConditionNames[conditionCode]
- : integerConditionNames[conditionCode];
- }
-
- int getConditionFlag(int instruction) {
- return ((BPcc_CC_MASK & instruction) >>> BPcc_CC_START_BIT) + icc;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9MOVccDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9MOVccDecoder.java
deleted file mode 100644
index 665c96513d8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9MOVccDecoder.java
+++ /dev/null
@@ -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.*;
-
-class V9MOVccDecoder extends V9CMoveDecoder {
- private static String getMoveCCName(int conditionCode, int conditionFlag) {
- return "mov" + getConditionName(conditionCode, conditionFlag);
- }
-
- private static int getMoveConditionFlag(int instruction) {
- boolean cc2Bit = (instruction & CMOVE_CC2_MASK) != 0;
- int conditionFlag = (instruction & CMOVE_CC0_CC1_MASK) >>> CMOVE_CC_START_BIT;
- if (cc2Bit) conditionFlag |= (0x4); // 100;
- return conditionFlag;
- }
-
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int conditionFlag = getMoveConditionFlag(instruction);
- if (conditionFlag == CFLAG_RESERVED1 || conditionFlag == CFLAG_RESERVED2) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- int rdNum = getDestinationRegister(instruction);
- SPARCRegister rd = SPARCRegisters.getRegister(rdNum);
- int conditionCode = getMoveConditionCode(instruction);
- ImmediateOrRegister source = getCMoveSource(instruction, 11);
- String name = getMoveCCName(conditionCode, conditionFlag);
- instr = v9factory.newV9MOVccInstruction(name, conditionCode, conditionFlag, source, rd);
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9MOVrDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9MOVrDecoder.java
deleted file mode 100644
index d5afacb0dd3..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9MOVrDecoder.java
+++ /dev/null
@@ -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 V9MOVrDecoder extends V9CMoveDecoder {
- private static final String regConditionNames[] = {
- null, "movrz", "movrlez", "movrlz", null, "movrnz", "movrgz", "movrgez"
- };
-
- private static String getMOVrName(int conditionCode) {
- return regConditionNames[conditionCode];
- }
-
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int regConditionCode = getRegisterConditionCode(instruction);
- String name = getMOVrName(regConditionCode);
- if (name == null) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- int rdNum = getDestinationRegister(instruction);
- SPARCRegister rd = SPARCRegisters.getRegister(rdNum);
- SPARCRegister rs1 = SPARCRegisters.getRegister(getSourceRegister1(instruction));
- ImmediateOrRegister operand2 = getCMoveSource(instruction, 10);
- instr = v9factory.newV9MOVrInstruction(name, rs1, operand2, rd, regConditionCode);
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PopcDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PopcDecoder.java
deleted file mode 100644
index 44ffd52e57c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PopcDecoder.java
+++ /dev/null
@@ -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 V9PopcDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- int rs1Num = getSourceRegister1(instruction);
- Instruction instr = null;
- // in POPC, rs1 should be zero. see page 205 - A.41 Population Count
- if (rs1Num != 0) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- SPARCRegister rd = SPARCRegisters.getRegister(getDestinationRegister(instruction));
- instr = v9factory.newV9PopcInstruction(getOperand2(instruction), rd);
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PrefetchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PrefetchDecoder.java
deleted file mode 100644
index 75593ba83d2..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PrefetchDecoder.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2002, 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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-class V9PrefetchDecoder extends MemoryInstructionDecoder
- implements V9InstructionDecoder {
- V9PrefetchDecoder() {
- // Fake the destination with an integer type so we can get fcn from rd
- super(PREFETCH, "prefetch", RTLDT_SIGNED_WORD);
- }
-
- Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- return v9factory.newV9PrefetchInstruction(name, addr, rd.getNumber());
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PrivilegedReadWriteDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PrivilegedReadWriteDecoder.java
deleted file mode 100644
index 20840faf01a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9PrivilegedReadWriteDecoder.java
+++ /dev/null
@@ -1,34 +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 V9PrivilegedReadWriteDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- static boolean isLegalPrivilegedRegister(int reg) {
- return (reg > -1 && reg < 16) || reg == 31;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9RdprDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9RdprDecoder.java
deleted file mode 100644
index 4318c3efd2f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9RdprDecoder.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-class V9RdprDecoder extends V9PrivilegedReadWriteDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int prNum = getSourceRegister1(instruction);
- if (isLegalPrivilegedRegister(prNum)) {
- SPARCRegister rd = SPARCRegisters.getRegister(getDestinationRegister(instruction));
- instr = v9factory.newV9RdprInstruction(prNum, rd);
- } else {
- instr = v9factory.newIllegalInstruction(instruction);
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9ReadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9ReadDecoder.java
deleted file mode 100644
index e4b99e2dbe8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9ReadDecoder.java
+++ /dev/null
@@ -1,66 +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 V9ReadDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int specialRegNum = getSourceRegister1(instruction);
-
- // rs1 values 1, 7-14 are reserved - see page 214, A.44 Read State Register.
- if (specialRegNum == 1 || (specialRegNum > 6 && specialRegNum < 15)) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- int rdNum = getDestinationRegister(instruction);
- if (specialRegNum == 15) {
- // may be stbar, member or illegal
- if (rdNum == 0) {
- boolean iBit = isIBitSet(instruction);
- if (iBit) {
- instr = v9factory.newV9MembarInstruction((instruction & MMASK_MASK) >>> MMASK_START_BIT,
- (instruction & CMASK_MASK) >>> CMASK_START_BIT);
- } else {
- instr = v9factory.newStbarInstruction();
- }
- } else { // rd != 0 && rs1 == 15
- instr = v9factory.newIllegalInstruction(instruction);
- }
- } else {
- int asrRegNum = -1;
- if (specialRegNum > 15){
- asrRegNum = specialRegNum;
- specialRegNum = SPARCV9SpecialRegisters.ASR;
- }
- SPARCRegister rd = SPARCRegisters.getRegister(rdNum);
- instr = v9factory.newV9ReadInstruction(specialRegNum, asrRegNum, rd);
- }
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9RegisterBranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9RegisterBranchDecoder.java
deleted file mode 100644
index 60c81fe7a1e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9RegisterBranchDecoder.java
+++ /dev/null
@@ -1,60 +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 V9RegisterBranchDecoder extends V9BranchDecoder {
- static int getDisp16(int instruction) {
- int offset = (DISP_16_LO_MASK & instruction) |
- ((DISP_16_HI_MASK & instruction) >>> (DISP_16_HI_START_BIT - DISP_16_LO_NUMBITS));
-
- // sign extend and word align
- offset = extractSignedIntFromNBits(offset, 16);
- offset <<= 2;
-
- return offset;
- }
-
- String getConditionName(int conditionCode, boolean isAnnuled) {
- return null;
- }
-
- abstract String getRegisterConditionName(int rcond);
-
- public Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- int rcond = (BRANCH_RCOND_MASK & instruction) >>> BRANCH_RCOND_START_BIT;
- if (rcond == BRANCH_RCOND_RESERVED1 || rcond == BRANCH_RCOND_RESERVED2)
- return factory.newIllegalInstruction(instruction);
-
- SPARCRegister rs1 = SPARCRegisters.getRegister(getSourceRegister1(instruction));
- boolean predictTaken = getPredictTaken(instruction);
- boolean annuled = getAnnuledBit(instruction);
- PCRelativeAddress addr = new PCRelativeAddress(getDisp16(instruction));
- String name = getRegisterConditionName(rcond);
- return v9factory.newV9RegisterBranchInstruction(name, addr, annuled, rcond, rs1, predictTaken);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SavedRestoredDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SavedRestoredDecoder.java
deleted file mode 100644
index 5e04ece4148..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SavedRestoredDecoder.java
+++ /dev/null
@@ -1,51 +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 V9SavedRestoredDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int rdNum = getDestinationRegister(instruction);
- // "rd" field is "fcn". Only values 0 and 1 are defined.
- // see page 219 - A.47 Saved and Restored
- switch (rdNum) {
- case 0:
- instr = v9factory.newV9SavedInstruction();
- break;
- case 1:
- instr = v9factory.newV9RestoredInstruction();
- break;
- default:
- instr = v9factory.newIllegalInstruction(instruction);
- break;
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9ShiftDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9ShiftDecoder.java
deleted file mode 100644
index e42a085a08e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9ShiftDecoder.java
+++ /dev/null
@@ -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.sparc;
-
-import sun.jvm.hotspot.asm.*;
-
-class V9ShiftDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- final int op3;
- final String name;
- final int rtlOperation;
-
- V9ShiftDecoder(int op3, String name, int rtlOperation) {
- this.op3 = op3;
- this.name = name;
- this.rtlOperation = rtlOperation;
- }
-
- static boolean isXBitSet(int instruction) {
- return (instruction & X_MASK) != 0;
- }
-
- Instruction decode(int instruction,
- SPARCInstructionFactory factory) {
- SPARCRegister rs1 = SPARCRegisters.getRegister(getSourceRegister1(instruction));
- SPARCRegister rd = SPARCRegisters.getRegister(getDestinationRegister(instruction));
- boolean xBit = isXBitSet(instruction);
- ImmediateOrRegister operand2 = null;
-
- if (isIBitSet(instruction)) {
- // look for 64 bits shift operations.
- int value = instruction & ( xBit ? SHIFT_COUNT_6_MASK : SHIFT_COUNT_5_MASK);
- operand2 = new Immediate(new Short((short) value));
- } else {
- operand2 = SPARCRegisters.getRegister(getSourceRegister2(instruction));
- }
-
- return factory.newShiftInstruction(xBit? name + "x" : name, op3, rtlOperation, rs1, operand2, rd);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SpecialLoadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SpecialLoadDecoder.java
deleted file mode 100644
index 290acb71592..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SpecialLoadDecoder.java
+++ /dev/null
@@ -1,42 +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 V9SpecialLoadDecoder extends MemoryInstructionDecoder
- implements V9InstructionDecoder {
- V9SpecialLoadDecoder(int op3) {
- super(op3, "ld[x]fsr", RTLDT_UNKNOWN);
- }
-
- Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd, SPARCInstructionFactory factory) {
- return factory.newSpecialLoadInstruction(rd == SPARCRegisters.G0? "ld" : "ldx",
- SPARCSpecialRegisters.FSR, -1,
- addr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SpecialStoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SpecialStoreDecoder.java
deleted file mode 100644
index 4b82b8188a0..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9SpecialStoreDecoder.java
+++ /dev/null
@@ -1,42 +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 V9SpecialStoreDecoder extends MemoryInstructionDecoder
- implements V9InstructionDecoder {
- V9SpecialStoreDecoder(int op3) {
- super(op3, "st[x]fsr", RTLDT_UNKNOWN);
- }
-
- Instruction decodeMemoryInstruction(int instruction,
- SPARCRegisterIndirectAddress addr,
- SPARCRegister rd, SPARCInstructionFactory factory) {
- return factory.newSpecialStoreInstruction(rd == SPARCRegisters.G0? "st" : "stx",
- SPARCSpecialRegisters.FSR, -1,
- addr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9WriteDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9WriteDecoder.java
deleted file mode 100644
index 948c0dc5c80..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/V9WriteDecoder.java
+++ /dev/null
@@ -1,61 +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 V9WriteDecoder extends InstructionDecoder
- implements V9InstructionDecoder {
- Instruction decode(int instruction, SPARCInstructionFactory factory) {
- SPARCV9InstructionFactory v9factory = (SPARCV9InstructionFactory) factory;
- Instruction instr = null;
- int specialRegNum = getDestinationRegister(instruction);
-
- // rd values 1, 4,5 7-14 are reserved - see page 244, A.63 Write State Register.
- if (specialRegNum == 1 || specialRegNum == 4 || specialRegNum == 5
- || (specialRegNum > 6 && specialRegNum < 15)) {
- instr = v9factory.newIllegalInstruction(instruction);
- } else {
- int rs1Num = getSourceRegister1(instruction);
- if (specialRegNum == 15) {
- if (isIBitSet(instruction) && rs1Num == 0) {
- instr = v9factory.newV9SirInstruction();
- } else {
- instr = v9factory.newIllegalInstruction(instruction);
- }
- } else {
- int asrRegNum = -1;
- if (specialRegNum > 15) {
- asrRegNum = specialRegNum;
- specialRegNum = SPARCV9SpecialRegisters.ASR;
- }
- SPARCRegister rs1 = SPARCRegisters.getRegister(rs1Num);
- instr = v9factory.newV9WriteInstruction(specialRegNum, asrRegNum, rs1, getOperand2(instruction));
- }
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/WriteDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/WriteDecoder.java
deleted file mode 100644
index 0d760b736d8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/WriteDecoder.java
+++ /dev/null
@@ -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 WriteDecoder extends ReadWriteDecoder {
- WriteDecoder(int specialRegNum) {
- super(specialRegNum);
- }
-
- Instruction decodeReadWrite(int instruction, SPARCInstructionFactory factory,
- int rs1Num, int rdNum) {
- Instruction instr = null;
- int specialReg = specialRegNum;
- if (rdNum == 0)
- specialReg = SPARCSpecialRegisters.Y;
- return factory.newWriteInstruction(specialReg, rdNum,
- SPARCRegisters.getRegister(rs1Num),
- getOperand2(instruction));
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ArithmeticDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ArithmeticDecoder.java
deleted file mode 100644
index 23cc5a611b6..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ArithmeticDecoder.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-import sun.jvm.hotspot.asm.*;
-
-public class ArithmeticDecoder extends InstructionDecoder {
- private int rtlOperation;
-
- public ArithmeticDecoder(String name, int addrMode1, int operandType1, int rtlOperation) {
- super(name, addrMode1, operandType1);
- this.rtlOperation = rtlOperation;
- }
- public ArithmeticDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
- public ArithmeticDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int addrMode3, int operandType3, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2, addrMode3, operandType3);
- this.rtlOperation = rtlOperation;
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- Operand op3 = getOperand3(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newArithmeticInstruction(name, rtlOperation, op1, op2, op3, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/BranchDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/BranchDecoder.java
deleted file mode 100644
index fd47df8740a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/BranchDecoder.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-package sun.jvm.hotspot.asm.x86;
-
-import sun.jvm.hotspot.asm.*;
-import sun.jvm.hotspot.utilities.*;
-
-public class BranchDecoder extends InstructionDecoder {
-
- public BranchDecoder(String name) {
- super(name);
- }
- public BranchDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand addr = getOperand1(bytesArray, operandSize, addrSize);
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(addr == null || addr instanceof X86PCRelativeAddress, "Address should be PC Relative!");
- }
- int size = byteIndex - instrStartIndex;
- return factory.newBranchInstruction(name, (X86PCRelativeAddress)addr, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/CallDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/CallDecoder.java
deleted file mode 100644
index 12a7e1da892..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/CallDecoder.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-package sun.jvm.hotspot.asm.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class CallDecoder extends InstructionDecoder {
- public CallDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand operand = getOperand1(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- Address address;
- if (operand instanceof X86Register) {
- address = new X86RegisterDirectAddress((X86Register)operand);
- } else {
- address = (Address) operand;
- }
- return factory.newCallInstruction(name, address, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ConditionalJmpDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ConditionalJmpDecoder.java
deleted file mode 100644
index bedd5a2aefe..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ConditionalJmpDecoder.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-import sun.jvm.hotspot.utilities.*;
-
-public class ConditionalJmpDecoder extends InstructionDecoder {
-
- public ConditionalJmpDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand addr = getOperand1(bytesArray, operandSize, addrSize);
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(addr instanceof X86PCRelativeAddress, "Address should be PC Relative!");
- }
- return factory.newCondJmpInstruction(name, (X86PCRelativeAddress)addr, byteIndex-instrStartIndex, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPArithmeticDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPArithmeticDecoder.java
deleted file mode 100644
index 74d9e970d1f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPArithmeticDecoder.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class FPArithmeticDecoder extends FPInstructionDecoder {
- private int rtlOperation;
-
- public FPArithmeticDecoder(String name, int addrMode1, int operandType1, int rtlOperation) {
- super(name, addrMode1, operandType1);
- this.rtlOperation = rtlOperation;
- }
- public FPArithmeticDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newFPArithmeticInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPInstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPInstructionDecoder.java
deleted file mode 100644
index 885a3591173..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPInstructionDecoder.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-// basic float instruction decoder class
-public class FPInstructionDecoder extends InstructionDecoder {
-
- public FPInstructionDecoder(String name) {
- super(name);
- }
- public FPInstructionDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
- public FPInstructionDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return new X86FPInstruction(name, op1, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPLoadDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPLoadDecoder.java
deleted file mode 100644
index 630b550b985..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPLoadDecoder.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-class FPLoadDecoder extends FPInstructionDecoder {
- FPLoadDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op = getOperand1(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newFPLoadInstruction(name, op, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPStoreDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPStoreDecoder.java
deleted file mode 100644
index 6939c003c96..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FPStoreDecoder.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-class FPStoreDecoder extends FPInstructionDecoder {
- FPStoreDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op = getOperand1(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newFPStoreInstruction(name, op, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatDecoder.java
deleted file mode 100644
index cedfac4f0f3..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatDecoder.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class FloatDecoder extends FPInstructionDecoder {
-
- public FloatDecoder() {
- super(null);
- }
-
- //Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
- //APPENDIX A - Escape opcodes
-
- /*When ModR/M byte is within 00h to BFh*/
- private static final FPInstructionDecoder floatMapOne[][] = {
- /* d8 */
- {
- new FPArithmeticDecoder("fadds", ADDR_E, v_mode, RTLOP_ADD),
- new FPArithmeticDecoder("fmuls", ADDR_E, v_mode, RTLOP_SMUL),
- new FPInstructionDecoder("fcoms", ADDR_E, v_mode),
- new FPInstructionDecoder("fcomps", ADDR_E, v_mode),
- new FPArithmeticDecoder("fsubs", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fsubrs", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fdivs", ADDR_E, v_mode, RTLOP_SDIV),
- new FPArithmeticDecoder("fdivrs", ADDR_E, v_mode, RTLOP_SDIV)
- },
- /* d9 */
- {
- new FPLoadDecoder("flds", ADDR_E, v_mode),
- null,
- new FPStoreDecoder("fsts", ADDR_E, v_mode),
- new FPStoreDecoder("fstps", ADDR_E, v_mode),
- new FPStoreDecoder("fldenv", ADDR_E, v_mode),
- new FPStoreDecoder("fldcw", ADDR_E, v_mode),
- new FPStoreDecoder("fNstenv", ADDR_E, v_mode),
- new FPStoreDecoder("fNstcw", ADDR_E, v_mode)
- },
- /* da */
- {
- new FPArithmeticDecoder("fiaddl", ADDR_E, v_mode, RTLOP_ADD),
- new FPArithmeticDecoder("fimull", ADDR_E, v_mode, RTLOP_SMUL),
- new FPInstructionDecoder("ficoml", ADDR_E, v_mode),
- new FPInstructionDecoder("ficompl", ADDR_E, v_mode),
- new FPArithmeticDecoder("fisubl", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fisubrl", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fidivl", ADDR_E, v_mode, RTLOP_SDIV),
- new FPArithmeticDecoder("fidivrl", ADDR_E, v_mode, RTLOP_SDIV)
- },
- /* db */
- {
- new FPLoadDecoder("fildl", ADDR_E, v_mode),
- null,
- new FPStoreDecoder("fistl", ADDR_E, v_mode),
- new FPStoreDecoder("fistpl", ADDR_E, v_mode),
- null,
- new FPLoadDecoder("fldt", ADDR_E, v_mode),
- null,
- new FPStoreDecoder("fstpt", ADDR_E, v_mode)
- },
- /* dc */
- {
- new FPArithmeticDecoder("faddl", ADDR_E, v_mode, RTLOP_ADD),
- new FPArithmeticDecoder("fmull", ADDR_E, v_mode, RTLOP_SMUL),
- new FPInstructionDecoder("fcoml", ADDR_E, v_mode),
- new FPInstructionDecoder("fcompl", ADDR_E, v_mode),
- new FPArithmeticDecoder("fsubl", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fsubrl", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fdivl", ADDR_E, v_mode, RTLOP_SDIV),
- new FPArithmeticDecoder("fdivrl", ADDR_E, v_mode, RTLOP_SDIV)
- },
- /* dd */
- {
- new FPLoadDecoder("fldl", ADDR_E, v_mode),
- null,
- new FPStoreDecoder("fstl", ADDR_E, v_mode),
- new FPStoreDecoder("fstpl", ADDR_E, v_mode),
- new FPStoreDecoder("frstor", ADDR_E, v_mode),
- null,
- new FPStoreDecoder("fNsave", ADDR_E, v_mode),
- new FPStoreDecoder("fNstsw", ADDR_E, v_mode)
- },
- /* de */
- {
- new FPArithmeticDecoder("fiadd", ADDR_E, v_mode, RTLOP_ADD),
- new FPArithmeticDecoder("fimul", ADDR_E, v_mode, RTLOP_SMUL),
- new FPInstructionDecoder("ficom", ADDR_E, v_mode),
- new FPInstructionDecoder("ficomp", ADDR_E, v_mode),
- new FPArithmeticDecoder("fisub", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fisubr", ADDR_E, v_mode, RTLOP_SUB),
- new FPArithmeticDecoder("fidiv", ADDR_E, v_mode, RTLOP_SDIV),
- new FPArithmeticDecoder("fidivr", ADDR_E, v_mode, RTLOP_SDIV)
- },
- /* df */
- {
- new FPLoadDecoder("fild", ADDR_E, v_mode),
- null,
- new FPStoreDecoder("fist", ADDR_E, v_mode),
- new FPStoreDecoder("fistp", ADDR_E, v_mode),
- new FPLoadDecoder("fbld", ADDR_E, v_mode),
- new FPLoadDecoder("fildll", ADDR_E, v_mode),
- new FPStoreDecoder("fbstp", ADDR_E, v_mode),
- new FPStoreDecoder("fistpll", ADDR_E, v_mode)
- }
- };
-
- /*When ModR/M byte is outside 00h to BFh*/
- private static final FPInstructionDecoder floatMapTwo[][] = {
-
- /* d8 */
- /*parameter for ADDR_FPREG, 0 means ST(0), 1 means ST at rm value. */
- {
- new FPArithmeticDecoder("fadd", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_ADD),
- new FPArithmeticDecoder("fmul", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SMUL),
- new FPInstructionDecoder("fcom", ADDR_FPREG, 1),
- new FPInstructionDecoder("fcomp", ADDR_FPREG, 1),
- new FPArithmeticDecoder("fsub", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SUB),
- new FPArithmeticDecoder("fsubr", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SUB),
- new FPArithmeticDecoder("fdiv", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SDIV),
- new FPArithmeticDecoder("fdivr", ADDR_FPREG, 0, ADDR_FPREG, 1, RTLOP_SDIV)
- },
- /* d9 */
- {
- new FPLoadDecoder("fld", ADDR_FPREG, 1),
- new FPInstructionDecoder("fxch", ADDR_FPREG, 1),
- new FloatGRPDecoder(null, 0),
- null,
- new FloatGRPDecoder(null, 1),
- new FloatGRPDecoder(null, 2),
- new FloatGRPDecoder(null, 3),
- new FloatGRPDecoder(null, 4)
- },
- /* da */
- {
- null,
- null,
- null,
- null,
- null,
- new FloatGRPDecoder(null, 5),
- null,
- null
- },
- /* db */
- {
- null,
- null,
- null,
- null,
- new FloatGRPDecoder(null, 6),
- null,
- null,
- null
- },
- /* dc */
- {
- new FPArithmeticDecoder("fadd", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_ADD),
- new FPArithmeticDecoder("fmul", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SMUL),
- null,
- null,
- new FPArithmeticDecoder("fsub", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
- new FPArithmeticDecoder("fsubr",ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
- new FPArithmeticDecoder("fdiv", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV),
- new FPArithmeticDecoder("fdivr", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV)
- },
- /* dd */
- {
- new FPInstructionDecoder("ffree", ADDR_FPREG, 1),
- null,
- new FPStoreDecoder("fst", ADDR_FPREG, 1),
- new FPStoreDecoder("fstp", ADDR_FPREG, 1),
- new FPInstructionDecoder("fucom", ADDR_FPREG, 1),
- new FPInstructionDecoder("fucomp", ADDR_FPREG, 1),
- null,
- null
- },
- /* de */
- {
- new FPArithmeticDecoder("faddp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_ADD),
- new FPArithmeticDecoder("fmulp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SMUL),
- null,
- new FloatGRPDecoder(null, 7),
- new FPArithmeticDecoder("fsubrp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
- new FPArithmeticDecoder("fsubp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SUB),
- new FPArithmeticDecoder("fdivrp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV),
- new FPArithmeticDecoder("fdivp", ADDR_FPREG, 1, ADDR_FPREG, 0, RTLOP_SDIV)
- },
- /* df */
- {
- null,
- null,
- null,
- null,
- new FloatGRPDecoder(null, 7),
- null,
- null,
- null
- }
- };
-
- public Instruction decode(byte[] bytesArray, int index, int instrStartIndex, int segmentOverride, int prefixes, X86InstructionFactory factory) {
- this.byteIndex = index;
- this.instrStartIndex = instrStartIndex;
- this.prefixes = prefixes;
-
- int ModRM = readByte(bytesArray, byteIndex);
- int reg = (ModRM >> 3) & 7;
- int regOrOpcode = (ModRM >> 3) & 7;
- int rm = ModRM & 7;
-
- int floatOpcode = InstructionDecoder.readByte(bytesArray, instrStartIndex);
- FPInstructionDecoder instrDecoder = null;
-
- if(ModRM < 0xbf) {
- instrDecoder = floatMapOne[floatOpcode - 0xd8][reg];
- }
- else {
- instrDecoder = floatMapTwo[floatOpcode - 0xd8][reg];
- }
-
- Instruction instr = null;
- if(instrDecoder != null) {
- instr = instrDecoder.decode(bytesArray, byteIndex, instrStartIndex, segmentOverride, prefixes, factory);
- byteIndex = instrDecoder.getCurrentIndex();
- } else {
- instr = factory.newIllegalInstruction();
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatGRPDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatGRPDecoder.java
deleted file mode 100644
index 95422b7716a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/FloatGRPDecoder.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class FloatGRPDecoder extends FPInstructionDecoder {
-
- final private int number;
-
- //Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
- //APPENDIX A - Escape opcodes
-
- private static final FPInstructionDecoder floatGRPMap[][] = {
- /* d9_2 */
- {
- new FPInstructionDecoder("fnop"),
- null,
- null,
- null,
- null,
- null,
- null,
- null
- },
- /* d9_4 */
- {
- new FPInstructionDecoder("fchs"),
- new FPInstructionDecoder("fabs"),
- null,
- null,
- new FPInstructionDecoder("ftst"),
- new FPInstructionDecoder("fxam"),
- null,
- null
- },
- /* d9_5 */
- {
- new FPInstructionDecoder("fld1"),
- new FPInstructionDecoder("fldl2t"),
- new FPInstructionDecoder("fldl2e"),
- new FPInstructionDecoder("fldpi"),
- new FPInstructionDecoder("fldlg2"),
- new FPInstructionDecoder("fldln2"),
- new FPInstructionDecoder("fldz"),
- null
- },
- /* d9_6 */
- {
- new FPInstructionDecoder("f2xm1"),
- new FPInstructionDecoder("fyl2x"),
- new FPInstructionDecoder("fptan"),
- new FPInstructionDecoder("fpatan"),
- new FPInstructionDecoder("fxtract"),
- new FPInstructionDecoder("fprem1"),
- new FPInstructionDecoder("fdecstp"),
- new FPInstructionDecoder("fincstp")
- },
- /* d9_7 */
- {
- new FPInstructionDecoder("fprem"),
- new FPInstructionDecoder("fyl2xp1"),
- new FPInstructionDecoder("fsqrt"),
- new FPInstructionDecoder("fsincos"),
- new FPInstructionDecoder("frndint"),
- new FPInstructionDecoder("fscale"),
- new FPInstructionDecoder("fsin"),
- new FPInstructionDecoder("fcos")
- },
- /* da_5 */
- {
- null,
- new FPInstructionDecoder("fucompp"),
- null,
- null,
- null,
- null,
- null,
- null
- },
- /* db_4 */
- {
- new FPInstructionDecoder("feni(287 only)"),
- new FPInstructionDecoder("fdisi(287 only)"),
- new FPInstructionDecoder("fNclex"),
- new FPInstructionDecoder("fNinit"),
- new FPInstructionDecoder("fNsetpm(287 only)"),
- null,
- null,
- null
- },
- /* de_3 */
- {
- null,
- new FPInstructionDecoder("fcompp"),
- null,
- null,
- null,
- null,
- null,
- null
- },
- /* df_4 */
- {
- new FPInstructionDecoder("fNstsw"),
- null,
- null,
- null,
- null,
- null,
- null,
- null
- }
- };
-
- public FloatGRPDecoder(String name, int number) {
- super(name);
- this.number = number;
- }
-
- public Instruction decode(byte[] bytesArray, int index, int instrStartIndex, int segmentOverride, int prefixes, X86InstructionFactory factory) {
- this.byteIndex = index;
- this.instrStartIndex = instrStartIndex;
- this.prefixes = prefixes;
-
- int ModRM = readByte(bytesArray, byteIndex);
- int rm = ModRM & 7;
-
- FPInstructionDecoder instrDecoder = null;
- instrDecoder = floatGRPMap[number][rm];
-
- Instruction instr = null;
- if(instrDecoder != null) {
- instr = instrDecoder.decode(bytesArray, byteIndex, instrStartIndex, segmentOverride, prefixes, factory);
- byteIndex = instrDecoder.getCurrentIndex();
- } else {
- instr = factory.newIllegalInstruction();
- }
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/GRPDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/GRPDecoder.java
deleted file mode 100644
index 479ac7abdf8..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/GRPDecoder.java
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class GRPDecoder extends InstructionDecoder {
-
- final private int number;
- //Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
- //APPENDIX A - Table A-4. Opcode Extensions for One and Two-byte Opcodes by Group Number.
- private static final InstructionDecoder grpTable[][] = {
- {
- new ArithmeticDecoder("addb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_ADD),
- new LogicalDecoder("orb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_OR),
- new ArithmeticDecoder("adcb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_ADDC),
- new ArithmeticDecoder("sbbb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SUBC),
- new LogicalDecoder("andb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_AND),
- new ArithmeticDecoder("subb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SUB),
- new LogicalDecoder("xorb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_XOR),
- new InstructionDecoder("cmpb", ADDR_E, b_mode, ADDR_I, b_mode)
- },
- {
- new ArithmeticDecoder("addS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_ADD),
- new LogicalDecoder("orS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_OR),
- new ArithmeticDecoder("adcS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_ADDC),
- new ArithmeticDecoder("sbbS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_SUBC),
- new LogicalDecoder("andS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_AND),
- new ArithmeticDecoder("subS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_SUB),
- new LogicalDecoder("xorS", ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_XOR),
- new InstructionDecoder("cmpS", ADDR_E, v_mode, ADDR_I, v_mode)
- },
- {
- new ArithmeticDecoder("addS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_ADD), /*note: sIb here*/
- new LogicalDecoder("orS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_OR),
- new ArithmeticDecoder("adcS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_ADDC),
- new ArithmeticDecoder("sbbS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SUBC),
- new LogicalDecoder("andS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_AND),
- new ArithmeticDecoder("subS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SUB),
- new LogicalDecoder("xorS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_XOR),
- new InstructionDecoder("cmpS", ADDR_E, v_mode, ADDR_I, b_mode)
- },
- {
- new RotateDecoder("rolb", ADDR_E, b_mode, ADDR_I, b_mode),
- new RotateDecoder("rorb", ADDR_E, b_mode, ADDR_I, b_mode),
- new RotateDecoder("rclb", ADDR_E, b_mode, ADDR_I, b_mode),
- new RotateDecoder("rcrb", ADDR_E, b_mode, ADDR_I, b_mode),
- new ShiftDecoder("shlb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SLL),
- new ShiftDecoder("shrb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- new ShiftDecoder("sarb", ADDR_E, b_mode, ADDR_I, b_mode, RTLOP_SRA),
- },
- {
- new RotateDecoder("rolS", ADDR_E, v_mode, ADDR_I, b_mode),
- new RotateDecoder("rorS", ADDR_E, v_mode, ADDR_I, b_mode),
- new RotateDecoder("rclS", ADDR_E, v_mode, ADDR_I, b_mode),
- new RotateDecoder("rcrS", ADDR_E, v_mode, ADDR_I, b_mode),
- new ShiftDecoder("shlS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SLL),
- new ShiftDecoder("shrS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- new ShiftDecoder("sarS", ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SRA)
- },
- {
- new RotateDecoder("rolb", ADDR_E, b_mode),
- new RotateDecoder("rorb", ADDR_E, b_mode),
- new RotateDecoder("rclb", ADDR_E, b_mode),
- new RotateDecoder("rcrb", ADDR_E, b_mode),
- new ShiftDecoder("shlb", ADDR_E, b_mode, RTLOP_SLL),
- new ShiftDecoder("shrb", ADDR_E, b_mode, RTLOP_SRL),
- null,
- new ShiftDecoder("sarb", ADDR_E, b_mode, RTLOP_SRA)
- },
- {
- new RotateDecoder("rolS", ADDR_E, v_mode),
- new RotateDecoder("rorS", ADDR_E, v_mode),
- new RotateDecoder("rclS", ADDR_E, v_mode),
- new RotateDecoder("rcrS", ADDR_E, v_mode),
- new ShiftDecoder("shlS", ADDR_E, v_mode, RTLOP_SLL),
- new ShiftDecoder("shrS", ADDR_E, v_mode, RTLOP_SRL),
- null,
- new ShiftDecoder("sarS", ADDR_E, v_mode, RTLOP_SRA)
- },
- {
- new RotateDecoder("rolb", ADDR_E, b_mode, ADDR_REG, CL),
- new RotateDecoder("rorb", ADDR_E, b_mode, ADDR_REG, CL),
- new RotateDecoder("rclb", ADDR_E, b_mode, ADDR_REG, CL),
- new RotateDecoder("rcrb", ADDR_E, b_mode, ADDR_REG, CL),
- new ShiftDecoder( "shlb", ADDR_E, b_mode, ADDR_REG, CL, RTLOP_SLL),
- new ShiftDecoder("shrb", ADDR_E, b_mode, ADDR_REG, CL, RTLOP_SRL),
- null,
- new ShiftDecoder("sarb", ADDR_E, b_mode, ADDR_REG, CL, RTLOP_SRA)
- },
- {
- new RotateDecoder("rolS", ADDR_E, v_mode, ADDR_REG, CL),
- new RotateDecoder("rorS", ADDR_E, v_mode, ADDR_REG, CL),
- new RotateDecoder("rclS", ADDR_E, v_mode, ADDR_REG, CL),
- new RotateDecoder("rcrS", ADDR_E, v_mode, ADDR_REG, CL),
- new ShiftDecoder("shlS", ADDR_E, v_mode, ADDR_REG, CL, RTLOP_SLL),
- new ShiftDecoder("shrS", ADDR_E, v_mode, ADDR_REG, CL, RTLOP_SRL),
- null,
- new ShiftDecoder("sarS", ADDR_E, v_mode, ADDR_REG, CL, RTLOP_SRA)
- },
- {
- new InstructionDecoder("testb", ADDR_E, b_mode, ADDR_I, b_mode),
- null, /*new InstructionDecoder("(bad)", ADDR_E, b_mode)*/
- new LogicalDecoder("notb", ADDR_E, b_mode, RTLOP_NOT),
- new InstructionDecoder("negb", ADDR_E, b_mode),
- new ArithmeticDecoder("mulb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_UMUL),
- new ArithmeticDecoder("imulb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_SMUL),
- new ArithmeticDecoder("divb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_UDIV),
- new ArithmeticDecoder("idivb", ADDR_REG, AL, ADDR_E, b_mode, RTLOP_SDIV)
- },
- {
- new InstructionDecoder("testS", ADDR_E, v_mode, ADDR_I, v_mode),
- null,
- new LogicalDecoder("notS", ADDR_E, v_mode, RTLOP_NOT),
- new InstructionDecoder("negS", ADDR_E, v_mode),
- new ArithmeticDecoder("mulS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_UMUL),
- new ArithmeticDecoder("imulS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_SMUL),
- new ArithmeticDecoder("divS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_SDIV),
- new ArithmeticDecoder("idivS", ADDR_REG, EAX, ADDR_E, v_mode, RTLOP_SDIV)
- },
- {
- new ArithmeticDecoder("incb", ADDR_E, b_mode, RTLOP_ADD),
- new ArithmeticDecoder("decb", ADDR_E, b_mode, RTLOP_SUB),
- null,
- null,
- null,
- null,
- null,
- null
- },
- {
- new ArithmeticDecoder("incS", ADDR_E, v_mode, RTLOP_ADD),
- new ArithmeticDecoder("decS", ADDR_E, v_mode, RTLOP_SUB),
- new CallDecoder("call", ADDR_E, v_mode),
- new CallDecoder("lcall", ADDR_E, p_mode),
- new JmpDecoder("jmp", ADDR_E, v_mode),
- new JmpDecoder("ljmp", ADDR_E, p_mode),
- new InstructionDecoder("pushS", ADDR_E, v_mode),
- null
- },
- {
- new InstructionDecoder("sldt", ADDR_E, w_mode),
- new InstructionDecoder("str", ADDR_E, w_mode),
- new InstructionDecoder("lldt", ADDR_E, w_mode),
- new InstructionDecoder("ltr", ADDR_E, w_mode),
- new InstructionDecoder("verr", ADDR_E, w_mode),
- new InstructionDecoder("verw", ADDR_E, w_mode),
- null,
- null
- },
- {
- new InstructionDecoder("sgdt", ADDR_E, w_mode),
- new InstructionDecoder("sidt", ADDR_E, w_mode),
- new InstructionDecoder("lgdt", ADDR_E, w_mode),
- new InstructionDecoder("lidt", ADDR_E, w_mode),
- new InstructionDecoder("smsw", ADDR_E, w_mode),
- null,
- new InstructionDecoder("lmsw", ADDR_E, w_mode),
- new InstructionDecoder("invlpg", ADDR_E, w_mode)
- },
- {
- null,
- null,
- null,
- null,
- new InstructionDecoder("btS", ADDR_E, v_mode, ADDR_I, b_mode),
- new InstructionDecoder("btsS", ADDR_E, v_mode, ADDR_I, b_mode),
- new InstructionDecoder("btrS", ADDR_E, v_mode, ADDR_I, b_mode),
- new InstructionDecoder("btcS", ADDR_E, v_mode, ADDR_I, b_mode)
- },
- /*16*/
- {
- null,
- new SSEInstructionDecoder("cmpxch8b", ADDR_W, q_mode),
- null,
- null,
- null,
- null,
- null,
- null
- },
- /*17*/
- {
- null,
- null,
- new SSEShiftDecoder("psrlw", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- new SSEShiftDecoder("psraw", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRA),
- null,
- new SSEShiftDecoder("psllw", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SLL),
- null
- },
- /*18*/
- {
- null,
- null,
- new SSEShiftDecoder("psrld", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- new SSEShiftDecoder("psrad", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRA),
- null,
- new SSEShiftDecoder("pslld", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SLL),
- null
- },
- /*19*/
- {
- null,
- null,
- new SSEShiftDecoder("psrlq", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- null,
- null,
- new SSEShiftDecoder("psllq", ADDR_P, q_mode, ADDR_I, b_mode, RTLOP_SLL),
- null
- },
- /*20 - Grp15*/
- {
- new SSEInstructionDecoder("fxsave"),
- new SSEInstructionDecoder("fxrstor"),
- new SSEInstructionDecoder("ldmxcsr"),
- new SSEInstructionDecoder("stmxcsr"),
- null,
- null,
- null,
- new SSEInstructionDecoder("clflush")
- },
- /*21 - Grp16*/
- {
- new SSEInstructionDecoder("prefetchnta"),
- new SSEInstructionDecoder("prefetcht0"),
- new SSEInstructionDecoder("prefetcht1"),
- new SSEInstructionDecoder("prefetcht2"),
- null,
- null,
- null,
- null
- },
- /*22 - Grp12:66*/
- {
- null,
- null,
- new SSEShiftDecoder("psrlw", ADDR_P, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- new SSEShiftDecoder("psraw", ADDR_P, dq_mode, ADDR_I, b_mode, RTLOP_SRA),
- null,
- new SSEShiftDecoder("psllw", ADDR_P, dq_mode, ADDR_I, b_mode, RTLOP_SLL),
- null
- },
- /*23 - Grp13:66*/
- {
- null,
- null,
- new SSEShiftDecoder("psrld", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- new SSEShiftDecoder("psrad", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRA),
- null,
- new SSEShiftDecoder("pslld", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SLL),
- null
- },
- /*24 - - Grp14:66*/
- {
- null,
- null,
- new SSEShiftDecoder("psrlq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
- new SSEShiftDecoder("psrldq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SRL),
- null,
- null,
- new SSEShiftDecoder("psllq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SLL),
- new SSEShiftDecoder("psllq", ADDR_W, dq_mode, ADDR_I, b_mode, RTLOP_SLL)
- }
-};
-
- public GRPDecoder(String name, int number) {
- super(name);
- this.number = number;
- }
-
- public Instruction decode(byte[] bytesArray, int index, int instrStartIndex, int segmentOverride, int prefixes, X86InstructionFactory factory) {
- this.byteIndex = index;
- this.instrStartIndex = instrStartIndex;
- this.prefixes = prefixes;
-
- int ModRM = readByte(bytesArray, byteIndex);
- int reg = (ModRM >> 3) & 7;
-
- InstructionDecoder instrDecoder = grpTable[number][reg];
- Instruction instr = null;
- if(instrDecoder != null) {
- instr = instrDecoder.decode(bytesArray, byteIndex, instrStartIndex, segmentOverride, prefixes, factory);
- byteIndex = instrDecoder.getCurrentIndex();
- } else {
- instr = factory.newIllegalInstruction();
- }
-
- return instr;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/InstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/InstructionDecoder.java
deleted file mode 100644
index 87f6e10a43c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/InstructionDecoder.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-// basic instruction decoder class
-public class InstructionDecoder implements /* imports */ X86Opcodes , RTLDataTypes, RTLOperations {
-
- protected String name;
- protected int addrMode1;
- protected int operandType1;
- protected int addrMode2;
- protected int operandType2;
- protected int addrMode3;
- protected int operandType3;
-
- private int mod;
- private int regOrOpcode;
- private int rm;
- protected int prefixes;
-
- protected int byteIndex;
- protected int instrStartIndex;
-
- public InstructionDecoder(String name) {
- this.name = name;
- this.operandType1 = INVALID_OPERANDTYPE;
- this.operandType2 = INVALID_OPERANDTYPE;
- this.operandType3 = INVALID_OPERANDTYPE;
- this.addrMode1 = INVALID_ADDRMODE;
- this.addrMode2 = INVALID_ADDRMODE;
- this.addrMode3 = INVALID_ADDRMODE;
- }
- public InstructionDecoder(String name, int addrMode1, int operandType1) {
- this(name);
- this.addrMode1 = addrMode1;
- this.operandType1 = operandType1;
- }
- public InstructionDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2) {
- this(name, addrMode1, operandType1);
- this.addrMode2 = addrMode2;
- this.operandType2 = operandType2;
- }
- public InstructionDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2,
- int addrMode3, int operandType3) {
- this(name, addrMode1, operandType1, addrMode2, operandType2);
- this.addrMode3 = addrMode3;
- this.operandType3 = operandType3;
- }
- // "operand1"
- protected Operand getOperand1(byte[] bytesArray, boolean operandSize, boolean addrSize) {
- if( (addrMode1 != INVALID_ADDRMODE) && (operandType1 != INVALID_OPERANDTYPE) )
- return getOperand(bytesArray, addrMode1, operandType1, operandSize, addrSize);
- else
- return null;
- }
-
- // "operand2"
- protected Operand getOperand2(byte[] bytesArray, boolean operandSize, boolean addrSize) {
- if( (addrMode2 != INVALID_ADDRMODE) && (operandType2 != INVALID_OPERANDTYPE) )
- return getOperand(bytesArray, addrMode2, operandType2, operandSize, addrSize);
- else
- return null;
- }
-
- // "operand3"
- protected Operand getOperand3(byte[] bytesArray, boolean operandSize, boolean addrSize) {
- if( (addrMode3 != INVALID_ADDRMODE) && (operandType3 != INVALID_OPERANDTYPE) )
- return getOperand(bytesArray, addrMode3, operandType3, operandSize, addrSize);
- else
- return null;
- }
-
- static int readInt32(byte[] bytesArray, int index) {
- int ret = 0;
- ret = readByte(bytesArray, index);
- ret |= readByte(bytesArray, index+1) << 8;
- ret |= readByte(bytesArray, index+2) << 16;
- ret |= readByte(bytesArray, index+3) << 24;
- return ret;
- }
- static int readInt16(byte[] bytesArray, int index) {
- int ret = 0;
- ret = readByte(bytesArray, index);
- ret |= readByte(bytesArray, index+1) << 8;
- return ret;
- }
- static int readByte(byte[] bytesArray, int index) {
- int ret = 0;
- if (index < bytesArray.length) {
- ret = (int)bytesArray[index];
- ret = ret & 0xff;
- }
- return ret;
- }
- private boolean isModRMPresent(int addrMode) {
- if( (addrMode == ADDR_E) || (addrMode == ADDR_G) || (addrMode == ADDR_FPREG) || (addrMode == ADDR_Q) || (addrMode == ADDR_W) )
- return true;
- else
- return false;
- }
- public int getCurrentIndex() {
- return byteIndex;
- }
-
- public Instruction decode(byte[] bytesArray, int index, int instrStartIndex, int segmentOverride, int prefixes, X86InstructionFactory factory) {
- this.byteIndex = index;
- this.instrStartIndex = instrStartIndex;
- this.prefixes = prefixes;
- boolean operandSize; //operand-size prefix
- boolean addrSize; //address-size prefix
- if ( ( (prefixes & PREFIX_DATA) ^ segmentOverride ) == 1)
- operandSize = true;
- else
- operandSize = false;
- if ( ((prefixes & PREFIX_ADR) ^ segmentOverride) == 1)
- addrSize = true;
- else
- addrSize = false;
- this.name = getCorrectOpcodeName(name, prefixes, operandSize, addrSize);
-
- //Fetch the mod/reg/rm byte only if it is present.
- if( isModRMPresent(addrMode1) || isModRMPresent(addrMode2) || isModRMPresent(addrMode3) ) {
-
- int ModRM = readByte(bytesArray, byteIndex);
- byteIndex++;
- mod = (ModRM >> 6) & 3;
- regOrOpcode = (ModRM >> 3) & 7;
- rm = ModRM & 7;
- }
- return decodeInstruction(bytesArray, operandSize, addrSize, factory);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- Operand op3 = getOperand3(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newGeneralInstruction(name, op1, op2, op3, size, prefixes);
- }
-
- // capital letters in template are macros
- private String getCorrectOpcodeName(String oldName, int prefixes, boolean operandSize, boolean addrSize) {
- StringBuffer newName = new StringBuffer(oldName);
- int index = 0;
- for(index=0; index> 6) & 3;
- index = (sib >> 3) & 7;
- base = sib & 7;
- }
-
- switch (mod) {
- case 0:
- switch(rm) {
- case 4:
- if(base == 5) {
- disp = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- if (index != 4) {
- op = new X86RegisterIndirectAddress(segReg, null, X86Registers.getRegister32(index), disp, scale);
- } else {
- op = new X86RegisterIndirectAddress(segReg, null, null, disp, scale);
- }
- }
- else {
- if (index != 4) {
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), X86Registers.getRegister32(index), 0, scale);
- } else {
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), null, 0, scale);
- }
- }
- break;
- case 5:
- disp = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- //Create an Address object only with displacement
- op = new X86RegisterIndirectAddress(segReg, null, null, disp);
- break;
- default:
- base = rm;
- //Create an Address object only with base
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), null, 0);
- break;
- }
- break;
- case 1:
- disp = (byte)readByte(bytesArray, byteIndex);
- byteIndex++;
- if (rm !=4) {
- base = rm;
- //Address with base and disp only
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), null, disp);
- } else {
- if (index != 4) {
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), X86Registers.getRegister32(index), disp, scale);
- } else {
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), null, disp, scale);
- }
- }
- break;
- case 2:
- disp = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- if (rm !=4) {
- base = rm;
- //Address with base and disp
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), null, disp);
- } else if (index != 4) {
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), X86Registers.getRegister32(index), disp, scale);
- } else {
- op = new X86RegisterIndirectAddress(segReg, X86Registers.getRegister32(base), null, disp, scale);
- }
- break;
- }
- }
- break;
-
- case ADDR_I:
- switch (operandType) {
- case b_mode:
- op = new Immediate(new Integer(readByte(bytesArray, byteIndex)));
- byteIndex++;
- break;
- case w_mode:
- op = new Immediate(new Integer(readInt16(bytesArray, byteIndex)));
- byteIndex += 2;
- break;
- case v_mode:
- if (operandSize == true) { //Operand size prefix is present
- op = new Immediate(new Integer(readInt32(bytesArray, byteIndex)));
- byteIndex += 4;
- } else {
- op = new Immediate(new Integer(readInt16(bytesArray, byteIndex)));
- byteIndex += 2;
- }
- break;
- default:
- break;
- }
- break;
- case ADDR_REG: //registers
- switch(operandType) {
- case EAX:
- case ECX:
- case EDX:
- case EBX:
- case ESP:
- case EBP:
- case ESI:
- case EDI:
- if(operandSize == true) {
- op = X86Registers.getRegister32(operandType - EAX);
- }
- else {
- op = X86Registers.getRegister16(operandType - EAX);
- }
- break;
- case AX:
- case CX:
- case DX:
- case BX:
- case SP:
- case BP:
- case SI:
- case DI:
- op = X86Registers.getRegister16(operandType - AX);
- break;
- case AL:
- case CL:
- case DL:
- case BL:
- case AH:
- case CH:
- case DH:
- case BH:
- op = X86Registers.getRegister8(operandType - AL);
- break;
- case ES: //ES, CS, SS, DS, FS, GS
- case CS:
- case SS:
- case DS:
- case FS:
- case GS:
- op = X86SegmentRegisters.getSegmentRegister(operandType - ES);
- break;
- }
- break;
- case ADDR_DIR: //segment and offset
- long segment = 0;
- long offset = 0;
- switch (operandType) {
- case p_mode:
- if (addrSize == true) {
- offset = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- segment = readInt16(bytesArray, byteIndex);
- byteIndex += 2;
- } else {
- offset = readInt16(bytesArray, byteIndex);
- byteIndex += 2;
- segment = readInt16(bytesArray, byteIndex);
- byteIndex += 2;
- }
- op = new X86DirectAddress(segment, offset); //with offset
- break;
- case v_mode:
- if (addrSize == true) {
- offset = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- } else {
- offset = readInt16(bytesArray, byteIndex);
- byteIndex += 2;
- }
- op = new X86DirectAddress(offset); //with offset
- break;
- default:
- break;
- }
- break;
- case ADDR_G:
- switch (operandType) {
- case b_mode:
- op = X86Registers.getRegister8(regOrOpcode);
- break;
- case w_mode:
- op = X86Registers.getRegister16(regOrOpcode);
- break;
- case d_mode:
- op = X86Registers.getRegister32(regOrOpcode);
- break;
- case v_mode:
- if (operandSize == true)
- op = X86Registers.getRegister32(regOrOpcode);
- else
- op = X86Registers.getRegister16(regOrOpcode);
- break;
- default:
- break;
- }
- break;
- case ADDR_SEG:
- op = X86SegmentRegisters.getSegmentRegister(regOrOpcode);
- break;
- case ADDR_OFF:
- int off = 0;
- if (addrSize == true) {
- off = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- }
- else {
- off = readInt16(bytesArray, byteIndex);
- byteIndex += 2;
- }
- op = new X86DirectAddress((long)off);
- break;
- case ADDR_J:
- long disp = 0;
- //The effective address is Instruction pointer + relative offset
- switch(operandType) {
- case b_mode:
- disp = (byte)readByte(bytesArray, byteIndex);
- byteIndex++;
- break;
- case v_mode:
- if (operandSize == true) {
- disp = readInt32(bytesArray, byteIndex);
- byteIndex += 4;
- }
- else {
- disp = readInt16(bytesArray, byteIndex);
- byteIndex += 2;
- }
- //disp = disp + (byteIndex-instrStartIndex);
- break;
- }
- op = new X86PCRelativeAddress(disp);
- break;
- case ADDR_ESDI:
- op = new X86SegmentRegisterAddress(X86SegmentRegisters.ES, X86Registers.DI);
- break;
- case ADDR_DSSI:
- op = new X86SegmentRegisterAddress(X86SegmentRegisters.DS, X86Registers.SI);
- break;
- case ADDR_R:
- switch (operandType) {
- case b_mode:
- op = X86Registers.getRegister8(mod);
- break;
- case w_mode:
- op = X86Registers.getRegister16(mod);
- break;
- case d_mode:
- op = X86Registers.getRegister32(mod);
- break;
- case v_mode:
- if (operandSize == true)
- op = X86Registers.getRegister32(mod);
- else
- op = X86Registers.getRegister16(mod);
- break;
- default:
- break;
- }
- break;
- case ADDR_FPREG:
- switch (operandType) {
- case 0:
- op = X86FloatRegisters.getRegister(0);
- break;
- case 1:
- op = X86FloatRegisters.getRegister(rm);
- break;
- }
- break;
-
- //SSE: reg field of ModR/M byte selects a 128-bit XMM register
- case ADDR_V:
- op = X86XMMRegisters.getRegister(regOrOpcode);
- break;
-
- //SSE: reg field of ModR/M byte selects a 64-bit MMX register
- case ADDR_P:
- op = X86MMXRegisters.getRegister(regOrOpcode);
- break;
- }
- return op;
- }
-
- private X86SegmentRegister getSegmentRegisterFromPrefix(int prefixes) {
- X86SegmentRegister segRegister = null;
-
- if ( (prefixes & PREFIX_CS) != 0)
- segRegister = X86SegmentRegisters.CS;
- if ( (prefixes & PREFIX_DS) != 0)
- segRegister = X86SegmentRegisters.DS;
- if ( (prefixes & PREFIX_ES) != 0)
- segRegister = X86SegmentRegisters.ES;
- if ( (prefixes & PREFIX_FS) != 0)
- segRegister = X86SegmentRegisters.FS;
- if ( (prefixes & PREFIX_SS) != 0)
- segRegister = X86SegmentRegisters.SS;
- if ( (prefixes & PREFIX_GS) != 0)
- segRegister = X86SegmentRegisters.GS;
-
- return segRegister;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/JmpDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/JmpDecoder.java
deleted file mode 100644
index 9a88823a069..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/JmpDecoder.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2002, 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.
- *
- */
-
-package sun.jvm.hotspot.asm.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class JmpDecoder extends InstructionDecoder {
- public JmpDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand operand = getOperand1(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- Address address;
- if (operand instanceof X86Register) {
- address = new X86RegisterDirectAddress((X86Register)operand);
- } else {
- address = (Address) operand;
- }
- return factory.newJmpInstruction(name, address, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/LogicalDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/LogicalDecoder.java
deleted file mode 100644
index 51de615c0bf..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/LogicalDecoder.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class LogicalDecoder extends InstructionDecoder {
- private int rtlOperation;
-
- public LogicalDecoder(String name, int addrMode1, int operandType1, int rtlOperation) {
- super(name, addrMode1, operandType1);
- this.rtlOperation = rtlOperation;
- }
- public LogicalDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newLogicInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/MoveDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/MoveDecoder.java
deleted file mode 100644
index 74f65f7a10c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/MoveDecoder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class MoveDecoder extends InstructionDecoder {
- public MoveDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
-
- if( (op1 instanceof X86Register) && (op2 instanceof ImmediateOrRegister) ) {
- return factory.newMoveInstruction(name, (X86Register)op1, (ImmediateOrRegister)op2, size, prefixes);
- }
- else if( (op1 instanceof Address) && (op2 instanceof Immediate) ) {
- return factory.newGeneralInstruction(name, op1, op2, size, prefixes);
- }
- else if( (op1 instanceof Address) && (op2 instanceof X86Register) ) {
- return factory.newMoveStoreInstruction(name, (Address)op1, (X86Register)op2, 0, size, prefixes);
- }
- else if( (op1 instanceof X86Register) && (op2 instanceof Address) ) {
- return factory.newMoveLoadInstruction(name, (X86Register)op1, (Address)op2, 0, size, prefixes);
- }
-
- return null;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/RotateDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/RotateDecoder.java
deleted file mode 100644
index 8f901c3119e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/RotateDecoder.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class RotateDecoder extends InstructionDecoder {
-
- public RotateDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
- public RotateDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newRotateInstruction(name, op1, (ImmediateOrRegister)op2, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEArithmeticDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEArithmeticDecoder.java
deleted file mode 100644
index 2fe15d9f7de..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEArithmeticDecoder.java
+++ /dev/null
@@ -1,48 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SSEArithmeticDecoder extends SSEInstructionDecoder {
- private int rtlOperation;
-
- public SSEArithmeticDecoder(String name, int addrMode1, int operandType1, int rtlOperation) {
- super(name, addrMode1, operandType1);
- this.rtlOperation = rtlOperation;
- }
-
- public SSEArithmeticDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newArithmeticInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEInstructionDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEInstructionDecoder.java
deleted file mode 100644
index 280c4e2c25a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEInstructionDecoder.java
+++ /dev/null
@@ -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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-// SSE instructions decoder class
-public class SSEInstructionDecoder extends InstructionDecoder {
-
- public SSEInstructionDecoder(String name) {
- super(name);
- }
- public SSEInstructionDecoder(String name, int addrMode1, int operandType1) {
- super(name, addrMode1, operandType1);
- }
- public SSEInstructionDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- }
-
- public SSEInstructionDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int addrMode3, int operandType3) {
- super(name, addrMode1, operandType1, addrMode2, operandType2, addrMode3, operandType3);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- Operand op3 = getOperand3(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newGeneralInstruction(name, op1, op2, op3, size, 0);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSELogicalDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSELogicalDecoder.java
deleted file mode 100644
index 2ae23a668d9..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSELogicalDecoder.java
+++ /dev/null
@@ -1,45 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SSELogicalDecoder extends SSEInstructionDecoder {
- private int rtlOperation;
-
- public SSELogicalDecoder(String name, int addrMode1, int operandType1, int addrMode2,
- int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize,
- boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newLogicInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEMoveDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEMoveDecoder.java
deleted file mode 100644
index 35630ae3059..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEMoveDecoder.java
+++ /dev/null
@@ -1,55 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SSEMoveDecoder extends SSEInstructionDecoder {
-
- public SSEMoveDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
-
- if( (op1 instanceof X86Register) && (op2 instanceof ImmediateOrRegister) ) {
- return factory.newMoveInstruction(name, (X86Register)op1, (ImmediateOrRegister)op2, size, 0);
- }
- else if( (op1 instanceof Address) && (op2 instanceof Immediate) ) {
- return factory.newGeneralInstruction(name, op1, op2, size, 0);
- }
- else if( (op1 instanceof Address) && (op2 instanceof X86Register) ) {
- return factory.newMoveStoreInstruction(name, (Address)op1, (X86Register)op2, 0, size, 0);
- }
- else if( (op1 instanceof X86Register) && (op2 instanceof Address) ) {
- return factory.newMoveLoadInstruction(name, (X86Register)op1, (Address)op2, 0, size, 0);
- }
-
- return null;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEShiftDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEShiftDecoder.java
deleted file mode 100644
index aace0a8bf65..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/SSEShiftDecoder.java
+++ /dev/null
@@ -1,43 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class SSEShiftDecoder extends SSEInstructionDecoder {
- private int rtlOperation;
-
- public SSEShiftDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
-
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newShiftInstruction(name, rtlOperation, op1, (ImmediateOrRegister)op2, size, 0);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ShiftDecoder.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ShiftDecoder.java
deleted file mode 100644
index 8b4e820052c..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/ShiftDecoder.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class ShiftDecoder extends InstructionDecoder {
- private int rtlOperation;
-
- public ShiftDecoder(String name, int addrMode1, int operandType1, int rtlOperation) {
- super(name, addrMode1, operandType1);
- this.rtlOperation = rtlOperation;
- }
- public ShiftDecoder(String name, int addrMode1, int operandType1, int addrMode2, int operandType2, int rtlOperation) {
- super(name, addrMode1, operandType1, addrMode2, operandType2);
- this.rtlOperation = rtlOperation;
- }
- protected Instruction decodeInstruction(byte[] bytesArray, boolean operandSize, boolean addrSize, X86InstructionFactory factory) {
- Operand op1 = getOperand1(bytesArray, operandSize, addrSize);
- Operand op2 = getOperand2(bytesArray, operandSize, addrSize);
- int size = byteIndex - instrStartIndex;
- return factory.newShiftInstruction(name, rtlOperation, op1, (ImmediateOrRegister)op2, size, prefixes);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86ArithmeticInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86ArithmeticInstruction.java
deleted file mode 100644
index e03df827241..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86ArithmeticInstruction.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86ArithmeticInstruction extends X86Instruction
- implements ArithmeticInstruction {
- final private int operation; //RTL operation
- final private Operand operand1;
- final private Operand operand2;
- final private Operand operand3;
- final private String description;
-
- public X86ArithmeticInstruction(String name, int operation, Operand op1, Operand op2, int size, int prefixes) {
- super(name, size, prefixes);
- this.operation = operation;
- this.operand1 = op1;
- this.operand2 = op2;
- this.operand3 = null;
- description = initDescription();
- }
-
- public X86ArithmeticInstruction(String name, int operation, Operand op1, Operand op2, Operand op3, int size, int prefixes) {
- super(name, size, prefixes);
- this.operation = operation;
- this.operand1 = op1;
- this.operand2 = op2;
- this.operand3 = op3;
- description = initDescription();
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- if (operand1 != null) {
- buf.append(getOperandAsString(operand1));
- }
- if (operand2 != null) {
- buf.append(comma);
- buf.append(getOperandAsString(operand2));
- }
- if(operand3 != null) {
- buf.append(comma);
- buf.append(getOperandAsString(operand3));
- }
- return buf.toString();
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public Operand getArithmeticDestination() {
- return operand1;
- }
-
- public Operand getOperand1() {
- return operand1;
- }
-
- public Operand getOperand2() {
- return operand2;
- }
-
- public Operand getOperand3() {
- return operand3;
- }
-
- public Operand[] getArithmeticSources() {
- return (new Operand[] { operand1, operand2, operand3 });
- }
-
- public int getOperation() {
- return operation;
- }
-
- public boolean isArithmetic() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86BranchInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86BranchInstruction.java
deleted file mode 100644
index 49d5f596088..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86BranchInstruction.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86BranchInstruction extends X86Instruction
- implements BranchInstruction {
- final private X86PCRelativeAddress addr;
-
- public X86BranchInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes) {
- super(name, size, prefixes);
- this.addr = addr;
- if(addr instanceof X86PCRelativeAddress) {
- addr.setInstructionSize(getSize());
- }
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- if(addr != null) {
- buf.append(spaces);
- if(addr instanceof X86PCRelativeAddress) {
- long disp = ((X86PCRelativeAddress)addr).getDisplacement();
- long address = disp + currentPc;
- buf.append(symFinder.getSymbolFor(address));
- }
- }
- return buf.toString();
- }
-
- public Address getBranchDestination() {
- return addr;
- }
-
- public boolean isBranch() {
- return true;
- }
-
- public boolean isConditional() {
- return false;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86CallInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86CallInstruction.java
deleted file mode 100644
index 6e137d248cb..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86CallInstruction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86CallInstruction extends X86Instruction
- implements CallInstruction {
- final private Address addr;
-
- public X86CallInstruction(String name, Address addr, int size, int prefixes) {
- super(name, size, prefixes);
- this.addr = addr;
- if(addr instanceof X86PCRelativeAddress) {
- ((X86PCRelativeAddress)addr).setInstructionSize(getSize());
- }
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- long address;
- if(addr instanceof X86PCRelativeAddress) {
- long disp = ((X86PCRelativeAddress)addr).getDisplacement();
- address = disp + currentPc;
- buf.append(symFinder.getSymbolFor(address));
- }
- else {
- buf.append(addr.toString());
- }
- return buf.toString();
- }
-
- public Address getBranchDestination() {
- return addr;
- }
-
- public boolean isCall() {
- return true;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86CondJmpInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86CondJmpInstruction.java
deleted file mode 100644
index 9962c7bc194..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86CondJmpInstruction.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86CondJmpInstruction extends X86Instruction
- implements BranchInstruction {
- final private X86PCRelativeAddress addr;
-
- public X86CondJmpInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes) {
- super(name, size, prefixes);
- this.addr = addr;
- if(addr instanceof X86PCRelativeAddress) {
- addr.setInstructionSize(getSize());
- }
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
-
- if(addr instanceof X86PCRelativeAddress) {
- long disp = ((X86PCRelativeAddress)addr).getDisplacement();
- long address = disp + currentPc;
- buf.append(symFinder.getSymbolFor(address));
- }
- return buf.toString();
- }
-
- public Address getBranchDestination() {
- return addr;
- }
-
- public boolean isBranch() {
- return true;
- }
-
- public boolean isConditional() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86DirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86DirectAddress.java
deleted file mode 100644
index 313e81bf5b3..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86DirectAddress.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.Address;
-import sun.jvm.hotspot.asm.DirectAddress;
-import sun.jvm.hotspot.asm.Register;
-
-public class X86DirectAddress extends DirectAddress {
- private long segment;
- public X86DirectAddress(long segment, long disp) {
- super(disp);
- this.segment = segment;
- }
- public X86DirectAddress(long disp) {
- super(disp);
- this.segment = 0;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- if (getSegment() != 0) {
- buf.append("0x");
- buf.append(Long.toHexString(getSegment()));
- buf.append(":");
- }
- buf.append("[");
- buf.append("0x");
- buf.append(Long.toHexString(getValue()));
- buf.append("]");
-
- return buf.toString();
- }
-
- long getSegment() {
- return segment;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Disassembler.java
deleted file mode 100644
index aa08e493353..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Disassembler.java
+++ /dev/null
@@ -1,1617 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-import java.io.*;
-
-public class X86Disassembler extends Disassembler
- implements X86Opcodes {
- private int byteIndex;
- protected final X86InstructionFactory factory;
-
- public X86Disassembler(long startPc, byte[] code, X86InstructionFactory factory) {
- super(startPc, code);
- this.factory = factory;
- }
-
- public X86Disassembler(long startPc, byte[] code) {
- this(startPc, code, new X86InstructionFactoryImpl());
- }
-
- //Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
- //APPENDIX A - Table A-2. One-byte Opcode Map
- private static final InstructionDecoder oneByteTable[] = {
- /* 00 */
- new ArithmeticDecoder("addb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_ADD),
- new ArithmeticDecoder("addS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_ADD),
- new ArithmeticDecoder("addb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_ADD),
- new ArithmeticDecoder("addS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_ADD),
- new ArithmeticDecoder("addb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_ADD),
- new ArithmeticDecoder("addS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_ADD),
- new InstructionDecoder("pushl", ADDR_REG, ES),
- new InstructionDecoder("popl", ADDR_REG, ES),
- /* 08 */
- new LogicalDecoder("orb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_OR),
- new LogicalDecoder("orS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_OR),
- new LogicalDecoder("orb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_OR),
- new LogicalDecoder("orS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_OR),
- new LogicalDecoder("orb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_OR),
- new LogicalDecoder("orS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_OR),
- new InstructionDecoder("pushl", ADDR_REG, CS),
- null, /* 0x0f extended opcode escape */
- /* 10 */
- new ArithmeticDecoder("adcb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_ADDC),
- new ArithmeticDecoder("adcS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_ADDC),
- new ArithmeticDecoder("adcb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_ADDC),
- new ArithmeticDecoder("adcS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_ADDC),
- new ArithmeticDecoder("adcb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_ADDC),
- new ArithmeticDecoder("adcS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_ADDC),
- new InstructionDecoder("pushl", ADDR_REG, SS),
- new InstructionDecoder("popl", ADDR_REG, SS),
- /* 18 */
- new ArithmeticDecoder("sbbb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_SUBC),
- new ArithmeticDecoder("sbbS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_SUBC),
- new ArithmeticDecoder("sbbb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_SUBC),
- new ArithmeticDecoder("sbbS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_SUBC),
- new ArithmeticDecoder("sbbb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_SUBC),
- new ArithmeticDecoder("sbbS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_SUBC),
- new InstructionDecoder("pushl", ADDR_REG, DS),
- new InstructionDecoder("popl", ADDR_REG, DS),
- /* 20 */
- new LogicalDecoder("andb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_AND),
- new LogicalDecoder("andS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_AND),
- new LogicalDecoder("andb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_AND),
- new LogicalDecoder("andS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_AND),
- new LogicalDecoder("andb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_AND),
- new LogicalDecoder("andS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_AND),
- null, /* SEG es prefix */
- new InstructionDecoder("daa"),
- /* 28 */
- new ArithmeticDecoder("subb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_SUB),
- new ArithmeticDecoder("subS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_SUB),
- new ArithmeticDecoder("subb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_SUB),
- new ArithmeticDecoder("subS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_SUB),
- new ArithmeticDecoder("subb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_SUB),
- new ArithmeticDecoder("subS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_SUB),
- null, /* SEG CS prefix */
- new InstructionDecoder("das"),
- /* 30 */
- new LogicalDecoder("xorb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_XOR),
- new LogicalDecoder("xorS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_XOR),
- new LogicalDecoder("xorb", ADDR_G, b_mode, ADDR_E, b_mode, RTLOP_XOR),
- new LogicalDecoder("xorS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_XOR),
- new LogicalDecoder("xorb", ADDR_REG, AL, ADDR_I, b_mode, RTLOP_XOR),
- new LogicalDecoder("xorS", ADDR_REG, EAX, ADDR_I, v_mode, RTLOP_XOR),
- null, /* SEG SS prefix */
- new InstructionDecoder("aaa"),
- /* 38 */
- new InstructionDecoder("cmpb", ADDR_E, b_mode, ADDR_G, b_mode),
- new InstructionDecoder("cmpS", ADDR_E, v_mode, ADDR_G, v_mode),
- new InstructionDecoder("cmpb", ADDR_G, b_mode, ADDR_E, b_mode),
- new InstructionDecoder("cmpS", ADDR_G, v_mode, ADDR_E, v_mode),
- new InstructionDecoder("cmpb", ADDR_REG, AL, ADDR_I, b_mode),
- new InstructionDecoder("cmpS", ADDR_REG, EAX, ADDR_I, v_mode),
- null, /* SEG DS prefix */
- new InstructionDecoder("aas"),
- /* 40 */
- new ArithmeticDecoder("incS", ADDR_REG, EAX, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, ECX, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, EDX, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, EBX, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, ESP, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, EBP, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, ESI, RTLOP_ADD),
- new ArithmeticDecoder("incS", ADDR_REG, EDI, RTLOP_ADD),
- /* 48 */
- new ArithmeticDecoder("decS", ADDR_REG, EAX, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, ECX, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, EDX, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, EBX, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, ESP, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, EBP, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, ESI, RTLOP_SUB),
- new ArithmeticDecoder("decS", ADDR_REG, EDI, RTLOP_SUB),
- /* 50 */
- new InstructionDecoder("pushS", ADDR_REG, EAX),
- new InstructionDecoder("pushS", ADDR_REG, ECX),
- new InstructionDecoder("pushS", ADDR_REG, EDX),
- new InstructionDecoder("pushS", ADDR_REG, EBX),
- new InstructionDecoder("pushS", ADDR_REG, ESP),
- new InstructionDecoder("pushS", ADDR_REG, EBP),
- new InstructionDecoder("pushS", ADDR_REG, ESI),
- new InstructionDecoder("pushS", ADDR_REG, EDI),
- /* 58 */
- new InstructionDecoder("popS", ADDR_REG, EAX),
- new InstructionDecoder("popS", ADDR_REG, ECX),
- new InstructionDecoder("popS", ADDR_REG, EDX),
- new InstructionDecoder("popS", ADDR_REG, EBX),
- new InstructionDecoder("popS", ADDR_REG, ESP),
- new InstructionDecoder("popS", ADDR_REG, EBP),
- new InstructionDecoder("popS", ADDR_REG, ESI),
- new InstructionDecoder("popS", ADDR_REG, EDI),
- /* 60 */
- new InstructionDecoder("pusha"),
- new InstructionDecoder("popa"),
- new InstructionDecoder("boundS", ADDR_G, v_mode, ADDR_E, v_mode),
- new InstructionDecoder("arpl", ADDR_E, w_mode, ADDR_G, w_mode),
- null, /* seg fs */
- null, /* seg gs */
- null, /* op size prefix */
- null, /* adr size prefix */
- /* 68 */
- new InstructionDecoder("pushS", ADDR_I, v_mode), /* 386 book wrong */
- new ArithmeticDecoder("imulS", ADDR_G, v_mode, ADDR_E, v_mode, ADDR_I, v_mode, RTLOP_SMUL),
- new InstructionDecoder("pushl", ADDR_I, b_mode), /* push of byte really pushes 4 bytes */
- new ArithmeticDecoder("imulS", ADDR_G, v_mode, ADDR_E, v_mode, ADDR_I, b_mode, RTLOP_SMUL),
- new InstructionDecoder("insb", ADDR_ESDI, b_mode, INDIR_REG, DX),
- new InstructionDecoder("insS", ADDR_ESDI, v_mode, INDIR_REG, DX),
- new InstructionDecoder("outsb", INDIR_REG, DX, ADDR_DSSI, b_mode),
- new InstructionDecoder("outsS", INDIR_REG, DX, ADDR_DSSI, v_mode),
- /* 70 */
- new ConditionalJmpDecoder("jo", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jno", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jb", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jae", ADDR_J, b_mode),
- new ConditionalJmpDecoder("je", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jne", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jbe", ADDR_J, b_mode),
- new ConditionalJmpDecoder("ja", ADDR_J, b_mode),
- /* 78 */
- new ConditionalJmpDecoder("js", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jns", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jp", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jnp", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jl", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jnl", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jle", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jg", ADDR_J, b_mode),
- /* 80 */
- new GRPDecoder(null, 0),
- new GRPDecoder(null, 1),
- null,
- new GRPDecoder(null, 2),
- new InstructionDecoder("testb", ADDR_E, b_mode, ADDR_G, b_mode),
- new InstructionDecoder("testS", ADDR_E, v_mode, ADDR_G, v_mode),
- new MoveDecoder("xchgb", ADDR_E, b_mode, ADDR_G, b_mode),
- new MoveDecoder("xchgS", ADDR_E, v_mode, ADDR_G, v_mode),
- /* 88 */
- new MoveDecoder("movb", ADDR_E, b_mode, ADDR_G, b_mode),
- new MoveDecoder("movS", ADDR_E, v_mode, ADDR_G, v_mode),
- new MoveDecoder("movb", ADDR_G, b_mode, ADDR_E, b_mode),
- new MoveDecoder("movS", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("movw", ADDR_E, w_mode, ADDR_SEG, w_mode),
- new InstructionDecoder("leaS", ADDR_G, v_mode, ADDR_E, 0),
- new MoveDecoder("movw", ADDR_SEG, w_mode, ADDR_E, w_mode),
- new InstructionDecoder("popS", ADDR_E, v_mode),
- /* 90 */
- new InstructionDecoder("nop"),
- new MoveDecoder("xchgS", ADDR_REG, ECX, ADDR_REG, EAX),
- new MoveDecoder("xchgS", ADDR_REG, EDX, ADDR_REG, EAX),
- new MoveDecoder("xchgS", ADDR_REG, EBX, ADDR_REG, EAX),
- new MoveDecoder("xchgS", ADDR_REG, ESP, ADDR_REG, EAX),
- new MoveDecoder("xchgS", ADDR_REG, EBP, ADDR_REG, EAX),
- new MoveDecoder("xchgS", ADDR_REG, ESI, ADDR_REG, EAX),
- new MoveDecoder("xchgS", ADDR_REG, EDI, ADDR_REG, EAX),
- /* 98 */
- new InstructionDecoder("cwtl"),
- new InstructionDecoder("cltd"),
- new CallDecoder("lcall", ADDR_DIR, p_mode),
- null, /* fwait */
- new InstructionDecoder("pushf"),
- new InstructionDecoder("popf"),
- new InstructionDecoder("sahf"),
- new InstructionDecoder("lahf"),
- /* a0 */
- new MoveDecoder("movb", ADDR_REG, AL, ADDR_OFF, b_mode),
- new MoveDecoder("movS", ADDR_REG, EAX, ADDR_OFF, v_mode),
- new MoveDecoder("movb", ADDR_OFF, b_mode, ADDR_REG, AL),
- new MoveDecoder("movS", ADDR_OFF, v_mode, ADDR_REG, EAX),
- new MoveDecoder("movsb", ADDR_ESDI, b_mode, ADDR_DSSI, b_mode),
- new MoveDecoder("movsS", ADDR_ESDI, v_mode, ADDR_DSSI, v_mode),
- new InstructionDecoder("cmpsb", ADDR_ESDI, b_mode, ADDR_DSSI, b_mode),
- new InstructionDecoder("cmpsS", ADDR_ESDI, v_mode, ADDR_DSSI, v_mode),
- /* a8 */
- new InstructionDecoder("testb", ADDR_REG, AL, ADDR_I, b_mode),
- new InstructionDecoder("testS", ADDR_REG, EAX, ADDR_I, v_mode),
- new InstructionDecoder("stosb", ADDR_ESDI, b_mode, ADDR_REG, AL),
- new InstructionDecoder("stosS", ADDR_ESDI, v_mode, ADDR_REG, EAX),
- new InstructionDecoder("lodsb", ADDR_REG, AL, ADDR_DSSI, b_mode),
- new InstructionDecoder("lodsS", ADDR_REG, EAX, ADDR_DSSI, v_mode),
- new InstructionDecoder("scasb", ADDR_REG, AL, ADDR_ESDI, b_mode),
- new InstructionDecoder("scasS", ADDR_REG, EAX, ADDR_ESDI, v_mode),
- /* b0 */
- new MoveDecoder("movb", ADDR_REG, AL, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, CL, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, DL, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, BL, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, AH, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, CH, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, DH, ADDR_I, b_mode),
- new MoveDecoder("movb", ADDR_REG, BH, ADDR_I, b_mode),
- /* b8 */
- new MoveDecoder("movS", ADDR_REG, EAX, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, ECX, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, EDX, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, EBX, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, ESP, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, EBP, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, ESI, ADDR_I, v_mode),
- new MoveDecoder("movS", ADDR_REG, EDI, ADDR_I, v_mode),
- /* c0 */
- new GRPDecoder(null, 3),
- new GRPDecoder(null, 4),
- new BranchDecoder("ret", ADDR_I, w_mode),
- new BranchDecoder("ret"),
- new InstructionDecoder("lesS", ADDR_G, v_mode, ADDR_E, 0),
- new InstructionDecoder("ldsS", ADDR_G, v_mode, ADDR_E, 0),
- new MoveDecoder("movb", ADDR_E, b_mode, ADDR_I, b_mode),
- new MoveDecoder("movS", ADDR_E, v_mode, ADDR_I, v_mode),
- /* c8 */
- new InstructionDecoder("enter", ADDR_I, w_mode, ADDR_I, b_mode),
- new InstructionDecoder("leave"),
- new InstructionDecoder("lret", ADDR_I, w_mode),
- new InstructionDecoder("lret"),
- new InstructionDecoder("int3"),
- new InstructionDecoder("int", ADDR_I, b_mode),
- new InstructionDecoder("into"),
- new InstructionDecoder("iret"),
- /* d0 */
- new GRPDecoder(null, 5),
- new GRPDecoder(null, 6),
- new GRPDecoder(null, 7),
- new GRPDecoder(null, 8),
- new InstructionDecoder("aam", ADDR_I, b_mode),
- new InstructionDecoder("aad", ADDR_I, b_mode),
- null,
- new InstructionDecoder("xlat"),
- /* d8 */
- new FloatDecoder(),
- new FloatDecoder(),
- new FloatDecoder(),
- new FloatDecoder(),
- new FloatDecoder(),
- new FloatDecoder(),
- new FloatDecoder(),
- new FloatDecoder(),
- /* e0 */
- new BranchDecoder("loopne", ADDR_J, b_mode),
- new BranchDecoder("loope", ADDR_J, b_mode),
- new BranchDecoder("loop", ADDR_J, b_mode),
- new ConditionalJmpDecoder("jCcxz", ADDR_J, b_mode),
- new InstructionDecoder("inb", ADDR_REG, AL, ADDR_I, b_mode),
- new InstructionDecoder("inS", ADDR_REG, EAX, ADDR_I, b_mode),
- new InstructionDecoder("outb", ADDR_I, b_mode, ADDR_REG, AL),
- new InstructionDecoder("outS", ADDR_I, b_mode, ADDR_REG, EAX),
- /* e8 */
- new CallDecoder("call", ADDR_J, v_mode),
- new JmpDecoder("jmp", ADDR_J, v_mode),
- new JmpDecoder("ljmp", ADDR_DIR, p_mode),
- new JmpDecoder("jmp", ADDR_J, b_mode),
- new InstructionDecoder("inb", ADDR_REG, AL, INDIR_REG, DX),
- new InstructionDecoder("inS", ADDR_REG, EAX, INDIR_REG, DX),
- new InstructionDecoder("outb", INDIR_REG, DX, ADDR_REG,AL),
- new InstructionDecoder("outS", INDIR_REG, DX, ADDR_REG, EAX),
- /* f0 */
- new InstructionDecoder("lock"), /* lock prefix */
- null,
- new InstructionDecoder("repne"), /* repne */
- new InstructionDecoder("rep"), /* repz */
- new InstructionDecoder("hlt"),
- new InstructionDecoder("cmc"),
- new GRPDecoder(null, 9),
- new GRPDecoder(null, 10),
- /* f8 */
- new InstructionDecoder("clc"),
- new InstructionDecoder("stc"),
- new InstructionDecoder("cli"),
- new InstructionDecoder("sti"),
- new InstructionDecoder("cld"),
- new InstructionDecoder("std"),
- new GRPDecoder(null, 11),
- new GRPDecoder(null, 12)
- };
-
- //APPENDIX A - Table A-3. Two-byte Opcode Map
- private static final InstructionDecoder twoByteTable[] = {
- /* 00 */
- new GRPDecoder(null, 13),
- new GRPDecoder(null, 14),
- new InstructionDecoder("larS", ADDR_G, v_mode, ADDR_E, w_mode),
- new InstructionDecoder("lslS", ADDR_G, v_mode, ADDR_E, w_mode),
- null,
- null,
- new InstructionDecoder("clts"),
- null,
- /* 08 */
- new InstructionDecoder("invd"),
- new InstructionDecoder("wbinvd"),
- null,
- null,
- null,
- null,
- null,
- null,
- /* 10 */ //SSE
- new SSEMoveDecoder("movups", ADDR_V, ps_mode, ADDR_W, ps_mode),
- new SSEMoveDecoder("movups", ADDR_W, ps_mode, ADDR_V, ps_mode),
- new SSEMoveDecoder("movlps", ADDR_W, q_mode, ADDR_V, q_mode),
- new SSEMoveDecoder("movlps", ADDR_V, q_mode, ADDR_W, q_mode),
- new SSEInstructionDecoder("unpcklps", ADDR_V, ps_mode, ADDR_W, q_mode),
- new SSEInstructionDecoder("unpckhps", ADDR_V, ps_mode, ADDR_W, q_mode),
- new SSEMoveDecoder("movhps", ADDR_V, q_mode, ADDR_W, q_mode),
- new SSEMoveDecoder("movhps", ADDR_W, q_mode, ADDR_V, q_mode),
- /* 18 */
- new GRPDecoder(null, 21),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 20 */
- /* these are all backward in appendix A of the intel book */
- new MoveDecoder("movl", ADDR_R, d_mode, ADDR_C, d_mode),
- new MoveDecoder("movl", ADDR_R, d_mode, ADDR_D, d_mode),
- new MoveDecoder("movl", ADDR_C, d_mode, ADDR_R, d_mode),
- new MoveDecoder("movl", ADDR_D, d_mode, ADDR_R, d_mode),
- new MoveDecoder("movl", ADDR_R, d_mode, ADDR_T, d_mode),
- null,
- new MoveDecoder("movl", ADDR_T, d_mode, ADDR_R, d_mode),
- null,
- /* 28 */
- new SSEMoveDecoder("movaps", ADDR_V, ps_mode, ADDR_W, ps_mode),
- new SSEMoveDecoder("movaps", ADDR_W, ps_mode, ADDR_V, ps_mode),
- new SSEInstructionDecoder("cvtpi2ps", ADDR_V, ps_mode, ADDR_Q, q_mode),
- new SSEMoveDecoder("movntps", ADDR_W, ps_mode, ADDR_V, ps_mode),
- new SSEInstructionDecoder("cvttps2pi", ADDR_Q, q_mode, ADDR_W, ps_mode),
- new SSEInstructionDecoder("cvtps2pi", ADDR_Q, q_mode, ADDR_W, ps_mode),
- new SSEInstructionDecoder("ucomiss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- new SSEInstructionDecoder("comiss", ADDR_V, ps_mode, ADDR_W, ps_mode),
- /* 30 */
- new SSEInstructionDecoder("wrmsr"),
- new SSEInstructionDecoder("rtdsc"),
- new SSEInstructionDecoder("rdmsr"),
- new SSEInstructionDecoder("rdpmc"),
- new SSEInstructionDecoder("sysenter"),
- new SSEInstructionDecoder("sysexit"),
- null,
- null,
- /* 38 */
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movnti", ADDR_G, v_mode, ADDR_E, v_mode),
- null,
- null,
- null,
- /* 40 */
- new MoveDecoder("cmovo", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovno", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovb", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovae", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmove", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovne", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovbe", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmova", ADDR_G, v_mode, ADDR_E, v_mode),
- /* 48 */
- new MoveDecoder("cmovs", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovns", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovp", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovnp", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovl", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovge", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovle", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("cmovg", ADDR_G, v_mode, ADDR_E, v_mode),
- /* 50 */
- new SSEMoveDecoder("movmskps", ADDR_E, d_mode, ADDR_V, ps_mode),
- new SSEInstructionDecoder("sqrtps", ADDR_V, ps_mode, ADDR_W, ps_mode),
- new SSEInstructionDecoder("rsqrtps", ADDR_V, ps_mode, ADDR_W, ps_mode),
- new SSEInstructionDecoder("rcpps", ADDR_V, ps_mode, ADDR_W, ps_mode),
- new SSELogicalDecoder("andps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_AND),
- new SSELogicalDecoder("andnps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_AND),
- new SSELogicalDecoder("orps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_OR),
- new SSELogicalDecoder("xorps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_XOR),
- /* 58 */
- new SSEArithmeticDecoder("addps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("mulps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_SMUL),
- new SSEInstructionDecoder("cvtps2pd", ADDR_V, pd_mode, ADDR_W, ps_mode),
- new SSEInstructionDecoder("cvtdq2ps", ADDR_V, ps_mode, ADDR_W, dq_mode),
- new SSEArithmeticDecoder("subps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_SUB),
- new SSEInstructionDecoder("minps", ADDR_V, ps_mode, ADDR_W, ps_mode),
- new SSEArithmeticDecoder("divps", ADDR_V, ps_mode, ADDR_W, ps_mode, RTLOP_SDIV),
- new SSEInstructionDecoder("maxps", ADDR_V, ps_mode, ADDR_W, ps_mode),
- /* 60 */
- new SSEInstructionDecoder("punpcklbw", ADDR_P, q_mode, ADDR_Q, d_mode),
- new SSEInstructionDecoder("punpcklwd", ADDR_P, q_mode, ADDR_Q, d_mode),
- new SSEInstructionDecoder("punpckldq", ADDR_P, q_mode, ADDR_Q, d_mode),
- new SSEInstructionDecoder("packsswb", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("pcmpgtb", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("pcmpgtw", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("pcmpgtd", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("packuswb", ADDR_P, q_mode, ADDR_Q, q_mode),
- /* 68 */
- new SSEInstructionDecoder("punpckhbw", ADDR_P, q_mode, ADDR_Q, d_mode),
- new SSEInstructionDecoder("punpckhwd", ADDR_P, q_mode, ADDR_Q, d_mode),
- new SSEInstructionDecoder("punpckhdq", ADDR_P, q_mode, ADDR_Q, d_mode),
- new SSEInstructionDecoder("packssdw", ADDR_P, q_mode, ADDR_Q, d_mode),
- null,
- null,
- new SSEMoveDecoder("movd", ADDR_P, d_mode, ADDR_E, d_mode),
- new SSEMoveDecoder("movq", ADDR_P, q_mode, ADDR_E, q_mode),
- /* 70 */
- new SSEInstructionDecoder("pshufw", ADDR_P, q_mode, ADDR_Q, q_mode, ADDR_I, b_mode),
- new GRPDecoder(null, 17),
- new GRPDecoder(null, 18),
- new GRPDecoder(null, 19),
- new SSEInstructionDecoder("pcmpeqb", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("pcmpeqw", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("pcmpeqd", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("emms"),
- /* 78 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movd", ADDR_E, d_mode, ADDR_P, d_mode),
- new SSEMoveDecoder("movq", ADDR_Q, q_mode, ADDR_P, q_mode),
- /* 80 */
- new ConditionalJmpDecoder("jo", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jno", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jb", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jae", ADDR_J, v_mode),
- new ConditionalJmpDecoder("je", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jne", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jbe", ADDR_J, v_mode),
- new ConditionalJmpDecoder("ja", ADDR_J, v_mode),
- /* 88 */
- new ConditionalJmpDecoder("js", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jns", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jp", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jnp", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jl", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jge", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jle", ADDR_J, v_mode),
- new ConditionalJmpDecoder("jg", ADDR_J, v_mode),
- /* 90 */
- new InstructionDecoder("seto", ADDR_E, b_mode),
- new InstructionDecoder("setno", ADDR_E, b_mode),
- new InstructionDecoder("setb", ADDR_E, b_mode),
- new InstructionDecoder("setae", ADDR_E, b_mode),
- new InstructionDecoder("sete", ADDR_E, b_mode),
- new InstructionDecoder("setne", ADDR_E, b_mode),
- new InstructionDecoder("setbe", ADDR_E, b_mode),
- new InstructionDecoder("seta", ADDR_E, b_mode),
- /* 98 */
- new InstructionDecoder("sets", ADDR_E, b_mode),
- new InstructionDecoder("setns", ADDR_E, b_mode),
- new InstructionDecoder("setp", ADDR_E, b_mode),
- new InstructionDecoder("setnp", ADDR_E, b_mode),
- new InstructionDecoder("setl", ADDR_E, b_mode),
- new InstructionDecoder("setge", ADDR_E, b_mode),
- new InstructionDecoder("setle", ADDR_E, b_mode),
- new InstructionDecoder("setg", ADDR_E, b_mode),
- /* a0 */
- new InstructionDecoder("pushl", ADDR_REG, FS),
- new InstructionDecoder("popl", ADDR_REG, FS),
- null,
- new InstructionDecoder("btS", ADDR_E, v_mode, ADDR_G, v_mode),
- new InstructionDecoder("shldS", ADDR_E, v_mode, ADDR_G, v_mode, ADDR_I, b_mode),
- new InstructionDecoder("shldS", ADDR_E, v_mode, ADDR_G, v_mode, ADDR_REG, CL),
- null,
- null,
- /* a8 */
- new InstructionDecoder("pushl", ADDR_REG, GS),
- new InstructionDecoder("popl", ADDR_REG, GS),
- new SSEInstructionDecoder("rsm"),
- new InstructionDecoder("btsS", ADDR_E, v_mode, ADDR_G, v_mode),
- new InstructionDecoder("shrdS", ADDR_E, v_mode, ADDR_G, v_mode, ADDR_I, b_mode),
- new InstructionDecoder("shrdS", ADDR_E, v_mode, ADDR_G, v_mode, ADDR_REG, CL),
- new GRPDecoder(null, 20),
- new ArithmeticDecoder("imulS", ADDR_G, v_mode, ADDR_E, v_mode, RTLOP_SMUL),
- /* b0 */
- new InstructionDecoder("cmpxchgb", ADDR_E, b_mode, ADDR_G, b_mode),
- new InstructionDecoder("cmpxchgS", ADDR_E, v_mode, ADDR_G, v_mode),
- new InstructionDecoder("lssS", ADDR_G, v_mode, ADDR_M, p_mode),
- new InstructionDecoder("btrS", ADDR_E, v_mode, ADDR_G, v_mode),
- new InstructionDecoder("lfsS", ADDR_G, v_mode, ADDR_M, p_mode),
- new InstructionDecoder("lgsS", ADDR_G, v_mode, ADDR_M, p_mode),
- new MoveDecoder("movzbS", ADDR_G, v_mode, ADDR_E, b_mode),
- new MoveDecoder("movzwS", ADDR_G, v_mode, ADDR_E, w_mode),
- /* b8 */
- null,
- null,
- new GRPDecoder(null, 15),
- new InstructionDecoder("btcS", ADDR_E, v_mode, ADDR_G, v_mode),
- new InstructionDecoder("bsfS", ADDR_G, v_mode, ADDR_E, v_mode),
- new InstructionDecoder("bsrS", ADDR_G, v_mode, ADDR_E, v_mode),
- new MoveDecoder("movsbS", ADDR_G, v_mode, ADDR_E, b_mode),
- new MoveDecoder("movswS", ADDR_G, v_mode, ADDR_E, w_mode),
- /* c0 */
- new ArithmeticDecoder("xaddb", ADDR_E, b_mode, ADDR_G, b_mode, RTLOP_ADD),
- new ArithmeticDecoder("xaddS", ADDR_E, v_mode, ADDR_G, v_mode, RTLOP_ADD),
- new SSEInstructionDecoder("cmpps", ADDR_V, ps_mode, ADDR_W, ps_mode, ADDR_I, b_mode),
- new SSEMoveDecoder("movnti", ADDR_E, d_mode, ADDR_G, d_mode),
- new SSEInstructionDecoder("pinsrw", ADDR_P, q_mode, ADDR_E, d_mode, ADDR_I, b_mode),
- new SSEInstructionDecoder("pextrw", ADDR_G, d_mode, ADDR_P, q_mode, ADDR_I, b_mode),
- new SSEInstructionDecoder("shufps", ADDR_V, ps_mode, ADDR_W, ps_mode, ADDR_I, b_mode),
- new GRPDecoder(null, 16),
- /* c8 */
- new InstructionDecoder("bswap", ADDR_REG, EAX),
- new InstructionDecoder("bswap", ADDR_REG, ECX),
- new InstructionDecoder("bswap", ADDR_REG, EDX),
- new InstructionDecoder("bswap", ADDR_REG, EBX),
- new InstructionDecoder("bswap", ADDR_REG, ESP),
- new InstructionDecoder("bswap", ADDR_REG, EBP),
- new InstructionDecoder("bswap", ADDR_REG, ESI),
- new InstructionDecoder("bswap", ADDR_REG, EDI),
- /* d0 */
- null,
- new SSEShiftDecoder("psrlw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SRL),
- new SSEShiftDecoder("psrld", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SRL),
- new SSEShiftDecoder("psrlq", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SRL),
- new SSEArithmeticDecoder("paddq", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("pmullw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SMUL),
- null,
- new SSEMoveDecoder("pmovmskb", ADDR_G, d_mode, ADDR_P, q_mode),
- /* d8 */
- new SSEArithmeticDecoder("psubusb", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubusw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEInstructionDecoder("pminub", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSELogicalDecoder("pand", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_AND),
- new SSEArithmeticDecoder("paddusb", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddusw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEInstructionDecoder("pmaxub", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSELogicalDecoder("pandn", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_AND),
- /* e0 */
- new SSEInstructionDecoder("pavgb", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("psraw", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("psrad", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEInstructionDecoder("pavgw", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSEArithmeticDecoder("pmulhuw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_UMUL),
- new SSEArithmeticDecoder("pmulhw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SMUL),
- null,
- new SSEMoveDecoder("movntq", ADDR_W, q_mode, ADDR_V, q_mode),
- /* e8 */
- new SSEArithmeticDecoder("psubsb", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubsw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEInstructionDecoder("pminsw", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSELogicalDecoder("por", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_OR),
- new SSEArithmeticDecoder("paddsb", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddsw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEInstructionDecoder("pmaxsw", ADDR_P, q_mode, ADDR_Q, q_mode),
- new SSELogicalDecoder("pxor", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_XOR),
- /* f0 */
- null,
- new SSEShiftDecoder("psllw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SLL),
- new SSEShiftDecoder("pslld", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SLL),
- new SSEShiftDecoder("psllq", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SLL),
- new SSEArithmeticDecoder("pmuludq", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_UMUL),
- new SSEArithmeticDecoder("pmaddwd", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("psadbw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEMoveDecoder("maskmoveq", ADDR_P, pi_mode, ADDR_Q, pi_mode),
- /* f8 */
- new SSEArithmeticDecoder("psubb", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubd", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubq", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("paddb", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddw", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddd", ADDR_P, q_mode, ADDR_Q, q_mode, RTLOP_ADD),
- null
- };
-
- private static final InstructionDecoder twoBytePrefixF2Table[] = {
- /* 00 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 08 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 10 */
- new SSEMoveDecoder("movsd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- new SSEMoveDecoder("movsd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- null,
- null,
- null,
- null,
- null,
- null,
- /* 18 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 20 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 28 */
- null,
- null,
- new SSEInstructionDecoder("cvtsi2sd", ADDR_V, sd_mode, ADDR_E, d_mode),
- null,
- new SSEInstructionDecoder("cvttsd2si", ADDR_G, d_mode, ADDR_W, sd_mode),
- new SSEInstructionDecoder("cvtsd2si", ADDR_G, d_mode, ADDR_W, sd_mode),
- null,
- null,
- /* 30 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 38 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 40 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 48 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 50 */
- null,
- new SSEInstructionDecoder("sqrtsd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- null,
- null,
- null,
- null,
- null,
- null,
- /* 58 */
- new SSEArithmeticDecoder("addsd", ADDR_V, sd_mode, ADDR_W, sd_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("mulsd", ADDR_V, sd_mode, ADDR_W, sd_mode, RTLOP_SMUL),
- new SSEInstructionDecoder("cvtsd2ss", ADDR_V, sd_mode, ADDR_W, sd_mode),
- null,
- new SSEArithmeticDecoder("subsd", ADDR_V, sd_mode, ADDR_W, sd_mode, RTLOP_SUB),
- new SSEInstructionDecoder("minsd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- new SSEArithmeticDecoder("divsd", ADDR_V, sd_mode, ADDR_W, sd_mode, RTLOP_SDIV),
- new SSEInstructionDecoder("maxsd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- /* 60 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 68 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 70 */
- new SSEInstructionDecoder("pshuflw", ADDR_V, dq_mode, ADDR_W, dq_mode, ADDR_I, b_mode),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 78 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 80 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 88 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 90 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 98 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* a0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* a8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* b0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* b8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* c0 */
- null,
- null,
- new SSEInstructionDecoder("cmpsd", ADDR_V, sd_mode, ADDR_W, sd_mode, ADDR_I, b_mode),
- null,
- null,
- null,
- null,
- null,
- /* c8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* d0 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movdq2q", ADDR_P, q_mode, ADDR_W, q_mode),
- null,
- /* d8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* e0 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEInstructionDecoder("cvtpd2dq", ADDR_V, dq_mode, ADDR_W, pd_mode),
- null,
- /* e8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* f0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* f8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
- };
-
- private static final InstructionDecoder twoBytePrefixF3Table[] = {
- /* 00 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 08 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 10 */
- new SSEMoveDecoder("movss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- new SSEMoveDecoder("movss", ADDR_W, ss_mode, ADDR_V, ss_mode),
- null,
- null,
- null,
- null,
- null,
- null,
- /* 18 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 20 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 28 */
- null,
- null,
- new SSEInstructionDecoder("cvtsi2ss", ADDR_V, ss_mode, ADDR_E, d_mode),
- null,
- new SSEInstructionDecoder("cvttss2si", ADDR_G, d_mode, ADDR_W, ss_mode),
- new SSEInstructionDecoder("cvtss2si", ADDR_G, d_mode, ADDR_W, ss_mode),
- null,
- null,
- /* 30 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 38 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 40 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 48 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 50 */
- null,
- new SSEInstructionDecoder("sqrtss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- new SSEInstructionDecoder("rsqrtss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- new SSEInstructionDecoder("rcpss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- null,
- null,
- null,
- null,
- /* 58 */
- new SSEArithmeticDecoder("addss", ADDR_V, ss_mode, ADDR_W, ss_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("mulss", ADDR_V, ss_mode, ADDR_W, ss_mode, RTLOP_SMUL),
- new SSEInstructionDecoder("cvtss2sd", ADDR_V, ss_mode, ADDR_W, ss_mode),
- new SSEInstructionDecoder("cvttps2dq", ADDR_V, dq_mode, ADDR_W, ps_mode),
- new SSEArithmeticDecoder("subss", ADDR_V, ss_mode, ADDR_W, ss_mode, RTLOP_SUB),
- new SSEInstructionDecoder("minss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- new SSEArithmeticDecoder("divss", ADDR_V, ss_mode, ADDR_W, ss_mode, RTLOP_SDIV),
- new SSEInstructionDecoder("maxss", ADDR_V, ss_mode, ADDR_W, ss_mode),
- /* 60 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 68 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movdqu", ADDR_V, dq_mode, ADDR_W, dq_mode),
- /* 70 */
- new SSEInstructionDecoder("pshufhw", ADDR_V, dq_mode, ADDR_W, dq_mode, ADDR_I, b_mode),
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 78 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movq", ADDR_V, q_mode, ADDR_W, q_mode),
- new SSEMoveDecoder("movdqu", ADDR_W, dq_mode, ADDR_V, dq_mode),
- /* 80 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 88 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 90 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 98 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* a0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* a8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* b0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* b8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* c0 */
- null,
- null,
- new SSEInstructionDecoder("cmpss", ADDR_V, ss_mode, ADDR_W, ss_mode, ADDR_I, b_mode),
- null,
- null,
- null,
- null,
- null,
- /* c8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* d0 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movq2dq", ADDR_V, dq_mode, ADDR_Q, q_mode),
- null,
- /* d8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* e0 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEInstructionDecoder("cvtdq2pd", ADDR_V, pd_mode, ADDR_W, dq_mode),
- null,
- /* e8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* f0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* f8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
- };
-
- private static final InstructionDecoder twoBytePrefix66Table[] = {
- /* 00 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 08 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 10 */
- new SSEMoveDecoder("movupd", ADDR_V, pd_mode, ADDR_W, pd_mode),
- new SSEMoveDecoder("movupd", ADDR_W, pd_mode, ADDR_V, pd_mode),
- new SSEMoveDecoder("movlpd", ADDR_V, q_mode, ADDR_W, s_mode),
- new SSEMoveDecoder("movlpd", ADDR_V, q_mode, ADDR_W, q_mode),
- new SSEInstructionDecoder("unpcklpd", ADDR_V, pd_mode, ADDR_W, q_mode),
- new SSEInstructionDecoder("unpckhpd", ADDR_V, pd_mode, ADDR_W, q_mode),
- new SSEMoveDecoder("movhpd", ADDR_V, q_mode, ADDR_W, q_mode),
- new SSEMoveDecoder("movhpd", ADDR_W, q_mode, ADDR_V, q_mode),
- /* 18 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 20 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 28 */
- new SSEMoveDecoder("movapd", ADDR_V, pd_mode, ADDR_W, pd_mode),
- new SSEMoveDecoder("movapd", ADDR_W, pd_mode, ADDR_V, pd_mode),
- new SSEInstructionDecoder("cvtpi2pd", ADDR_V, pd_mode, ADDR_Q, dq_mode),
- new SSEMoveDecoder("movntpd", ADDR_W, pd_mode, ADDR_V, pd_mode),
- new SSEInstructionDecoder("cvttpd2pi", ADDR_Q, dq_mode, ADDR_W, pd_mode),
- new SSEInstructionDecoder("cvtpd2pi", ADDR_Q, dq_mode, ADDR_W, pd_mode),
- new SSEInstructionDecoder("ucomisd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- new SSEInstructionDecoder("comisd", ADDR_V, sd_mode, ADDR_W, sd_mode),
- /* 30 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 38 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 40 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 48 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 50 */
- new SSEMoveDecoder("movmskpd", ADDR_E, d_mode, ADDR_V, pd_mode),
- new SSEInstructionDecoder("sqrtpd", ADDR_V, pd_mode, ADDR_W, pd_mode),
- null,
- null,
- new SSELogicalDecoder("andpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_AND),
- new SSELogicalDecoder("andnpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_AND),
- new SSELogicalDecoder("orpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_OR),
- new SSELogicalDecoder("xorpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_XOR),
- /* 58 */
- new SSEArithmeticDecoder("addpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("mulpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_SMUL),
- new SSEInstructionDecoder("cvtpd2ps", ADDR_V, ps_mode, ADDR_W, pd_mode),
- new SSEInstructionDecoder("cvtps2dq", ADDR_V, dq_mode, ADDR_W, ps_mode),
- new SSEArithmeticDecoder("subpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_SUB),
- new SSEInstructionDecoder("minpd", ADDR_V, pd_mode, ADDR_W, pd_mode),
- new SSEArithmeticDecoder("divpd", ADDR_V, pd_mode, ADDR_W, pd_mode, RTLOP_SDIV),
- new SSEInstructionDecoder("maxpd", ADDR_V, pd_mode, ADDR_W, pd_mode),
- /* 60 */
- new SSEInstructionDecoder("punpcklbw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("punpcklwd", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("punpckldq", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("packsswb", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("pcmpgtb", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("pcmpgtw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("pcmpgtd", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("packuswb", ADDR_V, dq_mode, ADDR_W, dq_mode),
- /* 68 */
- new SSEInstructionDecoder("punpckhbw", ADDR_P, dq_mode, ADDR_Q, dq_mode),
- new SSEInstructionDecoder("punpckhwd", ADDR_P, dq_mode, ADDR_Q, dq_mode),
- new SSEInstructionDecoder("punpckhdq", ADDR_P, dq_mode, ADDR_Q, dq_mode),
- new SSEInstructionDecoder("packssdw", ADDR_P, dq_mode, ADDR_Q, dq_mode),
- new SSEInstructionDecoder("punpcklqdq", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("punpckhqdq", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEMoveDecoder("movd", ADDR_V, dq_mode, ADDR_E, d_mode),
- new SSEMoveDecoder("movdqa", ADDR_V, dq_mode, ADDR_W, dq_mode),
- /* 70 */
- new SSEInstructionDecoder("pshufd", ADDR_V, dq_mode, ADDR_W, dq_mode, ADDR_I, b_mode),
- new GRPDecoder(null, 22),
- new GRPDecoder(null, 23),
- new GRPDecoder(null, 24),
- new SSEInstructionDecoder("pcmpeqb", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("pcmpeqw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("pcmpeqd", ADDR_V, dq_mode, ADDR_W, dq_mode),
- null,
- /* 78 */
- null,
- null,
- null,
- null,
- null,
- null,
- new SSEMoveDecoder("movd", ADDR_E, d_mode, ADDR_V, dq_mode),
- new SSEMoveDecoder("movdqa", ADDR_W, dq_mode, ADDR_V, dq_mode),
- /* 80 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 88 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 90 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* 98 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* a0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* a8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* b0 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* b8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* c0 */
- null,
- null,
- new SSEInstructionDecoder("cmppd", ADDR_V, pd_mode, ADDR_W, pd_mode, ADDR_I, b_mode),
- null,
- new SSEInstructionDecoder("pinsrw", ADDR_V, dq_mode, ADDR_E, d_mode, ADDR_I, b_mode),
- new SSEInstructionDecoder("pextrw", ADDR_G, d_mode, ADDR_V, dq_mode, ADDR_I, b_mode),
- new SSEInstructionDecoder("shufpd", ADDR_V, pd_mode, ADDR_W, pd_mode, ADDR_I, b_mode),
- null,
- /* c8 */
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- /* d0 */
- null,
- new SSEShiftDecoder("psrlw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SRL),
- new SSEShiftDecoder("psrld", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SRL),
- new SSEShiftDecoder("psrlq", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SRL),
- new SSEArithmeticDecoder("paddq", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("pmullw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SMUL),
- new SSEMoveDecoder("movq", ADDR_W, q_mode, ADDR_V, q_mode),
- new SSEMoveDecoder("pmovmskb", ADDR_G, d_mode, ADDR_V, dq_mode),
- /* d8 */
- new SSEArithmeticDecoder("psubusb", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubusw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEInstructionDecoder("pminub", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSELogicalDecoder("pand", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_AND),
- new SSEArithmeticDecoder("paddusb", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddusw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEInstructionDecoder("pmaxub", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSELogicalDecoder("pandn", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_AND),
- /* e0 */
- new SSEInstructionDecoder("pavgb", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("psraw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("psrad", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEInstructionDecoder("pavgw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSEArithmeticDecoder("pmulhuw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_UMUL),
- new SSEArithmeticDecoder("pmulhw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SMUL),
- new SSEInstructionDecoder("cvttpd2dq", ADDR_V, dq_mode, ADDR_W, pd_mode),
- new SSEMoveDecoder("movntdq", ADDR_W, dq_mode, ADDR_V, dq_mode),
- /* e8 */
- new SSEArithmeticDecoder("psubusb", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubusw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEInstructionDecoder("pminsw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSELogicalDecoder("por", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_OR),
- new SSEArithmeticDecoder("paddsb", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddsw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEInstructionDecoder("pmaxsw", ADDR_V, dq_mode, ADDR_W, dq_mode),
- new SSELogicalDecoder("pxor", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_XOR),
- /* f0 */
- null,
- new SSEShiftDecoder("psllw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SLL),
- new SSEShiftDecoder("pslld", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SLL),
- new SSEShiftDecoder("psllq", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SLL),
- new SSEArithmeticDecoder("pmuludq", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_UMUL),
- new SSEArithmeticDecoder("pmaddwd", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("psadbw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEMoveDecoder("maskmovdqu", ADDR_V, dq_mode, ADDR_W, dq_mode),
- /* f8 */
- new SSEArithmeticDecoder("psubb", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubd", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("psubq", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_SUB),
- new SSEArithmeticDecoder("paddb", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddw", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- new SSEArithmeticDecoder("paddd", ADDR_V, dq_mode, ADDR_W, dq_mode, RTLOP_ADD),
- null
- };
-
- public void decode(InstructionVisitor visitor) {
- int enter_instruction = 0;
- Instruction instr = null;
- visitor.prologue();
- InstructionDecoder instrDecoder = null;
- try {
- byteIndex = 0;
- int len = 0;
- int instrStartIndex = 0;
-
- while(len < code.length) {
- int prefixes = 0;
- instrStartIndex = byteIndex;
-
- //check if there is any prefix
- prefixes = getPrefixes();
- int segmentOverride = 1; //get segment override prefix
-
- if (code[byteIndex] == 0xc8)
- enter_instruction = 1;
- else
- enter_instruction = 0;
-
- //Read opcode
- int opcode = InstructionDecoder.readByte(code, byteIndex);
- byteIndex++;
-
- if (opcode == 0x0f) {
- opcode = InstructionDecoder.readByte(code, byteIndex);
- byteIndex++;
-
- //SSE: SSE instructions have reserved use of 0xF2, 0xF3, 0x66 prefixes
- if ((prefixes & PREFIX_REPNZ) != 0) {
- instrDecoder = twoBytePrefixF2Table[opcode];
- } else if ((prefixes & PREFIX_REPZ) != 0) {
- instrDecoder = twoBytePrefixF3Table[opcode];
- } else if ((prefixes & PREFIX_DATA) != 0) {
- instrDecoder = twoBytePrefix66Table[opcode];
- } else {
- instrDecoder = twoByteTable[opcode];
- }
-
- } else {
- instrDecoder = oneByteTable[opcode];
- }
- if (instrDecoder != null) {
- instr = instrDecoder.decode(code, byteIndex, instrStartIndex, segmentOverride, prefixes, factory);
- visitor.visit(startPc + len, instr);
- len = instrDecoder.getCurrentIndex();
- }
- else {
- len += 1;
- }
- byteIndex = len;
- }
- } catch (Exception exp) {
- visitor.epilogue();
- }
- }
-
- private int getPrefixes() {
- int prefixByte = 0;
- int prefixes = 0;
- boolean isPrefix = true;
- while (isPrefix) {
- prefixByte = InstructionDecoder.readByte(code, byteIndex);
-
- switch (prefixByte) {
- case 0xf3:
- prefixes |= PREFIX_REPZ;
- break;
- case 0xf2:
- prefixes |= PREFIX_REPNZ;
- break;
- case 0xf0:
- prefixes |= PREFIX_LOCK;
- break;
- case 0x2e:
- prefixes |= PREFIX_CS;
- break;
- case 0x36:
- prefixes |= PREFIX_SS;
- break;
- case 0x3e:
- prefixes |= PREFIX_DS;
- break;
- case 0x26:
- prefixes |= PREFIX_ES;
- break;
- case 0x64:
- prefixes |= PREFIX_FS;
- break;
- case 0x65:
- prefixes |= PREFIX_GS;
- break;
- case 0x66:
- prefixes |= PREFIX_DATA;
- break;
- case 0x67:
- prefixes |= PREFIX_ADR;
- break;
- case 0x9b:
- prefixes |= PREFIX_FWAIT;
- break;
- default:
- isPrefix = false;
- break;
- }
- if(isPrefix)
- byteIndex++;
- }
- return prefixes;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPArithmeticInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPArithmeticInstruction.java
deleted file mode 100644
index 0764ab862cb..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPArithmeticInstruction.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86FPArithmeticInstruction extends X86FPInstruction
- implements ArithmeticInstruction {
- final private int operation; //RTL operation
- final private Operand operand1;
- final private Operand operand2;
- final private String description;
-
- public X86FPArithmeticInstruction(String name, int operation, Operand op1, Operand op2, int size, int prefixes) {
- super(name, size, prefixes);
- this.operation = operation;
- this.operand1 = op1;
- this.operand2 = op2;
- description = initDescription();
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- if (operand1 != null) {
- buf.append(getOperandAsString(operand1));
- }
- if (operand2 != null) {
- buf.append(comma);
- buf.append(getOperandAsString(operand2));
- }
- return buf.toString();
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public Operand getArithmeticDestination() {
- return operand1;
- }
- public Operand getOperand1() {
- return operand1;
- }
-
- public Operand getOperand2() {
- return operand2;
- }
-
- public Operand[] getArithmeticSources() {
- return (new Operand[] { operand1, operand2});
- }
-
- public int getOperation() {
- return operation;
- }
-
- public boolean isArithmetic() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPInstruction.java
deleted file mode 100644
index 1b9617c05c4..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPInstruction.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86FPInstruction extends X86Instruction {
-
- final private Operand operand1;
- final private String description;
-
- public X86FPInstruction(String name, int size, int prefixes) {
- super(name, size, prefixes);
- this.operand1 = null;
- description = initDescription();
- }
-
- public X86FPInstruction(String name, Operand op1, int size, int prefixes) {
- super(name, size, prefixes);
- this.operand1 = op1;
- description = initDescription();
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- if (operand1 != null) {
- buf.append(getOperandAsString(operand1));
- }
- return buf.toString();
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public Operand getOperand1() {
- return operand1;
- }
-
- public boolean isFloat() {
- return true;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPLoadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPLoadInstruction.java
deleted file mode 100644
index 6c2eca037b4..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPLoadInstruction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86FPLoadInstruction extends X86FPInstruction {
-
- final private Operand source;
-
- public X86FPLoadInstruction(String name, Operand operand, int size, int prefixes) {
- super(name, size, prefixes);
- this.source = operand;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(source.toString());
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPStoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPStoreInstruction.java
deleted file mode 100644
index b608b4e8bd6..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FPStoreInstruction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86FPStoreInstruction extends X86FPInstruction {
-
- final private Operand dest;
-
- public X86FPStoreInstruction(String name, Operand op, int size, int prefixes) {
- super(name, size, prefixes);
- this.dest = op;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(dest.toString());
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FloatRegister.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FloatRegister.java
deleted file mode 100644
index e4bb5093844..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FloatRegister.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.Register;
-import sun.jvm.hotspot.utilities.Assert;
-
-public class X86FloatRegister extends Register {
-
- public X86FloatRegister(int number) {
- super(number);
- }
-
- public int getNumber() {
- return number;
- }
-
- public int getNumberOfRegisters() {
- return X86FloatRegisters.getNumRegisters();
- }
-
- public boolean isFloat() {
- return true;
- }
-
- public boolean isFramePointer() {
- return false;
- }
-
- public boolean isStackPointer() {
- return false;
- }
-
- public boolean isValid() {
- return number >= 0 && number < X86FloatRegisters.getNumRegisters();
- }
-
- public String toString() {
- return X86FloatRegisters.getRegisterName(number);
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FloatRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FloatRegisters.java
deleted file mode 100644
index 010b97bad97..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86FloatRegisters.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.utilities.Assert;
-
-public class X86FloatRegisters {
-
- public static int getNumRegisters() {
- return NUM_REGISTERS;
- }
-
- public static X86FloatRegister getRegister(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid float register number!");
- }
- return registers[regNum];
- }
-
- public static String getRegisterName(int i) {
- return "ST(" + i + ")";
- }
-
- public static final X86FloatRegister ST0;
- public static final X86FloatRegister ST1;
- public static final X86FloatRegister ST2;
- public static final X86FloatRegister ST3;
- public static final X86FloatRegister ST4;
- public static final X86FloatRegister ST5;
- public static final X86FloatRegister ST6;
- public static final X86FloatRegister ST7;
-
- public static final int NUM_REGISTERS = 8;
-
- private static final X86FloatRegister registers[];
-
- static {
- ST0 = new X86FloatRegister(0);
- ST1 = new X86FloatRegister(1);
- ST2 = new X86FloatRegister(2);
- ST3 = new X86FloatRegister(3);
- ST4 = new X86FloatRegister(4);
- ST5 = new X86FloatRegister(5);
- ST6 = new X86FloatRegister(6);
- ST7 = new X86FloatRegister(7);
- registers = (new X86FloatRegister[] {
- ST0, ST1, ST2, ST3, ST4, ST5, ST6, ST7
- });
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86GeneralInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86GeneralInstruction.java
deleted file mode 100644
index 8226f19004f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86GeneralInstruction.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86GeneralInstruction extends X86Instruction {
- final private Operand operand1;
- final private Operand operand2;
- final private Operand operand3;
- final private String description;
-
- public X86GeneralInstruction(String name, Operand op1, Operand op2, Operand op3, int size, int prefixes) {
- super(name, size, prefixes);
- this.operand1 = op1;
- this.operand2 = op2;
- this.operand3 = op3;
- description = initDescription();
- }
- public X86GeneralInstruction(String name, Operand op1, Operand op2, int size, int prefixes) {
- this(name, op1, op2, null, size, prefixes);
- }
-
- public X86GeneralInstruction(String name, Operand op1, int size, int prefixes) {
- this(name, op1, null, null, size, prefixes);
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- if (operand1 != null) {
- buf.append(getOperandAsString(operand1));
- }
- if (operand2 != null) {
- buf.append(comma);
- buf.append(getOperandAsString(operand2));
- }
- if(operand3 != null) {
- buf.append(comma);
- buf.append(getOperandAsString(operand3));
- }
- return buf.toString();
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public Operand getOperand1() {
- return operand1;
- }
-
- public Operand getOperand2() {
- return operand2;
- }
-
- public Operand getOperand3() {
- return operand3;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Helper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Helper.java
deleted file mode 100644
index d5590f329aa..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Helper.java
+++ /dev/null
@@ -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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-
-public class X86Helper implements CPUHelper {
- public Disassembler createDisassembler(long startPc, byte[] code) {
- return new X86Disassembler(startPc, code);
- }
-
- public Register getIntegerRegister(int num) {
- return X86Registers.getRegister32(num);
- }
-
- public Register getFloatRegister(int num) {
- return X86FloatRegisters.getRegister(num);
- }
-
- public Register getStackPointer() {
- return X86Registers.ESP;
- }
-
- public Register getFramePointer() {
- return X86Registers.EBP;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86IllegalInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86IllegalInstruction.java
deleted file mode 100644
index 0a2032e946a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86IllegalInstruction.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.SymbolFinder;
-
-public final class X86IllegalInstruction extends X86Instruction {
- final private String description;
-
- public X86IllegalInstruction() {
- super("illegal", 1, 0);
- description = "bad opcode";
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public boolean isIllegal() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Instruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Instruction.java
deleted file mode 100644
index d0ec9bbc876..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Instruction.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public abstract class X86Instruction implements Instruction, X86Opcodes {
- final private String name;
- final private int size;
- final private int prefixes;
-
- public X86Instruction(String name, int size, int prefixes) {
- this.name = name;
- this.size = size;
- this.prefixes = prefixes;
- }
-
- public abstract String asString(long currentPc, SymbolFinder symFinder);
-
- public String getName() {
- return name;
- }
-
- public String getPrefixString() {
- StringBuffer buf = new StringBuffer();
- if ((prefixes & PREFIX_REPZ) != 0)
- buf.append("repz ");
- if ((prefixes & PREFIX_REPNZ) != 0)
- buf.append("repnz ");
- if ((prefixes & PREFIX_LOCK) != 0)
- buf.append("lock ");
-
- return buf.toString();
- }
-
- protected String getOperandAsString(Operand op) {
- StringBuffer buf = new StringBuffer();
- if ((op instanceof Register) || (op instanceof Address)) {
- buf.append(op.toString());
- } else {
- Number number = ((Immediate)op).getNumber();
- buf.append("0x");
- buf.append(Integer.toHexString(number.intValue()));
- }
- return buf.toString();
- }
-
- public int getSize() {
- return size;
- }
-
- public boolean isArithmetic() {
- return false;
- }
-
- public boolean isBranch() {
- return false;
- }
-
- public boolean isCall() {
- return false;
- }
-
- public boolean isFloat() {
- return false;
- }
-
- public boolean isIllegal() {
- return false;
- }
-
- public boolean isLoad() {
- return false;
- }
-
- public boolean isLogical() {
- return false;
- }
-
- public boolean isMove() {
- return false;
- }
-
- public boolean isReturn() {
- return false;
- }
-
- public boolean isShift() {
- return false;
- }
-
- public boolean isStore() {
- return false;
- }
-
- public boolean isTrap() {
- return false;
- }
-
- public boolean isNoop() {
- return false;
- }
-
- protected static String comma = ", ";
- protected static String spaces = "\t";
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86InstructionFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86InstructionFactory.java
deleted file mode 100644
index ff4bc8586b3..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86InstructionFactory.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 2002, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public interface X86InstructionFactory {
- public X86Instruction newCallInstruction(String name, Address addr, int size, int prefixes);
-
- public X86Instruction newJmpInstruction(String name, Address addr, int size, int prefixes);
-
- public X86Instruction newCondJmpInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes);
-
- public X86Instruction newMoveInstruction(String name, X86Register rd, ImmediateOrRegister oSrc, int size, int prefixes);
-
- public X86Instruction newMoveLoadInstruction(String name, X86Register op1, Address op2, int dataType, int size, int prefixes);
-
- public X86Instruction newMoveStoreInstruction(String name, Address op1, X86Register op2, int dataType, int size, int prefixes);
-
- public X86Instruction newArithmeticInstruction(String name, int rtlOperation, Operand op1, Operand op2, Operand op3, int size, int prefixes);
-
- public X86Instruction newArithmeticInstruction(String name, int rtlOperation, Operand op1, Operand op2, int size, int prefixes);
-
- public X86Instruction newLogicInstruction(String name, int rtlOperation, Operand op1, Operand op2, int size, int prefixes);
-
- public X86Instruction newBranchInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes);
-
- public X86Instruction newShiftInstruction(String name, int rtlOperation, Operand op1, ImmediateOrRegister op2, int size, int prefixes);
-
- public X86Instruction newRotateInstruction(String name, Operand op1, ImmediateOrRegister op2, int size, int prefixes);
-
- public X86Instruction newFPLoadInstruction(String name, Operand op, int size, int prefixes);
-
- public X86Instruction newFPStoreInstruction(String name, Operand op, int size, int prefixes);
-
- public X86Instruction newFPArithmeticInstruction(String name, int rtlOperation, Operand op1, Operand op2, int size, int prefixes);
-
- public X86Instruction newGeneralInstruction(String name, Operand op1, Operand op2, Operand op3, int size, int prefixes);
-
- public X86Instruction newGeneralInstruction(String name, Operand op1, Operand op2, int size, int prefixes);
-
- public X86Instruction newGeneralInstruction(String name, Operand op1, int size, int prefixes);
-
- public X86Instruction newIllegalInstruction();
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86InstructionFactoryImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86InstructionFactoryImpl.java
deleted file mode 100644
index d5a371a4602..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86InstructionFactoryImpl.java
+++ /dev/null
@@ -1,108 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86InstructionFactoryImpl implements X86InstructionFactory {
-
- public X86Instruction newCallInstruction(String name, Address addr, int size, int prefixes) {
- return new X86CallInstruction(name, addr, size, prefixes);
- }
-
- public X86Instruction newJmpInstruction(String name, Address addr, int size, int prefixes) {
- return new X86JmpInstruction(name, addr, size, prefixes);
- }
-
- public X86Instruction newCondJmpInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes) {
- return new X86CondJmpInstruction(name, addr, size, prefixes);
- }
-
- public X86Instruction newMoveInstruction(String name, X86Register rd, ImmediateOrRegister oSrc, int size, int prefixes) {
- return new X86MoveInstruction(name, rd, oSrc, size, prefixes);
- }
-
- public X86Instruction newMoveLoadInstruction(String name, X86Register op1, Address op2, int dataType, int size, int prefixes) {
- return new X86MoveLoadInstruction(name, op1, op2, dataType, size, prefixes);
- }
-
- public X86Instruction newMoveStoreInstruction(String name, Address op1, X86Register op2, int dataType, int size, int prefixes) {
- return new X86MoveStoreInstruction(name, op1, op2, dataType, size, prefixes);
- }
-
- public X86Instruction newArithmeticInstruction(String name, int rtlOperation, Operand op1, Operand op2, Operand op3, int size, int prefixes) {
- return new X86ArithmeticInstruction(name, rtlOperation, op1, op2, op3, size, prefixes);
- }
-
- public X86Instruction newArithmeticInstruction(String name, int rtlOperation, Operand op1, Operand op2, int size, int prefixes) {
- return new X86ArithmeticInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-
-
- public X86Instruction newLogicInstruction(String name, int rtlOperation, Operand op1, Operand op2, int size, int prefixes) {
- return new X86LogicInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-
- public X86Instruction newBranchInstruction(String name, X86PCRelativeAddress addr, int size, int prefixes) {
- return new X86BranchInstruction(name, addr, size, prefixes);
- }
-
- public X86Instruction newShiftInstruction(String name, int rtlOperation, Operand op1, ImmediateOrRegister op2, int size, int prefixes) {
- return new X86ShiftInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-
- public X86Instruction newRotateInstruction(String name, Operand op1, ImmediateOrRegister op2, int size, int prefixes) {
- return new X86RotateInstruction(name, op1, op2, size, prefixes);
- }
-
- public X86Instruction newFPLoadInstruction(String name, Operand op, int size, int prefixes) {
- return new X86FPLoadInstruction(name, op, size, prefixes);
- }
-
- public X86Instruction newFPStoreInstruction(String name, Operand op, int size, int prefixes) {
- return new X86FPStoreInstruction(name, op, size, prefixes);
- }
-
- public X86Instruction newFPArithmeticInstruction(String name, int rtlOperation, Operand op1, Operand op2, int size, int prefixes) {
- return new X86FPArithmeticInstruction(name, rtlOperation, op1, op2, size, prefixes);
- }
-
- public X86Instruction newGeneralInstruction(String name, Operand op1, Operand op2, Operand op3, int size, int prefixes) {
- return new X86GeneralInstruction(name, op1, op2, op3, size, prefixes);
- }
-
- public X86Instruction newGeneralInstruction(String name, Operand op1, Operand op2, int size, int prefixes) {
- return new X86GeneralInstruction(name, op1, op2, size, prefixes);
- }
-
- public X86Instruction newGeneralInstruction(String name, Operand op1, int size, int prefixes) {
- return new X86GeneralInstruction(name, op1, size, prefixes);
- }
-
- public X86Instruction newIllegalInstruction() {
- return new X86IllegalInstruction();
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86JmpInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86JmpInstruction.java
deleted file mode 100644
index baeae4f0d07..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86JmpInstruction.java
+++ /dev/null
@@ -1,69 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86JmpInstruction extends X86Instruction
- implements BranchInstruction {
- final private Address addr;
-
- public X86JmpInstruction(String name, Address addr, int size, int prefixes) {
- super(name, size, prefixes);
- this.addr = addr;
- if(addr instanceof X86PCRelativeAddress) {
- ((X86PCRelativeAddress)addr).setInstructionSize(getSize());
- }
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- long address;
- if(addr instanceof X86PCRelativeAddress) {
- long disp = ((X86PCRelativeAddress)addr).getDisplacement();
- address = disp + currentPc;
- buf.append(symFinder.getSymbolFor(address));
- }
- else {
- buf.append(addr.toString());
- }
- return buf.toString();
- }
-
- public Address getBranchDestination() {
- return addr;
- }
-
- public boolean isBranch() {
- return true;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86LogicInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86LogicInstruction.java
deleted file mode 100644
index 63de7fd76e3..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86LogicInstruction.java
+++ /dev/null
@@ -1,70 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86LogicInstruction extends X86Instruction
- implements LogicInstruction {
- final private Operand operand1;
- final private Operand operand2;
- final private int operation;
-
- public X86LogicInstruction(String name, int operation, Operand op1, Operand op2, int size, int prefixes) {
- super(name, size, prefixes);
- this.operation = operation;
- this.operand1 = op1;
- this.operand2 = op2;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(getOperandAsString(operand1));
- if(operand2 != null) {
- buf.append(comma);
- buf.append(getOperandAsString(operand2));
- }
- return buf.toString();
- }
-
- public Operand getLogicDestination() {
- return operand1;
- }
-
- public Operand[] getLogicSources() {
- return (new Operand[] { operand2 });
- }
-
- public int getOperation() {
- return operation;
- }
-
- public boolean isLogic() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MMXRegister.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MMXRegister.java
deleted file mode 100644
index 501792f63e5..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MMXRegister.java
+++ /dev/null
@@ -1,40 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86MMXRegister extends X86Register {
-
- public X86MMXRegister(int num, String name) {
- super(num, name);
- }
- public int getNumberOfRegisters() {
- return X86MMXRegisters.getNumberOfRegisters();
- }
- public String toString() {
- return name;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MMXRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MMXRegisters.java
deleted file mode 100644
index d6784511fea..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MMXRegisters.java
+++ /dev/null
@@ -1,80 +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.x86;
-
-import sun.jvm.hotspot.utilities.*;
-
-/* 8 64-bit registers called MMX registers*/
-
-public class X86MMXRegisters {
-
- public static final int NUM_MMX_REGISTERS = 8;
-
- public static final X86MMXRegister MM0;
- public static final X86MMXRegister MM1;
- public static final X86MMXRegister MM2;
- public static final X86MMXRegister MM3;
- public static final X86MMXRegister MM4;
- public static final X86MMXRegister MM5;
- public static final X86MMXRegister MM6;
- public static final X86MMXRegister MM7;
-
- private static X86MMXRegister mmxRegisters[];
-
- static {
- //MMX registers
- MM0 = new X86MMXRegister(0, "%mm0");
- MM1 = new X86MMXRegister(1, "%mm1");
- MM2 = new X86MMXRegister(2, "%mm2");
- MM3 = new X86MMXRegister(3, "%mm3");
- MM4 = new X86MMXRegister(4, "%mm4");
- MM5 = new X86MMXRegister(5, "%mm5");
- MM6 = new X86MMXRegister(6, "%mm6");
- MM7 = new X86MMXRegister(7, "%mm7");
-
- mmxRegisters = (new X86MMXRegister[] {
- MM0, MM1, MM2, MM3, MM4, MM5, MM6, MM7
- });
- }
-
- public static int getNumberOfRegisters() {
- return NUM_MMX_REGISTERS;
- }
-
- //Return the register name
- public static String getRegisterName(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_MMX_REGISTERS, "invalid MMX register number!");
- }
- return mmxRegisters[regNum].toString();
- }
-
- public static X86MMXRegister getRegister(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_MMX_REGISTERS, "invalid MMX register number!");
- }
- return mmxRegisters[regNum];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MemoryIndirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MemoryIndirectAddress.java
deleted file mode 100644
index 856f7d6697e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MemoryIndirectAddress.java
+++ /dev/null
@@ -1,46 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-import sun.jvm.hotspot.asm.x86.*;
-
-public class X86MemoryIndirectAddress extends IndirectAddress {
-
- private long value;
-
- public X86MemoryIndirectAddress(long value) {
- this.value = value;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("*");
- buf.append("[");
- buf.append(Long.toHexString(value));
- buf.append(']');
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MemoryInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MemoryInstruction.java
deleted file mode 100644
index 639483f7634..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MemoryInstruction.java
+++ /dev/null
@@ -1,66 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public abstract class X86MemoryInstruction extends X86Instruction
- implements MemoryInstruction {
- final protected Address address;
- final protected X86Register register;
- final protected int dataType;
- final protected String description;
-
- public X86MemoryInstruction(String name, Address address, X86Register register, int dataType, int size, int prefixes) {
- super(name, size, prefixes);
- this.address = address;
- this.register = register;
- this.dataType = dataType;
- description = initDescription();
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(register.toString());
- buf.append(comma);
- buf.append(address.toString());
- return buf.toString();
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- return description;
- }
-
- public int getDataType() {
- return dataType;
- }
-
- public boolean isConditional() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveInstruction.java
deleted file mode 100644
index d1419708c2f..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveInstruction.java
+++ /dev/null
@@ -1,78 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86MoveInstruction extends X86Instruction
- implements MoveInstruction, RTLOperations {
- private ImmediateOrRegister source;
- private X86Register destination;
-
- public X86MoveInstruction(String name, X86Register rd, ImmediateOrRegister oSrc, int size, int prefixes) {
- super(name, size, prefixes);
- this.source = oSrc;
- this.destination = rd;
- }
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(destination.toString());
- buf.append(comma);
- buf.append(getSourceString());
- return buf.toString();
- }
-
- protected String getSourceString() {
- StringBuffer buf = new StringBuffer();
- if ((source instanceof Register)) {
- buf.append(source.toString());
- } else {
- Number number = ((Immediate)source).getNumber();
- buf.append("0x");
- buf.append(Integer.toHexString(number.intValue()));
- }
- return buf.toString();
- }
-
- public ImmediateOrRegister getMoveSource() {
- return source;
- }
-
- public Register getMoveDestination() {
- return destination;
- }
-
- // for condition moves
- public boolean isConditional() {
- return false;
- }
-
- public boolean isMove() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveLoadInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveLoadInstruction.java
deleted file mode 100644
index 1b94a1851ec..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveLoadInstruction.java
+++ /dev/null
@@ -1,60 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86MoveLoadInstruction extends X86MemoryInstruction
- implements LoadInstruction {
- public X86MoveLoadInstruction(String name, X86Register register, Address address, int dataType, int size, int prefixes) {
- super(name, address, register, dataType, size, prefixes);
- }
-
- public boolean isLoad() {
- return true;
- }
-
- public Register[] getLoadDestinations() {
- Register[] destinations = new Register[1];
- destinations[0] = register;
- return destinations;
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(register.toString());
- buf.append(comma);
- buf.append(address.toString());
- return buf.toString();
- }
-
- public Address getLoadSource() {
- return address;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveStoreInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveStoreInstruction.java
deleted file mode 100644
index 64c492cfacc..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86MoveStoreInstruction.java
+++ /dev/null
@@ -1,65 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86MoveStoreInstruction extends X86MemoryInstruction
- implements StoreInstruction {
- final protected Register[] storeSources;
-
- public X86MoveStoreInstruction(String name, Address address, X86Register register, int dataType, int size, int prefixes) {
- super(name, address, register, dataType, size, prefixes);
- storeSources = new Register[1];
- storeSources[0] = register;
- }
-
- protected String initDescription() {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(address.toString());
- buf.append(comma);
- buf.append(register.toString());
- return buf.toString();
- }
-
- public int getDataType() {
- return dataType;
- }
-
- public Address getStoreDestination() {
- return address;
- }
-
- public Register[] getStoreSources() {
- return storeSources;
- }
-
- public boolean isStore() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Opcodes.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Opcodes.java
deleted file mode 100644
index 171cad307ca..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Opcodes.java
+++ /dev/null
@@ -1,127 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-//Please refer to IA-32 Intel Architecture Software Developer's Manual Volume 2
-//APPENDIX A - A.1.
-
-public interface X86Opcodes
- extends RTLDataTypes, RTLOperations {
- public static final int b_mode = 1;
- public static final int v_mode = 2;
- public static final int w_mode = 3;
- public static final int d_mode = 4;
- public static final int p_mode = 5;
-
- public static final int dq_mode = 6; //SSE: double-quadword
- public static final int pi_mode = 7; //SSE: quadword MMX register
- public static final int ps_mode = 8; //SSE: 128bit single precision floating point data
- public static final int pd_mode = 9; //SSE: 128bit double precision floating point data
- public static final int sd_mode = 10; //SSE: 128bit scalar double precision floating point data
- public static final int q_mode = 11; //SSE: quadword
- public static final int ss_mode = 12; //SSE: scalar element of 128bit floating data
- public static final int si_mode = 13; //SSE: doubleword integer register (e.g. eax)
- public static final int s_mode = 14; //SSE: 6 byte pseudo descriptor
-
- public static final int INVALID_OPERANDTYPE = -1;
-
- public static final int EAX = 0;
- public static final int ECX = 1;
- public static final int EDX = 2;
- public static final int EBX = 3;
- public static final int ESP = 4;
- public static final int EBP = 5;
- public static final int ESI = 6;
- public static final int EDI = 7;
-
- public static final int AX = 8;
- public static final int CX = 9;
- public static final int DX = 10;
- public static final int BX = 11;
- public static final int SP = 12;
- public static final int BP = 13;
- public static final int SI = 14;
- public static final int DI = 15;
-
- public static final int AL = 16;
- public static final int CL = 17;
- public static final int DL = 18;
- public static final int BL = 19;
- public static final int AH = 20;
- public static final int CH = 21;
- public static final int DH = 22;
- public static final int BH = 23;
-
- public static final int ES = 24;
- public static final int CS = 25;
- public static final int SS = 26;
- public static final int DS = 27;
- public static final int FS = 28;
- public static final int GS = 29;
-
- //Addressing modes
- public static final int ADDR_E = 1;
- public static final int ADDR_I = 2;
- public static final int ADDR_DIR = 3;
- public static final int ADDR_J = 4;
- public static final int ADDR_G = 5;
- public static final int ADDR_REG = 6;
- public static final int ADDR_ESDI = 7;
- public static final int ADDR_DSSI = 8;
- public static final int ADDR_SEG = 9;
- public static final int ADDR_OFF = 10;
- public static final int INDIR_REG = 11;
- public static final int ADDR_INDIR_E = 12;
- public static final int ADDR_R = 13; //mod field selects a register
- public static final int ADDR_C = 14; //reg field selects a control register
- public static final int ADDR_D = 15; //reg field selects debug register
- public static final int ADDR_T = 16; //reg field selects test register
- public static final int ADDR_M = 17; //modR/M refer only to memory
- public static final int ADDR_FPREG = 18;
- //SSE
- public static final int ADDR_W = 19; //modR/M: either a 128 bit XMM register or memory
- public static final int ADDR_Q = 20; //modR/M: either a 128 bit MMX register or memory
- public static final int ADDR_V = 21; //reg field of modR/M selects a 128-bit XMM register
- public static final int ADDR_P = 22; //reg field of modR/M selects a 64-bit MMX register
-
- public static final int INVALID_ADDRMODE = -1;
-
- //Refer to chapter 2 - Instruction Format
- //Prefix codes
- public static final int PREFIX_REPZ = 1;
- public static final int PREFIX_REPNZ = 2;
- public static final int PREFIX_LOCK = 4;
- public static final int PREFIX_CS = 8;
- public static final int PREFIX_SS = 0x10;
- public static final int PREFIX_DS = 0x20;
- public static final int PREFIX_ES = 0x40;
- public static final int PREFIX_FS = 0x80;
- public static final int PREFIX_GS = 0x100;
- public static final int PREFIX_DATA = 0x200;
- public static final int PREFIX_ADR = 0x400;
- public static final int PREFIX_FWAIT = 0x800;
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Register.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Register.java
deleted file mode 100644
index 6712a6d3fbf..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Register.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2001, 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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86Register extends Register {
- protected String name;
- public X86Register(int num, String name) {
- super(num);
- this.name = name;
- }
- public int getNumberOfRegisters() {
- return X86Registers.getNumberOfRegisters();
- }
- public String toString() {
- return name;
- }
- public boolean isFramePointer() {
- return number == 5; //ebp
- }
- public boolean isStackPointer() {
- return number == 4; //esp
- }
- public boolean isFloat() {
- return false;
- }
- public boolean isSegmentPointer() {
- return false;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterDirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterDirectAddress.java
deleted file mode 100644
index ba1ed44d7bc..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterDirectAddress.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (c) 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.
- *
- */
-
-package sun.jvm.hotspot.asm.x86;
-
-import sun.jvm.hotspot.asm.Address;
-import sun.jvm.hotspot.asm.BaseIndexScaleDispAddress;
-
-public class X86RegisterDirectAddress extends Address {
- final private X86Register base;
-
- public X86RegisterDirectAddress(X86Register base) {
- this.base = base;
- }
-
- public String toString() {
- return base.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterIndirectAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterIndirectAddress.java
deleted file mode 100644
index 834b5b10811..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterIndirectAddress.java
+++ /dev/null
@@ -1,86 +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.x86;
-
-import sun.jvm.hotspot.asm.Address;
-import sun.jvm.hotspot.asm.BaseIndexScaleDispAddress;
-
-public class X86RegisterIndirectAddress extends BaseIndexScaleDispAddress {
-
- final private X86SegmentRegister segReg;
-
- public X86RegisterIndirectAddress(X86SegmentRegister segReg, X86Register base, X86Register index, long disp, int scale) {
- super(base, index, disp, scale);
- this.segReg = segReg;
- }
-
- public X86RegisterIndirectAddress(X86SegmentRegister segReg, X86Register base, X86Register index, long disp) {
- super(base, index, disp, -1);
- this.segReg = segReg;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- if(segReg != null) {
- buf.append(segReg.toString());
- buf.append(":");
- }
-
- long disp = getDisplacement();
- if(disp != 0)
- buf.append(disp);
-
- sun.jvm.hotspot.asm.Register base = getBase();
- sun.jvm.hotspot.asm.Register index = getIndex();
- int scaleVal = getScale();
- scaleVal = 1 << scaleVal;
-
- if( (base != null) || (index != null) || (scaleVal > 1) )
- buf.append('[');
-
- if(base != null) {
- buf.append(base.toString());
- if(index != null) {
- buf.append("+");
- buf.append(index.toString());
- }
- }
- else {
- if(index != null) {
- buf.append(index.toString());
- }
- }
-
- if (scaleVal > 1) {
- buf.append(" * ");
- buf.append(Integer.toString(scaleVal));
- }
-
- if( (base != null) || (index != null) || (scaleVal > 1) )
- buf.append(']');
-
- return buf.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterPart.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterPart.java
deleted file mode 100644
index fe936d98847..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RegisterPart.java
+++ /dev/null
@@ -1,47 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86RegisterPart extends X86Register {
- private int startBit;
- private int length;
- public X86RegisterPart(int num, String name, int startBit, int length) {
- super(num, name);
- this.startBit = startBit;
- this.length = length;
- }
- public boolean is32BitRegister() {
- return ( length == 32);
- }
- public boolean is16BitRegister() {
- return ( length == 16);
- }
- public boolean is8BitRegister() {
- return ( length == 8);
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Registers.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Registers.java
deleted file mode 100644
index 778118bbb42..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86Registers.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-package sun.jvm.hotspot.asm.x86;
-
-import sun.jvm.hotspot.utilities.*;
-
-public class X86Registers {
- public static final int NUM_REGISTERS = 8;
-
- public static final X86Register EAX;
- public static final X86Register ECX;
- public static final X86Register EDX;
- public static final X86Register EBX;
- public static final X86Register ESP;
- public static final X86Register EBP;
- public static final X86Register ESI;
- public static final X86Register EDI;
-
- public static final X86Register AX;
- public static final X86Register CX;
- public static final X86Register DX;
- public static final X86Register BX;
- public static final X86Register SP;
- public static final X86Register BP;
- public static final X86Register SI;
- public static final X86Register DI;
-
- public static final X86Register AL;
- public static final X86Register CL;
- public static final X86Register DL;
- public static final X86Register BL;
- public static final X86Register AH;
- public static final X86Register CH;
- public static final X86Register DH;
- public static final X86Register BH;
-
- private static X86Register registers8[];
- private static X86Register registers16[];
- private static X86Register registers32[];
-
- static {
- EAX = new X86RegisterPart(0, "%eax", 0, 32);
- ECX = new X86RegisterPart(1, "%ecx", 0, 32);
- EDX = new X86RegisterPart(2, "%edx", 0, 32);
- EBX = new X86RegisterPart(3, "%ebx", 0, 32);
- ESP = new X86RegisterPart(4, "%esp", 0, 32);
- EBP = new X86RegisterPart(5, "%ebp", 0, 32);
- ESI = new X86RegisterPart(6, "%esi", 0, 32);
- EDI = new X86RegisterPart(7, "%edi", 0, 32);
-
- AX = new X86RegisterPart(0, "%ax", 0, 16);
- CX = new X86RegisterPart(1, "%cx", 0, 16);
- DX = new X86RegisterPart(2, "%dx", 0, 16);
- BX = new X86RegisterPart(3, "%bx", 0, 16);
- SP = new X86RegisterPart(4, "%sp", 0, 16);
- BP = new X86RegisterPart(5, "%bp", 0, 16);
- SI = new X86RegisterPart(6, "%si", 0, 16);
- DI = new X86RegisterPart(7, "%di", 0, 16);
-
- AL = new X86RegisterPart(0, "%al", 0, 8);
- CL = new X86RegisterPart(1, "%cl", 0, 8);
- DL = new X86RegisterPart(2, "%dl", 0, 8);
- BL = new X86RegisterPart(3, "%bl", 0, 8);
- AH = new X86RegisterPart(0, "%ah", 8, 8);
- CH = new X86RegisterPart(1, "%ch", 8, 8);
- DH = new X86RegisterPart(2, "%dh", 8, 8);
- BH = new X86RegisterPart(3, "%bh", 8, 8);
-
- registers32 = (new X86Register[] {
- EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI
- });
- registers16 = (new X86Register[] {
- AX, CX, DX, BX, SP, BP, SI, DI
- });
- registers8 = (new X86Register[] {
- AL, CL, DL, BL, AH, CH, DH, BH
- });
- }
-
- public static int getNumberOfRegisters() {
- return NUM_REGISTERS;
- }
-
- public static X86Register getRegister8(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
- }
- return registers8[regNum];
- }
-
- public static X86Register getRegister16(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
- }
- return registers16[regNum];
- }
-
- public static X86Register getRegister32(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
- }
- return registers32[regNum];
- }
-
- //Return the 32bit register name
- public static String getRegisterName(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_REGISTERS, "invalid integer register number!");
- }
- return registers32[regNum].toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RotateInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RotateInstruction.java
deleted file mode 100644
index d830d1f28ee..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86RotateInstruction.java
+++ /dev/null
@@ -1,66 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86RotateInstruction extends X86Instruction {
- final private Operand operand1;
- final private ImmediateOrRegister operand2;
-
- public X86RotateInstruction(String name, Operand operand1, ImmediateOrRegister operand2, int size, int prefixes) {
- super(name, size, prefixes);
- this.operand1 = operand1;
- this.operand2 = operand2;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- if(operand2 != null) {
- if ((operand2 instanceof Register)) {
- buf.append(operand2.toString());
- }
- else {
- Number number = ((Immediate)operand2).getNumber();
- buf.append("0x");
- buf.append(Integer.toHexString(number.intValue()));
- }
- buf.append(comma);
- }
- buf.append(getOperandAsString(operand1));
- return buf.toString();
- }
-
- public Operand getRotateDestination() {
- return operand1;
- }
-
- public Operand getRotateSource() {
- return operand1;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegister.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegister.java
deleted file mode 100644
index 333eb6ab354..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegister.java
+++ /dev/null
@@ -1,43 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86SegmentRegister extends X86Register {
-
- public X86SegmentRegister(int num, String name) {
- super(num, name);
- }
- public int getNumberOfRegisters() {
- return X86SegmentRegisters.getNumberOfRegisters();
- }
- public String toString() {
- return name;
- }
- public boolean isSegmentPointer() {
- return true;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegisterAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegisterAddress.java
deleted file mode 100644
index 9626b4d931a..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegisterAddress.java
+++ /dev/null
@@ -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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86SegmentRegisterAddress extends IndirectAddress {
- private final X86SegmentRegister segment;
- private final X86Register offset;
-
- public X86SegmentRegisterAddress(X86SegmentRegister segment, X86Register offset) {
- this.segment = segment;
- this.offset = offset;
- }
-
- public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append(getSegment().toString());
- buf.append(":");
- buf.append(getOffset().toString());
- return buf.toString();
- }
-
- public X86SegmentRegister getSegment() {
- return segment;
- }
-
- public X86Register getOffset() {
- return offset;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegisters.java
deleted file mode 100644
index ac26b83f829..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86SegmentRegisters.java
+++ /dev/null
@@ -1,66 +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.x86;
-
-import sun.jvm.hotspot.utilities.*;
-
-public class X86SegmentRegisters {
-
- public static final int NUM_SEGMENT_REGISTERS = 6;
-
- public static final X86SegmentRegister ES;
- public static final X86SegmentRegister CS;
- public static final X86SegmentRegister SS;
- public static final X86SegmentRegister DS;
- public static final X86SegmentRegister FS;
- public static final X86SegmentRegister GS;
-
- private static X86SegmentRegister segmentRegisters[];
-
- static {
- //Segment registers
- ES = new X86SegmentRegister(0, "%es");
- CS = new X86SegmentRegister(1, "%cs");
- SS = new X86SegmentRegister(2, "%ss");
- DS = new X86SegmentRegister(3, "%ds");
- FS = new X86SegmentRegister(4, "%fs");
- GS = new X86SegmentRegister(5, "%gs");
-
- segmentRegisters = (new X86SegmentRegister[] {
- ES, CS, SS, DS, FS, GS
- });
- }
-
- public static int getNumberOfRegisters() {
- return NUM_SEGMENT_REGISTERS;
- }
-
- public static X86SegmentRegister getSegmentRegister(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_SEGMENT_REGISTERS, "invalid segment register number!");
- }
- return segmentRegisters[regNum];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86ShiftInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86ShiftInstruction.java
deleted file mode 100644
index 300eedfb911..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86ShiftInstruction.java
+++ /dev/null
@@ -1,86 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86ShiftInstruction extends X86Instruction implements ShiftInstruction {
- final private int operation;
- final private Operand operand1;
- final private ImmediateOrRegister operand2;
-
- public X86ShiftInstruction(String name, int operation, Operand operand1, ImmediateOrRegister operand2, int size, int prefixes) {
- super(name, size, prefixes);
- this.operand1 = operand1;
- this.operand2 = operand2;
- this.operation = operation;
- }
-
- public String asString(long currentPc, SymbolFinder symFinder) {
- StringBuffer buf = new StringBuffer();
- buf.append(getPrefixString());
- buf.append(getName());
- buf.append(spaces);
- buf.append(getOperandAsString(operand1));
-
- if(operand2 != null) {
- buf.append(comma);
-
- if ((operand2 instanceof Register)) {
- buf.append(operand2.toString());
- }
- else {
- Number number = ((Immediate)operand2).getNumber();
- buf.append("0x");
- buf.append(Integer.toHexString(number.intValue()));
- }
- }
- return buf.toString();
- }
-
- public int getOperation() {
- return operation;
- }
-
- public Operand getShiftDestination() {
- return operand1;
- }
-
- public Operand getShiftLength() {
- return operand2;
- }
-
- public Operand getShiftSource() {
- return operand1;
- }
-
- public boolean isShift() {
- return true;
- }
-
- protected String getOperand2String() {
- return operand2.toString();
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86XMMRegister.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86XMMRegister.java
deleted file mode 100644
index 81e34c91401..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86XMMRegister.java
+++ /dev/null
@@ -1,40 +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.x86;
-
-import sun.jvm.hotspot.asm.*;
-
-public class X86XMMRegister extends X86Register {
-
- public X86XMMRegister(int num, String name) {
- super(num, name);
- }
- public int getNumberOfRegisters() {
- return X86XMMRegisters.getNumberOfRegisters();
- }
- public String toString() {
- return name;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86XMMRegisters.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86XMMRegisters.java
deleted file mode 100644
index 6de96ff88f3..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/x86/X86XMMRegisters.java
+++ /dev/null
@@ -1,80 +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.x86;
-
-import sun.jvm.hotspot.utilities.*;
-
-/* There are 8 128-bit XMM registers*/
-
-public class X86XMMRegisters {
-
- public static final int NUM_XMM_REGISTERS = 8;
-
- public static final X86XMMRegister XMM0;
- public static final X86XMMRegister XMM1;
- public static final X86XMMRegister XMM2;
- public static final X86XMMRegister XMM3;
- public static final X86XMMRegister XMM4;
- public static final X86XMMRegister XMM5;
- public static final X86XMMRegister XMM6;
- public static final X86XMMRegister XMM7;
-
- private static X86XMMRegister xmmRegisters[];
-
- static {
- //XMM registers
- XMM0 = new X86XMMRegister(0, "%xmm0");
- XMM1 = new X86XMMRegister(1, "%xmm1");
- XMM2 = new X86XMMRegister(2, "%xmm2");
- XMM3 = new X86XMMRegister(3, "%xmm3");
- XMM4 = new X86XMMRegister(4, "%xmm4");
- XMM5 = new X86XMMRegister(5, "%xmm5");
- XMM6 = new X86XMMRegister(6, "%xmm6");
- XMM7 = new X86XMMRegister(7, "%xmm7");
-
- xmmRegisters = (new X86XMMRegister[] {
- XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7
- });
- }
-
- public static int getNumberOfRegisters() {
- return NUM_XMM_REGISTERS;
- }
-
- //Return the register name
- public static String getRegisterName(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_XMM_REGISTERS, "invalid XMM register number!");
- }
- return xmmRegisters[regNum].toString();
- }
-
- public static X86XMMRegister getRegister(int regNum) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(regNum > -1 && regNum < NUM_XMM_REGISTERS, "invalid XMM register number!");
- }
- return xmmRegisters[regNum];
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java
index 92d71356e65..b2b279524f4 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/bugspot/BugSpotAgent.java
@@ -58,10 +58,6 @@ import sun.jvm.hotspot.utilities.*;
*
The BugSpot debugger requires that the underlying Debugger
* support C/C++ debugging via the CDebugger interface.
*
- *
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.
- *
*
FIXME: especially with the addition of remote debugging, this
* has turned into a mess; needs rethinking.
*/
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
index 13d19e4fd65..e1be42422be 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
@@ -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
@@ -27,7 +27,6 @@ package sun.jvm.hotspot.code;
import java.io.*;
import java.util.*;
-import sun.jvm.hotspot.asm.x86.*;
import sun.jvm.hotspot.compiler.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
index 9cb837f9ee3..7b999e052f6 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeCache.java
@@ -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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
index 86af73625f7..839ad00aafb 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
@@ -351,6 +351,82 @@ public class NMethod extends CodeBlob {
return bestGuessPCDesc;
}
+ PCDesc find_pc_desc(long pc, boolean approximate) {
+ return find_pc_desc_internal(pc, approximate);
+ }
+
+ // Finds a PcDesc with real-pc equal to "pc"
+ PCDesc find_pc_desc_internal(long pc, boolean approximate) {
+ long base_address = VM.getAddressValue(codeBegin());
+ int pc_offset = (int) (pc - base_address);
+
+ // Fallback algorithm: quasi-linear search for the PcDesc
+ // Find the last pc_offset less than the given offset.
+ // The successor must be the required match, if there is a match at all.
+ // (Use a fixed radix to avoid expensive affine pointer arithmetic.)
+ Address lower = scopesPCsBegin();
+ Address upper = scopesPCsEnd();
+ upper = upper.addOffsetTo(-pcDescSize); // exclude final sentinel
+ if (lower.greaterThan(upper)) return null; // native method; no PcDescs at all
+
+ // Take giant steps at first (4096, then 256, then 16, then 1)
+ int LOG2_RADIX = 4;
+ int RADIX = (1 << LOG2_RADIX);
+ Address mid;
+ for (int step = (1 << (LOG2_RADIX*3)); step > 1; step >>= LOG2_RADIX) {
+ while ((mid = lower.addOffsetTo(step * pcDescSize)).lessThan(upper)) {
+ PCDesc m = new PCDesc(mid);
+ if (m.getPCOffset() < pc_offset) {
+ lower = mid;
+ } else {
+ upper = mid;
+ break;
+ }
+ }
+ }
+ // Sneak up on the value with a linear search of length ~16.
+ while (true) {
+ mid = lower.addOffsetTo(pcDescSize);
+ PCDesc m = new PCDesc(mid);
+ if (m.getPCOffset() < pc_offset) {
+ lower = mid;
+ } else {
+ upper = mid;
+ break;
+ }
+ }
+
+ PCDesc u = new PCDesc(upper);
+ if (match_desc(u, pc_offset, approximate)) {
+ return u;
+ } else {
+ return null;
+ }
+ }
+
+ // ScopeDesc retrieval operation
+ PCDesc pc_desc_at(long pc) { return find_pc_desc(pc, false); }
+ // pc_desc_near returns the first PCDesc at or after the givne pc.
+ PCDesc pc_desc_near(long pc) { return find_pc_desc(pc, true); }
+
+ // Return a the last scope in (begin..end]
+ public ScopeDesc scope_desc_in(long begin, long end) {
+ PCDesc p = pc_desc_near(begin+1);
+ if (p != null && VM.getAddressValue(p.getRealPC(this)) <= end) {
+ return new ScopeDesc(this, p.getScopeDecodeOffset(), p.getObjDecodeOffset(), p.getReexecute());
+ }
+ return null;
+ }
+
+ static boolean match_desc(PCDesc pc, int pc_offset, boolean approximate) {
+ if (!approximate) {
+ return pc.getPCOffset() == pc_offset;
+ } else {
+ PCDesc prev = new PCDesc(pc.getAddress().addOffsetTo(-pcDescSize));
+ return prev.getPCOffset() < pc_offset && pc_offset <= pc.getPCOffset();
+ }
+ }
+
/** This is only for use by the debugging system, and is only
intended for use in the topmost frame, where we are not
guaranteed to be at a PC for which we have a PCDesc. It finds
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java
index 0579260ecab..21db5d55831 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Address.java
@@ -89,6 +89,7 @@ public interface Address {
public Address getAddressAt (long offset) throws UnmappedAddressException, UnalignedAddressException;
/** Returns the decoded address at the given offset */
public Address getCompOopAddressAt (long offset) throws UnmappedAddressException, UnalignedAddressException;
+ public Address getCompKlassAddressAt (long offset) throws UnmappedAddressException, UnalignedAddressException;
//
// Java-related routines
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java
index 63d7d8da320..405c82cbb02 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/Debugger.java
@@ -121,6 +121,9 @@ public interface Debugger extends SymbolLookup, ThreadAccess {
public long getHeapOopSize();
public long getNarrowOopBase();
public int getNarrowOopShift();
+ public long getKlassPtrSize();
+ public long getNarrowKlassBase();
+ public int getNarrowKlassShift();
public ReadResult readBytesFromProcess(long address, long numBytes)
throws DebuggerException;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java
index d616da68eb0..815fbf7442d 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java
@@ -58,6 +58,10 @@ public abstract class DebuggerBase implements Debugger {
protected long heapOopSize;
protected long narrowOopBase; // heap base for compressed oops.
protected int narrowOopShift; // shift to decode compressed oops.
+ // class metadata space
+ protected long klassPtrSize;
+ protected long narrowKlassBase; // heap base for compressed klass ptrs.
+ protected int narrowKlassShift; // shift to decode compressed klass ptrs.
// Should be initialized if desired by calling initCache()
private PageCache cache;
@@ -159,10 +163,14 @@ public abstract class DebuggerBase implements Debugger {
javaPrimitiveTypesConfigured = true;
}
- public void putHeapConst(long heapOopSize, long narrowOopBase, int narrowOopShift) {
+ public void putHeapConst(long heapOopSize, long klassPtrSize, long narrowOopBase, int narrowOopShift,
+ long narrowKlassBase, int narrowKlassShift) {
this.heapOopSize = heapOopSize;
+ this.klassPtrSize = klassPtrSize;
this.narrowOopBase = narrowOopBase;
this.narrowOopShift = narrowOopShift;
+ this.narrowKlassBase = narrowKlassBase;
+ this.narrowKlassShift = narrowKlassShift;
}
/** May be called by subclasses if desired to initialize the page
@@ -464,6 +472,15 @@ public abstract class DebuggerBase implements Debugger {
return value;
}
+ protected long readCompKlassAddressValue(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCInteger(address, getKlassPtrSize(), true);
+ if (value != 0) {
+ value = (long)(narrowKlassBase + (long)(value << narrowKlassShift));
+ }
+ return value;
+ }
+
protected void writeAddressValue(long address, long value)
throws UnmappedAddressException, UnalignedAddressException {
writeCInteger(address, machDesc.getAddressSize(), value);
@@ -551,4 +568,15 @@ public abstract class DebuggerBase implements Debugger {
public int getNarrowOopShift() {
return narrowOopShift;
}
+
+ public long getKlassPtrSize() {
+ return klassPtrSize;
+ }
+
+ public long getNarrowKlassBase() {
+ return narrowKlassBase;
+ }
+ public int getNarrowKlassShift() {
+ return narrowKlassShift;
+ }
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java
index 31ad2ec5882..77b18a158d8 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/JVMDebugger.java
@@ -42,5 +42,7 @@ public interface JVMDebugger extends Debugger {
long jintSize,
long jlongSize,
long jshortSize);
- public void putHeapConst(long heapOopSize, long narrowOopBase, int narrowOopShift);
+ public void putHeapConst(long heapOopSize, long klassPtrSize,
+ long narrowKlassBase, int narrowKlassShift,
+ long narrowOopBase, int narrowOopShift);
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java
index ec6b7e6de11..eef49b669cb 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ThreadContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java
index 5b2332a0fe6..2798ab17f7a 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/amd64/AMD64ThreadContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java
index de707f0e99c..d1b56881f13 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdAddress.java
@@ -79,6 +79,11 @@ class BsdAddress implements Address {
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset)
+ throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompOopAddress(addr + offset);
+ }
+
//
// Java-related routines
//
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java
index 1818d1d5a96..addcf0569c8 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdCDebugger.java
@@ -1,5 +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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java
index a708a750c0f..3500e38f124 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebugger.java
@@ -46,6 +46,7 @@ public interface BsdDebugger extends JVMDebugger {
throws DebuggerException;
public BsdAddress readAddress(long address) throws DebuggerException;
public BsdAddress readCompOopAddress(long address) throws DebuggerException;
+ public BsdAddress readCompKlassAddress(long address) throws DebuggerException;
public BsdOopHandle readOopHandle(long address) throws DebuggerException;
public BsdOopHandle readCompOopHandle(long address) throws DebuggerException;
public long[] getThreadIntegerRegisterSet(int lwp_id) throws DebuggerException;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
index 13785ef4ebf..9596d26e22e 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdDebuggerLocal.java
@@ -431,6 +431,12 @@ public class BsdDebuggerLocal extends DebuggerBase implements BsdDebugger {
return (value == 0 ? null : new BsdAddress(this, value));
}
+ public BsdAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new BsdAddress(this, value));
+ }
+
/** From the BsdDebugger interface */
public BsdOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException,
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java
index 01fe1d74577..0624fa92c78 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/bsd/BsdThreadContextFactory.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2006, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java
index ecc4aa12800..b14ae19ad09 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/dummy/DummyAddress.java
@@ -80,6 +80,10 @@ class DummyAddress implements Address {
return new DummyAddress(debugger, badLong);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return new DummyAddress(debugger, badLong);
+ }
+
//
// Java-related routines
//
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java
index 4a5aa00d945..8a8ce383f2e 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/ia64/IA64ThreadContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java
index c2e652d2059..9e85e133b3a 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxAddress.java
@@ -79,6 +79,11 @@ class LinuxAddress implements Address {
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset)
+ throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
+
//
// Java-related routines
//
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java
index 3a03fe5dc73..a1f8e128df8 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebugger.java
@@ -46,6 +46,7 @@ public interface LinuxDebugger extends JVMDebugger {
throws DebuggerException;
public LinuxAddress readAddress(long address) throws DebuggerException;
public LinuxAddress readCompOopAddress(long address) throws DebuggerException;
+ public LinuxAddress readCompKlassAddress(long address) throws DebuggerException;
public LinuxOopHandle readOopHandle(long address) throws DebuggerException;
public LinuxOopHandle readCompOopHandle(long address) throws DebuggerException;
public long[] getThreadIntegerRegisterSet(int lwp_id) throws DebuggerException;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
index c3cbf14887a..150b5442786 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxDebuggerLocal.java
@@ -429,6 +429,12 @@ public class LinuxDebuggerLocal extends DebuggerBase implements LinuxDebugger {
return (value == 0 ? null : new LinuxAddress(this, value));
}
+ public LinuxAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new LinuxAddress(this, value));
+ }
+
/** From the LinuxDebugger interface */
public LinuxOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException,
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java
index cd496cacb0f..d91d896e982 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcAddress.java
@@ -76,6 +76,10 @@ class ProcAddress implements Address {
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
+
//
// Java-related routines
//
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java
index adf1bcc9139..9fbdbe9c33f 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebugger.java
@@ -47,6 +47,7 @@ public interface ProcDebugger extends JVMDebugger {
throws DebuggerException;
public ProcAddress readAddress(long address) throws DebuggerException;
public ProcAddress readCompOopAddress(long address) throws DebuggerException;
+ public ProcAddress readCompKlassAddress(long address) throws DebuggerException;
public ProcOopHandle readOopHandle(long address) throws DebuggerException;
public ProcOopHandle readCompOopHandle(long address) throws DebuggerException;
public long[] getThreadIntegerRegisterSet(int tid) throws DebuggerException;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java
index dbfed015c92..298dbfda634 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java
@@ -351,6 +351,12 @@ public class ProcDebuggerLocal extends DebuggerBase implements ProcDebugger {
return (value == 0 ? null : new ProcAddress(this, value));
}
+ public ProcAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new ProcAddress(this, value));
+ }
+
/** From the ProcDebugger interface */
public ProcOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java
index 90588a09b98..6b34f5c1a66 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteAddress.java
@@ -74,6 +74,9 @@ class RemoteAddress implements Address {
public Address getCompOopAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
//
// Java-related routines
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java
index 013ad1c576c..1f72aa6aa04 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebugger.java
@@ -68,6 +68,9 @@ public interface RemoteDebugger extends Remote {
public long getHeapOopSize() throws RemoteException;
public long getNarrowOopBase() throws RemoteException;
public int getNarrowOopShift() throws RemoteException;
+ public long getKlassPtrSize() throws RemoteException;
+ public long getNarrowKlassBase() throws RemoteException;
+ public int getNarrowKlassShift() throws RemoteException;
public boolean areThreadsEqual(long addrOrId1, boolean isAddress1,
long addrOrId2, boolean isAddress2) throws RemoteException;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java
index 8417b8cb5a6..ffa61b548e7 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java
@@ -99,7 +99,10 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
javaPrimitiveTypesConfigured = true;
narrowOopBase = remoteDebugger.getNarrowOopBase();
narrowOopShift = remoteDebugger.getNarrowOopShift();
+ narrowKlassBase = remoteDebugger.getNarrowKlassBase();
+ narrowKlassShift = remoteDebugger.getNarrowKlassShift();
heapOopSize = remoteDebugger.getHeapOopSize();
+ klassPtrSize = remoteDebugger.getKlassPtrSize();
}
catch (RemoteException e) {
throw new DebuggerException(e);
@@ -319,6 +322,12 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger {
return (value == 0 ? null : new RemoteAddress(this, value));
}
+ RemoteAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ long value = readCompKlassAddressValue(address);
+ return (value == 0 ? null : new RemoteAddress(this, value));
+ }
+
RemoteOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
long value = readAddressValue(address);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java
index 86ccadb79fa..3dc7b28bfd7 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerServer.java
@@ -126,6 +126,18 @@ public class RemoteDebuggerServer extends UnicastRemoteObject
return debugger.getNarrowOopShift();
}
+ public long getKlassPtrSize() throws RemoteException {
+ return debugger.getHeapOopSize();
+ }
+
+ public long getNarrowKlassBase() throws RemoteException {
+ return debugger.getNarrowKlassBase();
+ }
+
+ public int getNarrowKlassShift() throws RemoteException {
+ return debugger.getNarrowKlassShift();
+ }
+
public boolean areThreadsEqual(long addrOrId1, boolean isAddress1,
long addrOrId2, boolean isAddress2) throws RemoteException {
ThreadProxy t1 = getThreadProxy(addrOrId1, isAddress1);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java
index 228d9191dfe..89ebec6c920 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/sparc/SPARCThreadContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2007, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java
index c2130f8ea55..a5fc0dc2bd5 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgAddress.java
@@ -76,6 +76,10 @@ class WindbgAddress implements Address {
return debugger.readCompOopAddress(addr + offset);
}
+ public Address getCompKlassAddressAt(long offset) throws UnalignedAddressException, UnmappedAddressException {
+ return debugger.readCompKlassAddress(addr + offset);
+ }
+
//
// Java-related routines
//
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java
index 47ea85e421b..81825c67d06 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebugger.java
@@ -46,6 +46,7 @@ public interface WindbgDebugger extends JVMDebugger {
throws DebuggerException;
public WindbgAddress readAddress(long address) throws DebuggerException;
public WindbgAddress readCompOopAddress(long address) throws DebuggerException;
+ public WindbgAddress readCompKlassAddress(long address) throws DebuggerException;
public WindbgOopHandle readOopHandle(long address) throws DebuggerException;
public WindbgOopHandle readCompOopHandle(long address) throws DebuggerException;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
index 3e5a6aa96b6..fe7559d05fa 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
@@ -321,6 +321,11 @@ public class WindbgDebuggerLocal extends DebuggerBase implements WindbgDebugger
return (WindbgAddress) newAddress(readCompOopAddressValue(address));
}
+ public WindbgAddress readCompKlassAddress(long address)
+ throws UnmappedAddressException, UnalignedAddressException {
+ return (WindbgAddress) newAddress(readCompKlassAddressValue(address));
+ }
+
/** From the WindbgDebugger interface */
public WindbgOopHandle readOopHandle(long address)
throws UnmappedAddressException, UnalignedAddressException, NotInHeapException {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java
index 9d51bcffc49..9f24c410ea5 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/x86/X86ThreadContext.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2001, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java
index df5cf24f437..19c41dfa84b 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/SADebugServer.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, 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
@@ -51,6 +51,13 @@ public final class SADebugServer {
usage();
}
+ // By default SA agent classes prefer Windows process debugger
+ // to windbg debugger. SA expects special properties to be set
+ // to choose other debuggers. We will set those here before
+ // attaching to SA agent.
+
+ System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true");
+
// delegate to the actual SA debug server.
sun.jvm.hotspot.DebugServer.main(args);
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
index 707673246a4..dc99ffd76be 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/jdi/VirtualMachineImpl.java
@@ -263,6 +263,13 @@ public class VirtualMachineImpl extends MirrorImpl implements PathSearchingVirtu
this.hashCode() + "]");
((com.sun.tools.jdi.VirtualMachineManagerImpl)mgr).addVirtualMachine(this);
+
+ // By default SA agent classes prefer Windows process debugger
+ // to windbg debugger. SA expects special properties to be set
+ // to choose other debuggers. We will set those here before
+ // attaching to SA agent.
+
+ System.setProperty("sun.jvm.hotspot.debugger.useWindbgDebugger", "true");
}
// we reflectively use newly spec'ed class because our ALT_BOOTDIR
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java
index 06e9b58016d..c23ce3a4093 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/Universe.java
@@ -53,6 +53,8 @@ public class Universe {
private static AddressField narrowOopBaseField;
private static CIntegerField narrowOopShiftField;
+ private static AddressField narrowKlassBaseField;
+ private static CIntegerField narrowKlassShiftField;
static {
VM.registerVMInitializedObserver(new Observer() {
@@ -86,6 +88,8 @@ public class Universe {
narrowOopBaseField = type.getAddressField("_narrow_oop._base");
narrowOopShiftField = type.getCIntegerField("_narrow_oop._shift");
+ narrowKlassBaseField = type.getAddressField("_narrow_klass._base");
+ narrowKlassShiftField = type.getCIntegerField("_narrow_klass._shift");
}
public Universe() {
@@ -111,6 +115,19 @@ public class Universe {
return (int)narrowOopShiftField.getValue();
}
+ public static long getNarrowKlassBase() {
+ if (narrowKlassBaseField.getValue() == null) {
+ return 0;
+ } else {
+ return narrowKlassBaseField.getValue().minus(null);
+ }
+ }
+
+ public static int getNarrowKlassShift() {
+ return (int)narrowKlassShiftField.getValue();
+ }
+
+
/** Returns "TRUE" iff "p" points into the allocated area of the heap. */
public boolean isIn(Address p) {
return heap().isIn(p);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java
index 64b297ff25e..46d8b83bddf 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Array.java
@@ -59,7 +59,7 @@ public class Array extends Oop {
if (headerSize != 0) {
return headerSize;
}
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
headerSize = typeSize;
} else {
headerSize = VM.getVM().alignUp(typeSize + VM.getVM().getIntSize(),
@@ -80,7 +80,7 @@ public class Array extends Oop {
if (lengthOffsetInBytes != 0) {
return lengthOffsetInBytes;
}
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
lengthOffsetInBytes = typeSize - VM.getVM().getIntSize();
} else {
lengthOffsetInBytes = typeSize;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java
index 3b9ff5e576e..f7cfb046d7d 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ArrayKlass.java
@@ -44,7 +44,7 @@ public class ArrayKlass extends Klass {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("arrayKlass");
+ Type type = db.lookupType("ArrayKlass");
dimension = new CIntField(type.getCIntegerField("_dimension"), 0);
higherDimension = new MetadataField(type.getAddressField("_higher_dimension"), 0);
lowerDimension = new MetadataField(type.getAddressField("_lower_dimension"), 0);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java
index b3d09109084..5f27437289c 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/BranchData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java
index 65549a15827..f803c71e02b 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/CounterData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java
index b7a724f113e..b16c59481a6 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Instance.java
@@ -53,7 +53,7 @@ public class Instance extends Oop {
// Returns header size in bytes.
public static long getHeaderSize() {
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
return typeSize - VM.getVM().getIntSize();
} else {
return typeSize;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java
index 7e2ab758aeb..008a6ee7164 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/JumpData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
index 9d724516ef9..63ac006ebb9 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Klass.java
@@ -188,11 +188,11 @@ public class Klass extends Metadata implements ClassConstants {
public Klass arrayKlassOrNull() { return arrayKlassImpl(true); }
public Klass arrayKlassImpl(boolean orNull, int rank) {
- throw new RuntimeException("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
+ throw new RuntimeException("array_klass should be dispatched to InstanceKlass, ObjArrayKlass or TypeArrayKlass");
}
public Klass arrayKlassImpl(boolean orNull) {
- throw new RuntimeException("array_klass should be dispatched to InstanceKlass, objArrayKlass or typeArrayKlass");
+ throw new RuntimeException("array_klass should be dispatched to InstanceKlass, ObjArrayKlass or TypeArrayKlass");
}
// This returns the name in the form java/lang/String which isn't really a signature
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
index 505aa0c960d..35ce375b52e 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Metadata.java
@@ -55,8 +55,8 @@ abstract public class Metadata extends VMObject {
metadataConstructor.addMapping("InstanceMirrorKlass", InstanceMirrorKlass.class);
metadataConstructor.addMapping("InstanceRefKlass", InstanceRefKlass.class);
metadataConstructor.addMapping("InstanceClassLoaderKlass", InstanceClassLoaderKlass.class);
- metadataConstructor.addMapping("typeArrayKlass", TypeArrayKlass.class);
- metadataConstructor.addMapping("objArrayKlass", ObjArrayKlass.class);
+ metadataConstructor.addMapping("TypeArrayKlass", TypeArrayKlass.class);
+ metadataConstructor.addMapping("ObjArrayKlass", ObjArrayKlass.class);
metadataConstructor.addMapping("Method", Method.class);
metadataConstructor.addMapping("MethodData", MethodData.class);
metadataConstructor.addMapping("ConstMethod", ConstMethod.class);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java
index 9e786b3e316..56824c600ab 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MetadataField.java
@@ -27,7 +27,6 @@ package sun.jvm.hotspot.oops;
import sun.jvm.hotspot.runtime.VMObject;
import sun.jvm.hotspot.debugger.*;
-// The class for an C int field simply provides access to the value.
public class MetadataField extends Field {
public MetadataField(sun.jvm.hotspot.types.AddressField vmField, long startOffset) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java
index 77f2647c41a..0075339f520 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/MultiBranchData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstruction.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java
similarity index 64%
rename from hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstruction.java
rename to hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java
index e123ccd7ba7..70fb41f7253 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/sparc/SPARCInstruction.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/NarrowKlassField.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 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,21 +22,20 @@
*
*/
-package sun.jvm.hotspot.asm.sparc;
+package sun.jvm.hotspot.oops;
-import sun.jvm.hotspot.asm.*;
+import sun.jvm.hotspot.debugger.*;
-public abstract class SPARCInstruction
- extends AbstractInstruction
- implements /* imports */ SPARCOpcodes {
- public SPARCInstruction(String name) {
- super(name);
- }
+public class NarrowKlassField extends MetadataField {
- public int getSize() {
- return 4;
- }
+ public NarrowKlassField(sun.jvm.hotspot.types.AddressField vmField, long startOffset) {
+ super(vmField, startOffset);
+ }
- protected static String comma = ", ";
- protected static String spaces = "\t";
+ public Metadata getValue(Address addr) {
+ return Metadata.instantiateWrapperFor(addr.getCompKlassAddressAt(getOffset()));
+ }
+ public void setValue(Oop obj, long value) throws MutationException {
+ // Fix this: set* missing in Address
+ }
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java
index b254bc96298..c45ff130cf7 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ObjArrayKlass.java
@@ -43,7 +43,7 @@ public class ObjArrayKlass extends ArrayKlass {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type type = db.lookupType("objArrayKlass");
+ Type type = db.lookupType("ObjArrayKlass");
elementKlass = new MetadataField(type.getAddressField("_element_klass"), 0);
bottomKlass = new MetadataField(type.getAddressField("_bottom_klass"), 0);
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java
index 0d588ecb13e..ab81252d4e7 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java
@@ -47,10 +47,7 @@ public class Oop {
Type type = db.lookupType("oopDesc");
mark = new CIntField(type.getCIntegerField("_mark"), 0);
klass = new MetadataField(type.getAddressField("_metadata._klass"), 0);
- if (VM.getVM().isCompressedHeadersEnabled()) {
- // compressedKlass = new CIntField(type.getCIntegerField("_metadata._compressed_klass"), 0);
- throw new InternalError("unimplemented");
- }
+ compressedKlass = new NarrowKlassField(type.getAddressField("_metadata._compressed_klass"), 0);
headerSize = type.getSize();
}
@@ -74,13 +71,13 @@ public class Oop {
private static CIntField mark;
private static MetadataField klass;
- private static CIntField compressedKlass;
+ private static NarrowKlassField compressedKlass;
// Accessors for declared fields
public Mark getMark() { return new Mark(getHandle()); }
public Klass getKlass() {
- if (VM.getVM().isCompressedHeadersEnabled()) {
- throw new InternalError("unimplemented");
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ return (Klass)compressedKlass.getValue(getHandle());
} else {
return (Klass)klass.getValue(getHandle());
}
@@ -150,7 +147,7 @@ public class Oop {
void iterateFields(OopVisitor visitor, boolean doVMFields) {
if (doVMFields) {
visitor.doCInt(mark, true);
- if (VM.getVM().isCompressedHeadersEnabled()) {
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
throw new InternalError("unimplemented");
} else {
visitor.doMetadata(klass, true);
@@ -210,8 +207,8 @@ public class Oop {
if (handle == null) {
return null;
}
- if (VM.getVM().isCompressedHeadersEnabled()) {
- throw new InternalError("Unimplemented");
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ return (Klass)Metadata.instantiateWrapperFor(handle.getCompKlassAddressAt(compressedKlass.getOffset()));
} else {
return (Klass)Metadata.instantiateWrapperFor(handle.getAddressAt(klass.getOffset()));
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java
index 94f58a9dc01..e4f1f98f7d5 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/TypeArrayKlass.java
@@ -31,7 +31,7 @@ import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.utilities.*;
-// TypeArrayKlass is a proxy for typeArrayKlass in the JVM
+// TypeArrayKlass is a proxy for TypeArrayKlass in the JVM
public class TypeArrayKlass extends ArrayKlass {
static {
@@ -43,7 +43,7 @@ public class TypeArrayKlass extends ArrayKlass {
}
private static synchronized void initialize(TypeDataBase db) throws WrongTypeException {
- Type t = db.lookupType("typeArrayKlass");
+ Type t = db.lookupType("TypeArrayKlass");
maxLength = new CIntField(t.getCIntegerField("_max_length"), 0);
}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java
index 2516fe07e06..21b715f343c 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/VirtualCallData.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
index d1d7adeb7b5..e82d80789f4 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/java_lang_Class.java
@@ -63,11 +63,7 @@ public class java_lang_Class {
/** get Klass* field at offset hc_klass_offset from a java.lang.Class object */
public static Klass asKlass(Oop aClass) {
- if (VM.getVM().isCompressedHeadersEnabled()) {
- throw new InternalError("unimplemented");
- } else {
- return (Klass)Metadata.instantiateWrapperFor(aClass.getHandle().getAddressAt(klassOffset));
- }
+ return (Klass)Metadata.instantiateWrapperFor(aClass.getHandle().getAddressAt(klassOffset));
}
/** get oop_size field at offset oop_size_offset from a java.lang.Class object */
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
index dfa6fe3f19a..a8df4418454 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Bytes.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
@@ -25,14 +25,29 @@
package sun.jvm.hotspot.runtime;
import sun.jvm.hotspot.debugger.*;
+import sun.jvm.hotspot.utilities.PlatformInfo;
/** Encapsulates some byte-swapping operations defined in the VM */
public class Bytes {
+ // swap if client platform is different from server's.
private boolean swap;
public Bytes(MachineDescription machDesc) {
- swap = !machDesc.isBigEndian();
+ String cpu = PlatformInfo.getCPU();
+ if (cpu.equals("sparc")) {
+ if (machDesc.isBigEndian()) {
+ swap = false;
+ } else {
+ swap = true;
+ }
+ } else { // intel
+ if (machDesc.isBigEndian()) {
+ swap = true;
+ } else {
+ swap = false;
+ }
+ }
}
/** Should only swap if the hardware's underlying byte order is
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
index 5a4c344657d..8e259e3a145 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java
@@ -32,9 +32,7 @@ import sun.jvm.hotspot.runtime.solaris_x86.SolarisX86JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.solaris_amd64.SolarisAMD64JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.win32_amd64.Win32AMD64JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.win32_x86.Win32X86JavaThreadPDAccess;
-import sun.jvm.hotspot.runtime.win32_ia64.Win32IA64JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess;
-import sun.jvm.hotspot.runtime.linux_ia64.LinuxIA64JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess;
import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess;
import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess;
@@ -79,14 +77,10 @@ public class Threads {
access = new Win32X86JavaThreadPDAccess();
} else if (cpu.equals("amd64")) {
access = new Win32AMD64JavaThreadPDAccess();
- } else if (cpu.equals("ia64")) {
- access = new Win32IA64JavaThreadPDAccess();
}
} else if (os.equals("linux")) {
if (cpu.equals("x86")) {
access = new LinuxX86JavaThreadPDAccess();
- } else if (cpu.equals("ia64")) {
- access = new LinuxIA64JavaThreadPDAccess();
} else if (cpu.equals("amd64")) {
access = new LinuxAMD64JavaThreadPDAccess();
} else if (cpu.equals("sparc")) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
index ffe177238c2..5531980b1f8 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
@@ -103,6 +103,7 @@ public class VM {
private int logMinObjAlignmentInBytes;
private int heapWordSize;
private int heapOopSize;
+ private int klassPtrSize;
private int oopSize;
/** This is only present in a non-core build */
private CodeCache codeCache;
@@ -129,7 +130,7 @@ public class VM {
private static CIntegerType boolType;
private Boolean sharingEnabled;
private Boolean compressedOopsEnabled;
- private Boolean compressedHeadersEnabled;
+ private Boolean compressedKlassPointersEnabled;
// command line flags supplied to VM - see struct Flag in globals.hpp
public static final class Flag {
@@ -350,6 +351,12 @@ public class VM {
} else {
heapOopSize = (int)getOopSize();
}
+
+ if (isCompressedKlassPointersEnabled()) {
+ klassPtrSize = (int)getIntSize();
+ } else {
+ klassPtrSize = (int)getOopSize(); // same as an oop
+ }
}
/** This could be used by a reflective runtime system */
@@ -374,8 +381,9 @@ public class VM {
((Observer) iter.next()).update(null, null);
}
- debugger.putHeapConst(soleInstance.getHeapOopSize(), Universe.getNarrowOopBase(),
- Universe.getNarrowOopShift());
+ debugger.putHeapConst(soleInstance.getHeapOopSize(), soleInstance.getKlassPtrSize(),
+ Universe.getNarrowOopBase(), Universe.getNarrowOopShift(),
+ Universe.getNarrowKlassBase(), Universe.getNarrowKlassShift());
}
/** This is used by the debugging system */
@@ -477,6 +485,11 @@ public class VM {
return db.lookupIntConstant(name);
}
+ // Convenience function for conversions
+ static public long getAddressValue(Address addr) {
+ return VM.getVM().getDebugger().getAddressValue(addr);
+ }
+
public long getAddressSize() {
return db.getAddressSize();
}
@@ -531,6 +544,10 @@ public class VM {
public int getHeapOopSize() {
return heapOopSize;
}
+
+ public int getKlassPtrSize() {
+ return klassPtrSize;
+ }
/** Utility routine for getting data structure alignment correct */
public long alignUp(long size, long alignment) {
return (size + alignment - 1) & ~(alignment - 1);
@@ -779,13 +796,13 @@ public class VM {
return compressedOopsEnabled.booleanValue();
}
- public boolean isCompressedHeadersEnabled() {
- if (compressedHeadersEnabled == null) {
- Flag flag = getCommandLineFlag("UseCompressedHeaders");
- compressedHeadersEnabled = (flag == null) ? Boolean.FALSE:
+ public boolean isCompressedKlassPointersEnabled() {
+ if (compressedKlassPointersEnabled == null) {
+ Flag flag = getCommandLineFlag("UseCompressedKlassPointers");
+ compressedKlassPointersEnabled = (flag == null) ? Boolean.FALSE:
(flag.getBool()? Boolean.TRUE: Boolean.FALSE);
}
- return compressedHeadersEnabled.booleanValue();
+ return compressedKlassPointersEnabled.booleanValue();
}
public int getObjectAlignmentInBytes() {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64CurrentFrameGuess.java
deleted file mode 100644
index 6a0acef50f1..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64CurrentFrameGuess.java
+++ /dev/null
@@ -1,80 +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.runtime.ia64;
-
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.ia64.*;
-import sun.jvm.hotspot.code.*;
-import sun.jvm.hotspot.interpreter.*;
-import sun.jvm.hotspot.runtime.*;
-
-/**
Should be able to be used on all ia64 platforms we support
- (Win32, Linux) to implement JavaThread's
- "currentFrameGuess()" functionality. Input is an IA64ThreadContext;
- output is SP, FP, and PC for an IA64Frame. Instantiation of the
- IA64Frame is left to the caller, since we may need to subclass
- IA64Frame to support signal handler frames on Unix platforms.
-
-
This is pretty much impossible on ia64.
-
*/
-
-public class IA64CurrentFrameGuess {
- private IA64ThreadContext context;
- private JavaThread thread;
- private Address spFound;
- private Address fpFound;
- private Address pcFound;
-
- private static final boolean DEBUG = false;
-
- public IA64CurrentFrameGuess(IA64ThreadContext context,
- JavaThread thread) {
- this.context = context;
- this.thread = thread;
- }
-
- /** Returns false if not able to find a frame within a reasonable range. */
- public boolean run(long regionInBytesToSearch) {
- /*
- Without using the stack walking library this is not possible on ia64.
- There is also the issue of walking dynamic code where there is no
- stack walking info generated.
- */
- return false;
- }
-
- public Address getSP() { return null; }
- public Address getFP() { return null; }
- /** May be null if getting values from thread-local storage; take
- care to call the correct IA64Frame constructor to recover this if
- necessary */
- public Address getPC() { return null; }
-
- private void setValues(Address sp, Address fp, Address pc) {
- spFound = sp;
- fpFound = fp;
- pcFound = pc;
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64Frame.java
deleted file mode 100644
index 273d8622bcc..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64Frame.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * 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
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.runtime.ia64;
-
-import java.util.*;
-// import sun.jvm.hotspot.asm.ia64.*;
-import sun.jvm.hotspot.code.*;
-import sun.jvm.hotspot.compiler.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.utilities.*;
-
-/** Specialization of and implementation of abstract methods of the
- Frame class for the ia64 family of CPUs. */
-
-public class IA64Frame extends Frame {
- private static final boolean DEBUG = false;
-
- // All frames
-
- // Interpreter frames
-
- // Entry frames
-
- // Native frames
-
- // an additional field beyond sp and pc:
- // Address raw_fp; // frame pointer only 1.4.2
-
- Address iframe;
-
- private IA64Frame() {
- }
-
- public IA64Frame(Address raw_sp, Address iframe, Address pc) {
- this.raw_sp = raw_sp;
- this.iframe = iframe;
- this.pc = pc;
- if (DEBUG) {
- System.err.println("IA64Frame(sp, iframe, pc): " + this);
- dumpStack();
- }
- }
-
- public Object clone() {
- IA64Frame frame = new IA64Frame();
- frame.raw_sp = raw_sp;
- frame.iframe = iframe;
- frame.pc = pc;
- return frame;
- }
-
- public boolean equals(Object arg) {
- if (arg == null) {
- return false;
- }
-
- if (!(arg instanceof IA64Frame)) {
- return false;
- }
-
- IA64Frame other = (IA64Frame) arg;
-
- return (AddressOps.equal(getSP(), other.getSP()) &&
- AddressOps.equal(getIFRAME(), other.getIFRAME()) &&
- AddressOps.equal(getPC(), other.getPC()));
- }
-
- public int hashCode() {
- if (iframe == null) {
- return 0;
- }
-
- return iframe.hashCode();
- }
-
- public String toString() {
- return "sp: " + (getSP() == null? "null" : getSP().toString()) +
- ", iframe: " + (getIFRAME() == null? "null" : getIFRAME().toString()) +
- ", pc: " + (pc == null? "null" : pc.toString());
- }
-
- // accessors for the instance variables
- public Address getFP() { return null; }
- public Address getIFRAME() { return iframe; }
- public Address getSP() { return raw_sp; }
- public Address getID() { return getFP(); }
-
- // FIXME: not implemented yet
- public boolean isSignalHandlerFrameDbg() { return false; }
- public int getSignalNumberDbg() { return 0; }
- public String getSignalNameDbg() { return null; }
-
- // FIXME: do sanity checks
- public boolean isInterpretedFrameValid() {
- return true;
- }
-
- public boolean isInterpretedFrame() { return iframe != null; }
-
-
- // FIXME: not applicable in current system
- // void patch_pc(Thread* thread, address pc);
-
- public Frame sender(RegisterMap regMap, CodeBlob cb) {
-
- if (iframe == null) {
- return null;
- }
-
- cInterpreter fr = new cInterpreter(iframe);
-
- if (fr.prev() == null) {
- Address wrapper = fr.wrapper();
- if ( wrapper == null) {
- return null;
- }
- IA64JavaCallWrapper jcw = new IA64JavaCallWrapper(wrapper);
- Address iprev = jcw.getPrevIFrame();
- if (iprev == null) {
- return null;
- }
- return new IA64Frame(null, iprev, null);
- } else {
- return new IA64Frame(null, fr.prev(), null);
- }
-
- /*
- IA64RegisterMap map = (IA64RegisterMap) regMap;
-
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(map != null, "map must be set");
- }
-
- // Default is we done have to follow them. The sender_for_xxx will
- // update it accordingly
- map.setIncludeArgumentOops(false);
-
- if (isEntryFrame()) return senderForEntryFrame(map);
- if (isInterpretedFrame()) return senderForInterpreterFrame(map);
-
- if (!VM.getVM().isCore()) {
- if(cb == null) {
- cb = VM.getVM().getCodeCache().findBlob(getPC());
- } else {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(cb.equals(VM.getVM().getCodeCache().findBlob(getPC())), "Must be the same");
- }
- }
-
- if (cb != null) {
- return senderForCompiledFrame(map, cb);
- }
- }
-
- // Must be native-compiled frame, i.e. the marshaling code for native
- // methods that exists in the core system.
- return new IA64Frame(getSenderSP(), getLink(), getSenderPC());
-
- */
- }
-
- private Frame senderForEntryFrame(IA64RegisterMap map) {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(map != null, "map must be set");
- }
- /*
- // Java frame called from C; skip all C frames and return top C
- // frame of that chunk as the sender
- IA64JavaCallWrapper jcw = (IA64JavaCallWrapper) getEntryFrameCallWrapper();
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(!entryFrameIsFirst(), "next Java fp must be non zero");
- Assert.that(jcw.getLastJavaSP().greaterThan(getSP()), "must be above this frame on stack");
- }
- IA64Frame fr = new IA64Frame(jcw.getLastJavaSP(), jcw.getLastJavaFP(), null);
- map.clear();
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(map.getIncludeArgumentOops(), "should be set by clear");
- }
- return fr;
- */
- throw new RuntimeException("senderForEntryFrame NYI");
- }
-
- private Frame senderForInterpreterFrame(IA64RegisterMap map) {
- /*
- Address sp = addressOfStackSlot(INTERPRETER_FRAME_SENDER_SP_OFFSET).getAddressAt(0);
- // We do not need to update the callee-save register mapping because above
- // us is either another interpreter frame or a converter-frame, but never
- // directly a compiled frame.
- return new IA64Frame(sp, getLink(), getSenderPC());
- */
- throw new RuntimeException("senderForInterpreterFrame NYI");
- }
-
- private Frame senderForDeoptimizedFrame(IA64RegisterMap map, CodeBlob cb) {
- // FIXME
- throw new RuntimeException("Deoptimized frames not handled yet");
- }
-
- private Frame senderForCompiledFrame(IA64RegisterMap map, CodeBlob cb) {
- //
- // NOTE: some of this code is (unfortunately) duplicated in IA64CurrentFrameGuess
- //
-
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(map != null, "map must be set");
- }
-
- throw new RuntimeException("senderForCompiledFrame NYI");
-
- /*
-
- // frame owned by optimizing compiler
- Address sender_sp = null;
-
- if (VM.getVM().isClientCompiler()) {
- sender_sp = addressOfStackSlot(SENDER_SP_OFFSET);
- } else {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(cb.getFrameSize() >= 0, "Compiled by Compiler1: do not use");
- }
- sender_sp = getSP().addOffsetTo(cb.getFrameSize());
- }
-
- // On Intel the return_address is always the word on the stack
- Address sender_pc = sender_sp.getAddressAt(-1 * VM.getVM().getAddressSize());
-
- if (map.getUpdateMap() && cb.getOopMaps() != null) {
- OopMapSet.updateRegisterMap(this, cb, map, true);
- }
-
- Address saved_fp = null;
- if (VM.getVM().isClientCompiler()) {
- saved_fp = getFP().getAddressAt(0);
- } else {
- int llink_offset = cb.getLinkOffset();
- if (llink_offset >= 0) {
- // Restore base-pointer, since next frame might be an interpreter frame.
- Address fp_addr = getSP().addOffsetTo(VM.getVM().getAddressSize() * llink_offset);
- saved_fp = fp_addr.getAddressAt(0);
- }
- }
-
- sender_sp = null ; // sp_addr.getAddressAt(0);
-
- return new IA64Frame(sender_sp, saved_fp, sender_pc);
-
- */
- }
-
- protected boolean hasSenderPD() {
- // FIXME
- return true;
- }
-
- public long frameSize() {
- throw new RuntimeException("frameSize NYI");
- /*
- return (getSenderSP().minus(getSP()) / VM.getVM().getAddressSize());
- */
- }
-
- public Address getLink() {
- throw new RuntimeException("getLink NYI");
- /*
- return addressOfStackSlot(LINK_OFFSET).getAddressAt(0);
- */
- }
-
- // FIXME: not implementable yet
- //inline void frame::set_link(intptr_t* addr) { *(intptr_t **)addr_at(link_offset) = addr; }
-
- public Address getUnextendedSP() { return getSP(); }
-
- // Return address:
- /*
- public Address getSenderPCAddr() { return addressOfStackSlot(RETURN_ADDR_OFFSET); }
- */
-
- public Address getSenderPC() { return null; }
-
- /*
- // return address of param, zero origin index.
- public Address getNativeParamAddr(int idx) {
- return addressOfStackSlot(NATIVE_FRAME_INITIAL_PARAM_OFFSET + idx);
- }
- */
-
- public Address getSenderSP() { return null; }
-
- /*
- public Address compiledArgumentToLocationPD(VMReg reg, RegisterMap regMap, int argSize) {
- if (VM.getVM().isCore() || VM.getVM().isClientCompiler()) {
- throw new RuntimeException("Should not reach here");
- }
-
- return oopMapRegToLocation(reg, regMap);
- }
-
- */
-
- public Address addressOfInterpreterFrameLocals() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- return fr.locals();
- }
-
- private Address addressOfInterpreterFrameBCX() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- return fr.bcpAddr();
- }
-
- public int getInterpreterFrameBCI() {
- // FIXME: this is not atomic with respect to GC and is unsuitable
- // for use in a non-debugging, or reflective, system. Need to
- // figure out how to express this.
- Address bcp = addressOfInterpreterFrameBCX().getAddressAt(0);
- Address methodHandle = addressOfInterpreterFrameMethod().getAddressAt(0);
- Method method = (Method)Metadata.instantiateWrapperFor(methodHandle);
- return bcpToBci(bcp, method);
- }
-
- public Address addressOfInterpreterFrameMDX() {
- return null;
- }
-
- // FIXME
- //inline int frame::interpreter_frame_monitor_size() {
- // return BasicObjectLock::size();
- //}
-
- // expression stack
- // (the max_stack arguments are used by the GC; see class FrameClosure)
-
- public Address addressOfInterpreterFrameExpressionStack() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- return fr.stackBase();
- }
-
- public int getInterpreterFrameExpressionStackDirection() { return -1; }
-
- // top of expression stack
- public Address addressOfInterpreterFrameTOS() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- // tos always points to first free element in c++ interpreter not tos
- return fr.stackBase().addOffsetTo(VM.getVM().getAddressSize());
- }
-
- /** Expression stack from top down */
- public Address addressOfInterpreterFrameTOSAt(int slot) {
- return addressOfInterpreterFrameTOS().addOffsetTo(slot * VM.getVM().getAddressSize());
- }
-
- public Address getInterpreterFrameSenderSP() {
- if (Assert.ASSERTS_ENABLED) {
- Assert.that(isInterpretedFrame(), "interpreted frame expected");
- }
- throw new RuntimeException("getInterpreterFrameSenderSP NYI");
- }
-
- // Monitors
- public BasicObjectLock interpreterFrameMonitorBegin() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- return new BasicObjectLock(fr.monitorBase());
- }
-
- public BasicObjectLock interpreterFrameMonitorEnd() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- // Monitors end is just above stack base (2 slots per monitor)
- Address result = fr.stackBase().addOffsetTo(2 * VM.getVM().getAddressSize());
- /*
- if (Assert.ASSERTS_ENABLED) {
- // make sure the pointer points inside the frame
- Assert.that(AddressOps.gt(getFP(), result), "result must < than frame pointer");
- Assert.that(AddressOps.lte(getSP(), result), "result must >= than stack pointer");
- }
- */
- return new BasicObjectLock(result);
- }
-
- public int interpreterFrameMonitorSize() {
- return BasicObjectLock.size();
- }
-
- // Method
- public Address addressOfInterpreterFrameMethod() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- return fr.methodAddr();
- }
-
- // Constant pool cache
- public Address addressOfInterpreterFrameCPCache() {
- if (iframe == null) {
- throw new RuntimeException("Not an Interpreter frame");
- }
- cInterpreter fr = new cInterpreter(iframe);
- return fr.constantsAddr();
- }
-
- // Entry frames
- public JavaCallWrapper getEntryFrameCallWrapper() {
- throw new RuntimeException("getEntryFrameCallWrapper NYI");
- }
-
- protected Address addressOfSavedOopResult() {
- throw new RuntimeException("public boolean isInterpretedFrame() NYI");
- /*
- // offset is 2 for compiler2 and 3 for compiler1
- return getSP().addOffsetTo((VM.getVM().isClientCompiler() ? 2 : 3) *
- VM.getVM().getAddressSize());
- */
- }
-
- protected Address addressOfSavedReceiver() {
- throw new RuntimeException("getEntryFrameCallWrapper NYI");
- // return getSP().addOffsetTo(-4 * VM.getVM().getAddressSize());
- }
-
- private void dumpStack() {
- /*
- if (getFP() != null) {
- for (Address addr = getSP().addOffsetTo(-5 * VM.getVM().getAddressSize());
- AddressOps.lte(addr, getFP().addOffsetTo(5 * VM.getVM().getAddressSize()));
- addr = addr.addOffsetTo(VM.getVM().getAddressSize())) {
- System.out.println(addr + ": " + addr.getAddressAt(0));
- }
- } else {
- for (Address addr = getSP().addOffsetTo(-5 * VM.getVM().getAddressSize());
- AddressOps.lte(addr, getSP().addOffsetTo(20 * VM.getVM().getAddressSize()));
- addr = addr.addOffsetTo(VM.getVM().getAddressSize())) {
- System.out.println(addr + ": " + addr.getAddressAt(0));
- }
- }
- */
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64JavaCallWrapper.java
deleted file mode 100644
index 6b3d45cedca..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64JavaCallWrapper.java
+++ /dev/null
@@ -1,56 +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.runtime.ia64;
-
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.runtime.*;
-
-public class IA64JavaCallWrapper extends JavaCallWrapper {
- private static AddressField lastJavaIFrameField;
-
- static {
- VM.registerVMInitializedObserver(new Observer() {
- public void update(Observable o, Object data) {
- initialize(VM.getVM().getTypeDataBase());
- }
- });
- }
-
- private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("JavaCallWrapper");
-
- lastJavaIFrameField = type.getAddressField("_last_Java_iframe");
- }
-
- public IA64JavaCallWrapper(Address addr) {
- super(addr);
- }
-
- public Address getPrevIFrame() {
- return lastJavaIFrameField.getValue(addr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64RegisterMap.java
deleted file mode 100644
index 99c358d0d2e..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/IA64RegisterMap.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please 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.runtime.ia64;
-
-import sun.jvm.hotspot.asm.ia64.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.runtime.*;
-
-public class IA64RegisterMap extends RegisterMap {
-
- /** This is the only public constructor */
- public IA64RegisterMap(JavaThread thread, boolean updateMap) {
- super(thread, updateMap);
- }
-
- protected IA64RegisterMap(RegisterMap map) {
- super(map);
- }
-
- public Object clone() {
- IA64RegisterMap retval = new IA64RegisterMap(this);
- return retval;
- }
-
- // no PD state to clear or copy:
- protected void clearPD() {}
- protected void initializePD() {}
- protected void initializeFromPD(RegisterMap map) {}
- protected Address getLocationPD(VMReg reg) { return null; }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/cInterpreter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/cInterpreter.java
deleted file mode 100644
index 72419755da9..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ia64/cInterpreter.java
+++ /dev/null
@@ -1,199 +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.runtime.ia64;
-
-import java.util.*;
-// import sun.jvm.hotspot.asm.ia64.*;
-import sun.jvm.hotspot.code.*;
-import sun.jvm.hotspot.compiler.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.oops.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.utilities.*;
-
-/** Specialization of and implementation of abstract methods of the
- Frame class for the ia64 family of CPUs. */
-
-public class cInterpreter extends VMObject {
- private static final boolean DEBUG = true;
-
- private static AddressField bcpField;
- private static AddressField localsField;
- private static AddressField constantsField;
- private static AddressField methodField;
- private static AddressField stackField; // i.e. tos
- private static AddressField stackBaseField; // ultimate bottom of stack
- private static AddressField stackLimitField; // ultimate top of stack
- private static AddressField monitorBaseField;
- private static CIntegerField messageField;
- private static AddressField prevFieldField;
- private static AddressField wrapperField;
- private static AddressField prevField;
-
- private static int NO_REQUEST;
- private static int INITIALIZE;
- private static int METHOD_ENTRY;
- private static int METHOD_RESUME;
- private static int GOT_MONITORS;
- private static int RETHROW_EXCEPTION;
- private static int CALL_METHOD;
- private static int RETURN_FROM_METHOD;
- private static int RETRY_METHOD;
- private static int MORE_MONITORS;
- private static int THROWING_EXCEPTION;
- private static int POPPING_FRAME;
-
- static {
- VM.registerVMInitializedObserver(new Observer() {
- public void update(Observable o, Object data) {
- initialize(VM.getVM().getTypeDataBase());
- }
- });
- }
-
- private static synchronized void initialize(TypeDataBase db) {
-
- Type cInterpreterType = db.lookupType("cInterpreter");
- bcpField = cInterpreterType.getAddressField("_bcp");
- localsField = cInterpreterType.getAddressField("_locals");
- constantsField = cInterpreterType.getAddressField("_constants");
- methodField = cInterpreterType.getAddressField("_method");
- stackField = cInterpreterType.getAddressField("_stack");
- stackBaseField = cInterpreterType.getAddressField("_stack_base");
- stackLimitField = cInterpreterType.getAddressField("_stack_limit");
- monitorBaseField = cInterpreterType.getAddressField("_monitor_base");
- // messageField = cInterpreterType.getCIntegerField("_msg");
- messageField = null;
- wrapperField = cInterpreterType.getAddressField("_wrapper");
- prevField = cInterpreterType.getAddressField("_prev_link");
-
- /*
- NO_REQUEST = db.lookupIntConstant("no_request").intValue();
- INITIALIZE = db.lookupIntConstant("initialize").intValue();
- METHOD_ENTRY = db.lookupIntConstant("method_entry").intValue();
- METHOD_RESUME = db.lookupIntConstant("method_resume").intValue();
- GOT_MONITORS = db.lookupIntConstant("got_monitors").intValue();
- RETHROW_EXCEPTION = db.lookupIntConstant("rethrow_exception").intValue();
- CALL_METHOD = db.lookupIntConstant("call_method").intValue();
- RETURN_FROM_METHOD = db.lookupIntConstant("return_from_method").intValue();
- RETRY_METHOD = db.lookupIntConstant("retry_method").intValue();
- MORE_MONITORS = db.lookupIntConstant("more_monitors").intValue();
- THROWING_EXCEPTION = db.lookupIntConstant("throwing_exception").intValue();
- POPPING_FRAME = db.lookupIntConstant("popping_frame").intValue();
- */
- }
-
-
- public cInterpreter(Address addr) {
- super(addr);
- }
-
- public Address prev() {
- return prevField.getValue(addr);
- }
-
- public Address locals() {
-
- Address val = localsField.getValue(addr);
- return val;
- }
-
- public Address localsAddr() {
-
- Address localsAddr = localsField.getValue(addr);
- return localsAddr;
- }
-
- public Address bcp() {
-
- Address val = bcpField.getValue(addr);
- return val;
- }
-
- public Address bcpAddr() {
-
- Address bcpAddr = addr.addOffsetTo(bcpField.getOffset());
- return bcpAddr;
- }
-
- public Address constants() {
-
- Address val = constantsField.getValue(addr);
- return val;
- }
-
- public Address constantsAddr() {
-
- Address constantsAddr = constantsField.getValue(addr);
- return constantsAddr;
- }
-
- public Address method() {
-
- Address val = methodField.getValue(addr);
- return val;
- }
- public Address methodAddr() {
-
- Address methodAddr = addr.addOffsetTo(methodField.getOffset());
- return methodAddr;
- }
-
- public Address stack() {
-
- Address val = stackField.getValue(addr);
- return val;
- }
-
- public Address stackBase() {
-
- Address val = stackBaseField.getValue(addr);
- return val;
- }
-
- public Address stackLimit() {
-
- Address val = stackLimitField.getValue(addr);
- return val;
- }
-
- public Address monitorBase() {
-
- Address val = monitorBaseField.getValue(addr);
- return val;
- }
-
- public Address wrapper() {
-
- return wrapperField.getValue(addr);
- }
-
- public int message() {
- int val = (int) messageField.getValue(addr);
- return val;
- }
-
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ia64/LinuxIA64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ia64/LinuxIA64JavaThreadPDAccess.java
deleted file mode 100644
index a0e36d59b7b..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_ia64/LinuxIA64JavaThreadPDAccess.java
+++ /dev/null
@@ -1,137 +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.runtime.linux_ia64;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.ia64.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.runtime.ia64.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.utilities.*;
-
-public class LinuxIA64JavaThreadPDAccess implements JavaThreadPDAccess {
- // private static AddressField lastJavaPCField;
- // private static AddressField lastJavaFPField;
- private static AddressField lastJavaIFrameField;
- private static AddressField osThreadField;
-
- // Field from OSThread
- private static CIntegerField osThreadPThreadIDField;
-
- // This is currently unneeded but is being kept in case we change
- // the currentFrameGuess algorithm
- private static final long GUESS_SCAN_RANGE = 128 * 1024;
-
- static {
- VM.registerVMInitializedObserver(new Observer() {
- public void update(Observable o, Object data) {
- initialize(VM.getVM().getTypeDataBase());
- }
- });
- }
-
- private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("JavaThread");
-
- lastJavaIFrameField = type.getAddressField("_last_Java_iframe");
- osThreadField = type.getAddressField("_osthread");
-
- type = db.lookupType("OSThread");
- osThreadPThreadIDField = type.getCIntegerField("_pthread_id");
- }
-
- public Address getLastJavaIFrame(Address addr) {
- return lastJavaIFrameField.getValue(addr);
- }
-
-
- public Address getBaseOfStackPointer(Address addr) {
- return null;
- }
-
- public Address getLastJavaFP(Address addr) {
- return null; // Not in 1.4.1
- }
-
- public Address getLastJavaPC(Address addr) {
- return null; // Not in 1.4.1
- }
-
- public boolean isInterpretedFrame() {
-
- // In 1.4.1 there are only interpreted frames
- // and there is no pc
- return true;
- }
-
- public Frame getLastFramePD(JavaThread thread, Address addr) {
- // The thread is the JavaThread that contains "this"
- // so we don't need any new accessor at the JavaThread level
- Address iframe = getLastJavaIFrame(addr);
- Address pc = thread.getLastJavaPC();
- if (iframe == null) {
- return null; // no information
- }
- return new IA64Frame(thread.getLastJavaSP(), iframe, pc);
- }
-
- public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) {
- return new IA64RegisterMap(thread, updateMap);
- }
-
- public Frame getCurrentFrameGuess(JavaThread thread, Address addr) {
- return getLastFramePD(thread, addr);
- }
-
- public void printThreadIDOn(Address addr, PrintStream tty) {
- tty.print(getThreadProxy(addr));
- }
-
- public void printInfoOn(Address threadAddr, PrintStream tty) {
- tty.print("Thread id: ");
- printThreadIDOn(threadAddr, tty);
- tty.println("\nLastJavaIFrame: " + getLastJavaIFrame(threadAddr));
- }
-
- public Address getLastSP(Address addr) {
- ThreadProxy t = getThreadProxy(addr);
- IA64ThreadContext context = (IA64ThreadContext) t.getContext();
- return context.getRegisterAsAddress(IA64ThreadContext.SP);
- }
-
- public ThreadProxy getThreadProxy(Address addr) {
- // Addr is the address of the JavaThread.
- // Fetch the OSThread (for now and for simplicity, not making a
- // separate "OSThread" class in this package)
- Address osThreadAddr = osThreadField.getValue(addr);
- // Get the address of the _pthread_id from the OSThread
- Address pthreadIdAddr = osThreadAddr.addOffsetTo(osThreadPThreadIDField.getOffset());
-
- JVMDebugger debugger = VM.getVM().getDebugger();
- return debugger.getThreadForIdentifierAddress(pthreadIdAddr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_ia64/Win32IA64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_ia64/Win32IA64JavaThreadPDAccess.java
deleted file mode 100644
index 48014ab3938..00000000000
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/win32_ia64/Win32IA64JavaThreadPDAccess.java
+++ /dev/null
@@ -1,137 +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.runtime.win32_ia64;
-
-import java.io.*;
-import java.util.*;
-import sun.jvm.hotspot.debugger.*;
-import sun.jvm.hotspot.debugger.ia64.*;
-import sun.jvm.hotspot.runtime.*;
-import sun.jvm.hotspot.runtime.ia64.*;
-import sun.jvm.hotspot.types.*;
-import sun.jvm.hotspot.utilities.*;
-
-public class Win32IA64JavaThreadPDAccess implements JavaThreadPDAccess {
- // private static AddressField lastJavaPCField;
- // private static AddressField lastJavaFPField;
- private static AddressField lastJavaIFrameField;
- private static AddressField osThreadField;
-
- // Field from OSThread
- private static CIntegerField osThreadPThreadIDField;
-
- // This is currently unneeded but is being kept in case we change
- // the currentFrameGuess algorithm
- private static final long GUESS_SCAN_RANGE = 128 * 1024;
-
- static {
- VM.registerVMInitializedObserver(new Observer() {
- public void update(Observable o, Object data) {
- initialize(VM.getVM().getTypeDataBase());
- }
- });
- }
-
- private static synchronized void initialize(TypeDataBase db) {
- Type type = db.lookupType("JavaThread");
-
- lastJavaIFrameField = type.getAddressField("_last_Java_iframe");
- osThreadField = type.getAddressField("_osthread");
-
- type = db.lookupType("OSThread");
- osThreadPThreadIDField = type.getCIntegerField("_pthread_id");
- }
-
- public Address getLastJavaIFrame(Address addr) {
- return lastJavaIFrameField.getValue(addr);
- }
-
-
- public Address getBaseOfStackPointer(Address addr) {
- return null;
- }
-
- public Address getLastJavaFP(Address addr) {
- return null; // Not in 1.4.1
- }
-
- public Address getLastJavaPC(Address addr) {
- return null; // Not in 1.4.1
- }
-
- public boolean isInterpretedFrame() {
-
- // In 1.4.1 there are only interpreted frames
- // and there is no pc
- return true;
- }
-
- public Frame getLastFramePD(JavaThread thread, Address addr) {
- // The thread is the JavaThread that contains "this"
- // so we don't need any new accessor at the JavaThread level
- Address iframe = getLastJavaIFrame(addr);
- Address pc = thread.getLastJavaPC();
- if (iframe == null) {
- return null; // no information
- }
- return new IA64Frame(thread.getLastJavaSP(), iframe, pc);
- }
-
- public RegisterMap newRegisterMap(JavaThread thread, boolean updateMap) {
- return new IA64RegisterMap(thread, updateMap);
- }
-
- public Frame getCurrentFrameGuess(JavaThread thread, Address addr) {
- return getLastFramePD(thread, addr);
- }
-
- public void printThreadIDOn(Address addr, PrintStream tty) {
- tty.print(getThreadProxy(addr));
- }
-
- public void printInfoOn(Address threadAddr, PrintStream tty) {
- tty.print("Thread id: ");
- printThreadIDOn(threadAddr, tty);
- tty.println("\nLastJavaIFrame: " + getLastJavaIFrame(threadAddr));
- }
-
- public Address getLastSP(Address addr) {
- ThreadProxy t = getThreadProxy(addr);
- IA64ThreadContext context = (IA64ThreadContext) t.getContext();
- return context.getRegisterAsAddress(IA64ThreadContext.SP);
- }
-
- public ThreadProxy getThreadProxy(Address addr) {
- // Addr is the address of the JavaThread.
- // Fetch the OSThread (for now and for simplicity, not making a
- // separate "OSThread" class in this package)
- Address osThreadAddr = osThreadField.getValue(addr);
- // Get the address of the _pthread_id from the OSThread
- Address pthreadIdAddr = osThreadAddr.addOffsetTo(osThreadPThreadIDField.getOffset());
-
- JVMDebugger debugger = VM.getVM().getDebugger();
- return debugger.getThreadForIdentifierAddress(pthreadIdAddr);
- }
-}
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java
index 707df689e70..4cde2902043 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/x86/X86RegisterMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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,7 +24,6 @@
package sun.jvm.hotspot.runtime.x86;
-import sun.jvm.hotspot.asm.x86.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
index d7c9913da1b..954052703c8 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
@@ -354,15 +354,14 @@ public class ClassWriter implements /* imports */ ClassConstants
}
protected void writeFields() throws IOException {
- U2Array fields = klass.getFields();
- final int length = (int) fields.length();
+ final int javaFieldsCount = klass.getJavaFieldsCount();
// write number of fields
- dos.writeShort((short) length);
+ dos.writeShort((short) javaFieldsCount);
- if (DEBUG) debugMessage("number of fields = " + length);
+ if (DEBUG) debugMessage("number of fields = " + javaFieldsCount);
- for (int index = 0; index < length; index++) {
+ for (int index = 0; index < javaFieldsCount; index++) {
short accessFlags = klass.getFieldAccessFlags(index);
dos.writeShort(accessFlags & (short) JVM_RECOGNIZED_FIELD_MODIFIERS);
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
index 5f673f26e46..91993feea8c 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
@@ -27,10 +27,6 @@ package sun.jvm.hotspot.ui.classbrowser;
import java.io.*;
import java.util.*;
import sun.jvm.hotspot.asm.*;
-import sun.jvm.hotspot.asm.sparc.*;
-import sun.jvm.hotspot.asm.x86.*;
-import sun.jvm.hotspot.asm.ia64.*;
-import sun.jvm.hotspot.asm.amd64.*;
import sun.jvm.hotspot.code.*;
import sun.jvm.hotspot.compiler.*;
import sun.jvm.hotspot.debugger.*;
@@ -182,40 +178,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
spaces = " ";
tab = " ";
}
- }
-
- private static CPUHelper cpuHelper;
- static {
- VM.registerVMInitializedObserver(new Observer() {
- public void update(Observable o, Object data) {
- initialize();
- }
- });
- }
-
- private static synchronized void initialize() {
- String cpu = VM.getVM().getCPU();
- if (cpu.equals("sparc")) {
- cpuHelper = new SPARCHelper();
- } else if (cpu.equals("x86")) {
- cpuHelper = new X86Helper();
- } else if (cpu.equals("amd64") || cpu.equals("x86_64")) {
- cpuHelper = new AMD64Helper();
- } else if (cpu.equals("ia64")) {
- cpuHelper = new IA64Helper();
- } else {
- try {
- cpuHelper = (CPUHelper)Class.forName("sun.jvm.hotspot.asm." +
- cpu.toLowerCase() + "." + cpu.toUpperCase() +
- "Helper").newInstance();
- } catch (Exception e) {
- throw new RuntimeException("cpu '" + cpu + "' is not yet supported!");
- }
- }
- }
-
- protected static synchronized CPUHelper getCPUHelper() {
- return cpuHelper;
}
protected String escapeHTMLSpecialChars(String value) {
@@ -827,10 +789,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
}
}
- protected Disassembler createDisassembler(long startPc, byte[] code) {
- return getCPUHelper().createDisassembler(startPc, code);
- }
-
protected SymbolFinder createSymbolFinder() {
return new DummySymbolFinder();
}
@@ -892,17 +850,9 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
return genHTMLForRawDisassembly(pc, null);
}
- protected byte[] readBuffer(sun.jvm.hotspot.debugger.Address addr, int size) {
- byte[] buf = new byte[size];
- for (int b = 0; b < size; b++) {
- buf[b] = (byte) addr.getJByteAt(b);
- }
- return buf;
- }
-
- public String genHTMLForRawDisassembly(sun.jvm.hotspot.debugger.Address startPc, int size) {
+ public String genHTMLForRawDisassembly(sun.jvm.hotspot.debugger.Address startPc, int size) {
try {
- return genHTMLForRawDisassembly(startPc, null, readBuffer(startPc, size));
+ return genHTMLForRawDisassembly(startPc, size, null);
} catch (Exception exp) {
return genHTMLErrorMessage(exp);
}
@@ -911,7 +861,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
protected String genHTMLForRawDisassembly(sun.jvm.hotspot.debugger.Address startPc,
String prevPCs) {
try {
- return genHTMLForRawDisassembly(startPc, prevPCs, readBuffer(startPc, NATIVE_CODE_SIZE));
+ return genHTMLForRawDisassembly(startPc, NATIVE_CODE_SIZE, prevPCs);
} catch (Exception exp) {
return genHTMLErrorMessage(exp);
}
@@ -928,25 +878,28 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
return buf.toString();
}
- protected String genPCHref(long currentPc, sun.jvm.hotspot.asm.Address addr) {
- String href = null;
- if (addr instanceof PCRelativeAddress) {
- PCRelativeAddress pcRelAddr = (PCRelativeAddress) addr;
- href = genPCHref(currentPc + pcRelAddr.getDisplacement());
- } else if(addr instanceof DirectAddress) {
- href = genPCHref(((DirectAddress) addr).getValue());
- }
-
- return href;
+ protected String genPCHref(Address addr) {
+ return genPCHref(addressToLong(addr));
}
- class RawCodeVisitor implements InstructionVisitor {
+ class HTMLDisassembler implements InstructionVisitor {
private int instrSize = 0;
private Formatter buf;
private SymbolFinder symFinder = createSymbolFinder();
+ private long pc;
+ private OopMapSet oms;
+ private CodeBlob blob;
+ private NMethod nmethod;
- RawCodeVisitor(Formatter buf) {
+ HTMLDisassembler(Formatter buf, CodeBlob blob) {
this.buf = buf;
+ this.blob = blob;
+ if (blob != null) {
+ if (blob instanceof NMethod) {
+ nmethod = (NMethod)blob;
+ }
+ oms = blob.getOopMaps();
+ }
}
public int getInstructionSize() {
@@ -956,26 +909,68 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
public void prologue() {
}
- public void visit(long currentPc, Instruction instr) {
- String href = null;
- if (instr.isCall()) {
- CallInstruction call = (CallInstruction) instr;
- sun.jvm.hotspot.asm.Address addr = call.getBranchDestination();
- href = genPCHref(currentPc, addr);
- }
+ public void beginInstruction(long currentPc) {
+ pc = currentPc;
- instrSize += instr.getSize();
- buf.append("0x");
- buf.append(Long.toHexString(currentPc));
- buf.append(':');
- buf.append(tab);
+ sun.jvm.hotspot.debugger.Address adr = longToAddress(pc);
+ if (nmethod != null) {
+ if (adr.equals(nmethod.getEntryPoint())) print("[Entry Point]\n");
+ if (adr.equals(nmethod.getVerifiedEntryPoint())) print("[Verified Entry Point]\n");
+ if (adr.equals(nmethod.exceptionBegin())) print("[Exception Handler]\n");
+ if (adr.equals(nmethod.stubBegin()) &&
+ !nmethod.stubBegin().equals(nmethod.stubEnd())) print("[Stub Code]\n");
+ // if (adr.equals(nmethod.constsBegin())) print("[Constants]\n");
+ }
- if (href != null) {
- buf.link(href, instr.asString(currentPc, symFinder));
- } else {
- buf.append(instr.asString(currentPc, symFinder));
- }
- buf.br();
+ buf.append(adr.toString());
+ buf.append(':');
+ buf.append(tab);
+ }
+
+ public void printAddress(long address) {
+ sun.jvm.hotspot.debugger.Address addr = longToAddress(address);
+ if (VM.getVM().getCodeCache().contains(addr)) {
+ buf.link(genPCHref(address), addr.toString());
+ } else {
+ buf.append(addr.toString());
+ }
+ }
+
+ public void print(String s) {
+ buf.append(s);
+ }
+
+ public void endInstruction(long endPc) {
+ instrSize += endPc - pc;
+ if (genHTML) buf.br();
+
+ if (nmethod != null) {
+ ScopeDesc sd = nmethod.scope_desc_in(pc, endPc);
+ if (sd != null) {
+ buf.br();
+ buf.append(genSafepointInfo(nmethod, sd));
+ }
+ }
+
+ if (oms != null) {
+ long base = addressToLong(blob.codeBegin());
+ for (int i = 0, imax = (int)oms.getSize(); i < imax; i++) {
+ OopMap om = oms.getMapAt(i);
+ long omspc = base + om.getOffset();
+ if (omspc > pc) {
+ if (omspc <= endPc) {
+ buf.br();
+ buf.append(genOopMapInfo(om));
+ // st.move_to(column);
+ // visitor.print("; ");
+ // om.print_on(st);
+ }
+ break;
+ }
+ }
+ }
+ // follow each complete insn by a nice newline
+ buf.br();
}
public void epilogue() {
@@ -983,13 +978,11 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
};
protected String genHTMLForRawDisassembly(sun.jvm.hotspot.debugger.Address addr,
- String prevPCs,
- byte[] code) {
+ int size,
+ String prevPCs) {
try {
- long startPc = addressToLong(addr);
- Disassembler disasm = createDisassembler(startPc, code);
final Formatter buf = new Formatter(genHTML);
- buf.genHTMLPrologue("Disassembly @0x" + Long.toHexString(startPc));
+ buf.genHTMLPrologue("Disassembly @ " + addr);
if (prevPCs != null && genHTML) {
buf.beginTag("p");
@@ -999,11 +992,12 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.h3("Code");
- RawCodeVisitor visitor = new RawCodeVisitor(buf);
- disasm.decode(visitor);
+ HTMLDisassembler visitor = new HTMLDisassembler(buf, null);
+ Disassembler.decode(visitor, null, addr, addr.addOffsetTo(size));
if (genHTML) buf.beginTag("p");
Formatter tmpBuf = new Formatter(genHTML);
+ long startPc = addressToLong(addr);
tmpBuf.append("0x");
tmpBuf.append(Long.toHexString(startPc + visitor.getInstructionSize()).toString());
tmpBuf.append(",0x");
@@ -1024,8 +1018,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
}
}
- protected String genSafepointInfo(NMethod nm, PCDesc pcDesc) {
- ScopeDesc sd = nm.getScopeDescAt(pcDesc.getRealPC(nm));
+ protected String genSafepointInfo(NMethod nm, ScopeDesc sd) {
Formatter buf = new Formatter(genHTML);
Formatter tabs = new Formatter(genHTML);
tabs.append(tab + tab + tab); // Initial indent for debug info
@@ -1040,8 +1033,6 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
genScObjInfo(buf, tabs, sd);
buf.endTag("pre");
- buf.append(genOopMapInfo(nm, pcDesc));
-
return buf.toString();
}
@@ -1229,7 +1220,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append(omvIterator.iterate(oms, "Oops:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.NARROWOOP_VALUE);
- buf.append(omvIterator.iterate(oms, "narrowOops:", false));
+ buf.append(omvIterator.iterate(oms, "NarrowOops:", false));
oms = new OopMapStream(map, OopMapValue.OopTypes.VALUE_VALUE);
buf.append(omvIterator.iterate(oms, "Values:", false));
@@ -1433,76 +1424,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.append(genMethodAndKlassLink(nmethod.getMethod()));
buf.h3("Compiled Code");
- sun.jvm.hotspot.debugger.Address instsBegin = nmethod.instsBegin();
- sun.jvm.hotspot.debugger.Address instsEnd = nmethod.instsEnd();
- final int instsSize = nmethod.instsSize();
- final long startPc = addressToLong(instsBegin);
- final byte[] code = new byte[instsSize];
- for (int i=0; i < code.length; i++)
- code[i] = instsBegin.getJByteAt(i);
-
- final long verifiedEntryPoint = addressToLong(nmethod.getVerifiedEntryPoint());
- final long entryPoint = addressToLong(nmethod.getEntryPoint());
- final Map safepoints = nmethod.getSafepoints();
-
- final SymbolFinder symFinder = createSymbolFinder();
- final Disassembler disasm = createDisassembler(startPc, code);
- class NMethodVisitor implements InstructionVisitor {
- public void prologue() {
- }
-
- public void visit(long currentPc, Instruction instr) {
- String href = null;
- if (instr.isCall()) {
- CallInstruction call = (CallInstruction) instr;
- sun.jvm.hotspot.asm.Address addr = call.getBranchDestination();
- href = genPCHref(currentPc, addr);
- }
-
- if (currentPc == verifiedEntryPoint) {
- buf.bold("Verified Entry Point"); buf.br();
- }
- if (currentPc == entryPoint) {
- buf.bold(">Entry Point"); buf.br();
- }
-
- PCDesc pcDesc = (PCDesc) safepoints.get(longToAddress(currentPc));
-
- if (pcDesc != null) {
- buf.append(genSafepointInfo(nmethod, pcDesc));
- }
-
- buf.append("0x");
- buf.append(Long.toHexString(currentPc));
- buf.append(':');
- buf.append(tab);
-
- if (href != null) {
- buf.link(href, instr.asString(currentPc, symFinder));
- } else {
- buf.append(instr.asString(currentPc, symFinder));
- }
-
- buf.br();
- }
-
- public void epilogue() {
- }
- };
-
- disasm.decode(new NMethodVisitor());
-
- sun.jvm.hotspot.debugger.Address stubBegin = nmethod.stubBegin();
- if (stubBegin != null) {
- sun.jvm.hotspot.debugger.Address stubEnd = nmethod.stubEnd();
- buf.h3("Stub");
- long stubStartPc = addressToLong(stubBegin);
- long stubEndPc = addressToLong(stubEnd);
- int range = (int) (stubEndPc - stubStartPc);
- byte[] stubCode = readBuffer(stubBegin, range);
- Disassembler disasm2 = createDisassembler(stubStartPc, stubCode);
- disasm2.decode(new NMethodVisitor());
- }
+ Disassembler.decode(new HTMLDisassembler(buf, nmethod), nmethod);
buf.genHTMLEpilogue();
return buf.toString();
} catch (Exception exp) {
@@ -1517,72 +1439,7 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
buf.h3("CodeBlob");
buf.h3("Compiled Code");
- final sun.jvm.hotspot.debugger.Address codeBegin = blob.codeBegin();
- final int codeSize = blob.getCodeSize();
- final long startPc = addressToLong(codeBegin);
- final byte[] code = new byte[codeSize];
- for (int i=0; i < code.length; i++)
- code[i] = codeBegin.getJByteAt(i);
-
- final SymbolFinder symFinder = createSymbolFinder();
- final Disassembler disasm = createDisassembler(startPc, code);
- class CodeBlobVisitor implements InstructionVisitor {
- OopMapSet maps;
- OopMap curMap;
- int curMapIndex;
- long curMapOffset;
- public void prologue() {
- maps = blob.getOopMaps();
- if (maps != null && (maps.getSize() > 0)) {
- curMap = maps.getMapAt(0);
- if (curMap != null) {
- curMapOffset = curMap.getOffset();
- }
- }
- }
-
- public void visit(long currentPc, Instruction instr) {
- String href = null;
- if (instr.isCall()) {
- CallInstruction call = (CallInstruction) instr;
- sun.jvm.hotspot.asm.Address addr = call.getBranchDestination();
- href = genPCHref(currentPc, addr);
- }
-
- buf.append("0x");
- buf.append(Long.toHexString(currentPc));
- buf.append(':');
- buf.append(tab);
-
- if (href != null) {
- buf.link(href, instr.asString(currentPc, symFinder));
- } else {
- buf.append(instr.asString(currentPc, symFinder));
- }
- buf.br();
-
- // See whether we have an oop map at this PC
- if (curMap != null) {
- long curOffset = currentPc - startPc;
- if (curOffset == curMapOffset) {
- buf.append(genOopMapInfo(curMap));
- if (++curMapIndex >= maps.getSize()) {
- curMap = null;
- } else {
- curMap = maps.getMapAt(curMapIndex);
- if (curMap != null) {
- curMapOffset = curMap.getOffset();
- }
- }
- }
- }
- }
-
- public void epilogue() {
- }
- };
-
- disasm.decode(new CodeBlobVisitor());
+ Disassembler.decode(new HTMLDisassembler(buf, blob), blob);
buf.genHTMLEpilogue();
return buf.toString();
@@ -1653,13 +1510,8 @@ public class HTMLGenerator implements /* imports */ ClassConstants {
}
buf.h3("Code");
- long stubStartPc = addressToLong(codelet.codeBegin());
- long stubEndPc = addressToLong(codelet.codeEnd());
- int range = (int) (stubEndPc - stubStartPc);
- byte[] stubCode = readBuffer(codelet.codeBegin(), range);
- Disassembler disasm = createDisassembler(stubStartPc, stubCode);
- disasm.decode(new RawCodeVisitor(buf));
-
+ Disassembler.decode(new HTMLDisassembler(buf, null), null,
+ codelet.codeBegin(), codelet.codeEnd());
Stub next = stubq.getNext(codelet);
if (next != null) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java
index 0f4da3a9218..5b7cfc571eb 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java
index 0296dcbd651..2399fc28c38 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/BasicHashtableEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2004, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java
index 70709f02b84..e9248e74fdc 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/Hashtable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java
index 44f78e49dd8..d86ee992ef0 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableBucket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java
index 38c5968720d..428715f63d6 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/HashtableEntry.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, 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
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java
index b2e9ed20b15..ca1f3baa6ec 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/RobustOopDeterminator.java
@@ -53,9 +53,8 @@ public class RobustOopDeterminator {
private static void initialize(TypeDataBase db) {
Type type = db.lookupType("oopDesc");
- if (VM.getVM().isCompressedHeadersEnabled()) {
- // klassField = type.getNarrowOopField("_metadata._compressed_klass");
- throw new InternalError("unimplemented");
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ klassField = type.getAddressField("_metadata._compressed_klass");
} else {
klassField = type.getAddressField("_metadata._klass");
}
@@ -70,7 +69,11 @@ public class RobustOopDeterminator {
}
try {
// Try to instantiate the Klass
- Metadata.instantiateWrapperFor(klassField.getValue(oop));
+ if (VM.getVM().isCompressedKlassPointersEnabled()) {
+ Metadata.instantiateWrapperFor(oop.getCompKlassAddressAt(klassField.getOffset()));
+ } else {
+ Metadata.instantiateWrapperFor(klassField.getValue(oop));
+ }
return true;
}
catch (AddressException e) {
diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
index b191dda80ca..ad977642bf0 100644
--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
@@ -221,15 +221,6 @@ function main(globals, jvmarg) {
// if "registerCommand" function is defined
// then register few global functions as "commands".
if (typeof(registerCommand) == 'function') {
- this.printDis = function(addr, len) {
- if (!addr) {
- writeln("Usage: dis address [ length ]");
- } else {
- dis(addr, len);
- }
- }
- registerCommand("dis", "dis address [ length ]", "printDis");
-
this.jclass = function(name) {
if (typeof(name) == "string") {
var clazz = sapkg.utilities.SystemDictionaryHelper.findInstanceKlass(name);
@@ -251,15 +242,6 @@ function main(globals, jvmarg) {
}
registerCommand("classes", "classes", "jclasses");
- this.printJDis = function(addr) {
- if (!addr) {
- writeln("Usage: jdis address");
- } else {
- jdis(addr);
- }
- }
- registerCommand("jdis", "jdis address", "printJDis");
-
this.dclass = function(clazz, dir) {
if (!clazz) {
writeln("Usage: dumpclass { address | name } [ directory ]");
@@ -395,18 +377,6 @@ function addr2sym(addr) {
}
}
-// read 'num' bytes at 'addr' and return an array as result.
-// returns Java byte[] type result and not a JavaScript array.
-function readBytesAt(addr, num) {
- addr = any2addr(addr);
- var res = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, num);
- var i;
- for (i = 0; i < num; i++) {
- res[i] = addr.getJByteAt(i);
- }
- return res;
-}
-
// read 'num' words at 'addr' and return an array as result.
// returns Java long[] type result and not a JavaScript array.
function readWordsAt(addr, num) {
@@ -506,54 +476,6 @@ function mem(addr, num) {
writeln();
}
-// return the disassemble class for current CPU
-function disassemblerClass() {
- var DisAsmClass;
- if (CPU == 'x86') {
- DisAsmClass = sapkg.asm.x86.X86Disassembler;
- } else if (CPU == 'sparc') {
- DisAsmClass = sapkg.asm.sparc.SPARCV9Disassembler;
- }
- return DisAsmClass;
-}
-
-// print native code disassembly of 'num' bytes at 'addr'
-function dis(addr, num) {
- addr = any2addr(addr);
- var nmethod = findNMethod(addr);
- if (nmethod != null) {
- // disassemble it as nmethod
- nmethoddis(nmethod);
- } else {
- // raw disassembly
- if (num == undefined) {
- // size of one SPARC instruction and
- // unknown number of Intel instructions.
- num = 4;
- }
- DisAsmClass = disassemblerClass();
- if (DisAsmClass == undefined) {
- // unsupported CPU
- writeln(CPU + " is not yet supported!");
- return;
- }
-
- var bytes = readBytesAt(addr, num);
- var disAsm = new DisAsmClass(addr2num(addr), bytes);
- disAsm.decode(new sapkg.asm.InstructionVisitor() {
- visit: function (pc, instr) {
- write(addr2sym(num2addr(pc)) + ':', '\t');
- writeln(instr.asString(pc,
- new sapkg.asm.SymbolFinder() {
- getSymbolFor: function(addr) {
- return addr2sym(num2addr(addr));
- }
- }));
- }
- });
- }
-}
-
// System dictionary functions
// find InstanceKlass by name
@@ -586,31 +508,6 @@ function forEachPrimArrayKlass(callback) {
sa.sysDict.primArrayClassesDo(new VisitorClass() { visit: callback });
}
-// (hotspot) symbol table functions
-
-// String-to-Symbol
-function str2sym(str) {
- return sa.symTbl.probe(str);
-}
-
-// Symbol-to-String
-function sym2str(sym) {
- return sym.asString();
-}
-
-// oop functions
-
-// Address-to-Oop
-function addr2oop(addr) {
- addr = any2addr(addr);
- return sa.objHeap.newOop(addr.addOffsetToAsOopHandle(0));
-}
-
-// Oop-to-Address
-function oop2addr(oop) {
- return oop.handle;
-}
-
// 'oop' to higher-level java object wrapper in which for(i in o)
// works by iterating java level fields and javaobject.javafield
// syntax works.
@@ -646,202 +543,6 @@ function forEachOopOfKlass(callback, klass, includeSubtypes) {
klass, includeSubtypes);
}
-// code cache functions
-
-// iterates CodeCache for each 'CodeBlob'
-function forEachCodeBlob(callback) {
- var VisitorClass = sapkg.code.CodeCacheVisitor;
- sa.codeCache.iterate(new VisitorClass() { visit: callback });
-}
-
-// find the ClodBlob (if any) that contains given address
-function findCodeBlob(addr) {
- addr = any2addr(addr);
- return sa.codeCache.findBlobUnsafe(addr);
-}
-
-// find the NMethod (if any) that contains given address
-function findNMethod(addr) {
- var codeBlob = findCodeBlob(addr);
- return (codeBlob != null && codeBlob.isNMethod())? codeBlob : null;
-}
-
-// returns PcDesc at given address or null
-function pcDescAt(addr) {
- addr = any2addr(addr);
- var nmethod = findNMethod(addr);
- return (nmethod != null)? nmethod.safepoints.get(addr) : null;
-}
-
-// helpers for nmethod disassembler
-function printScope(scopeDesc) {
- if (scopeDesc == null) {
- return;
- }
- printScope(scopeDesc.sender());
- var method = scopeDesc.method;
- var bci = scopeDesc.BCI;
- var line = -1;
- if (method.hasLineNumberTable()) {
- line = method.getLineNumberFromBCI(bci);
- }
-
- write('\t', method.externalNameAndSignature(), '@', method.handle, 'bci=' + bci);
- if (line != -1) {
- write('line=' + line);
- }
- writeln();
-}
-
-function printSafepointInfo(nmethod, pcDesc) {
- var scopeDesc = nmethod.getScopeDescAt(
- pcDesc.getRealPC(nmethod),
- pcDesc.isAtCall());
- printScope(scopeDesc);
-}
-
-// print disassembly for a given nmethod
-function nmethoddis(nmethod) {
- var DisAsmClass = disassemblerClass();
- if (DisAsmClass == undefined) {
- writeln(CPU + " is not yet supported!");
- return;
- }
-
- var method = nmethod.method;
- writeln('NMethod:', method.externalNameAndSignature(), '@', method.handle);
-
- var codeBegin = nmethod.codeBegin();
- var codeEnd = nmethod.codeEnd();
- var size = codeEnd.minus(codeBegin);
- var code = readBytesAt(codeBegin, size);
- var startPc = addr2num(codeBegin);
- var verifiedEntryPoint = addr2num(nmethod.verifiedEntryPoint);
- var entryPoint = addr2num(nmethod.entryPoint);
- var interpreterEntryPoint = addr2num(nmethod.interpreterEntryPointOrNull);
- var safepoints = nmethod.safepoints;
- var disAsm = new DisAsmClass(startPc, code);
- disAsm.decode(new sapkg.asm.InstructionVisitor() {
- visit: function(curPc, instr) {
- if (curPc == verifiedEntryPoint) {
- writeln();
- writeln("Verified Entry Point:");
- }
- if (curPc == entryPoint) {
- writeln();
- writeln("Entry Point:");
- }
- if (curPc == interpreterEntryPoint) {
- writeln("");
- writeln("Interpreter Entry Point:");
- }
-
- var pcDesc = safepoints.get(num2addr(curPc));
- var isSafepoint = (pcDesc != null);
- if (isSafepoint && pcDesc.isAtCall()) {
- printSafepointInfo(nmethod, pcDesc);
- }
-
- write(num2addr(curPc) + ':', '\t');
- writeln(instr.asString(curPc,
- new sapkg.asm.SymbolFinder() {
- getSymbolFor: function(addr) {
- return addr2sym(num2addr(addr));
- }
- }));
-
- if (isSafepoint && !pcDesc.isAtCall()) {
- printSafepointInfo(nmethod, pcDesc);
- }
- }
- });
-}
-
-// bytecode interpreter functions
-
-// iterates interpreter codelets for each interpreter codelet
-function forEachInterpCodelet(callback) {
- var stubQueue = sa.interpreter.code;
- var stub = stubQueue.first;
- while (stub != null) {
- if (callback(stub) == false) return;
- stub = stubQueue.getNext(stub);
- }
-}
-
-// helper for bytecode disassembler
-function printExceptionTable(method) {
- var expTbl = method.getExceptionTable();
- var len = expTbl.getLength();
- if (len != 0) {
- var i;
- var cpool = method.constants;
- writeln("start", '\t', "end", '\t', "handler", '\t', "exception");
- writeln("");
- for (i = 0; i < len; i += 4) {
- write(expTbl.getIntAt(i), '\t',
- expTbl.getIntAt(i + 1), '\t',
- expTbl.getIntAt(i + 2), '\t');
- var cpIndex = expTbl.getIntAt(i + 3);
- var oop = (cpIndex == 0)? null : cpool.getObjAt(cpIndex);
- if (oop == null) {
- writeln("");
- } else if (oop.isSymbol()) {
- writeln(oop.asString().replace('/', '.'));
- } else if (oop.isKlass()) {
- writeln(oop.name.asString().replace('/', '.'));
- } else {
- writeln(cpIndex);
- }
- }
- }
-}
-
-// print Java bytecode disassembly
-function jdis(method) {
- if (method.getByteCode == undefined) {
- // method oop may be specified by address
- method = addr2oop(any2addr(method));
- }
- writeln(method, '-', method.externalNameAndSignature());
- if (method.isNative()) {
- writeln("native method");
- return;
- }
- if (method.isAbstract()) {
- writeln("abstract method");
- return;
- }
-
- writeln();
- var BytecodeDisAsmClass = sapkg.interpreter.BytecodeDisassembler;
- var disAsm = new BytecodeDisAsmClass(method);
- var bci = 0;
- var hasLines = method.hasLineNumberTable();
- if (hasLines) {
- writeln("bci", '\t', "line", '\t', "instruction");
- } else {
- writeln("bci", '\t', "instruction");
- }
- writeln("");
- disAsm.decode(new sapkg.interpreter.BytecodeVisitor() {
- prologue: function(method) { },
- epilogue: function() { },
- visit: function(bytecode) {
- if (hasLines) {
- var line = method.getLineNumberFromBCI(bci);
- writeln(bci, '\t', line, '\t', bytecode);
- } else {
- writeln(bci, '\t', bytecode);
- }
- bci++;
- }
- });
-
- writeln();
- printExceptionTable(method);
-}
-
// Java thread
// iterates each Thread
diff --git a/hotspot/agent/src/share/native/sadis.c b/hotspot/agent/src/share/native/sadis.c
new file mode 100644
index 00000000000..06525deecf5
--- /dev/null
+++ b/hotspot/agent/src/share/native/sadis.c
@@ -0,0 +1,289 @@
+/*
+ * Copyright 2012, Oracle and/or its affiliates. All Rights Reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+#include "sun_jvm_hotspot_asm_Disassembler.h"
+
+/*
+ * This file implements a binding between Java and the hsdis
+ * dissasembler. It should compile on Linux/Solaris and Windows.
+ * The only platform dependent pieces of the code for doing
+ * dlopen/dlsym to find the entry point in hsdis. All the rest is
+ * standard JNI code.
+ */
+
+#ifdef _WINDOWS
+
+#define snprintf _snprintf
+#define vsnprintf _vsnprintf
+
+#include
+#include
+#include
+#ifdef _DEBUG
+#include
+#endif
+
+#else
+
+#include
+#include
+#include
+
+#endif
+
+#include
+#include
+#include
+#include
+#include
+
+#ifdef _WINDOWS
+static int getLastErrorString(char *buf, size_t len)
+{
+ long errval;
+
+ if ((errval = GetLastError()) != 0)
+ {
+ /* DOS error */
+ size_t n = (size_t)FormatMessage(
+ FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL,
+ errval,
+ 0,
+ buf,
+ (DWORD)len,
+ NULL);
+ if (n > 3) {
+ /* Drop final '.', CR, LF */
+ if (buf[n - 1] == '\n') n--;
+ if (buf[n - 1] == '\r') n--;
+ if (buf[n - 1] == '.') n--;
+ buf[n] = '\0';
+ }
+ return (int)n;
+ }
+
+ if (errno != 0)
+ {
+ /* C runtime error that has no corresponding DOS error code */
+ const char *s = strerror(errno);
+ size_t n = strlen(s);
+ if (n >= len) n = len - 1;
+ strncpy(buf, s, n);
+ buf[n] = '\0';
+ return (int)n;
+ }
+ return 0;
+}
+#endif /* _WINDOWS */
+
+/*
+ * 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 */
+#ifdef _WINDOWS
+ HINSTANCE hsdis_handle;
+ hsdis_handle = LoadLibrary(libname);
+ if (hsdis_handle == NULL) {
+ snprintf(buffer, sizeof(buffer), "%s%s", jrepath, libname);
+ hsdis_handle = LoadLibrary(buffer);
+ }
+ if (hsdis_handle != NULL) {
+ func = (uintptr_t)GetProcAddress(hsdis_handle, "decode_instructions_virtual");
+ }
+ if (func == 0) {
+ getLastErrorString(buffer, sizeof(buffer));
+ error_message = buffer;
+ }
+#else
+ 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();
+ }
+#endif
+
+ (*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.
+ */
+ jclass eclass = (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException");
+ (*env)->ThrowNew(env, eclass, 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);
+ if ((*env)->ExceptionOccurred(env) != NULL) {
+ /* ignore exceptions for now */
+ (*env)->ExceptionClear(env);
+ result = 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);
+ if ((*env)->ExceptionOccurred(env) != NULL) {
+ /* ignore exceptions for now */
+ (*env)->ExceptionClear(env);
+ }
+ 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);
+ if ((*env)->ExceptionOccurred(env) != NULL) {
+ /* ignore exceptions for now */
+ (*env)->ExceptionClear(env);
+ }
+ 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");
+ if ((*env)->ExceptionOccurred(env)) {
+ return;
+ }
+
+ /* find Disassembler.rawPrint callback */
+ denv.raw_print = (*env)->GetMethodID(env, disclass, "rawPrint",
+ "(Lsun/jvm/hotspot/asm/InstructionVisitor;Ljava/lang/String;)V");
+ if ((*env)->ExceptionOccurred(env)) {
+ return;
+ }
+
+ /* 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);
+}
diff --git a/hotspot/agent/test/jdi/jstack.sh b/hotspot/agent/test/jdi/jstack.sh
index 2d23f3dd999..67f7770e092 100644
--- a/hotspot/agent/test/jdi/jstack.sh
+++ b/hotspot/agent/test/jdi/jstack.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2003, 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
@@ -23,10 +23,4 @@
#
#
-OS=`uname`
-
-if [ "$OS" != "Linux" ]; then
- OPTIONS="-Dsun.jvm.hotspot.debugger.useProcDebugger"
-fi
-
$JAVA_HOME/bin/java -showversion ${OPTIONS} -classpath $JAVA_HOME/lib/sa-jdi.jar sun.jvm.hotspot.tools.StackTrace $*
diff --git a/hotspot/agent/test/jdi/jstack64.sh b/hotspot/agent/test/jdi/jstack64.sh
index b62e2ec2efd..cd2a422546b 100644
--- a/hotspot/agent/test/jdi/jstack64.sh
+++ b/hotspot/agent/test/jdi/jstack64.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright (c) 2003, 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
@@ -23,6 +23,4 @@
#
#
-OPTIONS="-Dsun.jvm.hotspot.debugger.useProcDebugger"
-
$JAVA_HOME/bin/java -d64 -showversion ${OPTIONS} -classpath $JAVA_HOME/lib/sa-jdi.jar sun.jvm.hotspot.tools.StackTrace $*
diff --git a/hotspot/agent/test/jdi/runsa.sh b/hotspot/agent/test/jdi/runsa.sh
index d9ab903c52d..aa4d7786326 100644
--- a/hotspot/agent/test/jdi/runsa.sh
+++ b/hotspot/agent/test/jdi/runsa.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# 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
@@ -112,7 +112,6 @@ if [ -z "$jdk" ] ; then
fi
set -x
-#setenv USE_LIBPROC_DEBUGGER "-Dsun.jvm.hotspot.debugger.useProcDebugger -Djava.library.path=$saprocdir"
# If jjh makes this, then the classes are in .../build/agent.
# if someone else does, they are in .
diff --git a/hotspot/agent/test/jdi/sasanity.sh b/hotspot/agent/test/jdi/sasanity.sh
index 19580aa2049..0e155526dd8 100644
--- a/hotspot/agent/test/jdi/sasanity.sh
+++ b/hotspot/agent/test/jdi/sasanity.sh
@@ -1,6 +1,6 @@
#!/bin/ksh
#
-# Copyright (c) 2003, 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
@@ -46,10 +46,6 @@ jdk=$1
shift
OS=`uname`
-if [ "$OS" != "Linux" ]; then
- OPTIONS="-Dsun.jvm.hotspot.debugger.useProcDebugger"
-fi
-
javacp=$jdk/lib/sa-jdi.jar:./workdir
mkdir -p workdir
diff --git a/hotspot/agent/test/libproc/libproctest.sh b/hotspot/agent/test/libproc/libproctest.sh
index fc7df1b482b..9eed0a2db5e 100644
--- a/hotspot/agent/test/libproc/libproctest.sh
+++ b/hotspot/agent/test/libproc/libproctest.sh
@@ -1,7 +1,7 @@
#!/bin/ksh
#
-# Copyright (c) 2003, 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
@@ -59,7 +59,7 @@ gcore $pid
kill -9 $pid
-OPTIONS="-Djava.library.path=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/../solaris/`uname -p` -Dsun.jvm.hotspot.debugger.useProcDebugger"
+OPTIONS="-Djava.library.path=$STARTDIR/../src/os/solaris/proc/`uname -p`:$STARTDIR/../solaris/`uname -p`"
# run libproc client
$SA_JAVA -showversion ${OPTIONS} -cp $STARTDIR/../../build/classes::$STARTDIR/../sa.jar:$STARTDIR LibprocClient x core.$pid
diff --git a/hotspot/agent/test/libproc/libproctest64.sh b/hotspot/agent/test/libproc/libproctest64.sh
index 5fcf709e057..05706d90791 100644
--- a/hotspot/agent/test/libproc/libproctest64.sh
+++ b/hotspot/agent/test/libproc/libproctest64.sh
@@ -1,7 +1,7 @@
#!/bin/ksh
#
-# Copyright (c) 2003, 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
@@ -58,7 +58,7 @@ done
gcore $pid
kill -9 $pid
-OPTIONS="-Djava.library.path=$STARTDIR/../src/os/solaris/proc/sparcv9:$STARTDIR/../solaris/sparcv9 -Dsun.jvm.hotspot.debugger.useProcDebugger"
+OPTIONS="-Djava.library.path=$STARTDIR/../src/os/solaris/proc/sparcv9:$STARTDIR/../solaris/sparcv9"
# run libproc client
$SA_JAVA -d64 -showversion ${OPTIONS} -cp $STARTDIR/../../build/classes::$STARTDIR/../sa.jar:$STARTDIR LibprocClient x core.$pid
diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile
index fc536c12072..a0b7ba7687c 100644
--- a/hotspot/make/Makefile
+++ b/hotspot/make/Makefile
@@ -76,6 +76,8 @@ endif
include $(GAMMADIR)/make/altsrc.make
+-include $(HS_ALT_MAKE)/Makefile.make
+
ifneq ($(ALT_OUTPUTDIR),)
ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR)
else
@@ -88,16 +90,23 @@ C2_VM_TARGETS=product fastdebug optimized jvmg
KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel
ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero
SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark
+MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 jvmgminimal1
-COMMON_VM_PRODUCT_TARGETS=product product1 productkernel docs export_product
-COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 fastdebugkernel docs export_fastdebug
-COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 jvmgkernel docs export_debug
+COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product
+COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug
+COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 docs export_debug
# JDK directory list
JDK_DIRS=bin include jre lib demo
all: all_product all_fastdebug
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+all_product: productminimal1
+all_fastdebug: fastdebugminimal1
+all_debug: jvmgminimal1
+endif
+
ifdef BUILD_CLIENT_ONLY
all_product: product1 docs export_product
all_fastdebug: fastdebug1 docs export_fastdebug
@@ -114,7 +123,7 @@ all_debug: $(COMMON_VM_DEBUG_TARGETS)
endif
endif
-all_optimized: optimized optimized1 optimizedkernel docs export_optimized
+all_optimized: optimized optimized1 docs export_optimized
allzero: all_productzero all_fastdebugzero
all_productzero: productzero docs export_product
@@ -167,6 +176,11 @@ $(SHARK_VM_TARGETS):
$(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \
generic_buildshark $(ALT_OUT)
+$(MINIMAL1_VM_TARGETS):
+ $(CD) $(GAMMADIR)/make; \
+ $(MAKE) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ \
+ generic_buildminimal1 $(ALT_OUT)
+
# Build compiler1 (client) rule, different for platforms
generic_build1:
$(MKDIR) -p $(OUTPUTDIR)
@@ -239,6 +253,27 @@ generic_buildshark:
$(MAKE) -f $(ABS_OS_MAKEFILE) \
$(MAKE_ARGS) $(VM_TARGET)
+generic_buildminimal1:
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+ $(MKDIR) -p $(OUTPUTDIR)
+ ifeq ($(ARCH_DATA_MODEL), 32)
+ ifeq ($(OSNAME),windows)
+ $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
+ else
+ ifeq ($(OSNAME),solaris)
+ $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ;
+ else
+ $(CD) $(OUTPUTDIR); \
+ $(MAKE) -f $(ABS_OS_MAKEFILE) $(MAKE_ARGS) $(VM_TARGET) ;
+ endif
+ endif
+ else
+ @$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
+ endif
+else
+ @$(ECHO) "Error: trying to build a minimal target but JVM_VARIANT_MINIMAL1 is not true."
+endif
+
# Export file rule
generic_export: $(EXPORT_LIST)
export_product:
@@ -287,6 +322,8 @@ C2_DIR=$(C2_BASE_DIR)/$(VM_SUBDIR)
KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR)
ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR)
SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR)
+MINIMAL1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1
+MINIMAL1_DIR=$(MINIMAL1_BASE_DIR)/$(VM_SUBDIR)
ifeq ($(JVM_VARIANT_SERVER), true)
MISC_DIR=$(C2_DIR)
@@ -308,6 +345,10 @@ ifeq ($(JVM_VARIANT_ZERO), true)
MISC_DIR=$(ZERO_DIR)
GEN_DIR=$(ZERO_BASE_DIR)/generated
endif
+ifeq ($(JVM_VARIANT_MINIMAL1), true)
+ MISC_DIR=$(MINIMAL1_DIR)
+ GEN_DIR=$(MINIMAL1_BASE_DIR)/generated
+endif
# Bin files (windows)
ifeq ($(OSNAME),windows)
@@ -357,6 +398,16 @@ $(EXPORT_KERNEL_DIR)/%.map: $(KERNEL_DIR)/%.map
$(install-file)
endif
+# Minimal JVM files always come from minimal area
+$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll
+ $(install-file)
+$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb
+ $(install-file)
+$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map
+ $(install-file)
+
# Shared Library
ifneq ($(OSNAME),windows)
ifeq ($(JVM_VARIANT_SERVER), true)
@@ -411,6 +462,26 @@ ifneq ($(OSNAME),windows)
$(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX)
$(install-file)
endif
+ ifeq ($(JVM_VARIANT_MINIMAL1), true)
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX)
+ $(install-file)
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo
+ $(install-file)
+ $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+ $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz
+ $(install-file)
+ endif
endif
# Jar file (sa-jdi.jar)
@@ -451,7 +522,7 @@ $(EXPORT_DOCS_DIR)/platform/jvmti/%: $(DOCS_DIR)/%
$(install-file)
# Xusage file
-$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE)
+$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt $(EXPORT_MINIMAL_DIR)/Xusage.txt: $(XUSAGE)
$(prep-target)
$(RM) $@.temp
$(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp
@@ -467,6 +538,7 @@ clean_build:
$(RM) -r $(KERNEL_DIR)
$(RM) -r $(ZERO_DIR)
$(RM) -r $(SHARK_DIR)
+ $(RM) -r $(MINIMAL1_DIR)
clean_export:
$(RM) -r $(EXPORT_PATH)
clean_jdk:
@@ -574,10 +646,11 @@ target_help:
@$(ECHO) "create_jdk: Create JDK image, export all files into it"
@$(ECHO) "update_jdk: Update JDK image with fresh exported files"
@$(ECHO) " "
- @$(ECHO) "Others targets are:"
+ @$(ECHO) "Other targets are:"
@$(ECHO) " $(C1_VM_TARGETS)"
@$(ECHO) " $(C2_VM_TARGETS)"
@$(ECHO) " $(KERNEL_VM_TARGETS)"
+ @$(ECHO) " $(MINIMAL1_VM_TARGETS)"
# Variable help (only common ones used by this workspace)
variable_help: variable_help_intro variable_list variable_help_end
@@ -672,9 +745,10 @@ endif
include $(GAMMADIR)/make/jprt.gmk
.PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \
- $(KERNEL_VM_TARGETS) \
- generic_build1 generic_build2 generic_buildkernel generic_export \
+ $(KERNEL_VM_TARGETS) $(MINIMAL1_VM_TARGETS) \
+ generic_build1 generic_build2 generic_buildkernel generic_buildminimal1 generic_export \
export_product export_fastdebug export_debug export_optimized \
export_jdk_product export_jdk_fastdebug export_jdk_debug \
create_jdk copy_jdk update_jdk test_jdk \
- copy_product_jdk copy_fastdebug_jdk copy_debug_jdk
+ copy_product_jdk copy_fastdebug_jdk copy_debug_jdk \
+ $(HS_ALT_MAKE)/Makefile.make
diff --git a/hotspot/make/bsd/Makefile b/hotspot/make/bsd/Makefile
index 518c54fd31b..7c047e99070 100644
--- a/hotspot/make/bsd/Makefile
+++ b/hotspot/make/bsd/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -175,6 +175,10 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# profiledshark shark __shark/profiled
# productshark shark __shark/product
#
+# fastdebugminimal1 minimal1 __minimal1/fastdebug
+# jvmgminimal1 minimal1 __minimal1/jvmg
+# productminimal1 minimal1 __minimal1/product
+#
# What you get with each target:
#
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
@@ -199,6 +203,7 @@ SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
+SUBDIRS_MINIMAL1 = $(addprefix $(OSNAME)_$(BUILDARCH)_minimal1/,$(TARGETS))
TARGETS_C2 = $(TARGETS)
TARGETS_C1 = $(addsuffix 1,$(TARGETS))
@@ -206,6 +211,7 @@ TARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
TARGETS_CORE = $(addsuffix core,$(TARGETS))
TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK = $(addsuffix shark,$(TARGETS))
+TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX)
@@ -223,6 +229,7 @@ all:
@echo " $(TARGETS_CORE)"
@echo " $(TARGETS_ZERO)"
@echo " $(TARGETS_SHARK)"
+ @echo " $(TARGETS_MINIMAL1)"
checks: check_os_version check_j2se_version
@@ -281,6 +288,10 @@ $(SUBDIRS_SHARK): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
+$(SUBDIRS_MINIMAL1): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=minimal1
+
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
@@ -288,52 +299,74 @@ platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(TARGETS_C2): $(SUBDIRS_C2)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
endif
+$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
+endif
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
treeshark: $(SUBDIRS_SHARK)
+treeminimal1: $(SUBDIRS_MINIMAL1)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
@@ -355,17 +388,23 @@ shark: jvmgshark productshark
clean_docs:
rm -rf $(SUBDIR_DOCS)
-clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
+clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark clean_minimal1:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
-clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
+clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_minimal1 clean_docs
include $(GAMMADIR)/make/cscope.make
+#
+# Include alternate Makefile if it exists.
+#
+-include $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
+
#-------------------------------------------------------------------------------
-.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_MINIMAL1)
.PHONY: tree tree1 treecore treezero treeshark
.PHONY: all compiler1 compiler2 core zero shark
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
.PHONY: checks check_os_version check_j2se_version
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
diff --git a/hotspot/make/bsd/makefiles/adlc.make b/hotspot/make/bsd/makefiles/adlc.make
index 2f161cb3fce..ceaa893ec8d 100644
--- a/hotspot/make/bsd/makefiles/adlc.make
+++ b/hotspot/make/bsd/makefiles/adlc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/bsd/makefiles/buildtree.make b/hotspot/make/bsd/makefiles/buildtree.make
index 5d218ff48f9..800b68d225e 100644
--- a/hotspot/make/bsd/makefiles/buildtree.make
+++ b/hotspot/make/bsd/makefiles/buildtree.make
@@ -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
@@ -60,6 +60,7 @@ OS_VENDOR:=$(shell uname -s)
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
+include $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
@@ -163,6 +164,13 @@ ifndef HOTSPOT_VM_DISTRO
endif
endif
+# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
+ifndef OPENJDK
+ ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
+ OPENJDK=true
+ endif
+endif
+
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \
@@ -195,6 +203,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
echo; \
echo "GAMMADIR = $(GAMMADIR)"; \
+ echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \
+ echo "OSNAME = $(OSNAME)"; \
echo "SYSDEFS = \$$(Platform_sysdefs)"; \
echo "SRCARCH = $(SRCARCH)"; \
echo "BUILDARCH = $(BUILDARCH)"; \
@@ -205,6 +215,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo "OPENJDK = $(OPENJDK)"; \
echo; \
echo "# Used for platform dispatching"; \
echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
@@ -251,6 +262,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
+ echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@
diff --git a/hotspot/make/bsd/makefiles/defs.make b/hotspot/make/bsd/makefiles/defs.make
index 1183981390f..824abe3aa0c 100644
--- a/hotspot/make/bsd/makefiles/defs.make
+++ b/hotspot/make/bsd/makefiles/defs.make
@@ -155,6 +155,7 @@ EXPORT_LIST += $(EXPORT_DOCS_DIR)/platform/jvmti/jvmti.html
EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX)
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
@@ -168,6 +169,19 @@ ifeq ($(JVM_VARIANT_CLIENT),true)
EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX)
endif
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
+
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ ifeq ($(ZIP_DEBUGINFO_FILES),1)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
+ else
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
+ endif
+ endif
+endif
+
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
diff --git a/hotspot/make/bsd/makefiles/dtrace.make b/hotspot/make/bsd/makefiles/dtrace.make
index 1f5d95627e9..98ce02f7e29 100644
--- a/hotspot/make/bsd/makefiles/dtrace.make
+++ b/hotspot/make/bsd/makefiles/dtrace.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, 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
@@ -114,21 +114,21 @@ $(GENOFFS): $(DTRACE_SRCDIR)/$(GENOFFS)Main.c lib$(GENOFFS).dylib
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
$(JVMOFFS).h: $(GENOFFS)
- $(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp; touch $@; \
+ $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp; touch $@; \
if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
then rm -f $@; mv $@.tmp $@; \
else rm -f $@.tmp; \
fi
$(JVMOFFS)Index.h: $(GENOFFS)
- $(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp; touch $@; \
+ $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp; touch $@; \
if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
then rm -f $@; mv $@.tmp $@; \
else rm -f $@.tmp; \
fi
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
- $(QUIETLY) DYLD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp; touch $@; \
+ $(QUIETLY) DYLD_LIBRARY_PATH=.:$(DYLD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp; touch $@; \
if [ `diff $@.tmp $@ > /dev/null 2>&1; echo $$?` -ne 0 ] ; \
then rm -f $@; mv $@.tmp $@; \
else rm -f $@.tmp; \
diff --git a/hotspot/make/bsd/makefiles/gcc.make b/hotspot/make/bsd/makefiles/gcc.make
index 249628ee7fa..f9451d84f77 100644
--- a/hotspot/make/bsd/makefiles/gcc.make
+++ b/hotspot/make/bsd/makefiles/gcc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -151,11 +151,6 @@ ifdef CC_INTERP
CFLAGS += -DCC_INTERP
endif
-# Build for embedded targets
-ifdef JAVASE_EMBEDDED
- CFLAGS += -DJAVASE_EMBEDDED
-endif
-
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@@ -186,20 +181,32 @@ ifeq ($(OS_VENDOR), Darwin)
CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations
endif
+OPT_CFLAGS/SIZE=-Os
+OPT_CFLAGS/SPEED=-O3
+
+# Hotspot uses very unstrict aliasing turn this optimization off
+# This option is added to CFLAGS rather than OPT_CFLAGS
+# so that OPT_CFLAGS overrides get this option too.
+CFLAGS += -fno-strict-aliasing
# The flags to use for an Optimized g++ build
ifeq ($(OS_VENDOR), Darwin)
# use -Os by default, unless -O3 can be proved to be worth the cost, as per policy
#
- OPT_CFLAGS += -Os
+ OPT_CFLAGS_DEFAULT ?= SIZE
else
- OPT_CFLAGS += -O3
+ OPT_CFLAGS_DEFAULT ?= SPEED
endif
-# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
+ifdef OPT_CFLAGS
+ ifneq ("$(origin OPT_CFLAGS)", "command line")
+ $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
+ endif
+endif
-# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
+OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
+
+# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
# if we use expensive-optimizations
ifeq ($(BUILDARCH), ia64)
OPT_CFLAGS += -fno-expensive-optimizations
diff --git a/hotspot/make/bsd/makefiles/ia64.make b/hotspot/make/bsd/makefiles/ia64.make
index 0fa65f270a8..8535807a787 100644
--- a/hotspot/make/bsd/makefiles/ia64.make
+++ b/hotspot/make/bsd/makefiles/ia64.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, 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
@@ -25,8 +25,6 @@
#
# IA64 only uses c++ based interpreter
CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN
-# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
ifeq ($(VERSION),debug)
ASM_FLAGS= -DDEBUG
else
diff --git a/hotspot/make/bsd/makefiles/jvmg.make b/hotspot/make/bsd/makefiles/jvmg.make
index b5be2967edc..3f1061a2830 100644
--- a/hotspot/make/bsd/makefiles/jvmg.make
+++ b/hotspot/make/bsd/makefiles/jvmg.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/bsd/makefiles/launcher.make b/hotspot/make/bsd/makefiles/launcher.make
index c78d5516902..588bf9aaebf 100644
--- a/hotspot/make/bsd/makefiles/launcher.make
+++ b/hotspot/make/bsd/makefiles/launcher.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, 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
@@ -19,7 +19,7 @@
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
-#
+#
#
# Rules to build gamma launcher, used by vm.make
@@ -41,6 +41,8 @@ LAUNCHERFLAGS := $(ARCHFLAG) \
-DLAUNCHER_TYPE=\"gamma\" \
-DLINK_INTO_$(LINK_INTO) \
$(TARGET_DEFINES)
+# Give the launcher task_for_pid() privileges so that it can be used to run JStack, JInfo, et al.
+LFLAGS_LAUNCHER += -sectcreate __TEXT __info_plist $(GAMMADIR)/src/os/bsd/launcher/Info-privileged.plist
ifeq ($(LINK_INTO),AOUT)
LAUNCHER.o = launcher.o $(JVM_OBJ_FILES)
@@ -50,22 +52,22 @@ ifeq ($(LINK_INTO),AOUT)
LIBS_LAUNCHER += $(STATIC_STDCXX) $(LIBS)
else
LAUNCHER.o = launcher.o
- LFLAGS_LAUNCHER += -L`pwd`
+ LFLAGS_LAUNCHER += -L`pwd`
# The gamma launcher runs the JDK from $JAVA_HOME, overriding the JVM with a
- # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
- # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
+ # freshly built JVM at ./libjvm.{so|dylib}. This is accomplished by setting
+ # the library searchpath using ({DY}LD_LIBRARY_PATH) to find the local JVM
# first. Gamma dlopen()s libjava from $JAVA_HOME/jre/lib{/$arch}, which is
# statically linked with CoreFoundation framework libs. Unfortunately, gamma's
- # unique searchpath results in some unresolved symbols in the framework
+ # unique searchpath results in some unresolved symbols in the framework
# libraries, because JDK libraries are inadvertently discovered first on the
# searchpath, e.g. libjpeg. On Mac OS X, filenames are case *insensitive*.
# So, the actual filename collision is libjpeg.dylib and libJPEG.dylib.
- # To resolve this, gamma needs to also statically link with the CoreFoundation
+ # To resolve this, gamma needs to also statically link with the CoreFoundation
# framework libraries.
ifeq ($(OS_VENDOR),Darwin)
- LFLAGS_LAUNCHER += -framework CoreFoundation
+ LFLAGS_LAUNCHER += -framework CoreFoundation
endif
LIBS_LAUNCHER += -l$(JVM) $(LIBS)
@@ -99,8 +101,11 @@ $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
$(QUIETLY) echo Linking launcher...
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
- $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
+ $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
+ # Sign the launcher with the development certificate (if present) so that it can be used
+ # to run JStack, JInfo, et al.
+ $(QUIETLY) -codesign -s openjdk_codesign $@
$(LAUNCHER): $(LAUNCHER_SCRIPT)
diff --git a/jdk/src/share/test/pack200/pack.conf b/hotspot/make/bsd/makefiles/minimal1.make
similarity index 54%
rename from jdk/src/share/test/pack200/pack.conf
rename to hotspot/make/bsd/makefiles/minimal1.make
index 628ad038b1f..9494f78bcdd 100644
--- a/jdk/src/share/test/pack200/pack.conf
+++ b/hotspot/make/bsd/makefiles/minimal1.make
@@ -1,11 +1,10 @@
-# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
-# published by the Free Software Foundation. Oracle designates this
-# particular file as subject to the "Classpath" exception as provided
-# by Oracle in the LICENSE file that accompanied this code.
+# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
@@ -20,12 +19,28 @@
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
# or visit www.oracle.com if you need additional information or have any
# questions.
+#
#
-#
-# The config file for the packer, define all the test properties here.
-pack.effort=1
-pack.unknown.attribute=error
-pack.deflate.hint=false
-pack.keep.class.order=true
-pack.verbose=1
+TYPE=MINIMAL1
+
+INCLUDE_JVMTI ?= false
+INCLUDE_FPROF ?= false
+INCLUDE_VM_STRUCTS ?= false
+INCLUDE_JNI_CHECK ?= false
+INCLUDE_SERVICES ?= false
+INCLUDE_MANAGEMENT ?= false
+INCLUDE_ALTERNATE_GCS ?= false
+INCLUDE_NMT ?= false
+INCLUDE_CDS ?= false
+
+CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+
+Src_Dirs/MINIMAL1 = $(CORE_PATHS) $(COMPILER1_PATHS)
+
+Src_Files_EXCLUDE/MINIMAL1 += $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+
+-include $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
+
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
diff --git a/hotspot/make/bsd/makefiles/product.make b/hotspot/make/bsd/makefiles/product.make
index 6edcef5f4ba..d27c0a6011c 100644
--- a/hotspot/make/bsd/makefiles/product.make
+++ b/hotspot/make/bsd/makefiles/product.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/bsd/makefiles/rules.make b/hotspot/make/bsd/makefiles/rules.make
index a1e4c34b286..d40b88d5ed0 100644
--- a/hotspot/make/bsd/makefiles/rules.make
+++ b/hotspot/make/bsd/makefiles/rules.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
diff --git a/hotspot/make/bsd/makefiles/sa.make b/hotspot/make/bsd/makefiles/sa.make
index b7bb477ca30..83b9b7954be 100644
--- a/hotspot/make/bsd/makefiles/sa.make
+++ b/hotspot/make/bsd/makefiles/sa.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
@@ -120,9 +120,9 @@ $(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
- $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
+ $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler
clean:
rm -rf $(SA_CLASSDIR)
diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make
index 458cd3a0c50..24109f6d50f 100644
--- a/hotspot/make/bsd/makefiles/saproc.make
+++ b/hotspot/make/bsd/makefiles/saproc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, 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
@@ -40,12 +40,13 @@ AGENT_DIR = $(GAMMADIR)/agent
SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)
-NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
- $(SASRCDIR)/symtab.c \
- $(SASRCDIR)/libproc_impl.c \
- $(SASRCDIR)/ps_proc.c \
- $(SASRCDIR)/ps_core.c \
- $(SASRCDIR)/BsdDebuggerLocal.c
+NON_STUB_SASRCFILES = $(SASRCDIR)/salibelf.c \
+ $(SASRCDIR)/symtab.c \
+ $(SASRCDIR)/libproc_impl.c \
+ $(SASRCDIR)/ps_proc.c \
+ $(SASRCDIR)/ps_core.c \
+ $(SASRCDIR)/BsdDebuggerLocal.c \
+ $(AGENT_DIR)/src/share/native/sadis.c
ifeq ($(OS_VENDOR), FreeBSD)
SASRCFILES = $(NON_STUB_SASRCFILES)
diff --git a/hotspot/make/bsd/makefiles/sparcWorks.make b/hotspot/make/bsd/makefiles/sparcWorks.make
index c87f5044096..e39116023c5 100644
--- a/hotspot/make/bsd/makefiles/sparcWorks.make
+++ b/hotspot/make/bsd/makefiles/sparcWorks.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/bsd/makefiles/top.make b/hotspot/make/bsd/makefiles/top.make
index 934e5d1f470..647e132b076 100644
--- a/hotspot/make/bsd/makefiles/top.make
+++ b/hotspot/make/bsd/makefiles/top.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/bsd/makefiles/vm.make b/hotspot/make/bsd/makefiles/vm.make
index f423408acd9..e60535821b6 100644
--- a/hotspot/make/bsd/makefiles/vm.make
+++ b/hotspot/make/bsd/makefiles/vm.make
@@ -190,7 +190,7 @@ SHARK_SPECIFIC_FILES := shark
ZERO_SPECIFIC_FILES := zero
# Always exclude these.
-Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
# Exclude per type.
Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
@@ -311,7 +311,7 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
echo Linking vm...; \
$(LINK_LIB.CXX/PRE_HOOK) \
$(LINK_VM) $(LD_SCRIPT_FLAG) \
- $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \
+ $(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM); \
$(LINK_LIB.CXX/POST_HOOK) \
rm -f $@.1; ln -s $@ $@.1; \
[ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make
index 63c6be7e274..3d86ed70e6c 100644
--- a/hotspot/make/defs.make
+++ b/hotspot/make/defs.make
@@ -22,6 +22,27 @@
#
#
+# The common definitions for hotspot builds.
+
+# Optionally include SPEC file generated by configure.
+ifneq ($(SPEC),)
+ include $(SPEC)
+endif
+
+# Directory paths and user name
+# Unless GAMMADIR is set on the command line, search upward from
+# the current directory for a parent directory containing "src/share/vm".
+# If that fails, look for $GAMMADIR in the environment.
+# When the tree of subdirs is built, this setting is stored in each flags.make.
+GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)
+HS_SRC_DIR=$(GAMMADIR)/src
+HS_MAKE_DIR=$(GAMMADIR)/make
+HS_BUILD_DIR=$(GAMMADIR)/build
+
+ifeq ($(USER),)
+ USER=$(USERNAME)
+endif
+
ifeq ($(HS_ALT_MAKE),)
ifneq ($(OPENJDK),true)
HS_ALT_MAKE=$(GAMMADIR)/make/closed
@@ -30,12 +51,10 @@ ifeq ($(HS_ALT_MAKE),)
endif
endif
-# The common definitions for hotspot builds.
-
-# Optionally include SPEC file generated by configure.
-ifneq ($(SPEC),)
- include $(SPEC)
-endif
+#
+# Include alternate defs.make if it exists
+#
+-include $(HS_ALT_MAKE)/defs.make
# Default to verbose build logs (show all compile lines):
MAKE_VERBOSE=y
@@ -84,20 +103,6 @@ ifeq ($(JVM_VARIANTS),)
endif
endif
-# Directory paths and user name
-# Unless GAMMADIR is set on the command line, search upward from
-# the current directory for a parent directory containing "src/share/vm".
-# If that fails, look for $GAMMADIR in the environment.
-# When the tree of subdirs is built, this setting is stored in each flags.make.
-GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done)
-HS_SRC_DIR=$(GAMMADIR)/src
-HS_MAKE_DIR=$(GAMMADIR)/make
-HS_BUILD_DIR=$(GAMMADIR)/build
-
-ifeq ($(USER),)
- USER=$(USERNAME)
-endif
-
# hotspot version definitions
include $(GAMMADIR)/make/hotspot_version
@@ -332,7 +337,11 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
+# By default, run Queens test after building
+TEST_IN_BUILD ?= true
+
ifndef JAVASE_EMBEDDED
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
endif
+.PHONY: $(HS_ALT_MAKE)/defs.make
diff --git a/hotspot/make/excludeSrc.make b/hotspot/make/excludeSrc.make
new file mode 100644
index 00000000000..00a1e3a706e
--- /dev/null
+++ b/hotspot/make/excludeSrc.make
@@ -0,0 +1,110 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+#
+ifeq ($(INCLUDE_JVMTI), false)
+ CXXFLAGS += -DINCLUDE_JVMTI=0
+ CFLAGS += -DINCLUDE_JVMTI=0
+
+ Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \
+ jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \
+ jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \
+ jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp
+endif
+
+ifeq ($(INCLUDE_FPROF), false)
+ CXXFLAGS += -DINCLUDE_FPROF=0
+ CFLAGS += -DINCLUDE_FPROF=0
+
+ Src_Files_EXCLUDE += fprofiler.cpp
+endif
+
+ifeq ($(INCLUDE_VM_STRUCTS), false)
+ CXXFLAGS += -DINCLUDE_VM_STRUCTS=0
+ CFLAGS += -DINCLUDE_VM_STRUCTS=0
+
+ Src_Files_EXCLUDE += vmStructs.cpp
+endif
+
+ifeq ($(INCLUDE_JNI_CHECK), false)
+ CXXFLAGS += -DINCLUDE_JNI_CHECK=0
+ CFLAGS += -DINCLUDE_JNI_CHECK=0
+
+ Src_Files_EXCLUDE += jniCheck.cpp
+endif
+
+ifeq ($(INCLUDE_SERVICES), false)
+ CXXFLAGS += -DINCLUDE_SERVICES=0
+ CFLAGS += -DINCLUDE_SERVICES=0
+
+ Src_Files_EXCLUDE += heapDumper.cpp heapInspection.cpp \
+ attachListener_linux.cpp attachListener.cpp
+endif
+
+ifeq ($(INCLUDE_MANAGEMENT), false)
+ CXXFLAGS += -DINCLUDE_MANAGEMENT=0
+ CFLAGS += -DINCLUDE_MANAGEMENT=0
+endif
+
+ifeq ($(INCLUDE_CDS), false)
+ CXXFLAGS += -DINCLUDE_CDS=0
+ CFLAGS += -DINCLUDE_CDS=0
+
+ Src_Files_EXCLUDE += metaspaceShared.cpp
+endif
+
+ifeq ($(INCLUDE_ALTERNATE_GCS), false)
+ CXXFLAGS += -DINCLUDE_ALTERNATE_GCS=0
+ CFLAGS += -DINCLUDE_ALTERNATE_GCS=0
+
+ CXXFLAGS += -DSERIALGC
+ CFLAGS += -DSERIALGC
+ Src_Files_EXCLUDE += \
+ binaryTreeDictionary.cpp cmsAdaptiveSizePolicy.cpp cmsCollectorPolicy.cpp \
+ cmsGCAdaptivePolicyCounters.cpp cmsLockVerifier.cpp cmsPermGen.cpp compactibleFreeListSpace.cpp \
+ concurrentMarkSweepGeneration.cpp concurrentMarkSweepThread.cpp freeBlockDictionary.cpp \
+ freeChunk.cpp freeList.cpp promotionInfo.cpp vmCMSOperations.cpp collectionSetChooser.cpp \
+ concurrentG1Refine.cpp concurrentG1RefineThread.cpp concurrentMark.cpp concurrentMarkThread.cpp \
+ dirtyCardQueue.cpp g1AllocRegion.cpp g1BlockOffsetTable.cpp g1CollectedHeap.cpp g1GCPhaseTimes.cpp \
+ g1CollectorPolicy.cpp g1ErgoVerbose.cpp g1_globals.cpp g1HRPrinter.cpp g1MarkSweep.cpp \
+ g1MMUTracker.cpp g1MonitoringSupport.cpp g1RemSet.cpp g1SATBCardTableModRefBS.cpp heapRegion.cpp \
+ heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp ptrQueue.cpp \
+ satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp adjoiningGenerations.cpp \
+ adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp cardTableExtension.cpp \
+ gcTaskManager.cpp gcTaskThread.cpp objectStartArray.cpp parallelScavengeHeap.cpp parMarkBitMap.cpp \
+ pcTasks.cpp psAdaptiveSizePolicy.cpp psCompactionManager.cpp psGCAdaptivePolicyCounters.cpp \
+ psGenerationCounters.cpp psMarkSweep.cpp psMarkSweepDecorator.cpp psOldGen.cpp psParallelCompact.cpp \
+ psPermGen.cpp psPromotionLAB.cpp psPromotionManager.cpp psScavenge.cpp psTasks.cpp psVirtualspace.cpp \
+ psYoungGen.cpp vmPSOperations.cpp asParNewGeneration.cpp parCardTableModRefBS.cpp \
+ parGCAllocBuffer.cpp parNewGeneration.cpp mutableSpace.cpp gSpaceCounters.cpp allocationStats.cpp \
+ spaceCounters.cpp gcAdaptivePolicyCounters.cpp mutableNUMASpace.cpp immutableSpace.cpp \
+ immutableSpace.cpp g1MemoryPool.cpp psMemoryPool.cpp yieldWorkingGroup.cpp g1Log.cpp
+endif
+
+ifeq ($(INCLUDE_NMT), false)
+ CXXFLAGS += -DINCLUDE_NMT=0
+ CFLAGS += -DINCLUDE_NMT=0
+
+ Src_Files_EXCLUDE += \
+ memBaseline.cpp memPtr.cpp memRecorder.cpp memReporter.cpp memSnapshot.cpp memTrackWorker.cpp \
+ memTracker.cpp nmtDCmd.cpp
+endif
diff --git a/hotspot/make/hotspot_version b/hotspot/make/hotspot_version
index 0fcde16cec9..ef0a7519680 100644
--- a/hotspot/make/hotspot_version
+++ b/hotspot/make/hotspot_version
@@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2012
HS_MAJOR_VER=25
HS_MINOR_VER=0
-HS_BUILD_NUMBER=02
+HS_BUILD_NUMBER=05
JDK_MAJOR_VER=1
JDK_MINOR_VER=8
diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile
index ad49c935bce..065ca0e83e7 100644
--- a/hotspot/make/linux/Makefile
+++ b/hotspot/make/linux/Makefile
@@ -175,6 +175,10 @@ VARIANTARCH = $(subst i386,i486,$(ZERO_LIBARCH))
# profiledshark shark __shark/profiled
# productshark shark __shark/product
#
+# fastdebugminimal1 minimal1 __minimal1/fastdebug
+# jvmgminimal1 minimal1 __minimal1/jvmg
+# productminimal1 minimal1 __minimal1/product
+#
# What you get with each target:
#
# debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher
@@ -199,6 +203,7 @@ SUBDIRS_TIERED = $(addprefix $(OSNAME)_$(BUILDARCH)_tiered/,$(TARGETS))
SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS))
SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS))
SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS))
+SUBDIRS_MINIMAL1 = $(addprefix $(OSNAME)_$(BUILDARCH)_minimal1/,$(TARGETS))
TARGETS_C2 = $(TARGETS)
TARGETS_C1 = $(addsuffix 1,$(TARGETS))
@@ -206,6 +211,7 @@ TARGETS_TIERED = $(addsuffix tiered,$(TARGETS))
TARGETS_CORE = $(addsuffix core,$(TARGETS))
TARGETS_ZERO = $(addsuffix zero,$(TARGETS))
TARGETS_SHARK = $(addsuffix shark,$(TARGETS))
+TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS))
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH)
@@ -224,6 +230,7 @@ all:
@echo " $(TARGETS_CORE)"
@echo " $(TARGETS_ZERO)"
@echo " $(TARGETS_SHARK)"
+ @echo " $(TARGETS_MINIMAL1)"
checks: check_os_version check_j2se_version
@@ -281,6 +288,11 @@ $(SUBDIRS_SHARK): $(BUILDTREE_MAKE) platform_zero
$(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
$(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH)
+$(SUBDIRS_MINIMAL1): $(BUILDTREE_MAKE)
+ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks
+ $(BUILDTREE) VARIANT=minimal1
+
+
platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@
@@ -288,52 +300,74 @@ platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
$(TARGETS_C2): $(SUBDIRS_C2)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
endif
+$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
+endif
+ifdef INSTALL
+ cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
+endif
+
# Just build the tree, and nothing else:
tree: $(SUBDIRS_C2)
tree1: $(SUBDIRS_C1)
treecore: $(SUBDIRS_CORE)
treezero: $(SUBDIRS_ZERO)
treeshark: $(SUBDIRS_SHARK)
+treeminimal1: $(SUBDIRS_MINIMAL1)
# Doc target. This is the same for all build options.
# Hence create a docs directory beside ...$(ARCH)_[...]
@@ -357,17 +391,23 @@ shark: jvmgshark productshark
clean_docs:
rm -rf $(SUBDIR_DOCS)
-clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark:
+clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark clean_minimal1:
rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@)
-clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs
+clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_minimal1 clean_docs
include $(GAMMADIR)/make/cscope.make
+#
+# Include alternate Makefile if it exists.
+#
+-include $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
+
#-------------------------------------------------------------------------------
-.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK)
+.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_MINIMAL1)
.PHONY: tree tree1 treecore treezero treeshark
.PHONY: all compiler1 compiler2 core zero shark
.PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs
.PHONY: checks check_os_version check_j2se_version
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make
diff --git a/hotspot/make/linux/makefiles/adlc.make b/hotspot/make/linux/makefiles/adlc.make
index 6befe8a94fb..f1892d7d5cc 100644
--- a/hotspot/make/linux/makefiles/adlc.make
+++ b/hotspot/make/linux/makefiles/adlc.make
@@ -109,7 +109,7 @@ all: $(EXEC)
$(EXEC) : $(OBJECTS)
@echo Making adlc
- $(QUIETLY) $(HOST.LINK_NOPROF.CXX) -o $(EXEC) $(OBJECTS)
+ $(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.LINK_NOPROF.CXX)) -o $(EXEC) $(OBJECTS)
# Random dependencies:
$(OBJECTS): opcodes.hpp classes.hpp adlc.hpp adlcVMDeps.hpp adlparse.hpp archDesc.hpp arena.hpp dict2.hpp filebuff.hpp forms.hpp formsopt.hpp formssel.hpp
@@ -213,14 +213,14 @@ PROCESS_AD_FILES = awk '{ \
$(OUTDIR)/%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(HOST.COMPILE.CXX) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.COMPILE.CXX)) -o $@ $< $(COMPILE_DONE)
# Some object files are given a prefix, to disambiguate
# them from objects of the same name built for the VM.
$(OUTDIR)/adlc-%.o: %.cpp
@echo Compiling $<
$(QUIETLY) $(REMOVE_TARGET)
- $(QUIETLY) $(HOST.COMPILE.CXX) -o $@ $< $(COMPILE_DONE)
+ $(QUIETLY) $(filter-out $(ARCHFLAG),$(HOST.COMPILE.CXX)) -o $@ $< $(COMPILE_DONE)
# #########################################################################
diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make
index 9e8d4d9f784..639c11f87c8 100644
--- a/hotspot/make/linux/makefiles/buildtree.make
+++ b/hotspot/make/linux/makefiles/buildtree.make
@@ -57,6 +57,7 @@
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
+include $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
@@ -156,6 +157,13 @@ ifndef HOTSPOT_VM_DISTRO
endif
endif
+# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
+ifndef OPENJDK
+ ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
+ OPENJDK=true
+ endif
+endif
+
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \
@@ -188,6 +196,8 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \
echo; \
echo "GAMMADIR = $(GAMMADIR)"; \
+ echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \
+ echo "OSNAME = $(OSNAME)"; \
echo "SYSDEFS = \$$(Platform_sysdefs)"; \
echo "SRCARCH = $(SRCARCH)"; \
echo "BUILDARCH = $(BUILDARCH)"; \
@@ -198,6 +208,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo "OPENJDK = $(OPENJDK)"; \
echo; \
echo "# Used for platform dispatching"; \
echo "TARGET_DEFINES = -DTARGET_OS_FAMILY_\$$(Platform_os_family)"; \
@@ -254,6 +265,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
[ -n "$(SPEC)" ] && \
echo "include $(SPEC)"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \
+ echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \
echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \
) > $@
diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make
index 5a66e495a29..1fcc7859b07 100644
--- a/hotspot/make/linux/makefiles/defs.make
+++ b/hotspot/make/linux/makefiles/defs.make
@@ -29,8 +29,14 @@
SLASH_JAVA ?= /java
# Need PLATFORM (os-arch combo names) for jdk and hotspot, plus libarch name
-ARCH:=$(shell uname -m)
-PATH_SEP = :
+
+# ARCH can be set explicitly in spec.gmk
+ifndef ARCH
+ ARCH := $(shell uname -m)
+endif
+
+PATH_SEP ?= :
+
ifeq ($(LP64), 1)
ARCH_DATA_MODEL ?= 64
else
@@ -72,8 +78,8 @@ ifeq ($(ARCH), sparc64)
HS_ARCH = sparc
endif
-# x86_64
-ifeq ($(ARCH), x86_64)
+# amd64/x86_64
+ifneq (,$(findstring $(ARCH), amd64 x86_64))
ifeq ($(ARCH_DATA_MODEL), 64)
ARCH_DATA_MODEL = 64
MAKE_ARGS += LP64=1
@@ -90,8 +96,8 @@ ifeq ($(ARCH), x86_64)
endif
endif
-# i686
-ifeq ($(ARCH), i686)
+# i686/i586 ie 32-bit x86
+ifneq (,$(findstring $(ARCH), i686 i586))
ARCH_DATA_MODEL = 32
PLATFORM = linux-i586
VM_PLATFORM = linux_i486
@@ -248,6 +254,7 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
endif
EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server
EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client
+EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal
EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar
@@ -275,6 +282,19 @@ ifeq ($(JVM_VARIANT_CLIENT),true)
endif
endif
+ifeq ($(JVM_VARIANT_MINIMAL1),true)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX)
+
+ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
+ ifeq ($(ZIP_DEBUGINFO_FILES),1)
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz
+ else
+ EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo
+ endif
+ endif
+endif
+
# Serviceability Binaries
# No SA Support for PPC, IA64, ARM or zero
ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \
diff --git a/hotspot/make/linux/makefiles/dtrace.make b/hotspot/make/linux/makefiles/dtrace.make
index 785561cc64f..b50eab183de 100644
--- a/hotspot/make/linux/makefiles/dtrace.make
+++ b/hotspot/make/linux/makefiles/dtrace.make
@@ -1,5 +1,6 @@
#
-# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012 Red Hat, Inc.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -25,3 +26,40 @@
# Linux does not build jvm_db
LIBJVM_DB =
+# Only OPENJDK builds test and support SDT probes currently.
+ifndef OPENJDK
+REASON = "This JDK does not support SDT probes"
+else
+
+# We need a recent GCC for the default
+ifeq "$(shell expr \( $(CC_VER_MAJOR) \>= 4 \) \& \( $(CC_VER_MINOR) \>= 4 \) )" "0"
+REASON = "gcc version is too old"
+else
+
+# But it does have a SystemTap dtrace compatible sys/sdt.h
+ifneq ($(ALT_SDT_H),)
+ SDT_H_FILE = $(ALT_SDT_H)
+else
+ SDT_H_FILE = /usr/include/sys/sdt.h
+endif
+DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))
+REASON = "$(SDT_H_FILE) not found"
+
+ifneq ($(DTRACE_ENABLED),)
+ CFLAGS += -DDTRACE_ENABLED
+endif
+
+endif
+endif
+
+# Phony target used in vm.make build target to check whether enabled.
+.PHONY: dtraceCheck
+ifeq ($(DTRACE_ENABLED),)
+dtraceCheck:
+ $(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)"
+else
+dtraceCheck:
+endif
+
+# It doesn't support HAVE_DTRACE_H though.
+
diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make
index 9231dafde28..3bed2c8562f 100644
--- a/hotspot/make/linux/makefiles/gcc.make
+++ b/hotspot/make/linux/makefiles/gcc.make
@@ -116,11 +116,6 @@ ifdef CC_INTERP
CFLAGS += -DCC_INTERP
endif
-# Build for embedded targets
-ifdef JAVASE_EMBEDDED
- CFLAGS += -DJAVASE_EMBEDDED
-endif
-
# Keep temporary files (.ii, .s)
ifdef NEED_ASM
CFLAGS += -save-temps
@@ -146,10 +141,23 @@ CFLAGS_WARN/DEFAULT = $(WARNINGS_ARE_ERRORS) $(ACCEPTABLE_WARNINGS)
CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@))
# The flags to use for an Optimized g++ build
-OPT_CFLAGS += -O3
+OPT_CFLAGS/SIZE=-Os
+OPT_CFLAGS/SPEED=-O3
# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
+# This option is added to CFLAGS rather than OPT_CFLAGS
+# so that OPT_CFLAGS overrides get this option too.
+CFLAGS += -fno-strict-aliasing
+
+OPT_CFLAGS_DEFAULT ?= SPEED
+
+ifdef OPT_CFLAGS
+ ifneq ("$(origin OPT_CFLAGS)", "command line")
+ $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.")
+ endif
+endif
+
+OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS)
# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp
# if we use expensive-optimizations
diff --git a/hotspot/make/linux/makefiles/ia64.make b/hotspot/make/linux/makefiles/ia64.make
index 0fa65f270a8..8535807a787 100644
--- a/hotspot/make/linux/makefiles/ia64.make
+++ b/hotspot/make/linux/makefiles/ia64.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2008, 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
@@ -25,8 +25,6 @@
#
# IA64 only uses c++ based interpreter
CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN
-# Hotspot uses very unstrict aliasing turn this optimization off
-OPT_CFLAGS += -fno-strict-aliasing
ifeq ($(VERSION),debug)
ASM_FLAGS= -DDEBUG
else
diff --git a/hotspot/make/linux/makefiles/launcher.make b/hotspot/make/linux/makefiles/launcher.make
index 0c102eadc0a..23f3edad41a 100644
--- a/hotspot/make/linux/makefiles/launcher.make
+++ b/hotspot/make/linux/makefiles/launcher.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, 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
@@ -82,7 +82,7 @@ $(LAUNCHER_OUT)/%.o: $(LAUNCHERDIR)/%.c
$(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
$(QUIETLY) echo Linking launcher...
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
- $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
+ $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
$(LAUNCHER): $(LAUNCHER_SCRIPT)
diff --git a/hotspot/make/linux/makefiles/minimal1.make b/hotspot/make/linux/makefiles/minimal1.make
new file mode 100644
index 00000000000..9494f78bcdd
--- /dev/null
+++ b/hotspot/make/linux/makefiles/minimal1.make
@@ -0,0 +1,46 @@
+#
+# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+#
+
+TYPE=MINIMAL1
+
+INCLUDE_JVMTI ?= false
+INCLUDE_FPROF ?= false
+INCLUDE_VM_STRUCTS ?= false
+INCLUDE_JNI_CHECK ?= false
+INCLUDE_SERVICES ?= false
+INCLUDE_MANAGEMENT ?= false
+INCLUDE_ALTERNATE_GCS ?= false
+INCLUDE_NMT ?= false
+INCLUDE_CDS ?= false
+
+CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\"
+
+Src_Dirs/MINIMAL1 = $(CORE_PATHS) $(COMPILER1_PATHS)
+
+Src_Files_EXCLUDE/MINIMAL1 += $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
+
+-include $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
+
+.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make
diff --git a/hotspot/make/linux/makefiles/ppc.make b/hotspot/make/linux/makefiles/ppc.make
index 8d085e64211..3364bd743b8 100644
--- a/hotspot/make/linux/makefiles/ppc.make
+++ b/hotspot/make/linux/makefiles/ppc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2004, 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
diff --git a/hotspot/make/linux/makefiles/product.make b/hotspot/make/linux/makefiles/product.make
index efce43d08b7..a64d49f9d12 100644
--- a/hotspot/make/linux/makefiles/product.make
+++ b/hotspot/make/linux/makefiles/product.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/linux/makefiles/rules.make b/hotspot/make/linux/makefiles/rules.make
index a1e4c34b286..d40b88d5ed0 100644
--- a/hotspot/make/linux/makefiles/rules.make
+++ b/hotspot/make/linux/makefiles/rules.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
diff --git a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make
index f39e736827f..66a7b945737 100644
--- a/hotspot/make/linux/makefiles/sa.make
+++ b/hotspot/make/linux/makefiles/sa.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
@@ -107,9 +107,9 @@ $(GENERATED)/sa-jdi.jar:: $(AGENT_FILES)
$(QUIETLY) $(REMOTE) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(REMOTE) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
- $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
$(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext
+ $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler
clean:
rm -rf $(SA_CLASSDIR)
diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make
index af0767a4385..cffafb8ad3d 100644
--- a/hotspot/make/linux/makefiles/saproc.make
+++ b/hotspot/make/linux/makefiles/saproc.make
@@ -48,7 +48,8 @@ SASRCFILES = $(SASRCDIR)/salibelf.c \
$(SASRCDIR)/libproc_impl.c \
$(SASRCDIR)/ps_proc.c \
$(SASRCDIR)/ps_core.c \
- $(SASRCDIR)/LinuxDebuggerLocal.c
+ $(SASRCDIR)/LinuxDebuggerLocal.c \
+ $(AGENT_DIR)/src/share/native/sadis.c
-include $(HS_ALT_MAKE)/linux/makefiles/saproc.make
diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make
index c87f5044096..e39116023c5 100644
--- a/hotspot/make/linux/makefiles/sparcWorks.make
+++ b/hotspot/make/linux/makefiles/sparcWorks.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make
index 3f6e73ebc1b..011d46a05b8 100644
--- a/hotspot/make/linux/makefiles/top.make
+++ b/hotspot/make/linux/makefiles/top.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make
index 6e9794ba710..3da1a52e0ee 100644
--- a/hotspot/make/linux/makefiles/vm.make
+++ b/hotspot/make/linux/makefiles/vm.make
@@ -192,7 +192,7 @@ SHARK_SPECIFIC_FILES := shark
ZERO_SPECIFIC_FILES := zero
# Always exclude these.
-Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
+Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp
# Exclude per type.
Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp
@@ -320,7 +320,7 @@ $(LIBJVM): $(LIBJVM.o) $(LIBJVM_MAPFILE) $(LD_SCRIPT)
echo Linking vm...; \
$(LINK_LIB.CXX/PRE_HOOK) \
$(LINK_VM) $(LD_SCRIPT_FLAG) \
- $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM); \
+ $(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM); \
$(LINK_LIB.CXX/POST_HOOK) \
rm -f $@.1; ln -s $@ $@.1; \
[ -f $(LIBJVM_G) ] || { ln -s $@ $(LIBJVM_G); ln -s $@.1 $(LIBJVM_G).1; }; \
@@ -387,7 +387,7 @@ include $(MAKEFILES_DIR)/wb.make
#----------------------------------------------------------------------
-build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) $(WB_JAR)
+build: $(LIBJVM) $(LAUNCHER) $(LIBJSIG) $(LIBJVM_DB) $(BUILDLIBSAPROC) dtraceCheck $(WB_JAR)
install: install_jvm install_jsig install_saproc
diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files
index c634590fea5..b982aaff736 100644
--- a/hotspot/make/sa.files
+++ b/hotspot/make/sa.files
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
@@ -39,10 +39,7 @@ AGENT_SRC_DIR = $(AGENT_DIR)/src/share/classes
AGENT_FILES = \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/amd64/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/sparc/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/asm/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/bugspot/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/bugspot/tree/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/c1/*.java \
@@ -59,10 +56,8 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/posix/*.java \
@@ -79,7 +74,6 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/win32/coff/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/amd64/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/windbg/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/gc_implementation/g1/*.java \
@@ -98,10 +92,8 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_amd64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_x86/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_amd64/*.java \
-$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_ia64/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_x86/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_sparc/*.java \
$(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/posix/*.java \
diff --git a/hotspot/make/solaris/Makefile b/hotspot/make/solaris/Makefile
index eec2be46da6..3a71eb541a2 100644
--- a/hotspot/make/solaris/Makefile
+++ b/hotspot/make/solaris/Makefile
@@ -237,35 +237,45 @@ $(SUBDIRS_KERNEL): $(BUILDTREE_MAKE)
$(TARGETS_C2): $(SUBDIRS_C2)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_KERNEL): $(SUBDIRS_KERNEL)
cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && $(MAKE) $(MFLAGS)
+ifeq ($(TEST_IN_BUILD),true)
cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && ./test_gamma
+endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_kernel/$(patsubst %kernel,%,$@) && $(MAKE) $(MFLAGS) install
endif
diff --git a/hotspot/make/solaris/makefiles/adlc.make b/hotspot/make/solaris/makefiles/adlc.make
index 2d110cffe4f..750bd8319bf 100644
--- a/hotspot/make/solaris/makefiles/adlc.make
+++ b/hotspot/make/solaris/makefiles/adlc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
diff --git a/hotspot/make/solaris/makefiles/buildtree.make b/hotspot/make/solaris/makefiles/buildtree.make
index d3147676088..3bca3dcee79 100644
--- a/hotspot/make/solaris/makefiles/buildtree.make
+++ b/hotspot/make/solaris/makefiles/buildtree.make
@@ -148,6 +148,13 @@ ifndef HOTSPOT_VM_DISTRO
endif
endif
+# if hotspot-only build and/or OPENJDK isn't passed down, need to set OPENJDK
+ifndef OPENJDK
+ ifneq ($(call if-has-altsrc,$(HS_COMMON_SRC)/,true,false),true)
+ OPENJDK=true
+ endif
+endif
+
BUILDTREE_VARS += HOTSPOT_RELEASE_VERSION=$(HS_BUILD_VER) HOTSPOT_BUILD_VERSION= JRE_RELEASE_VERSION=$(JRE_RELEASE_VERSION)
BUILDTREE = \
@@ -190,6 +197,7 @@ flags.make: $(BUILDTREE_MAKE) ../shared_dirs.lst
echo "SA_BUILD_VERSION = $(HS_BUILD_VER)"; \
echo "HOTSPOT_BUILD_USER = $(HOTSPOT_BUILD_USER)"; \
echo "HOTSPOT_VM_DISTRO = $(HOTSPOT_VM_DISTRO)"; \
+ echo "OPENJDK = $(OPENJDK)"; \
echo "$(LP64_SETTING/$(DATA_MODE))"; \
echo; \
echo "# Used for platform dispatching"; \
diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make
index 48bc98d2dc6..1473a0f67b2 100644
--- a/hotspot/make/solaris/makefiles/dtrace.make
+++ b/hotspot/make/solaris/makefiles/dtrace.make
@@ -206,15 +206,15 @@ CONDITIONALLY_UPDATE_JVMOFFS_TARGET = \
# $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
$(JVMOFFS).h: $(GENOFFS)
- $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -header > $@.tmp
+ $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
$(JVMOFFS)Index.h: $(GENOFFS)
- $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -index > $@.tmp
+ $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
$(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
- $(QUIETLY) LD_LIBRARY_PATH=. ./$(GENOFFS) -table > $@.tmp
+ $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp
$(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
$(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp
diff --git a/hotspot/make/solaris/makefiles/gcc.make b/hotspot/make/solaris/makefiles/gcc.make
index be26f6d418c..8b2be7a7177 100644
--- a/hotspot/make/solaris/makefiles/gcc.make
+++ b/hotspot/make/solaris/makefiles/gcc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
diff --git a/hotspot/make/solaris/makefiles/jvmg.make b/hotspot/make/solaris/makefiles/jvmg.make
index 821c0a13850..4605e13ff39 100644
--- a/hotspot/make/solaris/makefiles/jvmg.make
+++ b/hotspot/make/solaris/makefiles/jvmg.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/solaris/makefiles/launcher.make b/hotspot/make/solaris/makefiles/launcher.make
index f735b20d343..090ff5ea7a6 100644
--- a/hotspot/make/solaris/makefiles/launcher.make
+++ b/hotspot/make/solaris/makefiles/launcher.make
@@ -96,7 +96,7 @@ $(LAUNCHER): $(OBJS) $(LIBJVM) $(LAUNCHER_MAPFILE)
ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
$(QUIETLY) echo Linking launcher...
$(QUIETLY) $(LINK_LAUNCHER/PRE_HOOK)
- $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(OBJS) $(LIBS_LAUNCHER)
+ $(QUIETLY) $(LINK_LAUNCHER) $(LFLAGS_LAUNCHER) -o $@ $(sort $(OBJS)) $(LIBS_LAUNCHER)
$(QUIETLY) $(LINK_LAUNCHER/POST_HOOK)
endif # filter -sbfast -xsbfast
diff --git a/hotspot/make/solaris/makefiles/optimized.make b/hotspot/make/solaris/makefiles/optimized.make
index 83fd01ca994..87716a88be0 100644
--- a/hotspot/make/solaris/makefiles/optimized.make
+++ b/hotspot/make/solaris/makefiles/optimized.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
diff --git a/hotspot/make/solaris/makefiles/rules.make b/hotspot/make/solaris/makefiles/rules.make
index 4401698801c..b7006f5836e 100644
--- a/hotspot/make/solaris/makefiles/rules.make
+++ b/hotspot/make/solaris/makefiles/rules.make
@@ -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
diff --git a/hotspot/make/solaris/makefiles/sa.make b/hotspot/make/solaris/makefiles/sa.make
index ec27f561313..2c08b1c5170 100644
--- a/hotspot/make/solaris/makefiles/sa.make
+++ b/hotspot/make/solaris/makefiles/sa.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
@@ -94,6 +94,7 @@ $(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(QUIETLY) $(RUN.JAR) cf $@ -C $(SA_CLASSDIR)/ .
$(QUIETLY) $(RUN.JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
$(QUIETLY) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.proc.ProcDebuggerLocal
+ $(QUIETLY) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler
clean:
rm -rf $(SA_CLASSDIR)
diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make
index 3e16f431d73..9e237615225 100644
--- a/hotspot/make/solaris/makefiles/saproc.make
+++ b/hotspot/make/solaris/makefiles/saproc.make
@@ -27,7 +27,9 @@
# libsaproc[_g].so: serviceability agent
SAPROC = saproc
+SADIS = sadis
LIBSAPROC = lib$(SAPROC).so
+SADISOBJ = $(SADIS).o
SAPROC_G = $(SAPROC)$(G_SUFFIX)
LIBSAPROC_G = lib$(SAPROC_G).so
@@ -43,6 +45,8 @@ SASRCDIR = $(AGENT_DIR)/src/os/$(Platform_os_family)/proc
SASRCFILES = $(SASRCDIR)/saproc.cpp
+SADISSRCFILES = $(AGENT_DIR)/src/share/native/sadis.c
+
SAMAPFILE = $(SASRCDIR)/mapfile
DEST_SAPROC = $(JDK_LIBDIR)/$(LIBSAPROC)
@@ -90,13 +94,14 @@ $(shell uname -r -v \
# when actually building on Nevada-B158 or earlier:
#SOLARIS_11_B159_OR_LATER=-DSOLARIS_11_B159_OR_LATER
-$(LIBSAPROC): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(SASRCFILES) $(SAMAPFILE)
+
+$(LIBSAPROC): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(SASRCFILES) $(SADISOBJ) $(SAMAPFILE)
$(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \
echo "ALT_BOOTDIR, BOOTDIR or JAVA_HOME needs to be defined to build SA"; \
exit 1; \
fi
@echo Making SA debugger back-end...
- $(QUIETLY) $(CXX) \
+ $(QUIETLY) $(CXX) \
$(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
-I$(SASRCDIR) \
-I$(GENERATED) \
@@ -104,10 +109,23 @@ $(LIBSAPROC): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(SASRCFILES) $(SA
-I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
$(SOLARIS_11_B159_OR_LATER) \
$(SASRCFILES) \
+ $(SADISOBJ) \
$(SA_LFLAGS) \
-o $@ \
-ldl -ldemangle -lthread -lc
[ -f $(LIBSAPROC_G) ] || { ln -s $@ $(LIBSAPROC_G); }
+
+$(SADISOBJ): $(SADISSRCFILES)
+ $(QUIETLY) $(CC) \
+ $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
+ -I$(SASRCDIR) \
+ -I$(GENERATED) \
+ -I$(BOOT_JAVA_HOME)/include \
+ -I$(BOOT_JAVA_HOME)/include/$(Platform_os_family) \
+ $(SOLARIS_11_B159_OR_LATER) \
+ $(SADISSRCFILES) \
+ -c -o $(SADISOBJ)
+
ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
# Clear the SHF_ALLOC flag (if set) from empty section headers.
diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make
index bbe10798ff5..1d31f1e8d55 100644
--- a/hotspot/make/solaris/makefiles/top.make
+++ b/hotspot/make/solaris/makefiles/top.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1998, 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
diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make
index 8f1a5e20adf..d91cba35131 100644
--- a/hotspot/make/solaris/makefiles/vm.make
+++ b/hotspot/make/solaris/makefiles/vm.make
@@ -288,7 +288,7 @@ $(LIBJVM): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(LIBJVM.o) $(LIBJVM_
ifeq ($(filter -sbfast -xsbfast, $(CFLAGS_BROWSE)),)
@echo Linking vm...
$(QUIETLY) $(LINK_LIB.CXX/PRE_HOOK)
- $(QUIETLY) $(LINK_VM) $(LFLAGS_VM) -o $@ $(LIBJVM.o) $(LIBS_VM)
+ $(QUIETLY) $(LINK_VM) $(LFLAGS_VM) -o $@ $(sort $(LIBJVM.o)) $(LIBS_VM)
$(QUIETLY) $(LINK_LIB.CXX/POST_HOOK)
$(QUIETLY) rm -f $@.1 && ln -s $@ $@.1
$(QUIETLY) [ -f $(LIBJVM_G) ] || ln -s $@ $(LIBJVM_G)
diff --git a/hotspot/make/windows/build.bat b/hotspot/make/windows/build.bat
index ac63bb2ad4a..e4eab3abf0c 100644
--- a/hotspot/make/windows/build.bat
+++ b/hotspot/make/windows/build.bat
@@ -1,6 +1,6 @@
@echo off
REM
-REM Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+REM Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
REM DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
REM
REM This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/windows/build_vm_def.sh b/hotspot/make/windows/build_vm_def.sh
index 35dd9dcd16f..c54a1803b93 100644
--- a/hotspot/make/windows/build_vm_def.sh
+++ b/hotspot/make/windows/build_vm_def.sh
@@ -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
diff --git a/hotspot/make/windows/get_msc_ver.sh b/hotspot/make/windows/get_msc_ver.sh
index da00db4d3c2..89c7a3f8c8f 100644
--- a/hotspot/make/windows/get_msc_ver.sh
+++ b/hotspot/make/windows/get_msc_ver.sh
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2005, 2010, 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
diff --git a/hotspot/make/windows/makefiles/adlc.make b/hotspot/make/windows/makefiles/adlc.make
index f091b988645..f320d4e932d 100644
--- a/hotspot/make/windows/makefiles/adlc.make
+++ b/hotspot/make/windows/makefiles/adlc.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/make/windows/makefiles/defs.make b/hotspot/make/windows/makefiles/defs.make
index cb2e0b791e4..d0f45c0bac6 100644
--- a/hotspot/make/windows/makefiles/defs.make
+++ b/hotspot/make/windows/makefiles/defs.make
@@ -154,10 +154,9 @@ MAKE_ARGS += ZIPEXE=$(ZIPEXE)
# On 32 bit windows we build server, client and kernel, on 64 bit just server.
ifeq ($(JVM_VARIANTS),)
ifeq ($(ARCH_DATA_MODEL), 32)
- JVM_VARIANTS:=client,server,kernel
+ JVM_VARIANTS:=client,server
JVM_VARIANT_CLIENT:=true
JVM_VARIANT_SERVER:=true
- JVM_VARIANT_KERNEL:=true
else
JVM_VARIANTS:=server
JVM_VARIANT_SERVER:=true
diff --git a/hotspot/make/windows/makefiles/launcher.make b/hotspot/make/windows/makefiles/launcher.make
index 90485aa7380..10ad009eef9 100644
--- a/hotspot/make/windows/makefiles/launcher.make
+++ b/hotspot/make/windows/makefiles/launcher.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 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
diff --git a/hotspot/make/windows/makefiles/projectcreator.make b/hotspot/make/windows/makefiles/projectcreator.make
index ebc5a0a8497..5d71de6618a 100644
--- a/hotspot/make/windows/makefiles/projectcreator.make
+++ b/hotspot/make/windows/makefiles/projectcreator.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@@ -29,12 +29,11 @@
# HOTSPOTRELEASEBINDEST, or HOTSPOTDEBUGBINDEST environment variables.
ProjectCreatorSources=\
- $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTree.java \
- $(WorkSpace)\src\share\tools\ProjectCreator\DirectoryTreeNode.java \
- $(WorkSpace)\src\share\tools\ProjectCreator\FileFormatException.java \
$(WorkSpace)\src\share\tools\ProjectCreator\ProjectCreator.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\FileTreeCreator.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\FileTreeCreatorVC7.java \
+ $(WorkSpace)\src\share\tools\ProjectCreator\FileTreeCreatorVC10.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatform.java \
- $(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC6.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC7.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC8.java \
$(WorkSpace)\src\share\tools\ProjectCreator\WinGammaPlatformVC9.java \
@@ -57,10 +56,24 @@ ProjectCreatorIncludesPRIVATE=\
-relativeInclude src\os_cpu\windows_$(Platform_arch)\vm \
-relativeInclude src\cpu\$(Platform_arch)\vm \
-absoluteInclude $(HOTSPOTBUILDSPACE)/%f/generated \
- -ignorePath $(HOTSPOTBUILDSPACE)/%f/generated \
- -ignorePath src\share\vm\adlc \
- -ignorePath src\share\vm\shark \
- -ignorePath posix
+ -relativeSrcInclude src \
+ -absoluteSrcInclude $(HOTSPOTBUILDSPACE) \
+ -ignorePath $(HOTSPOTBUILDSPACE) \
+ -ignorePath launcher \
+ -ignorePath share\vm\adlc \
+ -ignorePath share\vm\shark \
+ -ignorePath share\tools \
+ -ignorePath solaris \
+ -ignorePath posix \
+ -ignorePath sparc \
+ -ignorePath linux \
+ -ignorePath bsd \
+ -ignorePath osx \
+ -ignorePath arm \
+ -ignorePath ppc \
+ -ignorePath zero \
+ -hidePath .hg
+
# This is referenced externally by both the IDE and batch builds
ProjectCreatorOptions=
@@ -84,6 +97,7 @@ ProjectCreatorIDEOptions=\
$(ProjectCreatorIDEOptions) \
-sourceBase $(HOTSPOTWORKSPACE) \
-buildBase $(HOTSPOTBUILDSPACE)\%f\%b \
+ -buildSpace $(HOTSPOTBUILDSPACE) \
-startAt src \
-compiler $(VcVersion) \
-projectFileName $(HOTSPOTBUILDSPACE)\$(ProjectFile) \
@@ -103,6 +117,7 @@ ProjectCreatorIDEOptions=\
-define TARGET_OS_ARCH_windows_x86 \
-define TARGET_OS_FAMILY_windows \
-define TARGET_COMPILER_visCPP \
+ -define INCLUDE_TRACE \
$(ProjectCreatorIncludesPRIVATE)
# Add in build-specific options
@@ -125,9 +140,13 @@ ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
!endif
ProjectCreatorIDEOptionsIgnoreCompiler1=\
+ -ignorePath_TARGET compiler1 \
+ -ignorePath_TARGET tiered \
-ignorePath_TARGET c1_
ProjectCreatorIDEOptionsIgnoreCompiler2=\
+ -ignorePath_TARGET compiler2 \
+ -ignorePath_TARGET tiered \
-ignorePath_TARGET src/share/vm/opto \
-ignorePath_TARGET src/share/vm/libadt \
-ignorePath_TARGET adfiles \
@@ -209,6 +228,7 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=kernel) \
##################################################
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-define_compiler1 COMPILER1 \
+ -ignorePath_compiler1 core \
$(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
##################################################
@@ -217,18 +237,19 @@ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=compiler1)
#NOTE! This list must be kept in sync with GENERATED_NAMES in adlc.make.
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
-define_compiler2 COMPILER2 \
+ -ignorePath_compiler2 core \
-additionalFile_compiler2 $(Platform_arch_model).ad \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model).hpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_clone.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_expand.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_format.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_gen.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_misc.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_peephole.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles ad_$(Platform_arch_model)_pipeline.cpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles adGlobals_$(Platform_arch_model).hpp \
- -additionalGeneratedFile_compiler2 $(HOTSPOTBUILDSPACE)/%f/generated/adfiles dfa_$(Platform_arch_model).cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model).cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model).hpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_clone.cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_expand.cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_format.cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_gen.cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_misc.cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_peephole.cpp \
+ -additionalFile_compiler2 ad_$(Platform_arch_model)_pipeline.cpp \
+ -additionalFile_compiler2 adGlobals_$(Platform_arch_model).hpp \
+ -additionalFile_compiler2 dfa_$(Platform_arch_model).cpp \
$(ProjectCreatorIDEOptionsIgnoreCompiler1:TARGET=compiler2)
# Add in the jvmti (JSR-163) options
@@ -237,8 +258,8 @@ ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
# code merge was done correctly (@see jvmti.make and jvmtiEnvFill.java).
# If so, they would then check it in as a new version of jvmtiEnv.cpp.
ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnv.hpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnter.cpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmtiEnterTrace.cpp \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles jvmti.h \
- -additionalGeneratedFile $(HOTSPOTBUILDSPACE)/%f/generated/jvmtifiles bytecodeInterpreterWithChecks.cpp
+ -additionalFile jvmtiEnv.hpp \
+ -additionalFile jvmtiEnter.cpp \
+ -additionalFile jvmtiEnterTrace.cpp \
+ -additionalFile jvmti.h \
+ -additionalFile bytecodeInterpreterWithChecks.cpp
diff --git a/hotspot/make/windows/makefiles/rules.make b/hotspot/make/windows/makefiles/rules.make
index 3e8d8549a59..693c1926526 100644
--- a/hotspot/make/windows/makefiles/rules.make
+++ b/hotspot/make/windows/makefiles/rules.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2003, 2011, 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
diff --git a/hotspot/make/windows/makefiles/sa.make b/hotspot/make/windows/makefiles/sa.make
index 9391ce88fd5..9363f0e5e6f 100644
--- a/hotspot/make/windows/makefiles/sa.make
+++ b/hotspot/make/windows/makefiles/sa.make
@@ -69,8 +69,8 @@ $(GENERATED)/sa-jdi.jar: $(AGENT_FILES)
$(RUN_JAR) uf $@ -C $(AGENT_SRC_DIR) META-INF/services/com.sun.jdi.connect.Connector
$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.windbg.WindbgDebuggerLocal
$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext
- $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.ia64.IA64ThreadContext
$(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext
+ $(RUN_JAVAH) -classpath $(SA_CLASSDIR) -jni sun.jvm.hotspot.asm.Disassembler
diff --git a/hotspot/make/windows/makefiles/sanity.make b/hotspot/make/windows/makefiles/sanity.make
index 23e8f4b354c..86c6b59aefe 100644
--- a/hotspot/make/windows/makefiles/sanity.make
+++ b/hotspot/make/windows/makefiles/sanity.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 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
diff --git a/hotspot/make/windows/makefiles/shared.make b/hotspot/make/windows/makefiles/shared.make
index b525cf7b265..06cd75f0e5e 100644
--- a/hotspot/make/windows/makefiles/shared.make
+++ b/hotspot/make/windows/makefiles/shared.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make
index ee878fe7343..b1e71de0e5a 100644
--- a/hotspot/make/windows/makefiles/vm.make
+++ b/hotspot/make/windows/makefiles/vm.make
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1997, 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
diff --git a/hotspot/make/windows/projectfiles/common/Makefile b/hotspot/make/windows/projectfiles/common/Makefile
index 1b037a185a0..f14f9c4ba07 100644
--- a/hotspot/make/windows/projectfiles/common/Makefile
+++ b/hotspot/make/windows/projectfiles/common/Makefile
@@ -1,5 +1,5 @@
#
-# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
index 22cf4ced748..25c850c8b46 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.cpp
@@ -725,24 +725,6 @@ void MacroAssembler::jump(const AddressLiteral& addrlit, Register temp, int offs
}
-// Convert to C varargs format
-void MacroAssembler::set_varargs( Argument inArg, Register d ) {
- // spill register-resident args to their memory slots
- // (SPARC calling convention requires callers to have already preallocated these)
- // Note that the inArg might in fact be an outgoing argument,
- // if a leaf routine or stub does some tricky argument shuffling.
- // This routine must work even though one of the saved arguments
- // is in the d register (e.g., set_varargs(Argument(0, false), O0)).
- for (Argument savePtr = inArg;
- savePtr.is_register();
- savePtr = savePtr.successor()) {
- st_ptr(savePtr.as_register(), savePtr.address_in_frame());
- }
- // return the address of the first memory slot
- Address a = inArg.address_in_frame();
- add(a.base(), a.disp(), d);
-}
-
// Conditional breakpoint (for assertion checks in assembly code)
void MacroAssembler::breakpoint_trap(Condition c, CC cc) {
trap(c, cc, G0, ST_RESERVED_FOR_USER_0);
@@ -1659,6 +1641,21 @@ void MacroAssembler::set_narrow_oop(jobject obj, Register d) {
}
+void MacroAssembler::set_narrow_klass(Klass* k, Register d) {
+ assert(oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ narrowOop encoded_k = oopDesc::encode_klass(k);
+
+ assert_not_delayed();
+ // Relocation with special format (see relocInfo_sparc.hpp).
+ relocate(rspec, 1);
+ // Assembler::sethi(encoded_k, d);
+ emit_long( op(branch_op) | rd(d) | op2(sethi_op2) | hi22(encoded_k) );
+ // Don't add relocation for 'add'. Do patching during 'sethi' processing.
+ add(d, low10(encoded_k), d);
+
+}
void MacroAssembler::align(int modulus) {
while (offset() % modulus != 0) nop();
@@ -2943,6 +2940,20 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
assert(itable_index.is_constant() || itable_index.as_register() == method_result,
"caller must use same register for non-constant itable index as for method");
+ Label L_no_such_interface_restore;
+ bool did_save = false;
+ if (scan_temp == noreg || sethi_temp == noreg) {
+ Register recv_2 = recv_klass->is_global() ? recv_klass : L0;
+ Register intf_2 = intf_klass->is_global() ? intf_klass : L1;
+ assert(method_result->is_global(), "must be able to return value");
+ scan_temp = L2;
+ sethi_temp = L3;
+ save_frame_and_mov(0, recv_klass, recv_2, intf_klass, intf_2);
+ recv_klass = recv_2;
+ intf_klass = intf_2;
+ did_save = true;
+ }
+
// Compute start of first itableOffsetEntry (which is at the end of the vtable)
int vtable_base = InstanceKlass::vtable_start_offset() * wordSize;
int scan_step = itableOffsetEntry::size() * wordSize;
@@ -2981,7 +2992,7 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
// result = (klass + scan->offset() + itable_index);
// }
// }
- Label search, found_method;
+ Label L_search, L_found_method;
for (int peel = 1; peel >= 0; peel--) {
// %%%% Could load both offset and interface in one ldx, if they were
@@ -2991,23 +3002,23 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
// Check that this entry is non-null. A null entry means that
// the receiver class doesn't implement the interface, and wasn't the
// same as when the caller was compiled.
- bpr(Assembler::rc_z, false, Assembler::pn, method_result, L_no_such_interface);
+ bpr(Assembler::rc_z, false, Assembler::pn, method_result, did_save ? L_no_such_interface_restore : L_no_such_interface);
delayed()->cmp(method_result, intf_klass);
if (peel) {
- brx(Assembler::equal, false, Assembler::pt, found_method);
+ brx(Assembler::equal, false, Assembler::pt, L_found_method);
} else {
- brx(Assembler::notEqual, false, Assembler::pn, search);
+ brx(Assembler::notEqual, false, Assembler::pn, L_search);
// (invert the test to fall through to found_method...)
}
delayed()->add(scan_temp, scan_step, scan_temp);
if (!peel) break;
- bind(search);
+ bind(L_search);
}
- bind(found_method);
+ bind(L_found_method);
// Got a hit.
int ito_offset = itableOffsetEntry::offset_offset_in_bytes();
@@ -3015,6 +3026,18 @@ void MacroAssembler::lookup_interface_method(Register recv_klass,
ito_offset -= scan_step;
lduw(scan_temp, ito_offset, scan_temp);
ld_ptr(recv_klass, scan_temp, method_result);
+
+ if (did_save) {
+ Label L_done;
+ ba(L_done);
+ delayed()->restore();
+
+ bind(L_no_such_interface_restore);
+ ba(L_no_such_interface);
+ delayed()->restore();
+
+ bind(L_done);
+ }
}
@@ -4652,7 +4675,7 @@ void MacroAssembler::load_klass(Register src_oop, Register klass) {
// if this changes, change that.
if (UseCompressedKlassPointers) {
lduw(src_oop, oopDesc::klass_offset_in_bytes(), klass);
- decode_heap_oop_not_null(klass);
+ decode_klass_not_null(klass);
} else {
ld_ptr(src_oop, oopDesc::klass_offset_in_bytes(), klass);
}
@@ -4661,7 +4684,7 @@ void MacroAssembler::load_klass(Register src_oop, Register klass) {
void MacroAssembler::store_klass(Register klass, Register dst_oop) {
if (UseCompressedKlassPointers) {
assert(dst_oop != klass, "not enough registers");
- encode_heap_oop_not_null(klass);
+ encode_klass_not_null(klass);
st(klass, dst_oop, oopDesc::klass_offset_in_bytes());
} else {
st_ptr(klass, dst_oop, oopDesc::klass_offset_in_bytes());
@@ -4821,17 +4844,58 @@ void MacroAssembler::decode_heap_oop_not_null(Register src, Register dst) {
// pd_code_size_limit.
// Also do not verify_oop as this is called by verify_oop.
assert (UseCompressedOops, "must be compressed");
- assert (Universe::heap() != NULL, "java heap should be initialized");
assert (LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
sllx(src, LogMinObjAlignmentInBytes, dst);
if (Universe::narrow_oop_base() != NULL)
add(dst, G6_heapbase, dst);
}
+void MacroAssembler::encode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ if (Universe::narrow_klass_base() != NULL)
+ sub(r, G6_heapbase, r);
+ srlx(r, LogKlassAlignmentInBytes, r);
+}
+
+void MacroAssembler::encode_klass_not_null(Register src, Register dst) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ if (Universe::narrow_klass_base() == NULL) {
+ srlx(src, LogKlassAlignmentInBytes, dst);
+ } else {
+ sub(src, G6_heapbase, dst);
+ srlx(dst, LogKlassAlignmentInBytes, dst);
+ }
+}
+
+void MacroAssembler::decode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Do not add assert code to this unless you change vtableStubs_sparc.cpp
+ // pd_code_size_limit.
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ sllx(r, LogKlassAlignmentInBytes, r);
+ if (Universe::narrow_klass_base() != NULL)
+ add(r, G6_heapbase, r);
+}
+
+void MacroAssembler::decode_klass_not_null(Register src, Register dst) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Do not add assert code to this unless you change vtableStubs_sparc.cpp
+ // pd_code_size_limit.
+ assert (UseCompressedKlassPointers, "must be compressed");
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ sllx(src, LogKlassAlignmentInBytes, dst);
+ if (Universe::narrow_klass_base() != NULL)
+ add(dst, G6_heapbase, dst);
+}
+
void MacroAssembler::reinit_heapbase() {
- if (UseCompressedOops) {
- // call indirectly to solve generation ordering problem
- AddressLiteral base(Universe::narrow_oop_base_addr());
+ if (UseCompressedOops || UseCompressedKlassPointers) {
+ AddressLiteral base(Universe::narrow_ptrs_base_addr());
load_ptr_contents(base, G6_heapbase);
}
}
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
index 99153f33b4f..f9b893258be 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.hpp
@@ -2280,6 +2280,11 @@ public:
void encode_heap_oop_not_null(Register src, Register dst);
void decode_heap_oop_not_null(Register src, Register dst);
+ void encode_klass_not_null(Register r);
+ void decode_klass_not_null(Register r);
+ void encode_klass_not_null(Register src, Register dst);
+ void decode_klass_not_null(Register src, Register dst);
+
// Support for managing the JavaThread pointer (i.e.; the reference to
// thread-local information).
void get_thread(); // load G2_thread
@@ -2409,6 +2414,7 @@ public:
inline void set_metadata (const AddressLiteral& obj_addr, Register d); // same as load_address
void set_narrow_oop( jobject obj, Register d );
+ void set_narrow_klass( Klass* k, Register d );
// nop padding
void align(int modulus);
@@ -2428,9 +2434,6 @@ public:
static void test();
#endif
- // convert an incoming arglist to varargs format; put the pointer in d
- void set_varargs( Argument a, Register d );
-
int total_frame_size_in_bytes(int extraWords);
// used when extraWords known statically
diff --git a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
index bccbe13d41b..63359d511eb 100644
--- a/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
+++ b/hotspot/src/cpu/sparc/vm/assembler_sparc.inline.hpp
@@ -347,7 +347,11 @@ inline void Assembler::sub(Register s1, RegisterOrConstant s2, Register d, int o
inline void Assembler::swap( Register s1, Register s2, Register d) { v9_dep(); emit_long( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | rs2(s2) ); }
inline void Assembler::swap( Register s1, int simm13a, Register d) { v9_dep(); emit_data( op(ldst_op) | rd(d) | op3(swap_op3) | rs1(s1) | immed(true) | simm(simm13a, 13)); }
-inline void Assembler::swap( Address& a, Register d, int offset ) { relocate(a.rspec(offset)); swap( a.base(), a.disp() + offset, d ); }
+inline void Assembler::swap( Address& a, Register d, int offset ) {
+ relocate(a.rspec(offset));
+ if (a.has_index()) { assert(offset == 0, ""); swap( a.base(), a.index(), d ); }
+ else { swap( a.base(), a.disp() + offset, d ); }
+}
// Use the right loads/stores for the platform
diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
index 0dce2505412..97ec2239549 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
index 4eb731d7b4f..ae4262bb73b 100644
--- a/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_FrameMap_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
index 2890c56d81a..27bf44244b5 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.cpp
@@ -105,6 +105,11 @@ bool LIR_Assembler::is_single_instruction(LIR_Op* op) {
if (src->is_address() && !src->is_stack() && (src->type() == T_OBJECT || src->type() == T_ARRAY)) return false;
}
+ if (UseCompressedKlassPointers) {
+ if (src->is_address() && !src->is_stack() && src->type() == T_ADDRESS &&
+ src->as_address_ptr()->disp() == oopDesc::klass_offset_in_bytes()) return false;
+ }
+
if (dst->is_register()) {
if (src->is_address() && Assembler::is_simm13(src->as_address_ptr()->disp())) {
return !PatchALot;
@@ -969,8 +974,18 @@ int LIR_Assembler::load(Register base, int offset, LIR_Opr to_reg, BasicType typ
#endif
}
break;
- case T_METADATA:
- case T_ADDRESS: __ ld_ptr(base, offset, to_reg->as_register()); break;
+ case T_METADATA: __ ld_ptr(base, offset, to_reg->as_register()); break;
+ case T_ADDRESS:
+#ifdef _LP64
+ if (offset == oopDesc::klass_offset_in_bytes() && UseCompressedKlassPointers) {
+ __ lduw(base, offset, to_reg->as_register());
+ __ decode_klass_not_null(to_reg->as_register());
+ } else
+#endif
+ {
+ __ ld_ptr(base, offset, to_reg->as_register());
+ }
+ break;
case T_ARRAY : // fall through
case T_OBJECT:
{
@@ -1315,7 +1330,13 @@ void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_cod
Address LIR_Assembler::as_Address(LIR_Address* addr) {
Register reg = addr->base()->as_register();
- return Address(reg, addr->disp());
+ LIR_Opr index = addr->index();
+ if (index->is_illegal()) {
+ return Address(reg, addr->disp());
+ } else {
+ assert (addr->disp() == 0, "unsupported address mode");
+ return Address(reg, index->as_pointer_register());
+ }
}
@@ -2284,7 +2305,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
__ mov(length, len);
__ load_klass(dst, tmp);
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
__ ld_ptr(tmp, ek_offset, super_k);
int sco_offset = in_bytes(Klass::super_check_offset_offset());
@@ -2338,7 +2359,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
if (UseCompressedKlassPointers) {
// tmp holds the default type. It currently comes uncompressed after the
// load of a constant, so encode it.
- __ encode_heap_oop(tmp);
+ __ encode_klass_not_null(tmp);
// load the raw value of the dst klass, since we will be comparing
// uncompressed values directly.
__ lduw(dst, oopDesc::klass_offset_in_bytes(), tmp2);
@@ -2775,7 +2796,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ load_klass(value, klass_RInfo);
// get instance klass
- __ ld_ptr(Address(k_RInfo, objArrayKlass::element_klass_offset()), k_RInfo);
+ __ ld_ptr(Address(k_RInfo, ObjArrayKlass::element_klass_offset()), k_RInfo);
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, O7, success_target, failure_target, NULL);
@@ -3438,7 +3459,28 @@ void LIR_Assembler::peephole(LIR_List* lir) {
}
}
+void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp) {
+ LIR_Address* addr = src->as_address_ptr();
+ assert(data == dest, "swap uses only 2 operands");
+ assert (code == lir_xchg, "no xadd on sparc");
+ if (data->type() == T_INT) {
+ __ swap(as_Address(addr), data->as_register());
+ } else if (data->is_oop()) {
+ Register obj = data->as_register();
+ Register narrow = tmp->as_register();
+#ifdef _LP64
+ assert(UseCompressedOops, "swap is 32bit only");
+ __ encode_heap_oop(obj, narrow);
+ __ swap(as_Address(addr), narrow);
+ __ decode_heap_oop(narrow, obj);
+#else
+ __ swap(as_Address(addr), obj);
+#endif
+ } else {
+ ShouldNotReachHere();
+ }
+}
#undef __
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
index 1fa8e24565c..1b13f28f127 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRAssembler_sparc.hpp
@@ -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
diff --git a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
index 75b7b6cdfa9..2d4b3a2f1d1 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LIRGenerator_sparc.cpp
@@ -1204,3 +1204,58 @@ void LIRGenerator::get_Object_unsafe(LIR_Opr dst, LIR_Opr src, LIR_Opr offset,
__ load(addr, dst);
}
}
+
+void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
+ BasicType type = x->basic_type();
+ LIRItem src(x->object(), this);
+ LIRItem off(x->offset(), this);
+ LIRItem value(x->value(), this);
+
+ src.load_item();
+ value.load_item();
+ off.load_nonconstant();
+
+ LIR_Opr dst = rlock_result(x, type);
+ LIR_Opr data = value.result();
+ bool is_obj = (type == T_ARRAY || type == T_OBJECT);
+ LIR_Opr offset = off.result();
+
+ if (data != dst) {
+ __ move(data, dst);
+ data = dst;
+ }
+
+ assert (!x->is_add() && (type == T_INT || (is_obj LP64_ONLY(&& UseCompressedOops))), "unexpected type");
+ LIR_Address* addr;
+ if (offset->is_constant()) {
+
+#ifdef _LP64
+ jlong l = offset->as_jlong();
+ assert((jlong)((jint)l) == l, "offset too large for constant");
+ jint c = (jint)l;
+#else
+ jint c = offset->as_jint();
+#endif
+ addr = new LIR_Address(src.result(), c, type);
+ } else {
+ addr = new LIR_Address(src.result(), offset, type);
+ }
+
+ LIR_Opr tmp = LIR_OprFact::illegalOpr;
+ LIR_Opr ptr = LIR_OprFact::illegalOpr;
+
+ if (is_obj) {
+ // Do the pre-write barrier, if any.
+ // barriers on sparc don't work with a base + index address
+ tmp = FrameMap::G3_opr;
+ ptr = new_pointer_register();
+ __ add(src.result(), off.result(), ptr);
+ pre_barrier(ptr, LIR_OprFact::illegalOpr /* pre_val */,
+ true /* do_load */, false /* patch */, NULL);
+ }
+ __ xchg(LIR_OprFact::address(addr), data, dst, tmp);
+ if (is_obj) {
+ // Seems to be a precise address
+ post_barrier(ptr, data);
+ }
+}
diff --git a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
index 46902b68f52..164c000de21 100644
--- a/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/c1_LinearScan_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, 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
diff --git a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
index be56a7031e3..05db22c93f9 100644
--- a/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/c1_MacroAssembler_sparc.cpp
@@ -189,7 +189,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
if (UseCompressedKlassPointers) {
// Save klass
mov(klass, t1);
- encode_heap_oop_not_null(t1);
+ encode_klass_not_null(t1);
stw(t1, obj, oopDesc::klass_offset_in_bytes());
} else {
st_ptr(klass, obj, oopDesc::klass_offset_in_bytes());
diff --git a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
index d92291fb36e..2e2040efc54 100644
--- a/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/interp_masm_sparc.cpp
@@ -1395,12 +1395,17 @@ void InterpreterMacroAssembler::test_invocation_counter_for_mdp(Register invocat
AddressLiteral profile_limit((address) &InvocationCounter::InterpreterProfileLimit);
sethi(profile_limit, Rtmp);
ld(Rtmp, profile_limit.low10(), Rtmp);
- cmp_and_br_short(invocation_count, Rtmp, Assembler::lessUnsigned, Assembler::pn, profile_continue);
+ cmp(invocation_count, Rtmp);
+ // Use long branches because call_VM() code and following code generated by
+ // test_backedge_count_for_osr() is large in debug VM.
+ br(Assembler::lessUnsigned, false, Assembler::pn, profile_continue);
+ delayed()->nop();
// Build it now.
call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::profile_method));
set_method_data_pointer_for_bcp();
- ba_short(profile_continue);
+ ba(profile_continue);
+ delayed()->nop();
bind(done);
}
diff --git a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
index 2f9fac8ce1c..0558b7b3c3c 100644
--- a/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/interpreterGenerator_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
index 3e6accae3d6..9245f3b40ff 100644
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.cpp
@@ -121,6 +121,7 @@ void MethodHandles::verify_ref_kind(MacroAssembler* _masm, int ref_kind, Registe
void MethodHandles::jump_from_method_handle(MacroAssembler* _masm, Register method, Register target, Register temp,
bool for_compiler_entry) {
assert(method == G5_method, "interpreter calling convention");
+ assert_different_registers(method, target, temp);
if (!for_compiler_entry && JvmtiExport::can_post_interpreter_events()) {
Label run_compiled_code;
@@ -153,19 +154,19 @@ void MethodHandles::jump_to_lambda_form(MacroAssembler* _masm,
BLOCK_COMMENT("jump_to_lambda_form {");
// This is the initial entry point of a lazy method handle.
// After type checking, it picks up the invoker from the LambdaForm.
- assert_different_registers(recv, method_temp, temp2, temp3);
+ assert_different_registers(recv, method_temp, temp2); // temp3 is only passed on
assert(method_temp == G5_method, "required register for loading method");
//NOT_PRODUCT({ FlagSetting fs(TraceMethodHandles, true); trace_method_handle(_masm, "LZMH"); });
// Load the invoker, as MH -> MH.form -> LF.vmentry
__ verify_oop(recv);
- __ load_heap_oop(Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())), method_temp);
+ __ load_heap_oop(Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())), method_temp);
__ verify_oop(method_temp);
- __ load_heap_oop(Address(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())), method_temp);
+ __ load_heap_oop(Address(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())), method_temp);
__ verify_oop(method_temp);
// the following assumes that a Method* is normally compressed in the vmtarget field:
- __ ld_ptr(Address(method_temp, NONZERO(java_lang_invoke_MemberName::vmtarget_offset_in_bytes())), method_temp);
+ __ ld_ptr( Address(method_temp, NONZERO(java_lang_invoke_MemberName::vmtarget_offset_in_bytes())), method_temp);
if (VerifyMethodHandles && !for_compiler_entry) {
// make sure recv is already on stack
@@ -207,8 +208,6 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
Register O1_scratch = O1;
Register O4_param_size = O4; // size of parameters
- address code_start = __ pc();
-
// here's where control starts out:
__ align(CodeEntryAlignment);
address entry_point = __ pc();
@@ -251,22 +250,9 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
// O4_first_arg_addr is live!
if (TraceMethodHandles) {
- const char* name = vmIntrinsics::name_at(iid);
- if (*name == '_') name += 1;
- const size_t len = strlen(name) + 50;
- char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
- const char* suffix = "";
- if (vmIntrinsics::method_for(iid) == NULL ||
- !vmIntrinsics::method_for(iid)->access_flags().is_public()) {
- if (is_signature_polymorphic_static(iid))
- suffix = "/static";
- else
- suffix = "/private";
- }
- jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
if (O0_mh != noreg)
__ mov(O0_mh, G3_method_handle); // make stub happy
- trace_method_handle(_masm, qname);
+ trace_method_handle_interpreter_entry(_masm, iid);
}
if (iid == vmIntrinsics::_invokeBasic) {
@@ -286,14 +272,6 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
generate_method_handle_dispatch(_masm, iid, O0_recv, G5_member, not_for_compiler_entry);
}
- if (PrintMethodHandleStubs) {
- address code_end = __ pc();
- tty->print_cr("--------");
- tty->print_cr("method handle interpreter entry for %s", vmIntrinsics::name_at(iid));
- Disassembler::decode(code_start, code_end);
- tty->cr();
- }
-
return entry_point;
}
@@ -303,25 +281,25 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
Register member_reg,
bool for_compiler_entry) {
assert(is_signature_polymorphic(iid), "expected invoke iid");
- // temps used in this code are not used in *either* compiled or interpreted calling sequences
Register temp1 = (for_compiler_entry ? G1_scratch : O1);
- Register temp2 = (for_compiler_entry ? G4_scratch : O4);
- Register temp3 = G3_scratch;
- Register temp4 = (for_compiler_entry ? noreg : O2);
+ Register temp2 = (for_compiler_entry ? G3_scratch : O2);
+ Register temp3 = (for_compiler_entry ? G4_scratch : O3);
+ Register temp4 = (for_compiler_entry ? noreg : O4);
if (for_compiler_entry) {
assert(receiver_reg == (iid == vmIntrinsics::_linkToStatic ? noreg : O0), "only valid assignment");
- assert_different_registers(temp1, O0, O1, O2, O3, O4, O5);
- assert_different_registers(temp2, O0, O1, O2, O3, O4, O5);
- assert_different_registers(temp3, O0, O1, O2, O3, O4, O5);
- assert_different_registers(temp4, O0, O1, O2, O3, O4, O5);
+ assert_different_registers(temp1, O0, O1, O2, O3, O4, O5);
+ assert_different_registers(temp2, O0, O1, O2, O3, O4, O5);
+ assert_different_registers(temp3, O0, O1, O2, O3, O4, O5);
+ assert_different_registers(temp4, O0, O1, O2, O3, O4, O5);
+ } else {
+ assert_different_registers(temp1, temp2, temp3, temp4, O5_savedSP); // don't trash lastSP
}
if (receiver_reg != noreg) assert_different_registers(temp1, temp2, temp3, temp4, receiver_reg);
if (member_reg != noreg) assert_different_registers(temp1, temp2, temp3, temp4, member_reg);
- if (!for_compiler_entry) assert_different_registers(temp1, temp2, temp3, temp4, O5_savedSP); // don't trash lastSP
if (iid == vmIntrinsics::_invokeBasic) {
// indirect through MH.form.vmentry.vmtarget
- jump_to_lambda_form(_masm, receiver_reg, G5_method, temp2, temp3, for_compiler_entry);
+ jump_to_lambda_form(_masm, receiver_reg, G5_method, temp1, temp2, for_compiler_entry);
} else {
// The method is a member invoker used by direct method handles.
@@ -378,24 +356,22 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// member_reg - MemberName that was the trailing argument
// temp1_recv_klass - klass of stacked receiver, if needed
// O5_savedSP - interpreter linkage (if interpreted)
- // O0..O7,G1,G4 - compiler arguments (if compiled)
+ // O0..O5 - compiler arguments (if compiled)
- bool method_is_live = false;
+ Label L_incompatible_class_change_error;
switch (iid) {
case vmIntrinsics::_linkToSpecial:
if (VerifyMethodHandles) {
- verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3);
+ verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp2);
}
__ ld_ptr(member_vmtarget, G5_method);
- method_is_live = true;
break;
case vmIntrinsics::_linkToStatic:
if (VerifyMethodHandles) {
- verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp3);
+ verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp2);
}
__ ld_ptr(member_vmtarget, G5_method);
- method_is_live = true;
break;
case vmIntrinsics::_linkToVirtual:
@@ -404,7 +380,7 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// minus the CP setup and profiling:
if (VerifyMethodHandles) {
- verify_ref_kind(_masm, JVM_REF_invokeVirtual, member_reg, temp3);
+ verify_ref_kind(_masm, JVM_REF_invokeVirtual, member_reg, temp2);
}
// pick out the vtable index from the MemberName, and then we can discard it:
@@ -423,7 +399,6 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// get target Method* & entry point
__ lookup_virtual_method(temp1_recv_klass, temp2_index, G5_method);
- method_is_live = true;
break;
}
@@ -432,13 +407,13 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// same as TemplateTable::invokeinterface
// (minus the CP setup and profiling, with different argument motion)
if (VerifyMethodHandles) {
- verify_ref_kind(_masm, JVM_REF_invokeInterface, member_reg, temp3);
+ verify_ref_kind(_masm, JVM_REF_invokeInterface, member_reg, temp2);
}
- Register temp3_intf = temp3;
- __ load_heap_oop(member_clazz, temp3_intf);
- load_klass_from_Class(_masm, temp3_intf, temp2, temp4);
- __ verify_klass_ptr(temp3_intf);
+ Register temp2_intf = temp2;
+ __ load_heap_oop(member_clazz, temp2_intf);
+ load_klass_from_Class(_masm, temp2_intf, temp3, temp4);
+ __ verify_klass_ptr(temp2_intf);
Register G5_index = G5_method;
__ ld_ptr(member_vmindex, G5_index);
@@ -450,37 +425,34 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
}
// given intf, index, and recv klass, dispatch to the implementation method
- Label L_no_such_interface;
- Register no_sethi_temp = noreg;
- __ lookup_interface_method(temp1_recv_klass, temp3_intf,
+ __ lookup_interface_method(temp1_recv_klass, temp2_intf,
// note: next two args must be the same:
G5_index, G5_method,
- temp2, no_sethi_temp,
- L_no_such_interface);
-
- __ verify_method_ptr(G5_method);
- jump_from_method_handle(_masm, G5_method, temp2, temp3, for_compiler_entry);
-
- __ bind(L_no_such_interface);
- AddressLiteral icce(StubRoutines::throw_IncompatibleClassChangeError_entry());
- __ jump_to(icce, temp3);
- __ delayed()->nop();
+ temp3, temp4,
+ L_incompatible_class_change_error);
break;
}
default:
- fatal(err_msg("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+ fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
break;
}
- if (method_is_live) {
- // live at this point: G5_method, O5_savedSP (if interpreted)
+ // Live at this point:
+ // G5_method
+ // O5_savedSP (if interpreted)
- // After figuring out which concrete method to call, jump into it.
- // Note that this works in the interpreter with no data motion.
- // But the compiled version will require that rcx_recv be shifted out.
- __ verify_method_ptr(G5_method);
- jump_from_method_handle(_masm, G5_method, temp1, temp3, for_compiler_entry);
+ // After figuring out which concrete method to call, jump into it.
+ // Note that this works in the interpreter with no data motion.
+ // But the compiled version will require that rcx_recv be shifted out.
+ __ verify_method_ptr(G5_method);
+ jump_from_method_handle(_masm, G5_method, temp1, temp2, for_compiler_entry);
+
+ if (iid == vmIntrinsics::_linkToInterface) {
+ __ BIND(L_incompatible_class_change_error);
+ AddressLiteral icce(StubRoutines::throw_IncompatibleClassChangeError_entry());
+ __ jump_to(icce, temp1);
+ __ delayed()->nop();
}
}
}
diff --git a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp
index 75231984d0e..d58e7d75cd0 100644
--- a/hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/methodHandles_sparc.hpp
@@ -58,5 +58,3 @@ public:
Register recv, Register method_temp,
Register temp2, Register temp3,
bool for_compiler_entry);
-
- static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
diff --git a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
index fcaaa18a6f4..aeb2420c640 100644
--- a/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/relocInfo_sparc.cpp
@@ -97,8 +97,8 @@ void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
jint inst2;
guarantee(Assembler::inv_op2(inst)==Assembler::sethi_op2, "must be sethi");
if (format() != 0) {
- assert(type() == relocInfo::oop_type, "only narrow oops case");
- jint np = oopDesc::encode_heap_oop((oop)x);
+ assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type, "only narrow oops or klasses case");
+ jint np = type() == relocInfo::oop_type ? oopDesc::encode_heap_oop((oop)x) : oopDesc::encode_klass((Klass*)x);
inst &= ~Assembler::hi22(-1);
inst |= Assembler::hi22((intptr_t)np);
if (verify_only) {
diff --git a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
index 2968bc8dfa7..bc35d196dcf 100644
--- a/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/sharedRuntime_sparc.cpp
@@ -313,6 +313,14 @@ void RegisterSaver::restore_result_registers(MacroAssembler* masm) {
}
+// Is vector's size (in bytes) bigger than a size saved by default?
+// 8 bytes FP registers are saved by default on SPARC.
+bool SharedRuntime::is_wide_vector(int size) {
+ // Note, MaxVectorSize == 8 on SPARC.
+ assert(size <= 8, err_msg_res("%d bytes vectors are not supported", size));
+ return size > 8;
+}
+
// The java_calling_convention describes stack locations as ideal slots on
// a frame with no abi restrictions. Since we must observe abi restrictions
// (like the placement of the register window) the slots must be biased by
@@ -364,9 +372,9 @@ static VMRegPair reg64_to_VMRegPair(Register r) {
// ---------------------------------------------------------------------------
// The compiled Java calling convention. The Java convention always passes
// 64-bit values in adjacent aligned locations (either registers or stack),
-// floats in float registers and doubles in aligned float pairs. Values are
-// packed in the registers. There is no backing varargs store for values in
-// registers. In the 32-bit build, longs are passed in G1 and G4 (cannot be
+// floats in float registers and doubles in aligned float pairs. There is
+// no backing varargs store for values in registers.
+// In the 32-bit build, longs are passed on the stack (cannot be
// passed in I's, because longs in I's get their heads chopped off at
// interrupt).
int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
@@ -375,76 +383,13 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
int is_outgoing) {
assert(F31->as_VMReg()->is_reg(), "overlapping stack/register numbers");
- // Convention is to pack the first 6 int/oop args into the first 6 registers
- // (I0-I5), extras spill to the stack. Then pack the first 8 float args
- // into F0-F7, extras spill to the stack. Then pad all register sets to
- // align. Then put longs and doubles into the same registers as they fit,
- // else spill to the stack.
const int int_reg_max = SPARC_ARGS_IN_REGS_NUM;
const int flt_reg_max = 8;
- //
- // Where 32-bit 1-reg longs start being passed
- // In tiered we must pass on stack because c1 can't use a "pair" in a single reg.
- // So make it look like we've filled all the G regs that c2 wants to use.
- Register g_reg = TieredCompilation ? noreg : G1;
- // Count int/oop and float args. See how many stack slots we'll need and
- // where the longs & doubles will go.
- int int_reg_cnt = 0;
- int flt_reg_cnt = 0;
- // int stk_reg_pairs = frame::register_save_words*(wordSize>>2);
- // int stk_reg_pairs = SharedRuntime::out_preserve_stack_slots();
- int stk_reg_pairs = 0;
- for (int i = 0; i < total_args_passed; i++) {
- switch (sig_bt[i]) {
- case T_LONG: // LP64, longs compete with int args
- assert(sig_bt[i+1] == T_VOID, "");
-#ifdef _LP64
- if (int_reg_cnt < int_reg_max) int_reg_cnt++;
-#endif
- break;
- case T_OBJECT:
- case T_ARRAY:
- case T_ADDRESS: // Used, e.g., in slow-path locking for the lock's stack address
- if (int_reg_cnt < int_reg_max) int_reg_cnt++;
-#ifndef _LP64
- else stk_reg_pairs++;
-#endif
- break;
- case T_INT:
- case T_SHORT:
- case T_CHAR:
- case T_BYTE:
- case T_BOOLEAN:
- if (int_reg_cnt < int_reg_max) int_reg_cnt++;
- else stk_reg_pairs++;
- break;
- case T_FLOAT:
- if (flt_reg_cnt < flt_reg_max) flt_reg_cnt++;
- else stk_reg_pairs++;
- break;
- case T_DOUBLE:
- assert(sig_bt[i+1] == T_VOID, "");
- break;
- case T_VOID:
- break;
- default:
- ShouldNotReachHere();
- }
- }
-
- // This is where the longs/doubles start on the stack.
- stk_reg_pairs = (stk_reg_pairs+1) & ~1; // Round
-
- int flt_reg_pairs = (flt_reg_cnt+1) & ~1;
-
- // int stk_reg = frame::register_save_words*(wordSize>>2);
- // int stk_reg = SharedRuntime::out_preserve_stack_slots();
- int stk_reg = 0;
int int_reg = 0;
int flt_reg = 0;
+ int slot = 0;
- // Now do the signature layout
for (int i = 0; i < total_args_passed; i++) {
switch (sig_bt[i]) {
case T_INT:
@@ -461,11 +406,14 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
Register r = is_outgoing ? as_oRegister(int_reg++) : as_iRegister(int_reg++);
regs[i].set1(r->as_VMReg());
} else {
- regs[i].set1(VMRegImpl::stack2reg(stk_reg++));
+ regs[i].set1(VMRegImpl::stack2reg(slot++));
}
break;
#ifdef _LP64
+ case T_LONG:
+ assert(sig_bt[i+1] == T_VOID, "expecting VOID in other half");
+ // fall-through
case T_OBJECT:
case T_ARRAY:
case T_ADDRESS: // Used, e.g., in slow-path locking for the lock's stack address
@@ -473,78 +421,57 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
Register r = is_outgoing ? as_oRegister(int_reg++) : as_iRegister(int_reg++);
regs[i].set2(r->as_VMReg());
} else {
- regs[i].set2(VMRegImpl::stack2reg(stk_reg_pairs));
- stk_reg_pairs += 2;
+ slot = round_to(slot, 2); // align
+ regs[i].set2(VMRegImpl::stack2reg(slot));
+ slot += 2;
}
break;
-#endif // _LP64
-
+#else
case T_LONG:
assert(sig_bt[i+1] == T_VOID, "expecting VOID in other half");
-#ifdef _LP64
- if (int_reg < int_reg_max) {
- Register r = is_outgoing ? as_oRegister(int_reg++) : as_iRegister(int_reg++);
- regs[i].set2(r->as_VMReg());
- } else {
- regs[i].set2(VMRegImpl::stack2reg(stk_reg_pairs));
- stk_reg_pairs += 2;
- }
-#else
-#ifdef COMPILER2
- // For 32-bit build, can't pass longs in O-regs because they become
- // I-regs and get trashed. Use G-regs instead. G1 and G4 are almost
- // spare and available. This convention isn't used by the Sparc ABI or
- // anywhere else. If we're tiered then we don't use G-regs because c1
- // can't deal with them as a "pair". (Tiered makes this code think g's are filled)
- // G0: zero
- // G1: 1st Long arg
- // G2: global allocated to TLS
- // G3: used in inline cache check
- // G4: 2nd Long arg
- // G5: used in inline cache check
- // G6: used by OS
- // G7: used by OS
-
- if (g_reg == G1) {
- regs[i].set2(G1->as_VMReg()); // This long arg in G1
- g_reg = G4; // Where the next arg goes
- } else if (g_reg == G4) {
- regs[i].set2(G4->as_VMReg()); // The 2nd long arg in G4
- g_reg = noreg; // No more longs in registers
- } else {
- regs[i].set2(VMRegImpl::stack2reg(stk_reg_pairs));
- stk_reg_pairs += 2;
- }
-#else // COMPILER2
- regs[i].set2(VMRegImpl::stack2reg(stk_reg_pairs));
- stk_reg_pairs += 2;
-#endif // COMPILER2
-#endif // _LP64
+ // On 32-bit SPARC put longs always on the stack to keep the pressure off
+ // integer argument registers. They should be used for oops.
+ slot = round_to(slot, 2); // align
+ regs[i].set2(VMRegImpl::stack2reg(slot));
+ slot += 2;
+#endif
break;
case T_FLOAT:
- if (flt_reg < flt_reg_max) regs[i].set1(as_FloatRegister(flt_reg++)->as_VMReg());
- else regs[i].set1(VMRegImpl::stack2reg(stk_reg++));
- break;
- case T_DOUBLE:
- assert(sig_bt[i+1] == T_VOID, "expecting half");
- if (flt_reg_pairs + 1 < flt_reg_max) {
- regs[i].set2(as_FloatRegister(flt_reg_pairs)->as_VMReg());
- flt_reg_pairs += 2;
+ if (flt_reg < flt_reg_max) {
+ FloatRegister r = as_FloatRegister(flt_reg++);
+ regs[i].set1(r->as_VMReg());
} else {
- regs[i].set2(VMRegImpl::stack2reg(stk_reg_pairs));
- stk_reg_pairs += 2;
+ regs[i].set1(VMRegImpl::stack2reg(slot++));
}
break;
- case T_VOID: regs[i].set_bad(); break; // Halves of longs & doubles
+
+ case T_DOUBLE:
+ assert(sig_bt[i+1] == T_VOID, "expecting half");
+ if (round_to(flt_reg, 2) + 1 < flt_reg_max) {
+ flt_reg = round_to(flt_reg, 2); // align
+ FloatRegister r = as_FloatRegister(flt_reg);
+ regs[i].set2(r->as_VMReg());
+ flt_reg += 2;
+ } else {
+ slot = round_to(slot, 2); // align
+ regs[i].set2(VMRegImpl::stack2reg(slot));
+ slot += 2;
+ }
+ break;
+
+ case T_VOID:
+ regs[i].set_bad(); // Halves of longs & doubles
+ break;
+
default:
- ShouldNotReachHere();
+ fatal(err_msg_res("unknown basic type %d", sig_bt[i]));
+ break;
}
}
// retun the amount of stack space these arguments will need.
- return stk_reg_pairs;
-
+ return slot;
}
// Helper class mostly to avoid passing masm everywhere, and handle
@@ -601,8 +528,7 @@ void AdapterGenerator::patch_callers_callsite() {
Label L;
__ ld_ptr(G5_method, in_bytes(Method::code_offset()), G3_scratch);
__ br_null(G3_scratch, false, Assembler::pt, L);
- // Schedule the branch target address early.
- __ delayed()->ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), G3_scratch);
+ __ delayed()->nop();
// Call into the VM to patch the caller, then jump to compiled callee
__ save_frame(4); // Args in compiled layout; do not blow them
@@ -645,7 +571,6 @@ void AdapterGenerator::patch_callers_callsite() {
__ ldx(FP, -8 + STACK_BIAS, G1);
__ ldx(FP, -16 + STACK_BIAS, G4);
__ mov(L5, G5_method);
- __ ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), G3_scratch);
#endif /* _LP64 */
__ restore(); // Restore args
@@ -726,7 +651,7 @@ void AdapterGenerator::gen_c2i_adapter(
int comp_args_on_stack, // VMRegStackSlots
const BasicType *sig_bt,
const VMRegPair *regs,
- Label& skip_fixup) {
+ Label& L_skip_fixup) {
// Before we get into the guts of the C2I adapter, see if we should be here
// at all. We've come from compiled code and are attempting to jump to the
@@ -747,7 +672,7 @@ void AdapterGenerator::gen_c2i_adapter(
patch_callers_callsite();
- __ bind(skip_fixup);
+ __ bind(L_skip_fixup);
// Since all args are passed on the stack, total_args_passed*wordSize is the
// space we need. Add in varargs area needed by the interpreter. Round up
@@ -757,46 +682,18 @@ void AdapterGenerator::gen_c2i_adapter(
(frame::varargs_offset - frame::register_save_words)*wordSize;
const int extraspace = round_to(arg_size + varargs_area, 2*wordSize);
- int bias = STACK_BIAS;
+ const int bias = STACK_BIAS;
const int interp_arg_offset = frame::varargs_offset*wordSize +
(total_args_passed-1)*Interpreter::stackElementSize;
- Register base = SP;
+ const Register base = SP;
-#ifdef _LP64
- // In the 64bit build because of wider slots and STACKBIAS we can run
- // out of bits in the displacement to do loads and stores. Use g3 as
- // temporary displacement.
- if (!Assembler::is_simm13(extraspace)) {
- __ set(extraspace, G3_scratch);
- __ sub(SP, G3_scratch, SP);
- } else {
- __ sub(SP, extraspace, SP);
- }
+ // Make some extra space on the stack.
+ __ sub(SP, __ ensure_simm13_or_reg(extraspace, G3_scratch), SP);
set_Rdisp(G3_scratch);
-#else
- __ sub(SP, extraspace, SP);
-#endif // _LP64
- // First write G1 (if used) to where ever it must go
- for (int i=0; ias_VMReg()) {
- if (sig_bt[i] == T_OBJECT || sig_bt[i] == T_ARRAY) {
- store_c2i_object(G1_scratch, base, st_off);
- } else if (sig_bt[i] == T_LONG) {
- assert(!TieredCompilation, "should not use register args for longs");
- store_c2i_long(G1_scratch, base, st_off, false);
- } else {
- store_c2i_int(G1_scratch, base, st_off);
- }
- }
- }
-
- // Now write the args into the outgoing interpreter space
- for (int i=0; iis_valid(), "");
continue;
}
- // Skip G1 if found as we did it first in order to free it up
- if (r_1 == G1_scratch->as_VMReg()) {
- continue;
- }
-#ifdef ASSERT
- bool G1_forced = false;
-#endif // ASSERT
if (r_1->is_stack()) { // Pretend stack targets are loaded into G1
-#ifdef _LP64
- Register ld_off = Rdisp;
- __ set(reg2offset(r_1) + extraspace + bias, ld_off);
-#else
- int ld_off = reg2offset(r_1) + extraspace + bias;
-#endif // _LP64
-#ifdef ASSERT
- G1_forced = true;
-#endif // ASSERT
+ RegisterOrConstant ld_off = reg2offset(r_1) + extraspace + bias;
+ ld_off = __ ensure_simm13_or_reg(ld_off, Rdisp);
r_1 = G1_scratch->as_VMReg();// as part of the load/store shuffle
if (!r_2->is_valid()) __ ld (base, ld_off, G1_scratch);
else __ ldx(base, ld_off, G1_scratch);
@@ -831,11 +714,6 @@ void AdapterGenerator::gen_c2i_adapter(
if (sig_bt[i] == T_OBJECT || sig_bt[i] == T_ARRAY) {
store_c2i_object(r, base, st_off);
} else if (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) {
-#ifndef _LP64
- if (TieredCompilation) {
- assert(G1_forced || sig_bt[i] != T_LONG, "should not use register args for longs");
- }
-#endif // _LP64
store_c2i_long(r, base, st_off, r_2->is_stack());
} else {
store_c2i_int(r, base, st_off);
@@ -851,19 +729,12 @@ void AdapterGenerator::gen_c2i_adapter(
}
}
-#ifdef _LP64
- // Need to reload G3_scratch, used for temporary displacements.
+ // Load the interpreter entry point.
__ ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), G3_scratch);
// Pass O5_savedSP as an argument to the interpreter.
// The interpreter will restore SP to this value before returning.
- __ set(extraspace, G1);
- __ add(SP, G1, O5_savedSP);
-#else
- // Pass O5_savedSP as an argument to the interpreter.
- // The interpreter will restore SP to this value before returning.
- __ add(SP, extraspace, O5_savedSP);
-#endif // _LP64
+ __ add(SP, __ ensure_simm13_or_reg(extraspace, G1), O5_savedSP);
__ mov((frame::varargs_offset)*wordSize -
1*Interpreter::stackElementSize+bias+BytesPerWord, G1);
@@ -971,7 +842,6 @@ void AdapterGenerator::gen_i2c_adapter(
// Outputs:
// G2_thread - TLS
- // G1, G4 - Outgoing long args in 32-bit build
// O0-O5 - Outgoing args in compiled layout
// O6 - Adjusted or restored SP
// O7 - Valid return address
@@ -1016,10 +886,10 @@ void AdapterGenerator::gen_i2c_adapter(
// +--------------+ <--- start of outgoing args
// | pad, align | |
// +--------------+ |
- // | ints, floats | |---Outgoing stack args, packed low.
- // +--------------+ | First few args in registers.
- // : doubles : |
- // | longs | |
+ // | ints, longs, | |
+ // | floats, | |---Outgoing stack args.
+ // : doubles : | First few args in registers.
+ // | | |
// +--------------+ <--- SP' + 16*wordsize
// | |
// : window :
@@ -1033,7 +903,6 @@ void AdapterGenerator::gen_i2c_adapter(
// Cut-out for having no stack args. Since up to 6 args are passed
// in registers, we will commonly have no stack args.
if (comp_args_on_stack > 0) {
-
// Convert VMReg stack slots to words.
int comp_words_on_stack = round_to(comp_args_on_stack*VMRegImpl::stack_slot_size, wordSize)>>LogBytesPerWord;
// Round up to miminum stack alignment, in wordSize
@@ -1044,13 +913,9 @@ void AdapterGenerator::gen_i2c_adapter(
__ sub(SP, (comp_words_on_stack)*wordSize, SP);
}
- // Will jump to the compiled code just as if compiled code was doing it.
- // Pre-load the register-jump target early, to schedule it better.
- __ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3);
-
// Now generate the shuffle code. Pick up all register args and move the
// rest through G1_scratch.
- for (int i=0; iis_FloatRegister(), "");
if (!r_2->is_valid()) {
- __ ldf(FloatRegisterImpl::S, Gargs, arg_slot(ld_off), r_1->as_FloatRegister());
+ __ ldf(FloatRegisterImpl::S, Gargs, arg_slot(ld_off), r_1->as_FloatRegister());
} else {
#ifdef _LP64
// In V9, doubles are given 2 64-bit slots in the interpreter, but the
@@ -1104,11 +968,11 @@ void AdapterGenerator::gen_i2c_adapter(
// spare float register.
RegisterOrConstant slot = (sig_bt[i] == T_LONG || sig_bt[i] == T_DOUBLE) ?
next_arg_slot(ld_off) : arg_slot(ld_off);
- __ ldf(FloatRegisterImpl::D, Gargs, slot, r_1->as_FloatRegister());
+ __ ldf(FloatRegisterImpl::D, Gargs, slot, r_1->as_FloatRegister());
#else
// Need to marshal 64-bit value from misaligned Lesp loads
__ ldf(FloatRegisterImpl::S, Gargs, next_arg_slot(ld_off), r_1->as_FloatRegister());
- __ ldf(FloatRegisterImpl::S, Gargs, arg_slot(ld_off), r_2->as_FloatRegister());
+ __ ldf(FloatRegisterImpl::S, Gargs, arg_slot(ld_off), r_2->as_FloatRegister());
#endif
}
}
@@ -1124,76 +988,35 @@ void AdapterGenerator::gen_i2c_adapter(
else __ stf(FloatRegisterImpl::D, r_1->as_FloatRegister(), SP, slot);
}
}
- bool made_space = false;
-#ifndef _LP64
- // May need to pick up a few long args in G1/G4
- bool g4_crushed = false;
- bool g3_crushed = false;
- for (int i=0; iis_Register() && regs[i].second()->is_valid()) {
- // Load in argument order going down
- int ld_off = (total_args_passed-i)*Interpreter::stackElementSize;
- // Need to marshal 64-bit value from misaligned Lesp loads
- Register r = regs[i].first()->as_Register()->after_restore();
- if (r == G1 || r == G4) {
- assert(!g4_crushed, "ordering problem");
- if (r == G4){
- g4_crushed = true;
- __ lduw(Gargs, arg_slot(ld_off) , G3_scratch); // Load lo bits
- __ ld (Gargs, next_arg_slot(ld_off), r); // Load hi bits
- } else {
- // better schedule this way
- __ ld (Gargs, next_arg_slot(ld_off), r); // Load hi bits
- __ lduw(Gargs, arg_slot(ld_off) , G3_scratch); // Load lo bits
- }
- g3_crushed = true;
- __ sllx(r, 32, r);
- __ or3(G3_scratch, r, r);
- } else {
- assert(r->is_out(), "longs passed in two O registers");
- __ ld (Gargs, arg_slot(ld_off) , r->successor()); // Load lo bits
- __ ld (Gargs, next_arg_slot(ld_off), r); // Load hi bits
- }
- }
- }
-#endif
// Jump to the compiled code just as if compiled code was doing it.
- //
-#ifndef _LP64
- if (g3_crushed) {
- // Rats load was wasted, at least it is in cache...
- __ ld_ptr(G5_method, Method::from_compiled_offset(), G3);
- }
-#endif /* _LP64 */
+ __ ld_ptr(G5_method, in_bytes(Method::from_compiled_offset()), G3);
- // 6243940 We might end up in handle_wrong_method if
- // the callee is deoptimized as we race thru here. If that
- // happens we don't want to take a safepoint because the
- // caller frame will look interpreted and arguments are now
- // "compiled" so it is much better to make this transition
- // invisible to the stack walking code. Unfortunately if
- // we try and find the callee by normal means a safepoint
- // is possible. So we stash the desired callee in the thread
- // and the vm will find there should this case occur.
- Address callee_target_addr(G2_thread, JavaThread::callee_target_offset());
- __ st_ptr(G5_method, callee_target_addr);
+ // 6243940 We might end up in handle_wrong_method if
+ // the callee is deoptimized as we race thru here. If that
+ // happens we don't want to take a safepoint because the
+ // caller frame will look interpreted and arguments are now
+ // "compiled" so it is much better to make this transition
+ // invisible to the stack walking code. Unfortunately if
+ // we try and find the callee by normal means a safepoint
+ // is possible. So we stash the desired callee in the thread
+ // and the vm will find there should this case occur.
+ Address callee_target_addr(G2_thread, JavaThread::callee_target_offset());
+ __ st_ptr(G5_method, callee_target_addr);
- if (StressNonEntrant) {
- // Open a big window for deopt failure
- __ save_frame(0);
- __ mov(G0, L0);
- Label loop;
- __ bind(loop);
- __ sub(L0, 1, L0);
- __ br_null_short(L0, Assembler::pt, loop);
+ if (StressNonEntrant) {
+ // Open a big window for deopt failure
+ __ save_frame(0);
+ __ mov(G0, L0);
+ Label loop;
+ __ bind(loop);
+ __ sub(L0, 1, L0);
+ __ br_null_short(L0, Assembler::pt, loop);
+ __ restore();
+ }
- __ restore();
- }
-
-
- __ jmpl(G3, 0, G0);
- __ delayed()->nop();
+ __ jmpl(G3, 0, G0);
+ __ delayed()->nop();
}
// ---------------------------------------------------------------
@@ -1221,28 +1044,17 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
// compiled code, which relys solely on SP and not FP, get sick).
address c2i_unverified_entry = __ pc();
- Label skip_fixup;
+ Label L_skip_fixup;
{
-#if !defined(_LP64) && defined(COMPILER2)
- Register R_temp = L0; // another scratch register
-#else
- Register R_temp = G1; // another scratch register
-#endif
+ Register R_temp = G1; // another scratch register
AddressLiteral ic_miss(SharedRuntime::get_ic_miss_stub());
__ verify_oop(O0);
__ load_klass(O0, G3_scratch);
-#if !defined(_LP64) && defined(COMPILER2)
- __ save(SP, -frame::register_save_words*wordSize, SP);
__ ld_ptr(G5_method, CompiledICHolder::holder_klass_offset(), R_temp);
__ cmp(G3_scratch, R_temp);
- __ restore();
-#else
- __ ld_ptr(G5_method, CompiledICHolder::holder_klass_offset(), R_temp);
- __ cmp(G3_scratch, R_temp);
-#endif
Label ok, ok2;
__ brx(Assembler::equal, false, Assembler::pt, ok);
@@ -1256,8 +1068,8 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
// the call site corrected.
__ ld_ptr(G5_method, in_bytes(Method::code_offset()), G3_scratch);
__ bind(ok2);
- __ br_null(G3_scratch, false, Assembler::pt, skip_fixup);
- __ delayed()->ld_ptr(G5_method, in_bytes(Method::interpreter_entry_offset()), G3_scratch);
+ __ br_null(G3_scratch, false, Assembler::pt, L_skip_fixup);
+ __ delayed()->nop();
__ jump_to(ic_miss, G3_scratch);
__ delayed()->nop();
@@ -1265,7 +1077,7 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
address c2i_entry = __ pc();
- agen.gen_c2i_adapter(total_args_passed, comp_args_on_stack, sig_bt, regs, skip_fixup);
+ agen.gen_c2i_adapter(total_args_passed, comp_args_on_stack, sig_bt, regs, L_skip_fixup);
__ flush();
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry);
@@ -1985,12 +1797,12 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType
}
static void verify_oop_args(MacroAssembler* masm,
- int total_args_passed,
+ methodHandle method,
const BasicType* sig_bt,
const VMRegPair* regs) {
Register temp_reg = G5_method; // not part of any compiled calling seq
if (VerifyOops) {
- for (int i = 0; i < total_args_passed; i++) {
+ for (int i = 0; i < method->size_of_parameters(); i++) {
if (sig_bt[i] == T_OBJECT ||
sig_bt[i] == T_ARRAY) {
VMReg r = regs[i].first();
@@ -2009,35 +1821,32 @@ static void verify_oop_args(MacroAssembler* masm,
}
static void gen_special_dispatch(MacroAssembler* masm,
- int total_args_passed,
- int comp_args_on_stack,
- vmIntrinsics::ID special_dispatch,
+ methodHandle method,
const BasicType* sig_bt,
const VMRegPair* regs) {
- verify_oop_args(masm, total_args_passed, sig_bt, regs);
+ verify_oop_args(masm, method, sig_bt, regs);
+ vmIntrinsics::ID iid = method->intrinsic_id();
// Now write the args into the outgoing interpreter space
bool has_receiver = false;
Register receiver_reg = noreg;
int member_arg_pos = -1;
Register member_reg = noreg;
- int ref_kind = MethodHandles::signature_polymorphic_intrinsic_ref_kind(special_dispatch);
+ int ref_kind = MethodHandles::signature_polymorphic_intrinsic_ref_kind(iid);
if (ref_kind != 0) {
- member_arg_pos = total_args_passed - 1; // trailing MemberName argument
+ member_arg_pos = method->size_of_parameters() - 1; // trailing MemberName argument
member_reg = G5_method; // known to be free at this point
has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
- } else if (special_dispatch == vmIntrinsics::_invokeBasic) {
+ } else if (iid == vmIntrinsics::_invokeBasic) {
has_receiver = true;
} else {
- fatal(err_msg("special_dispatch=%d", special_dispatch));
+ fatal(err_msg_res("unexpected intrinsic id %d", iid));
}
if (member_reg != noreg) {
// Load the member_arg into register, if necessary.
- assert(member_arg_pos >= 0 && member_arg_pos < total_args_passed, "oob");
- assert(sig_bt[member_arg_pos] == T_OBJECT, "dispatch argument must be an object");
+ SharedRuntime::check_member_name_argument_is_last_argument(method, sig_bt, regs);
VMReg r = regs[member_arg_pos].first();
- assert(r->is_valid(), "bad member arg");
if (r->is_stack()) {
RegisterOrConstant ld_off = reg2offset(r) + STACK_BIAS;
ld_off = __ ensure_simm13_or_reg(ld_off, member_reg);
@@ -2050,7 +1859,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
if (has_receiver) {
// Make sure the receiver is loaded into a register.
- assert(total_args_passed > 0, "oob");
+ assert(method->size_of_parameters() > 0, "oob");
assert(sig_bt[0] == T_OBJECT, "receiver argument must be an object");
VMReg r = regs[0].first();
assert(r->is_valid(), "bad receiver arg");
@@ -2058,7 +1867,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
// Porting note: This assumes that compiled calling conventions always
// pass the receiver oop in a register. If this is not true on some
// platform, pick a temp and load the receiver from stack.
- assert(false, "receiver always in a register");
+ fatal("receiver always in a register");
receiver_reg = G3_scratch; // known to be free at this point
RegisterOrConstant ld_off = reg2offset(r) + STACK_BIAS;
ld_off = __ ensure_simm13_or_reg(ld_off, member_reg);
@@ -2070,7 +1879,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
}
// Figure out which address we are really jumping to:
- MethodHandles::generate_method_handle_dispatch(masm, special_dispatch,
+ MethodHandles::generate_method_handle_dispatch(masm, iid,
receiver_reg, member_reg, /*for_compiler_entry:*/ true);
}
@@ -2103,11 +1912,9 @@ static void gen_special_dispatch(MacroAssembler* masm,
// transition back to thread_in_Java
// return to caller
//
-nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
+nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
methodHandle method,
int compile_id,
- int total_in_args,
- int comp_args_on_stack, // in VMRegStackSlots
BasicType* in_sig_bt,
VMRegPair* in_regs,
BasicType ret_type) {
@@ -2116,9 +1923,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
intptr_t start = (intptr_t)__ pc();
int vep_offset = ((intptr_t)__ pc()) - start;
gen_special_dispatch(masm,
- total_in_args,
- comp_args_on_stack,
- method->intrinsic_id(),
+ method,
in_sig_bt,
in_regs);
int frame_complete = ((intptr_t)__ pc()) - start; // not complete, period
@@ -2220,6 +2025,7 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// we convert the java signature to a C signature by inserting
// the hidden arguments as arg[0] and possibly arg[1] (static method)
+ const int total_in_args = method->size_of_parameters();
int total_c_args = total_in_args;
int total_save_slots = 6 * VMRegImpl::slots_per_word;
if (!is_critical_native) {
@@ -3936,7 +3742,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
// the 64-bit %o's, then do a save, then fixup the caller's SP (our FP).
// Tricky, tricky, tricky...
-SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause_return) {
+SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
assert (StubRoutines::forward_exception_entry() != NULL, "must be generated before");
// allocate space for the code
@@ -3954,6 +3760,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
int start = __ offset();
+ bool cause_return = (poll_type == POLL_AT_RETURN);
// If this causes a return before the processing, then do a "restore"
if (cause_return) {
__ restore();
diff --git a/hotspot/src/cpu/sparc/vm/sparc.ad b/hotspot/src/cpu/sparc/vm/sparc.ad
index 42b4cf81b8b..b7029faa604 100644
--- a/hotspot/src/cpu/sparc/vm/sparc.ad
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad
@@ -557,9 +557,9 @@ int MachCallDynamicJavaNode::ret_addr_offset() {
int entry_offset = InstanceKlass::vtable_start_offset() + vtable_index*vtableEntry::size();
int v_off = entry_offset*wordSize + vtableEntry::method_offset_in_bytes();
int klass_load_size;
- if (UseCompressedOops && UseCompressedKlassPointers) {
+ if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
- if (Universe::narrow_oop_base() == NULL)
+ if (Universe::narrow_klass_base() == NULL)
klass_load_size = 2*BytesPerInstWord; // see MacroAssembler::load_klass()
else
klass_load_size = 3*BytesPerInstWord;
@@ -1707,11 +1707,11 @@ uint reloc_java_to_interp() {
void MachUEPNode::format( PhaseRegAlloc *ra_, outputStream *st ) const {
st->print_cr("\nUEP:");
#ifdef _LP64
- if (UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
st->print_cr("\tLDUW [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check - compressed klass");
st->print_cr("\tSLL R_G5,3,R_G5");
- if (Universe::narrow_oop_base() != NULL)
+ if (Universe::narrow_klass_base() != NULL)
st->print_cr("\tADD R_G5,R_G6_heap_base,R_G5");
} else {
st->print_cr("\tLDX [R_O0 + oopDesc::klass_offset_in_bytes],R_G5\t! Inline cache check");
@@ -1838,6 +1838,12 @@ const bool Matcher::match_rule_supported(int opcode) {
case Op_PopCountL:
if (!UsePopCountInstruction)
return false;
+ case Op_CompareAndSwapL:
+#ifdef _LP64
+ case Op_CompareAndSwapP:
+#endif
+ if (!VM_Version::supports_cx8())
+ return false;
break;
}
@@ -1864,6 +1870,11 @@ const int Matcher::vector_ideal_reg(int size) {
return Op_RegD;
}
+const int Matcher::vector_shift_count_ideal_reg(int size) {
+ fatal("vector shift is not supported");
+ return Node::NotAMachineReg;
+}
+
// Limits on vector size (number of elements) loaded into vector.
const int Matcher::max_vector_size(const BasicType bt) {
assert(is_java_primitive(bt), "only primitive type vectors");
@@ -1931,6 +1942,12 @@ bool Matcher::narrow_oop_use_complex_address() {
return false;
}
+bool Matcher::narrow_klass_use_complex_address() {
+ NOT_LP64(ShouldNotCallThis());
+ assert(UseCompressedKlassPointers, "only for compressed klass code");
+ return false;
+}
+
// Is it better to copy float constants, or load them directly from memory?
// Intel can load a float constant from a direct address, requiring no
// extra registers. Most RISCs will have to materialize an address into a
@@ -2591,9 +2608,9 @@ encode %{
int off = __ offset();
__ load_klass(O0, G3_scratch);
int klass_load_size;
- if (UseCompressedOops && UseCompressedKlassPointers) {
+ if (UseCompressedKlassPointers) {
assert(Universe::heap() != NULL, "java heap should be initialized");
- if (Universe::narrow_oop_base() == NULL)
+ if (Universe::narrow_klass_base() == NULL)
klass_load_size = 2*BytesPerInstWord;
else
klass_load_size = 3*BytesPerInstWord;
@@ -3599,6 +3616,15 @@ operand immN()
interface(CONST_INTER);
%}
+operand immNKlass()
+%{
+ match(ConNKlass);
+
+ op_cost(10);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// NULL Pointer Immediate
operand immN0()
%{
@@ -5859,8 +5885,8 @@ instruct loadI2L_immI(iRegL dst, memory mem, immI mask, iRegL tmp) %{
%}
// Load Unsigned Integer into a Long Register
-instruct loadUI2L(iRegL dst, memory mem) %{
- match(Set dst (LoadUI2L mem));
+instruct loadUI2L(iRegL dst, memory mem, immL_32bits mask) %{
+ match(Set dst (AndL (ConvI2L (LoadI mem)) mask));
ins_cost(MEMORY_REF_COST);
size(4);
@@ -6148,6 +6174,17 @@ instruct loadConN(iRegN dst, immN src) %{
ins_pipe(ialu_hi_lo_reg);
%}
+instruct loadConNKlass(iRegN dst, immNKlass src) %{
+ match(Set dst src);
+ ins_cost(DEFAULT_COST * 3/2);
+ format %{ "SET $src,$dst\t! compressed klass ptr" %}
+ ins_encode %{
+ Register dst = $dst$$Register;
+ __ set_narrow_klass((Klass*)$src$$constant, dst);
+ %}
+ ins_pipe(ialu_hi_lo_reg);
+%}
+
// Materialize long value (predicated by immL_cheap).
instruct loadConL_set64(iRegL dst, immL_cheap con, o7RegL tmp) %{
match(Set dst con);
@@ -6464,6 +6501,25 @@ instruct storeN(memory dst, iRegN src) %{
ins_pipe(istore_mem_spORreg);
%}
+instruct storeNKlass(memory dst, iRegN src) %{
+ match(Set dst (StoreNKlass dst src));
+ ins_cost(MEMORY_REF_COST);
+ size(4);
+
+ format %{ "STW $src,$dst\t! compressed klass ptr" %}
+ ins_encode %{
+ Register base = as_Register($dst$$base);
+ Register index = as_Register($dst$$index);
+ Register src = $src$$Register;
+ if (index != G0) {
+ __ stw(src, base, index);
+ } else {
+ __ stw(src, base, $dst$$disp);
+ }
+ %}
+ ins_pipe(istore_mem_spORreg);
+%}
+
instruct storeN0(memory dst, immN0 src) %{
match(Set dst (StoreN dst src));
ins_cost(MEMORY_REF_COST);
@@ -6571,6 +6627,23 @@ instruct decodeHeapOop_not_null(iRegP dst, iRegN src) %{
ins_pipe(ialu_reg);
%}
+instruct encodeKlass_not_null(iRegN dst, iRegP src) %{
+ match(Set dst (EncodePKlass src));
+ format %{ "encode_klass_not_null $src, $dst" %}
+ ins_encode %{
+ __ encode_klass_not_null($src$$Register, $dst$$Register);
+ %}
+ ins_pipe(ialu_reg);
+%}
+
+instruct decodeKlass_not_null(iRegP dst, iRegN src) %{
+ match(Set dst (DecodeNKlass src));
+ format %{ "decode_klass_not_null $src, $dst" %}
+ ins_encode %{
+ __ decode_klass_not_null($src$$Register, $dst$$Register);
+ %}
+ ins_pipe(ialu_reg);
+%}
//----------MemBar Instructions-----------------------------------------------
// Memory barrier flavors
@@ -7199,6 +7272,7 @@ instruct storeLConditional( iRegP mem_ptr, iRegL oldval, g3RegL newval, flagsReg
// No flag versions for CompareAndSwap{P,I,L} because matcher can't match them
instruct compareAndSwapL_bool(iRegP mem_ptr, iRegL oldval, iRegL newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{
+ predicate(VM_Version::supports_cx8());
match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval)));
effect( USE mem_ptr, KILL ccr, KILL tmp1);
format %{
@@ -7230,6 +7304,9 @@ instruct compareAndSwapI_bool(iRegP mem_ptr, iRegI oldval, iRegI newval, iRegI r
%}
instruct compareAndSwapP_bool(iRegP mem_ptr, iRegP oldval, iRegP newval, iRegI res, o7RegI tmp1, flagsReg ccr ) %{
+#ifdef _LP64
+ predicate(VM_Version::supports_cx8());
+#endif
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
effect( USE mem_ptr, KILL ccr, KILL tmp1);
format %{
@@ -7264,6 +7341,38 @@ instruct compareAndSwapN_bool(iRegP mem_ptr, iRegN oldval, iRegN newval, iRegI r
ins_pipe( long_memory_op );
%}
+instruct xchgI( memory mem, iRegI newval) %{
+ match(Set newval (GetAndSetI mem newval));
+ format %{ "SWAP [$mem],$newval" %}
+ size(4);
+ ins_encode %{
+ __ swap($mem$$Address, $newval$$Register);
+ %}
+ ins_pipe( long_memory_op );
+%}
+
+#ifndef _LP64
+instruct xchgP( memory mem, iRegP newval) %{
+ match(Set newval (GetAndSetP mem newval));
+ format %{ "SWAP [$mem],$newval" %}
+ size(4);
+ ins_encode %{
+ __ swap($mem$$Address, $newval$$Register);
+ %}
+ ins_pipe( long_memory_op );
+%}
+#endif
+
+instruct xchgN( memory mem, iRegN newval) %{
+ match(Set newval (GetAndSetN mem newval));
+ format %{ "SWAP [$mem],$newval" %}
+ size(4);
+ ins_encode %{
+ __ swap($mem$$Address, $newval$$Register);
+ %}
+ ins_pipe( long_memory_op );
+%}
+
//---------------------
// Subtraction Instructions
// Register Subtraction
diff --git a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
index d0887f6cf08..8faea51198e 100644
--- a/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/stubGenerator_sparc.cpp
@@ -3091,7 +3091,7 @@ class StubGenerator: public StubCodeGenerator {
arraycopy_range_checks(src, src_pos, dst, dst_pos, length,
O5_temp, G4_dst_klass, L_failed);
- // typeArrayKlass
+ // TypeArrayKlass
//
// src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
// dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
@@ -3142,7 +3142,7 @@ class StubGenerator: public StubCodeGenerator {
__ br(Assembler::always, false, Assembler::pt, entry_jlong_arraycopy);
__ delayed()->signx(length, count); // length
- // objArrayKlass
+ // ObjArrayKlass
__ BIND(L_objArray);
// live at this point: G3_src_klass, G4_dst_klass, src[_pos], dst[_pos], length
@@ -3198,8 +3198,8 @@ class StubGenerator: public StubCodeGenerator {
generate_type_check(G3_src_klass, sco_temp, G4_dst_klass,
O5_temp, L_plain_copy);
- // Fetch destination element klass from the objArrayKlass header.
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ // Fetch destination element klass from the ObjArrayKlass header.
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
// the checkcast_copy loop needs two extra arguments:
__ ld_ptr(G4_dst_klass, ek_offset, O4); // dest elem klass
diff --git a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
index e23f993338f..5b1887dbbca 100644
--- a/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/templateTable_sparc.cpp
@@ -867,7 +867,7 @@ void TemplateTable::aastore() {
// do fast instanceof cache test
- __ ld_ptr(O4, in_bytes(objArrayKlass::element_klass_offset()), O4);
+ __ ld_ptr(O4, in_bytes(ObjArrayKlass::element_klass_offset()), O4);
assert(Otos_i == O0, "just checking");
@@ -2936,6 +2936,7 @@ void TemplateTable::prepare_invoke(int byte_no,
// Push the appendix as a trailing parameter.
// This must be done before we get the receiver,
// since the parameter_size includes it.
+ assert(ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset == 0, "appendix expected at index+0");
__ load_resolved_reference_at_index(temp, index);
__ verify_oop(temp);
__ push_ptr(temp); // push appendix (MethodType, CallSite, etc.)
@@ -3235,15 +3236,15 @@ void TemplateTable::invokehandle(int byte_no) {
}
const Register Rret = Lscratch;
- const Register G4_mtype = G4_scratch; // f1
+ const Register G4_mtype = G4_scratch;
const Register O0_recv = O0;
const Register Rscratch = G3_scratch;
prepare_invoke(byte_no, G5_method, Rret, G4_mtype, O0_recv);
__ null_check(O0_recv);
- // G4: MethodType object (from cpool->resolved_references[])
- // G5: MH.linkToCallSite method (from f2)
+ // G4: MethodType object (from cpool->resolved_references[f1], if necessary)
+ // G5: MH.invokeExact_MT method (from f2)
// Note: G4_mtype is already pushed (if necessary) by prepare_invoke
@@ -3275,8 +3276,8 @@ void TemplateTable::invokedynamic(int byte_no) {
prepare_invoke(byte_no, G5_method, Rret, G4_callsite);
- // G4: CallSite object (from cpool->resolved_references[])
- // G5: MH.linkToCallSite method (from f1)
+ // G4: CallSite object (from cpool->resolved_references[f1])
+ // G5: MH.linkToCallSite method (from f2)
// Note: G4_callsite is already pushed by prepare_invoke
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
index ca93deb0e01..aaa601fbbc9 100644
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp
@@ -96,6 +96,7 @@ void VM_Version::initialize() {
UseSSE = 0; // Only on x86 and x64
_supports_cx8 = has_v9();
+ _supports_atomic_getset4 = true; // swap instruction
if (is_niagara()) {
// Indirect branch is the same cost as direct
@@ -116,6 +117,7 @@ void VM_Version::initialize() {
// 32-bit oops don't make sense for the 64-bit VM on sparc
// since the 32-bit VM has the same registers and smaller objects.
Universe::set_narrow_oop_shift(LogMinObjAlignmentInBytes);
+ Universe::set_narrow_klass_shift(LogKlassAlignmentInBytes);
#endif // _LP64
#ifdef COMPILER2
// Indirect branch is the same cost as direct
@@ -338,7 +340,11 @@ void VM_Version::revert() {
unsigned int VM_Version::calc_parallel_worker_threads() {
unsigned int result;
- if (is_niagara_plus()) {
+ if (is_M_series()) {
+ // for now, use same gc thread calculation for M-series as for niagara-plus
+ // in future, we may want to tweak parameters for nof_parallel_worker_thread
+ result = nof_parallel_worker_threads(5, 16, 8);
+ } else if (is_niagara_plus()) {
result = nof_parallel_worker_threads(5, 16, 8);
} else {
result = nof_parallel_worker_threads(5, 8, 8);
diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
index d7f21c328a3..d602fd08cfb 100644
--- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
+++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -124,6 +124,8 @@ public:
// Returns true if the platform is in the niagara line (T series)
// and newer than the niagara1.
static bool is_niagara_plus() { return is_T_family(_features) && !is_T1_model(_features); }
+
+ static bool is_M_series() { return is_M_family(_features); }
static bool is_T4() { return is_T_family(_features) && has_cbcond(); }
// Fujitsu SPARC64
diff --git a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
index 8a1f6ec5e4b..8e7021fa1a7 100644
--- a/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
+++ b/hotspot/src/cpu/sparc/vm/vtableStubs_sparc.cpp
@@ -220,13 +220,13 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
const int basic = 5*BytesPerInstWord +
// shift;add for load_klass (only shift with zero heap based)
(UseCompressedKlassPointers ?
- ((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
+ ((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
return basic + slop;
} else {
const int basic = (28 LP64_ONLY(+ 6)) * BytesPerInstWord +
// shift;add for load_klass (only shift with zero heap based)
(UseCompressedKlassPointers ?
- ((Universe::narrow_oop_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
+ ((Universe::narrow_klass_base() == NULL) ? BytesPerInstWord : 2*BytesPerInstWord) : 0);
return (basic + slop);
}
}
diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.cpp b/hotspot/src/cpu/x86/vm/assembler_x86.cpp
index 611d7ab50cd..378c1f8c6e7 100644
--- a/hotspot/src/cpu/x86/vm/assembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.cpp
@@ -1170,26 +1170,11 @@ void Assembler::cmpw(Address dst, int imm16) {
// and stores reg into adr if so; otherwise, the value at adr is loaded into rax,.
// The ZF is set if the compared values were equal, and cleared otherwise.
void Assembler::cmpxchgl(Register reg, Address adr) { // cmpxchg
- if (Atomics & 2) {
- // caveat: no instructionmark, so this isn't relocatable.
- // Emit a synthetic, non-atomic, CAS equivalent.
- // Beware. The synthetic form sets all ICCs, not just ZF.
- // cmpxchg r,[m] is equivalent to rax, = CAS (m, rax, r)
- cmpl(rax, adr);
- movl(rax, adr);
- if (reg != rax) {
- Label L ;
- jcc(Assembler::notEqual, L);
- movl(adr, reg);
- bind(L);
- }
- } else {
- InstructionMark im(this);
- prefix(adr, reg);
- emit_byte(0x0F);
- emit_byte(0xB1);
- emit_operand(reg, adr);
- }
+ InstructionMark im(this);
+ prefix(adr, reg);
+ emit_byte(0x0F);
+ emit_byte(0xB1);
+ emit_operand(reg, adr);
}
void Assembler::comisd(XMMRegister dst, Address src) {
@@ -1513,12 +1498,7 @@ void Assembler::leal(Register dst, Address src) {
}
void Assembler::lock() {
- if (Atomics & 1) {
- // Emit either nothing, a NOP, or a NOP: prefix
- emit_byte(0x90) ;
- } else {
- emit_byte(0xF0);
- }
+ emit_byte(0xF0);
}
void Assembler::lzcntl(Register dst, Register src) {
@@ -3496,6 +3476,33 @@ void Assembler::vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src)
emit_byte(0x01);
}
+void Assembler::vinsertf128h(XMMRegister dst, Address src) {
+ assert(VM_Version::supports_avx(), "");
+ InstructionMark im(this);
+ bool vector256 = true;
+ assert(dst != xnoreg, "sanity");
+ int dst_enc = dst->encoding();
+ // swap src<->dst for encoding
+ vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
+ emit_byte(0x18);
+ emit_operand(dst, src);
+ // 0x01 - insert into upper 128 bits
+ emit_byte(0x01);
+}
+
+void Assembler::vextractf128h(Address dst, XMMRegister src) {
+ assert(VM_Version::supports_avx(), "");
+ InstructionMark im(this);
+ bool vector256 = true;
+ assert(src != xnoreg, "sanity");
+ int src_enc = src->encoding();
+ vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
+ emit_byte(0x19);
+ emit_operand(src, dst);
+ // 0x01 - extract from upper 128 bits
+ emit_byte(0x01);
+}
+
void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src) {
assert(VM_Version::supports_avx2(), "");
bool vector256 = true;
@@ -3507,6 +3514,33 @@ void Assembler::vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src)
emit_byte(0x01);
}
+void Assembler::vinserti128h(XMMRegister dst, Address src) {
+ assert(VM_Version::supports_avx2(), "");
+ InstructionMark im(this);
+ bool vector256 = true;
+ assert(dst != xnoreg, "sanity");
+ int dst_enc = dst->encoding();
+ // swap src<->dst for encoding
+ vex_prefix(src, dst_enc, dst_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
+ emit_byte(0x38);
+ emit_operand(dst, src);
+ // 0x01 - insert into upper 128 bits
+ emit_byte(0x01);
+}
+
+void Assembler::vextracti128h(Address dst, XMMRegister src) {
+ assert(VM_Version::supports_avx2(), "");
+ InstructionMark im(this);
+ bool vector256 = true;
+ assert(src != xnoreg, "sanity");
+ int src_enc = src->encoding();
+ vex_prefix(dst, 0, src_enc, VEX_SIMD_66, VEX_OPCODE_0F_3A, false, vector256);
+ emit_byte(0x39);
+ emit_operand(src, dst);
+ // 0x01 - extract from upper 128 bits
+ emit_byte(0x01);
+}
+
void Assembler::vzeroupper() {
assert(VM_Version::supports_avx(), "");
(void)vex_prefix_and_encode(xmm0, xmm0, xmm0, VEX_SIMD_NONE);
@@ -6882,7 +6916,7 @@ void MacroAssembler::call_VM_base(Register oop_result,
#ifdef ASSERT
// TraceBytecodes does not use r12 but saves it over the call, so don't verify
// r12 is the heapbase.
- LP64_ONLY(if (UseCompressedOops && !TraceBytecodes) verify_heapbase("call_VM_base");)
+ LP64_ONLY(if ((UseCompressedOops || UseCompressedKlassPointers) && !TraceBytecodes) verify_heapbase("call_VM_base: heap base corrupted?");)
#endif // ASSERT
assert(java_thread != oop_result , "cannot use the same register for java_thread & oop_result");
@@ -8907,11 +8941,9 @@ void MacroAssembler::fp_runtime_fallback(address runtime_entry, int nb_args, int
pusha();
// if we are coming from c1, xmm registers may be live
- if (UseSSE >= 1) {
- subptr(rsp, sizeof(jdouble)* LP64_ONLY(16) NOT_LP64(8));
- }
int off = 0;
if (UseSSE == 1) {
+ subptr(rsp, sizeof(jdouble)*8);
movflt(Address(rsp,off++*sizeof(jdouble)),xmm0);
movflt(Address(rsp,off++*sizeof(jdouble)),xmm1);
movflt(Address(rsp,off++*sizeof(jdouble)),xmm2);
@@ -8921,23 +8953,50 @@ void MacroAssembler::fp_runtime_fallback(address runtime_entry, int nb_args, int
movflt(Address(rsp,off++*sizeof(jdouble)),xmm6);
movflt(Address(rsp,off++*sizeof(jdouble)),xmm7);
} else if (UseSSE >= 2) {
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm0);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm1);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm2);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm3);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm4);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm5);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm6);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm7);
+#ifdef COMPILER2
+ if (MaxVectorSize > 16) {
+ assert(UseAVX > 0, "256bit vectors are supported only with AVX");
+ // Save upper half of YMM registes
+ subptr(rsp, 16 * LP64_ONLY(16) NOT_LP64(8));
+ vextractf128h(Address(rsp, 0),xmm0);
+ vextractf128h(Address(rsp, 16),xmm1);
+ vextractf128h(Address(rsp, 32),xmm2);
+ vextractf128h(Address(rsp, 48),xmm3);
+ vextractf128h(Address(rsp, 64),xmm4);
+ vextractf128h(Address(rsp, 80),xmm5);
+ vextractf128h(Address(rsp, 96),xmm6);
+ vextractf128h(Address(rsp,112),xmm7);
#ifdef _LP64
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm8);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm9);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm10);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm11);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm12);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm13);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm14);
- movdbl(Address(rsp,off++*sizeof(jdouble)),xmm15);
+ vextractf128h(Address(rsp,128),xmm8);
+ vextractf128h(Address(rsp,144),xmm9);
+ vextractf128h(Address(rsp,160),xmm10);
+ vextractf128h(Address(rsp,176),xmm11);
+ vextractf128h(Address(rsp,192),xmm12);
+ vextractf128h(Address(rsp,208),xmm13);
+ vextractf128h(Address(rsp,224),xmm14);
+ vextractf128h(Address(rsp,240),xmm15);
+#endif
+ }
+#endif
+ // Save whole 128bit (16 bytes) XMM regiters
+ subptr(rsp, 16 * LP64_ONLY(16) NOT_LP64(8));
+ movdqu(Address(rsp,off++*16),xmm0);
+ movdqu(Address(rsp,off++*16),xmm1);
+ movdqu(Address(rsp,off++*16),xmm2);
+ movdqu(Address(rsp,off++*16),xmm3);
+ movdqu(Address(rsp,off++*16),xmm4);
+ movdqu(Address(rsp,off++*16),xmm5);
+ movdqu(Address(rsp,off++*16),xmm6);
+ movdqu(Address(rsp,off++*16),xmm7);
+#ifdef _LP64
+ movdqu(Address(rsp,off++*16),xmm8);
+ movdqu(Address(rsp,off++*16),xmm9);
+ movdqu(Address(rsp,off++*16),xmm10);
+ movdqu(Address(rsp,off++*16),xmm11);
+ movdqu(Address(rsp,off++*16),xmm12);
+ movdqu(Address(rsp,off++*16),xmm13);
+ movdqu(Address(rsp,off++*16),xmm14);
+ movdqu(Address(rsp,off++*16),xmm15);
#endif
}
@@ -9015,28 +9074,52 @@ void MacroAssembler::fp_runtime_fallback(address runtime_entry, int nb_args, int
movflt(xmm5, Address(rsp,off++*sizeof(jdouble)));
movflt(xmm6, Address(rsp,off++*sizeof(jdouble)));
movflt(xmm7, Address(rsp,off++*sizeof(jdouble)));
+ addptr(rsp, sizeof(jdouble)*8);
} else if (UseSSE >= 2) {
- movdbl(xmm0, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm1, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm2, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm3, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm4, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm5, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm6, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm7, Address(rsp,off++*sizeof(jdouble)));
+ // Restore whole 128bit (16 bytes) XMM regiters
+ movdqu(xmm0, Address(rsp,off++*16));
+ movdqu(xmm1, Address(rsp,off++*16));
+ movdqu(xmm2, Address(rsp,off++*16));
+ movdqu(xmm3, Address(rsp,off++*16));
+ movdqu(xmm4, Address(rsp,off++*16));
+ movdqu(xmm5, Address(rsp,off++*16));
+ movdqu(xmm6, Address(rsp,off++*16));
+ movdqu(xmm7, Address(rsp,off++*16));
#ifdef _LP64
- movdbl(xmm8, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm9, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm10, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm11, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm12, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm13, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm14, Address(rsp,off++*sizeof(jdouble)));
- movdbl(xmm15, Address(rsp,off++*sizeof(jdouble)));
+ movdqu(xmm8, Address(rsp,off++*16));
+ movdqu(xmm9, Address(rsp,off++*16));
+ movdqu(xmm10, Address(rsp,off++*16));
+ movdqu(xmm11, Address(rsp,off++*16));
+ movdqu(xmm12, Address(rsp,off++*16));
+ movdqu(xmm13, Address(rsp,off++*16));
+ movdqu(xmm14, Address(rsp,off++*16));
+ movdqu(xmm15, Address(rsp,off++*16));
+#endif
+ addptr(rsp, 16 * LP64_ONLY(16) NOT_LP64(8));
+#ifdef COMPILER2
+ if (MaxVectorSize > 16) {
+ // Restore upper half of YMM registes.
+ vinsertf128h(xmm0, Address(rsp, 0));
+ vinsertf128h(xmm1, Address(rsp, 16));
+ vinsertf128h(xmm2, Address(rsp, 32));
+ vinsertf128h(xmm3, Address(rsp, 48));
+ vinsertf128h(xmm4, Address(rsp, 64));
+ vinsertf128h(xmm5, Address(rsp, 80));
+ vinsertf128h(xmm6, Address(rsp, 96));
+ vinsertf128h(xmm7, Address(rsp,112));
+#ifdef _LP64
+ vinsertf128h(xmm8, Address(rsp,128));
+ vinsertf128h(xmm9, Address(rsp,144));
+ vinsertf128h(xmm10, Address(rsp,160));
+ vinsertf128h(xmm11, Address(rsp,176));
+ vinsertf128h(xmm12, Address(rsp,192));
+ vinsertf128h(xmm13, Address(rsp,208));
+ vinsertf128h(xmm14, Address(rsp,224));
+ vinsertf128h(xmm15, Address(rsp,240));
+#endif
+ addptr(rsp, 16 * LP64_ONLY(16) NOT_LP64(8));
+ }
#endif
- }
- if (UseSSE >= 1) {
- addptr(rsp, sizeof(jdouble)* LP64_ONLY(16) NOT_LP64(8));
}
popa();
}
@@ -9933,7 +10016,7 @@ void MacroAssembler::load_klass(Register dst, Register src) {
#ifdef _LP64
if (UseCompressedKlassPointers) {
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
- decode_heap_oop_not_null(dst);
+ decode_klass_not_null(dst);
} else
#endif
movptr(dst, Address(src, oopDesc::klass_offset_in_bytes()));
@@ -9944,15 +10027,10 @@ void MacroAssembler::load_prototype_header(Register dst, Register src) {
if (UseCompressedKlassPointers) {
assert (Universe::heap() != NULL, "java heap should be initialized");
movl(dst, Address(src, oopDesc::klass_offset_in_bytes()));
- if (Universe::narrow_oop_shift() != 0) {
- assert(LogMinObjAlignmentInBytes == Universe::narrow_oop_shift(), "decode alg wrong");
- if (LogMinObjAlignmentInBytes == Address::times_8) {
- movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset()));
- } else {
- // OK to use shift since we don't need to preserve flags.
- shlq(dst, LogMinObjAlignmentInBytes);
- movq(dst, Address(r12_heapbase, dst, Address::times_1, Klass::prototype_header_offset()));
- }
+ if (Universe::narrow_klass_shift() != 0) {
+ assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
+ movq(dst, Address(r12_heapbase, dst, Address::times_8, Klass::prototype_header_offset()));
} else {
movq(dst, Address(dst, Klass::prototype_header_offset()));
}
@@ -9967,7 +10045,7 @@ void MacroAssembler::load_prototype_header(Register dst, Register src) {
void MacroAssembler::store_klass(Register dst, Register src) {
#ifdef _LP64
if (UseCompressedKlassPointers) {
- encode_heap_oop_not_null(src);
+ encode_klass_not_null(src);
movl(Address(dst, oopDesc::klass_offset_in_bytes()), src);
} else
#endif
@@ -10049,12 +10127,12 @@ void MacroAssembler::store_klass_gap(Register dst, Register src) {
#ifdef ASSERT
void MacroAssembler::verify_heapbase(const char* msg) {
- assert (UseCompressedOops, "should be compressed");
+ assert (UseCompressedOops || UseCompressedKlassPointers, "should be compressed");
assert (Universe::heap() != NULL, "java heap should be initialized");
if (CheckCompressedOops) {
Label ok;
push(rscratch1); // cmpptr trashes rscratch1
- cmpptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
+ cmpptr(r12_heapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
jcc(Assembler::equal, ok);
STOP(msg);
bind(ok);
@@ -10192,6 +10270,74 @@ void MacroAssembler::decode_heap_oop_not_null(Register dst, Register src) {
}
}
+void MacroAssembler::encode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+#ifdef ASSERT
+ verify_heapbase("MacroAssembler::encode_klass_not_null: heap base corrupted?");
+#endif
+ if (Universe::narrow_klass_base() != NULL) {
+ subq(r, r12_heapbase);
+ }
+ if (Universe::narrow_klass_shift() != 0) {
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ shrq(r, LogKlassAlignmentInBytes);
+ }
+}
+
+void MacroAssembler::encode_klass_not_null(Register dst, Register src) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+#ifdef ASSERT
+ verify_heapbase("MacroAssembler::encode_klass_not_null2: heap base corrupted?");
+#endif
+ if (dst != src) {
+ movq(dst, src);
+ }
+ if (Universe::narrow_klass_base() != NULL) {
+ subq(dst, r12_heapbase);
+ }
+ if (Universe::narrow_klass_shift() != 0) {
+ assert (LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ shrq(dst, LogKlassAlignmentInBytes);
+ }
+}
+
+void MacroAssembler::decode_klass_not_null(Register r) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Note: it will change flags
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ // Cannot assert, unverified entry point counts instructions (see .ad file)
+ // vtableStubs also counts instructions in pd_code_size_limit.
+ // Also do not verify_oop as this is called by verify_oop.
+ if (Universe::narrow_klass_shift() != 0) {
+ assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ shlq(r, LogKlassAlignmentInBytes);
+ if (Universe::narrow_klass_base() != NULL) {
+ addq(r, r12_heapbase);
+ }
+ } else {
+ assert (Universe::narrow_klass_base() == NULL, "sanity");
+ }
+}
+
+void MacroAssembler::decode_klass_not_null(Register dst, Register src) {
+ assert(Metaspace::is_initialized(), "metaspace should be initialized");
+ // Note: it will change flags
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ // Cannot assert, unverified entry point counts instructions (see .ad file)
+ // vtableStubs also counts instructions in pd_code_size_limit.
+ // Also do not verify_oop as this is called by verify_oop.
+ if (Universe::narrow_klass_shift() != 0) {
+ assert(LogKlassAlignmentInBytes == Universe::narrow_klass_shift(), "decode alg wrong");
+ assert(LogKlassAlignmentInBytes == Address::times_8, "klass not aligned on 64bits?");
+ leaq(dst, Address(r12_heapbase, src, Address::times_8, 0));
+ } else {
+ assert (Universe::narrow_klass_base() == NULL, "sanity");
+ if (dst != src) {
+ movq(dst, src);
+ }
+ }
+}
+
void MacroAssembler::set_narrow_oop(Register dst, jobject obj) {
assert (UseCompressedOops, "should only be used for compressed headers");
assert (Universe::heap() != NULL, "java heap should be initialized");
@@ -10210,6 +10356,22 @@ void MacroAssembler::set_narrow_oop(Address dst, jobject obj) {
mov_narrow_oop(dst, oop_index, rspec);
}
+void MacroAssembler::set_narrow_klass(Register dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ mov_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
+void MacroAssembler::set_narrow_klass(Address dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ mov_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
void MacroAssembler::cmp_narrow_oop(Register dst, jobject obj) {
assert (UseCompressedOops, "should only be used for compressed headers");
assert (Universe::heap() != NULL, "java heap should be initialized");
@@ -10228,9 +10390,25 @@ void MacroAssembler::cmp_narrow_oop(Address dst, jobject obj) {
Assembler::cmp_narrow_oop(dst, oop_index, rspec);
}
+void MacroAssembler::cmp_narrow_klass(Register dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ Assembler::cmp_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
+void MacroAssembler::cmp_narrow_klass(Address dst, Klass* k) {
+ assert (UseCompressedKlassPointers, "should only be used for compressed headers");
+ assert (oop_recorder() != NULL, "this assembler needs an OopRecorder");
+ int klass_index = oop_recorder()->find_index(k);
+ RelocationHolder rspec = metadata_Relocation::spec(klass_index);
+ Assembler::cmp_narrow_oop(dst, oopDesc::encode_klass(k), rspec);
+}
+
void MacroAssembler::reinit_heapbase() {
- if (UseCompressedOops) {
- movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_oop_base_addr()));
+ if (UseCompressedOops || UseCompressedKlassPointers) {
+ movptr(r12_heapbase, ExternalAddress((address)Universe::narrow_ptrs_base_addr()));
}
}
#endif // _LP64
@@ -10513,7 +10691,7 @@ void MacroAssembler::string_indexof(Register str1, Register str2,
// Array header size is 12 bytes in 32-bit VM
// + 6 bytes for 3 chars == 18 bytes,
// enough space to load vec and shift.
- assert(HeapWordSize*typeArrayKlass::header_size() >= 12,"sanity");
+ assert(HeapWordSize*TypeArrayKlass::header_size() >= 12,"sanity");
movdqu(vec, Address(str2, (int_cnt2*2)-16));
psrldq(vec, 16-(int_cnt2*2));
}
diff --git a/hotspot/src/cpu/x86/vm/assembler_x86.hpp b/hotspot/src/cpu/x86/vm/assembler_x86.hpp
index 368f5c438c8..c936e13f5d8 100644
--- a/hotspot/src/cpu/x86/vm/assembler_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/assembler_x86.hpp
@@ -1743,6 +1743,12 @@ private:
void vinsertf128h(XMMRegister dst, XMMRegister nds, XMMRegister src);
void vinserti128h(XMMRegister dst, XMMRegister nds, XMMRegister src);
+ // Load/store high 128bit of YMM registers which does not destroy other half.
+ void vinsertf128h(XMMRegister dst, Address src);
+ void vinserti128h(XMMRegister dst, Address src);
+ void vextractf128h(Address dst, XMMRegister src);
+ void vextracti128h(Address dst, XMMRegister src);
+
// AVX instruction which is used to clear upper 128 bits of YMM registers and
// to avoid transaction penalty between AVX and SSE states. There is no
// penalty if legacy SSE instructions are encoded using VEX prefix because
@@ -2077,6 +2083,15 @@ class MacroAssembler: public Assembler {
void cmp_narrow_oop(Register dst, jobject obj);
void cmp_narrow_oop(Address dst, jobject obj);
+ void encode_klass_not_null(Register r);
+ void decode_klass_not_null(Register r);
+ void encode_klass_not_null(Register dst, Register src);
+ void decode_klass_not_null(Register dst, Register src);
+ void set_narrow_klass(Register dst, Klass* k);
+ void set_narrow_klass(Address dst, Klass* k);
+ void cmp_narrow_klass(Register dst, Klass* k);
+ void cmp_narrow_klass(Address dst, Klass* k);
+
// if heap base register is used - reinit it with the correct value
void reinit_heapbase();
diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp
index 87b32a43337..bd3ad930b70 100644
--- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp
index e61f72aa776..ea5d6d39da6 100644
--- a/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/c1_FrameMap_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -148,7 +148,7 @@
static int adjust_reg_range(int range) {
// Reduce the number of available regs (to free r12) in case of compressed oops
- if (UseCompressedOops) return range - 1;
+ if (UseCompressedOops || UseCompressedKlassPointers) return range - 1;
return range;
}
diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
index 36bd4d764e0..684ae866e9c 100644
--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp
@@ -340,7 +340,7 @@ int LIR_Assembler::check_icache() {
Register receiver = FrameMap::receiver_opr->as_register();
Register ic_klass = IC_Klass;
const int ic_cmp_size = LP64_ONLY(10) NOT_LP64(9);
- const bool do_post_padding = VerifyOops || UseCompressedOops;
+ const bool do_post_padding = VerifyOops || UseCompressedKlassPointers;
if (!do_post_padding) {
// insert some nops so that the verified entry point is aligned on CodeEntryAlignment
while ((__ offset() + ic_cmp_size) % CodeEntryAlignment != 0) {
@@ -1262,7 +1262,11 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
break;
case T_ADDRESS:
- __ movptr(dest->as_register(), from_addr);
+ if (UseCompressedKlassPointers && addr->disp() == oopDesc::klass_offset_in_bytes()) {
+ __ movl(dest->as_register(), from_addr);
+ } else {
+ __ movptr(dest->as_register(), from_addr);
+ }
break;
case T_INT:
__ movl(dest->as_register(), from_addr);
@@ -1364,6 +1368,12 @@ void LIR_Assembler::mem2reg(LIR_Opr src, LIR_Opr dest, BasicType type, LIR_Patch
}
#endif
__ verify_oop(dest->as_register());
+ } else if (type == T_ADDRESS && addr->disp() == oopDesc::klass_offset_in_bytes()) {
+#ifdef _LP64
+ if (UseCompressedKlassPointers) {
+ __ decode_klass_not_null(dest->as_register());
+ }
+#endif
}
}
@@ -1705,7 +1715,7 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
} else if (obj == klass_RInfo) {
klass_RInfo = dst;
}
- if (k->is_loaded() && !UseCompressedOops) {
+ if (k->is_loaded() && !UseCompressedKlassPointers) {
select_different_registers(obj, dst, k_RInfo, klass_RInfo);
} else {
Rtmp1 = op->tmp3()->as_register();
@@ -1881,7 +1891,7 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
__ load_klass(klass_RInfo, value);
// get instance klass (it's already uncompressed)
- __ movptr(k_RInfo, Address(k_RInfo, objArrayKlass::element_klass_offset()));
+ __ movptr(k_RInfo, Address(k_RInfo, ObjArrayKlass::element_klass_offset()));
// perform the fast part of the checking logic
__ check_klass_subtype_fast_path(klass_RInfo, k_RInfo, Rtmp1, success_target, failure_target, NULL);
// call out-of-line instance of __ check_klass_subtype_slow_path(...):
@@ -3349,7 +3359,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
#ifndef _LP64
__ movptr(tmp, dst_klass_addr);
- __ movptr(tmp, Address(tmp, objArrayKlass::element_klass_offset()));
+ __ movptr(tmp, Address(tmp, ObjArrayKlass::element_klass_offset()));
__ push(tmp);
__ movl(tmp, Address(tmp, Klass::super_check_offset_offset()));
__ push(tmp);
@@ -3375,14 +3385,14 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
// Allocate abi space for args but be sure to keep stack aligned
__ subptr(rsp, 6*wordSize);
__ load_klass(c_rarg3, dst);
- __ movptr(c_rarg3, Address(c_rarg3, objArrayKlass::element_klass_offset()));
+ __ movptr(c_rarg3, Address(c_rarg3, ObjArrayKlass::element_klass_offset()));
store_parameter(c_rarg3, 4);
__ movl(c_rarg3, Address(c_rarg3, Klass::super_check_offset_offset()));
__ call(RuntimeAddress(copyfunc_addr));
__ addptr(rsp, 6*wordSize);
#else
__ load_klass(c_rarg4, dst);
- __ movptr(c_rarg4, Address(c_rarg4, objArrayKlass::element_klass_offset()));
+ __ movptr(c_rarg4, Address(c_rarg4, ObjArrayKlass::element_klass_offset()));
__ movl(c_rarg3, Address(c_rarg4, Klass::super_check_offset_offset()));
__ call(RuntimeAddress(copyfunc_addr));
#endif
@@ -3446,7 +3456,7 @@ void LIR_Assembler::emit_arraycopy(LIR_OpArrayCopy* op) {
__ mov_metadata(tmp, default_type->constant_encoding());
#ifdef _LP64
if (UseCompressedKlassPointers) {
- __ encode_heap_oop(tmp);
+ __ encode_klass_not_null(tmp);
}
#endif
@@ -3794,5 +3804,49 @@ void LIR_Assembler::peephole(LIR_List*) {
// do nothing for now
}
+void LIR_Assembler::atomic_op(LIR_Code code, LIR_Opr src, LIR_Opr data, LIR_Opr dest, LIR_Opr tmp) {
+ assert(data == dest, "xchg/xadd uses only 2 operands");
+
+ if (data->type() == T_INT) {
+ if (code == lir_xadd) {
+ if (os::is_MP()) {
+ __ lock();
+ }
+ __ xaddl(as_Address(src->as_address_ptr()), data->as_register());
+ } else {
+ __ xchgl(data->as_register(), as_Address(src->as_address_ptr()));
+ }
+ } else if (data->is_oop()) {
+ assert (code == lir_xchg, "xadd for oops");
+ Register obj = data->as_register();
+#ifdef _LP64
+ if (UseCompressedOops) {
+ __ encode_heap_oop(obj);
+ __ xchgl(obj, as_Address(src->as_address_ptr()));
+ __ decode_heap_oop(obj);
+ } else {
+ __ xchgptr(obj, as_Address(src->as_address_ptr()));
+ }
+#else
+ __ xchgl(obj, as_Address(src->as_address_ptr()));
+#endif
+ } else if (data->type() == T_LONG) {
+#ifdef _LP64
+ assert(data->as_register_lo() == data->as_register_hi(), "should be a single register");
+ if (code == lir_xadd) {
+ if (os::is_MP()) {
+ __ lock();
+ }
+ __ xaddq(as_Address(src->as_address_ptr()), data->as_register_lo());
+ } else {
+ __ xchgq(data->as_register_lo(), as_Address(src->as_address_ptr()));
+ }
+#else
+ ShouldNotReachHere();
+#endif
+ } else {
+ ShouldNotReachHere();
+ }
+}
#undef __
diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
index d363c0eec68..5ef14861966 100644
--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp
@@ -753,9 +753,24 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) {
LIR_Opr addr = new_pointer_register();
LIR_Address* a;
if(offset.result()->is_constant()) {
+#ifdef _LP64
+ jlong c = offset.result()->as_jlong();
+ if ((jlong)((jint)c) == c) {
+ a = new LIR_Address(obj.result(),
+ (jint)c,
+ as_BasicType(type));
+ } else {
+ LIR_Opr tmp = new_register(T_LONG);
+ __ move(offset.result(), tmp);
+ a = new LIR_Address(obj.result(),
+ tmp,
+ as_BasicType(type));
+ }
+#else
a = new LIR_Address(obj.result(),
- NOT_LP64(offset.result()->as_constant_ptr()->as_jint()) LP64_ONLY((int)offset.result()->as_constant_ptr()->as_jlong()),
+ offset.result()->as_jint(),
as_BasicType(type));
+#endif
} else {
a = new LIR_Address(obj.result(),
offset.result(),
@@ -1151,7 +1166,7 @@ void LIRGenerator::do_CheckCast(CheckCast* x) {
}
LIR_Opr reg = rlock_result(x);
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
- if (!x->klass()->is_loaded() || UseCompressedOops) {
+ if (!x->klass()->is_loaded() || UseCompressedKlassPointers) {
tmp3 = new_register(objectType);
}
__ checkcast(reg, obj.result(), x->klass(),
@@ -1173,7 +1188,7 @@ void LIRGenerator::do_InstanceOf(InstanceOf* x) {
}
obj.load_item();
LIR_Opr tmp3 = LIR_OprFact::illegalOpr;
- if (!x->klass()->is_loaded() || UseCompressedOops) {
+ if (!x->klass()->is_loaded() || UseCompressedKlassPointers) {
tmp3 = new_register(objectType);
}
__ instanceof(reg, obj.result(), x->klass(),
@@ -1345,3 +1360,57 @@ void LIRGenerator::put_Object_unsafe(LIR_Opr src, LIR_Opr offset, LIR_Opr data,
}
}
}
+
+void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {
+ BasicType type = x->basic_type();
+ LIRItem src(x->object(), this);
+ LIRItem off(x->offset(), this);
+ LIRItem value(x->value(), this);
+
+ src.load_item();
+ value.load_item();
+ off.load_nonconstant();
+
+ LIR_Opr dst = rlock_result(x, type);
+ LIR_Opr data = value.result();
+ bool is_obj = (type == T_ARRAY || type == T_OBJECT);
+ LIR_Opr offset = off.result();
+
+ assert (type == T_INT || (!x->is_add() && is_obj) LP64_ONLY( || type == T_LONG ), "unexpected type");
+ LIR_Address* addr;
+ if (offset->is_constant()) {
+#ifdef _LP64
+ jlong c = offset->as_jlong();
+ if ((jlong)((jint)c) == c) {
+ addr = new LIR_Address(src.result(), (jint)c, type);
+ } else {
+ LIR_Opr tmp = new_register(T_LONG);
+ __ move(offset, tmp);
+ addr = new LIR_Address(src.result(), tmp, type);
+ }
+#else
+ addr = new LIR_Address(src.result(), offset->as_jint(), type);
+#endif
+ } else {
+ addr = new LIR_Address(src.result(), offset, type);
+ }
+
+ if (data != dst) {
+ __ move(data, dst);
+ data = dst;
+ }
+ if (x->is_add()) {
+ __ xadd(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr);
+ } else {
+ if (is_obj) {
+ // Do the pre-write barrier, if any.
+ pre_barrier(LIR_OprFact::address(addr), LIR_OprFact::illegalOpr /* pre_val */,
+ true /* do_load */, false /* patch */, NULL);
+ }
+ __ xchg(LIR_OprFact::address(addr), data, dst, LIR_OprFact::illegalOpr);
+ if (is_obj) {
+ // Seems to be a precise address
+ post_barrier(LIR_OprFact::address(addr), data);
+ }
+ }
+}
diff --git a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
index 77859b9d6e1..7956a6af59f 100644
--- a/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_LinearScan_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, 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
diff --git a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
index c1eb9d0f28d..d9ae6ce5de5 100644
--- a/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/c1_MacroAssembler_x86.cpp
@@ -159,7 +159,7 @@ void C1_MacroAssembler::initialize_header(Register obj, Register klass, Register
#ifdef _LP64
if (UseCompressedKlassPointers) { // Take care not to kill klass
movptr(t1, klass);
- encode_heap_oop_not_null(t1);
+ encode_klass_not_null(t1);
movl(Address(obj, oopDesc::klass_offset_in_bytes()), t1);
} else
#endif
diff --git a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp
index 9a058213ca2..13786e4149a 100644
--- a/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/interpreterGenerator_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
index eb4e20fb2ef..88ec6b71965 100644
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
@@ -209,8 +209,6 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
Register rcx_mh = rcx; // MH receiver; dies quickly and is recycled
Register rbx_method = rbx; // eventual target of this invocation
- address code_start = __ pc();
-
// here's where control starts out:
__ align(CodeEntryAlignment);
address entry_point = __ pc();
@@ -251,23 +249,7 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
// rdx_first_arg_addr is live!
- if (TraceMethodHandles) {
- const char* name = vmIntrinsics::name_at(iid);
- if (*name == '_') name += 1;
- const size_t len = strlen(name) + 50;
- char* qname = NEW_C_HEAP_ARRAY(char, len, mtInternal);
- const char* suffix = "";
- if (vmIntrinsics::method_for(iid) == NULL ||
- !vmIntrinsics::method_for(iid)->access_flags().is_public()) {
- if (is_signature_polymorphic_static(iid))
- suffix = "/static";
- else
- suffix = "/private";
- }
- jio_snprintf(qname, len, "MethodHandle::interpreter_entry::%s%s", name, suffix);
- // note: stub look for mh in rcx
- trace_method_handle(_masm, qname);
- }
+ trace_method_handle_interpreter_entry(_masm, iid);
if (iid == vmIntrinsics::_invokeBasic) {
generate_method_handle_dispatch(_masm, iid, rcx_mh, noreg, not_for_compiler_entry);
@@ -287,14 +269,6 @@ address MethodHandles::generate_method_handle_interpreter_entry(MacroAssembler*
generate_method_handle_dispatch(_masm, iid, rcx_recv, rbx_member, not_for_compiler_entry);
}
- if (PrintMethodHandleStubs) {
- address code_end = __ pc();
- tty->print_cr("--------");
- tty->print_cr("method handle interpreter entry for %s", vmIntrinsics::name_at(iid));
- Disassembler::decode(code_start, code_end);
- tty->cr();
- }
-
return entry_point;
}
@@ -327,10 +301,11 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
assert_different_registers(temp3, rcx, rdx);
}
#endif
+ else {
+ assert_different_registers(temp1, temp2, temp3, saved_last_sp_register()); // don't trash lastSP
+ }
assert_different_registers(temp1, temp2, temp3, receiver_reg);
assert_different_registers(temp1, temp2, temp3, member_reg);
- if (!for_compiler_entry)
- assert_different_registers(temp1, temp2, temp3, saved_last_sp_register()); // don't trash lastSP
if (iid == vmIntrinsics::_invokeBasic) {
// indirect through MH.form.vmentry.vmtarget
@@ -392,14 +367,13 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// rsi/r13 - interpreter linkage (if interpreted)
// rcx, rdx, rsi, rdi, r8, r8 - compiler arguments (if compiled)
- bool method_is_live = false;
+ Label L_incompatible_class_change_error;
switch (iid) {
case vmIntrinsics::_linkToSpecial:
if (VerifyMethodHandles) {
verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3);
}
__ movptr(rbx_method, member_vmtarget);
- method_is_live = true;
break;
case vmIntrinsics::_linkToStatic:
@@ -407,7 +381,6 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp3);
}
__ movptr(rbx_method, member_vmtarget);
- method_is_live = true;
break;
case vmIntrinsics::_linkToVirtual:
@@ -436,7 +409,6 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
// get target Method* & entry point
__ lookup_virtual_method(temp1_recv_klass, temp2_index, rbx_method);
- method_is_live = true;
break;
}
@@ -464,35 +436,32 @@ void MethodHandles::generate_method_handle_dispatch(MacroAssembler* _masm,
}
// given intf, index, and recv klass, dispatch to the implementation method
- Label L_no_such_interface;
__ lookup_interface_method(temp1_recv_klass, temp3_intf,
// note: next two args must be the same:
rbx_index, rbx_method,
temp2,
- L_no_such_interface);
-
- __ verify_method_ptr(rbx_method);
- jump_from_method_handle(_masm, rbx_method, temp2, for_compiler_entry);
- __ hlt();
-
- __ bind(L_no_such_interface);
- __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry()));
+ L_incompatible_class_change_error);
break;
}
default:
- fatal(err_msg("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
+ fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
break;
}
- if (method_is_live) {
- // live at this point: rbx_method, rsi/r13 (if interpreted)
+ // Live at this point:
+ // rbx_method
+ // rsi/r13 (if interpreted)
- // After figuring out which concrete method to call, jump into it.
- // Note that this works in the interpreter with no data motion.
- // But the compiled version will require that rcx_recv be shifted out.
- __ verify_method_ptr(rbx_method);
- jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry);
+ // After figuring out which concrete method to call, jump into it.
+ // Note that this works in the interpreter with no data motion.
+ // But the compiled version will require that rcx_recv be shifted out.
+ __ verify_method_ptr(rbx_method);
+ jump_from_method_handle(_masm, rbx_method, temp1, for_compiler_entry);
+
+ if (iid == vmIntrinsics::_linkToInterface) {
+ __ bind(L_incompatible_class_change_error);
+ __ jump(RuntimeAddress(StubRoutines::throw_IncompatibleClassChangeError_entry()));
}
}
}
diff --git a/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp b/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp
index 62342eefbf2..bb333781a62 100644
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp
@@ -55,8 +55,6 @@ public:
Register temp2,
bool for_compiler_entry);
- static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN;
-
static Register saved_last_sp_register() {
// Should be in sharedRuntime, not here.
return LP64_ONLY(r13) NOT_LP64(rsi);
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
index 30b5cfca9cd..7cb2bb81edd 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_32.cpp
@@ -46,11 +46,11 @@
const int StackAlignmentInSlots = StackAlignmentInBytes / VMRegImpl::stack_slot_size;
class RegisterSaver {
- enum { FPU_regs_live = 8 /*for the FPU stack*/+8/*eight more for XMM registers*/ };
// Capture info about frame layout
+#define DEF_XMM_OFFS(regnum) xmm ## regnum ## _off = xmm_off + (regnum)*16/BytesPerInt, xmm ## regnum ## H_off
enum layout {
fpu_state_off = 0,
- fpu_state_end = fpu_state_off+FPUStateSizeInWords-1,
+ fpu_state_end = fpu_state_off+FPUStateSizeInWords,
st0_off, st0H_off,
st1_off, st1H_off,
st2_off, st2H_off,
@@ -59,16 +59,16 @@ class RegisterSaver {
st5_off, st5H_off,
st6_off, st6H_off,
st7_off, st7H_off,
-
- xmm0_off, xmm0H_off,
- xmm1_off, xmm1H_off,
- xmm2_off, xmm2H_off,
- xmm3_off, xmm3H_off,
- xmm4_off, xmm4H_off,
- xmm5_off, xmm5H_off,
- xmm6_off, xmm6H_off,
- xmm7_off, xmm7H_off,
- flags_off,
+ xmm_off,
+ DEF_XMM_OFFS(0),
+ DEF_XMM_OFFS(1),
+ DEF_XMM_OFFS(2),
+ DEF_XMM_OFFS(3),
+ DEF_XMM_OFFS(4),
+ DEF_XMM_OFFS(5),
+ DEF_XMM_OFFS(6),
+ DEF_XMM_OFFS(7),
+ flags_off = xmm7_off + 16/BytesPerInt + 1, // 16-byte stack alignment fill word
rdi_off,
rsi_off,
ignore_off, // extra copy of rbp,
@@ -83,13 +83,13 @@ class RegisterSaver {
rbp_off,
return_off, // slot for return address
reg_save_size };
-
+ enum { FPU_regs_live = flags_off - fpu_state_end };
public:
static OopMap* save_live_registers(MacroAssembler* masm, int additional_frame_words,
- int* total_frame_words, bool verify_fpu = true);
- static void restore_live_registers(MacroAssembler* masm);
+ int* total_frame_words, bool verify_fpu = true, bool save_vectors = false);
+ static void restore_live_registers(MacroAssembler* masm, bool restore_vectors = false);
static int rax_offset() { return rax_off; }
static int rbx_offset() { return rbx_off; }
@@ -113,9 +113,20 @@ class RegisterSaver {
};
OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words,
- int* total_frame_words, bool verify_fpu) {
-
- int frame_size_in_bytes = (reg_save_size + additional_frame_words) * wordSize;
+ int* total_frame_words, bool verify_fpu, bool save_vectors) {
+ int vect_words = 0;
+#ifdef COMPILER2
+ if (save_vectors) {
+ assert(UseAVX > 0, "256bit vectors are supported only with AVX");
+ assert(MaxVectorSize == 32, "only 256bit vectors are supported now");
+ // Save upper half of YMM registes
+ vect_words = 8 * 16 / wordSize;
+ additional_frame_words += vect_words;
+ }
+#else
+ assert(!save_vectors, "vectors are generated only by C2");
+#endif
+ int frame_size_in_bytes = (reg_save_size + additional_frame_words) * wordSize;
int frame_words = frame_size_in_bytes / wordSize;
*total_frame_words = frame_words;
@@ -129,7 +140,7 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
__ enter();
__ pusha();
__ pushf();
- __ subptr(rsp,FPU_regs_live*sizeof(jdouble)); // Push FPU registers space
+ __ subptr(rsp,FPU_regs_live*wordSize); // Push FPU registers space
__ push_FPU_state(); // Save FPU state & init
if (verify_fpu) {
@@ -183,14 +194,28 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
__ movflt(Address(rsp,xmm6_off*wordSize),xmm6);
__ movflt(Address(rsp,xmm7_off*wordSize),xmm7);
} else if( UseSSE >= 2 ) {
- __ movdbl(Address(rsp,xmm0_off*wordSize),xmm0);
- __ movdbl(Address(rsp,xmm1_off*wordSize),xmm1);
- __ movdbl(Address(rsp,xmm2_off*wordSize),xmm2);
- __ movdbl(Address(rsp,xmm3_off*wordSize),xmm3);
- __ movdbl(Address(rsp,xmm4_off*wordSize),xmm4);
- __ movdbl(Address(rsp,xmm5_off*wordSize),xmm5);
- __ movdbl(Address(rsp,xmm6_off*wordSize),xmm6);
- __ movdbl(Address(rsp,xmm7_off*wordSize),xmm7);
+ // Save whole 128bit (16 bytes) XMM regiters
+ __ movdqu(Address(rsp,xmm0_off*wordSize),xmm0);
+ __ movdqu(Address(rsp,xmm1_off*wordSize),xmm1);
+ __ movdqu(Address(rsp,xmm2_off*wordSize),xmm2);
+ __ movdqu(Address(rsp,xmm3_off*wordSize),xmm3);
+ __ movdqu(Address(rsp,xmm4_off*wordSize),xmm4);
+ __ movdqu(Address(rsp,xmm5_off*wordSize),xmm5);
+ __ movdqu(Address(rsp,xmm6_off*wordSize),xmm6);
+ __ movdqu(Address(rsp,xmm7_off*wordSize),xmm7);
+ }
+
+ if (vect_words > 0) {
+ assert(vect_words*wordSize == 128, "");
+ __ subptr(rsp, 128); // Save upper half of YMM registes
+ __ vextractf128h(Address(rsp, 0),xmm0);
+ __ vextractf128h(Address(rsp, 16),xmm1);
+ __ vextractf128h(Address(rsp, 32),xmm2);
+ __ vextractf128h(Address(rsp, 48),xmm3);
+ __ vextractf128h(Address(rsp, 64),xmm4);
+ __ vextractf128h(Address(rsp, 80),xmm5);
+ __ vextractf128h(Address(rsp, 96),xmm6);
+ __ vextractf128h(Address(rsp,112),xmm7);
}
// Set an oopmap for the call site. This oopmap will map all
@@ -253,10 +278,20 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
}
-void RegisterSaver::restore_live_registers(MacroAssembler* masm) {
-
+void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) {
// Recover XMM & FPU state
- if( UseSSE == 1 ) {
+ int additional_frame_bytes = 0;
+#ifdef COMPILER2
+ if (restore_vectors) {
+ assert(UseAVX > 0, "256bit vectors are supported only with AVX");
+ assert(MaxVectorSize == 32, "only 256bit vectors are supported now");
+ additional_frame_bytes = 128;
+ }
+#else
+ assert(!restore_vectors, "vectors are generated only by C2");
+#endif
+ if (UseSSE == 1) {
+ assert(additional_frame_bytes == 0, "");
__ movflt(xmm0,Address(rsp,xmm0_off*wordSize));
__ movflt(xmm1,Address(rsp,xmm1_off*wordSize));
__ movflt(xmm2,Address(rsp,xmm2_off*wordSize));
@@ -265,18 +300,33 @@ void RegisterSaver::restore_live_registers(MacroAssembler* masm) {
__ movflt(xmm5,Address(rsp,xmm5_off*wordSize));
__ movflt(xmm6,Address(rsp,xmm6_off*wordSize));
__ movflt(xmm7,Address(rsp,xmm7_off*wordSize));
- } else if( UseSSE >= 2 ) {
- __ movdbl(xmm0,Address(rsp,xmm0_off*wordSize));
- __ movdbl(xmm1,Address(rsp,xmm1_off*wordSize));
- __ movdbl(xmm2,Address(rsp,xmm2_off*wordSize));
- __ movdbl(xmm3,Address(rsp,xmm3_off*wordSize));
- __ movdbl(xmm4,Address(rsp,xmm4_off*wordSize));
- __ movdbl(xmm5,Address(rsp,xmm5_off*wordSize));
- __ movdbl(xmm6,Address(rsp,xmm6_off*wordSize));
- __ movdbl(xmm7,Address(rsp,xmm7_off*wordSize));
+ } else if (UseSSE >= 2) {
+#define STACK_ADDRESS(x) Address(rsp,(x)*wordSize + additional_frame_bytes)
+ __ movdqu(xmm0,STACK_ADDRESS(xmm0_off));
+ __ movdqu(xmm1,STACK_ADDRESS(xmm1_off));
+ __ movdqu(xmm2,STACK_ADDRESS(xmm2_off));
+ __ movdqu(xmm3,STACK_ADDRESS(xmm3_off));
+ __ movdqu(xmm4,STACK_ADDRESS(xmm4_off));
+ __ movdqu(xmm5,STACK_ADDRESS(xmm5_off));
+ __ movdqu(xmm6,STACK_ADDRESS(xmm6_off));
+ __ movdqu(xmm7,STACK_ADDRESS(xmm7_off));
+#undef STACK_ADDRESS
+ }
+ if (restore_vectors) {
+ // Restore upper half of YMM registes.
+ assert(additional_frame_bytes == 128, "");
+ __ vinsertf128h(xmm0, Address(rsp, 0));
+ __ vinsertf128h(xmm1, Address(rsp, 16));
+ __ vinsertf128h(xmm2, Address(rsp, 32));
+ __ vinsertf128h(xmm3, Address(rsp, 48));
+ __ vinsertf128h(xmm4, Address(rsp, 64));
+ __ vinsertf128h(xmm5, Address(rsp, 80));
+ __ vinsertf128h(xmm6, Address(rsp, 96));
+ __ vinsertf128h(xmm7, Address(rsp,112));
+ __ addptr(rsp, additional_frame_bytes);
}
__ pop_FPU_state();
- __ addptr(rsp, FPU_regs_live*sizeof(jdouble)); // Pop FPU registers
+ __ addptr(rsp, FPU_regs_live*wordSize); // Pop FPU registers
__ popf();
__ popa();
@@ -308,6 +358,13 @@ void RegisterSaver::restore_result_registers(MacroAssembler* masm) {
__ addptr(rsp, return_off * wordSize);
}
+// Is vector's size (in bytes) bigger than a size saved by default?
+// 16 bytes XMM registers are saved by default using SSE2 movdqu instructions.
+// Note, MaxVectorSize == 0 with UseSSE < 2 and vectors are not generated.
+bool SharedRuntime::is_wide_vector(int size) {
+ return size > 16;
+}
+
// The java_calling_convention describes stack locations as ideal slots on
// a frame with no abi restrictions. Since we must observe abi restrictions
// (like the placement of the register window) the slots must be biased by
@@ -1346,12 +1403,12 @@ static void unpack_array_argument(MacroAssembler* masm, VMRegPair reg, BasicType
}
static void verify_oop_args(MacroAssembler* masm,
- int total_args_passed,
+ methodHandle method,
const BasicType* sig_bt,
const VMRegPair* regs) {
Register temp_reg = rbx; // not part of any compiled calling seq
if (VerifyOops) {
- for (int i = 0; i < total_args_passed; i++) {
+ for (int i = 0; i < method->size_of_parameters(); i++) {
if (sig_bt[i] == T_OBJECT ||
sig_bt[i] == T_ARRAY) {
VMReg r = regs[i].first();
@@ -1368,35 +1425,32 @@ static void verify_oop_args(MacroAssembler* masm,
}
static void gen_special_dispatch(MacroAssembler* masm,
- int total_args_passed,
- int comp_args_on_stack,
- vmIntrinsics::ID special_dispatch,
+ methodHandle method,
const BasicType* sig_bt,
const VMRegPair* regs) {
- verify_oop_args(masm, total_args_passed, sig_bt, regs);
+ verify_oop_args(masm, method, sig_bt, regs);
+ vmIntrinsics::ID iid = method->intrinsic_id();
// Now write the args into the outgoing interpreter space
bool has_receiver = false;
Register receiver_reg = noreg;
int member_arg_pos = -1;
Register member_reg = noreg;
- int ref_kind = MethodHandles::signature_polymorphic_intrinsic_ref_kind(special_dispatch);
+ int ref_kind = MethodHandles::signature_polymorphic_intrinsic_ref_kind(iid);
if (ref_kind != 0) {
- member_arg_pos = total_args_passed - 1; // trailing MemberName argument
+ member_arg_pos = method->size_of_parameters() - 1; // trailing MemberName argument
member_reg = rbx; // known to be free at this point
has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
- } else if (special_dispatch == vmIntrinsics::_invokeBasic) {
+ } else if (iid == vmIntrinsics::_invokeBasic) {
has_receiver = true;
} else {
- guarantee(false, err_msg("special_dispatch=%d", special_dispatch));
+ fatal(err_msg_res("unexpected intrinsic id %d", iid));
}
if (member_reg != noreg) {
// Load the member_arg into register, if necessary.
- assert(member_arg_pos >= 0 && member_arg_pos < total_args_passed, "oob");
- assert(sig_bt[member_arg_pos] == T_OBJECT, "dispatch argument must be an object");
+ SharedRuntime::check_member_name_argument_is_last_argument(method, sig_bt, regs);
VMReg r = regs[member_arg_pos].first();
- assert(r->is_valid(), "bad member arg");
if (r->is_stack()) {
__ movptr(member_reg, Address(rsp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
} else {
@@ -1407,7 +1461,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
if (has_receiver) {
// Make sure the receiver is loaded into a register.
- assert(total_args_passed > 0, "oob");
+ assert(method->size_of_parameters() > 0, "oob");
assert(sig_bt[0] == T_OBJECT, "receiver argument must be an object");
VMReg r = regs[0].first();
assert(r->is_valid(), "bad receiver arg");
@@ -1415,7 +1469,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
// Porting note: This assumes that compiled calling conventions always
// pass the receiver oop in a register. If this is not true on some
// platform, pick a temp and load the receiver from stack.
- assert(false, "receiver always in a register");
+ fatal("receiver always in a register");
receiver_reg = rcx; // known to be free at this point
__ movptr(receiver_reg, Address(rsp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
} else {
@@ -1425,7 +1479,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
}
// Figure out which address we are really jumping to:
- MethodHandles::generate_method_handle_dispatch(masm, special_dispatch,
+ MethodHandles::generate_method_handle_dispatch(masm, iid,
receiver_reg, member_reg, /*for_compiler_entry:*/ true);
}
@@ -1461,8 +1515,6 @@ static void gen_special_dispatch(MacroAssembler* masm,
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
methodHandle method,
int compile_id,
- int total_in_args,
- int comp_args_on_stack,
BasicType* in_sig_bt,
VMRegPair* in_regs,
BasicType ret_type) {
@@ -1471,9 +1523,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
intptr_t start = (intptr_t)__ pc();
int vep_offset = ((intptr_t)__ pc()) - start;
gen_special_dispatch(masm,
- total_in_args,
- comp_args_on_stack,
- method->intrinsic_id(),
+ method,
in_sig_bt,
in_regs);
int frame_complete = ((intptr_t)__ pc()) - start; // not complete, period
@@ -1506,6 +1556,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// we convert the java signature to a C signature by inserting
// the hidden arguments as arg[0] and possibly arg[1] (static method)
+ const int total_in_args = method->size_of_parameters();
int total_c_args = total_in_args;
if (!is_critical_native) {
total_c_args += 1;
@@ -2738,7 +2789,6 @@ uint SharedRuntime::out_preserve_stack_slots() {
return 0;
}
-
//------------------------------generate_deopt_blob----------------------------
void SharedRuntime::generate_deopt_blob() {
// allocate space for the code
@@ -3276,7 +3326,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
// setup oopmap, and calls safepoint code to stop the compiled code for
// a safepoint.
//
-SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause_return) {
+SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
// Account for thread arg in our frame
const int additional_words = 1;
@@ -3296,17 +3346,18 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
const Register java_thread = rdi; // callee-saved for VC++
address start = __ pc();
address call_pc = NULL;
-
+ bool cause_return = (poll_type == POLL_AT_RETURN);
+ bool save_vectors = (poll_type == POLL_AT_VECTOR_LOOP);
// If cause_return is true we are at a poll_return and there is
// the return address on the stack to the caller on the nmethod
// that is safepoint. We can leave this return on the stack and
// effectively complete the return and safepoint in the caller.
// Otherwise we push space for a return address that the safepoint
// handler will install later to make the stack walking sensible.
- if( !cause_return )
- __ push(rbx); // Make room for return address (or push it again)
+ if (!cause_return)
+ __ push(rbx); // Make room for return address (or push it again)
- map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words, false);
+ map = RegisterSaver::save_live_registers(masm, additional_words, &frame_size_in_words, false, save_vectors);
// The following is basically a call_VM. However, we need the precise
// address of the call in order to generate an oopmap. Hence, we do all the
@@ -3318,7 +3369,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
__ set_last_Java_frame(java_thread, noreg, noreg, NULL);
// if this was not a poll_return then we need to correct the return address now.
- if( !cause_return ) {
+ if (!cause_return) {
__ movptr(rax, Address(java_thread, JavaThread::saved_exception_pc_offset()));
__ movptr(Address(rbp, wordSize), rax);
}
@@ -3346,15 +3397,14 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
__ jcc(Assembler::equal, noException);
// Exception pending
-
- RegisterSaver::restore_live_registers(masm);
+ RegisterSaver::restore_live_registers(masm, save_vectors);
__ jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
__ bind(noException);
// Normal exit, register restoring and exit
- RegisterSaver::restore_live_registers(masm);
+ RegisterSaver::restore_live_registers(masm, save_vectors);
__ ret(0);
diff --git a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
index 4059ca6b30d..49ddcb8f255 100644
--- a/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/sharedRuntime_x86_64.cpp
@@ -116,8 +116,8 @@ class RegisterSaver {
};
public:
- static OopMap* save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words);
- static void restore_live_registers(MacroAssembler* masm);
+ static OopMap* save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors = false);
+ static void restore_live_registers(MacroAssembler* masm, bool restore_vectors = false);
// Offsets into the register save area
// Used by deoptimization when it is managing result register
@@ -134,7 +134,19 @@ class RegisterSaver {
static void restore_result_registers(MacroAssembler* masm);
};
-OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words) {
+OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_frame_words, int* total_frame_words, bool save_vectors) {
+ int vect_words = 0;
+#ifdef COMPILER2
+ if (save_vectors) {
+ assert(UseAVX > 0, "256bit vectors are supported only with AVX");
+ assert(MaxVectorSize == 32, "only 256bit vectors are supported now");
+ // Save upper half of YMM registes
+ vect_words = 16 * 16 / wordSize;
+ additional_frame_words += vect_words;
+ }
+#else
+ assert(!save_vectors, "vectors are generated only by C2");
+#endif
// Always make the frame size 16-byte aligned
int frame_size_in_bytes = round_to(additional_frame_words*wordSize +
@@ -155,6 +167,27 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
__ enter(); // rsp becomes 16-byte aligned here
__ push_CPU_state(); // Push a multiple of 16 bytes
+
+ if (vect_words > 0) {
+ assert(vect_words*wordSize == 256, "");
+ __ subptr(rsp, 256); // Save upper half of YMM registes
+ __ vextractf128h(Address(rsp, 0),xmm0);
+ __ vextractf128h(Address(rsp, 16),xmm1);
+ __ vextractf128h(Address(rsp, 32),xmm2);
+ __ vextractf128h(Address(rsp, 48),xmm3);
+ __ vextractf128h(Address(rsp, 64),xmm4);
+ __ vextractf128h(Address(rsp, 80),xmm5);
+ __ vextractf128h(Address(rsp, 96),xmm6);
+ __ vextractf128h(Address(rsp,112),xmm7);
+ __ vextractf128h(Address(rsp,128),xmm8);
+ __ vextractf128h(Address(rsp,144),xmm9);
+ __ vextractf128h(Address(rsp,160),xmm10);
+ __ vextractf128h(Address(rsp,176),xmm11);
+ __ vextractf128h(Address(rsp,192),xmm12);
+ __ vextractf128h(Address(rsp,208),xmm13);
+ __ vextractf128h(Address(rsp,224),xmm14);
+ __ vextractf128h(Address(rsp,240),xmm15);
+ }
if (frame::arg_reg_save_area_bytes != 0) {
// Allocate argument register save area
__ subptr(rsp, frame::arg_reg_save_area_bytes);
@@ -167,112 +200,111 @@ OopMap* RegisterSaver::save_live_registers(MacroAssembler* masm, int additional_
OopMapSet *oop_maps = new OopMapSet();
OopMap* map = new OopMap(frame_size_in_slots, 0);
- map->set_callee_saved(VMRegImpl::stack2reg( rax_off + additional_frame_slots), rax->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( rcx_off + additional_frame_slots), rcx->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( rdx_off + additional_frame_slots), rdx->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( rbx_off + additional_frame_slots), rbx->as_VMReg());
+
+#define STACK_OFFSET(x) VMRegImpl::stack2reg((x) + additional_frame_slots)
+
+ map->set_callee_saved(STACK_OFFSET( rax_off ), rax->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( rcx_off ), rcx->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( rdx_off ), rdx->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( rbx_off ), rbx->as_VMReg());
// rbp location is known implicitly by the frame sender code, needs no oopmap
// and the location where rbp was saved by is ignored
- map->set_callee_saved(VMRegImpl::stack2reg( rsi_off + additional_frame_slots), rsi->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( rdi_off + additional_frame_slots), rdi->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r8_off + additional_frame_slots), r8->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r9_off + additional_frame_slots), r9->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r10_off + additional_frame_slots), r10->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r11_off + additional_frame_slots), r11->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r12_off + additional_frame_slots), r12->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r13_off + additional_frame_slots), r13->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r14_off + additional_frame_slots), r14->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg( r15_off + additional_frame_slots), r15->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm0_off + additional_frame_slots), xmm0->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm1_off + additional_frame_slots), xmm1->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm2_off + additional_frame_slots), xmm2->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm3_off + additional_frame_slots), xmm3->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm4_off + additional_frame_slots), xmm4->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm5_off + additional_frame_slots), xmm5->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm6_off + additional_frame_slots), xmm6->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm7_off + additional_frame_slots), xmm7->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm8_off + additional_frame_slots), xmm8->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm9_off + additional_frame_slots), xmm9->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm10_off + additional_frame_slots), xmm10->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm11_off + additional_frame_slots), xmm11->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm12_off + additional_frame_slots), xmm12->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm13_off + additional_frame_slots), xmm13->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm14_off + additional_frame_slots), xmm14->as_VMReg());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm15_off + additional_frame_slots), xmm15->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( rsi_off ), rsi->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( rdi_off ), rdi->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r8_off ), r8->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r9_off ), r9->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r10_off ), r10->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r11_off ), r11->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r12_off ), r12->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r13_off ), r13->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r14_off ), r14->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET( r15_off ), r15->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm0_off ), xmm0->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm1_off ), xmm1->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm2_off ), xmm2->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm3_off ), xmm3->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm4_off ), xmm4->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm5_off ), xmm5->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm6_off ), xmm6->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm7_off ), xmm7->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm8_off ), xmm8->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm9_off ), xmm9->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm10_off), xmm10->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm11_off), xmm11->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm12_off), xmm12->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm13_off), xmm13->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm14_off), xmm14->as_VMReg());
+ map->set_callee_saved(STACK_OFFSET(xmm15_off), xmm15->as_VMReg());
// %%% These should all be a waste but we'll keep things as they were for now
if (true) {
- map->set_callee_saved(VMRegImpl::stack2reg( raxH_off + additional_frame_slots),
- rax->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( rcxH_off + additional_frame_slots),
- rcx->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( rdxH_off + additional_frame_slots),
- rdx->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( rbxH_off + additional_frame_slots),
- rbx->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( raxH_off ), rax->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( rcxH_off ), rcx->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( rdxH_off ), rdx->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( rbxH_off ), rbx->as_VMReg()->next());
// rbp location is known implicitly by the frame sender code, needs no oopmap
- map->set_callee_saved(VMRegImpl::stack2reg( rsiH_off + additional_frame_slots),
- rsi->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( rdiH_off + additional_frame_slots),
- rdi->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r8H_off + additional_frame_slots),
- r8->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r9H_off + additional_frame_slots),
- r9->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r10H_off + additional_frame_slots),
- r10->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r11H_off + additional_frame_slots),
- r11->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r12H_off + additional_frame_slots),
- r12->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r13H_off + additional_frame_slots),
- r13->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r14H_off + additional_frame_slots),
- r14->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg( r15H_off + additional_frame_slots),
- r15->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm0H_off + additional_frame_slots),
- xmm0->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm1H_off + additional_frame_slots),
- xmm1->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm2H_off + additional_frame_slots),
- xmm2->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm3H_off + additional_frame_slots),
- xmm3->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm4H_off + additional_frame_slots),
- xmm4->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm5H_off + additional_frame_slots),
- xmm5->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm6H_off + additional_frame_slots),
- xmm6->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm7H_off + additional_frame_slots),
- xmm7->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm8H_off + additional_frame_slots),
- xmm8->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm9H_off + additional_frame_slots),
- xmm9->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm10H_off + additional_frame_slots),
- xmm10->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm11H_off + additional_frame_slots),
- xmm11->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm12H_off + additional_frame_slots),
- xmm12->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm13H_off + additional_frame_slots),
- xmm13->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm14H_off + additional_frame_slots),
- xmm14->as_VMReg()->next());
- map->set_callee_saved(VMRegImpl::stack2reg(xmm15H_off + additional_frame_slots),
- xmm15->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( rsiH_off ), rsi->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( rdiH_off ), rdi->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r8H_off ), r8->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r9H_off ), r9->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r10H_off ), r10->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r11H_off ), r11->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r12H_off ), r12->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r13H_off ), r13->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r14H_off ), r14->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET( r15H_off ), r15->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm0H_off ), xmm0->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm1H_off ), xmm1->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm2H_off ), xmm2->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm3H_off ), xmm3->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm4H_off ), xmm4->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm5H_off ), xmm5->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm6H_off ), xmm6->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm7H_off ), xmm7->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm8H_off ), xmm8->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm9H_off ), xmm9->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm10H_off), xmm10->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm11H_off), xmm11->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm12H_off), xmm12->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm13H_off), xmm13->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm14H_off), xmm14->as_VMReg()->next());
+ map->set_callee_saved(STACK_OFFSET(xmm15H_off), xmm15->as_VMReg()->next());
}
return map;
}
-void RegisterSaver::restore_live_registers(MacroAssembler* masm) {
+void RegisterSaver::restore_live_registers(MacroAssembler* masm, bool restore_vectors) {
if (frame::arg_reg_save_area_bytes != 0) {
// Pop arg register save area
__ addptr(rsp, frame::arg_reg_save_area_bytes);
}
+#ifdef COMPILER2
+ if (restore_vectors) {
+ // Restore upper half of YMM registes.
+ assert(UseAVX > 0, "256bit vectors are supported only with AVX");
+ assert(MaxVectorSize == 32, "only 256bit vectors are supported now");
+ __ vinsertf128h(xmm0, Address(rsp, 0));
+ __ vinsertf128h(xmm1, Address(rsp, 16));
+ __ vinsertf128h(xmm2, Address(rsp, 32));
+ __ vinsertf128h(xmm3, Address(rsp, 48));
+ __ vinsertf128h(xmm4, Address(rsp, 64));
+ __ vinsertf128h(xmm5, Address(rsp, 80));
+ __ vinsertf128h(xmm6, Address(rsp, 96));
+ __ vinsertf128h(xmm7, Address(rsp,112));
+ __ vinsertf128h(xmm8, Address(rsp,128));
+ __ vinsertf128h(xmm9, Address(rsp,144));
+ __ vinsertf128h(xmm10, Address(rsp,160));
+ __ vinsertf128h(xmm11, Address(rsp,176));
+ __ vinsertf128h(xmm12, Address(rsp,192));
+ __ vinsertf128h(xmm13, Address(rsp,208));
+ __ vinsertf128h(xmm14, Address(rsp,224));
+ __ vinsertf128h(xmm15, Address(rsp,240));
+ __ addptr(rsp, 256);
+ }
+#else
+ assert(!restore_vectors, "vectors are generated only by C2");
+#endif
// Recover CPU state
__ pop_CPU_state();
// Get the rbp described implicitly by the calling convention (no oopMap)
@@ -297,6 +329,12 @@ void RegisterSaver::restore_result_registers(MacroAssembler* masm) {
__ addptr(rsp, return_offset_in_bytes());
}
+// Is vector's size (in bytes) bigger than a size saved by default?
+// 16 bytes XMM registers are saved by default using fxsave/fxrstor instructions.
+bool SharedRuntime::is_wide_vector(int size) {
+ return size > 16;
+}
+
// The java_calling_convention describes stack locations as ideal slots on
// a frame with no abi restrictions. Since we must observe abi restrictions
// (like the placement of the register window) the slots must be biased by
@@ -1593,12 +1631,12 @@ class ComputeMoveOrder: public StackObj {
};
static void verify_oop_args(MacroAssembler* masm,
- int total_args_passed,
+ methodHandle method,
const BasicType* sig_bt,
const VMRegPair* regs) {
Register temp_reg = rbx; // not part of any compiled calling seq
if (VerifyOops) {
- for (int i = 0; i < total_args_passed; i++) {
+ for (int i = 0; i < method->size_of_parameters(); i++) {
if (sig_bt[i] == T_OBJECT ||
sig_bt[i] == T_ARRAY) {
VMReg r = regs[i].first();
@@ -1615,35 +1653,32 @@ static void verify_oop_args(MacroAssembler* masm,
}
static void gen_special_dispatch(MacroAssembler* masm,
- int total_args_passed,
- int comp_args_on_stack,
- vmIntrinsics::ID special_dispatch,
+ methodHandle method,
const BasicType* sig_bt,
const VMRegPair* regs) {
- verify_oop_args(masm, total_args_passed, sig_bt, regs);
+ verify_oop_args(masm, method, sig_bt, regs);
+ vmIntrinsics::ID iid = method->intrinsic_id();
// Now write the args into the outgoing interpreter space
bool has_receiver = false;
Register receiver_reg = noreg;
int member_arg_pos = -1;
Register member_reg = noreg;
- int ref_kind = MethodHandles::signature_polymorphic_intrinsic_ref_kind(special_dispatch);
+ int ref_kind = MethodHandles::signature_polymorphic_intrinsic_ref_kind(iid);
if (ref_kind != 0) {
- member_arg_pos = total_args_passed - 1; // trailing MemberName argument
+ member_arg_pos = method->size_of_parameters() - 1; // trailing MemberName argument
member_reg = rbx; // known to be free at this point
has_receiver = MethodHandles::ref_kind_has_receiver(ref_kind);
- } else if (special_dispatch == vmIntrinsics::_invokeBasic) {
+ } else if (iid == vmIntrinsics::_invokeBasic) {
has_receiver = true;
} else {
- guarantee(false, err_msg("special_dispatch=%d", special_dispatch));
+ fatal(err_msg_res("unexpected intrinsic id %d", iid));
}
if (member_reg != noreg) {
// Load the member_arg into register, if necessary.
- assert(member_arg_pos >= 0 && member_arg_pos < total_args_passed, "oob");
- assert(sig_bt[member_arg_pos] == T_OBJECT, "dispatch argument must be an object");
+ SharedRuntime::check_member_name_argument_is_last_argument(method, sig_bt, regs);
VMReg r = regs[member_arg_pos].first();
- assert(r->is_valid(), "bad member arg");
if (r->is_stack()) {
__ movptr(member_reg, Address(rsp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
} else {
@@ -1654,7 +1689,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
if (has_receiver) {
// Make sure the receiver is loaded into a register.
- assert(total_args_passed > 0, "oob");
+ assert(method->size_of_parameters() > 0, "oob");
assert(sig_bt[0] == T_OBJECT, "receiver argument must be an object");
VMReg r = regs[0].first();
assert(r->is_valid(), "bad receiver arg");
@@ -1662,7 +1697,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
// Porting note: This assumes that compiled calling conventions always
// pass the receiver oop in a register. If this is not true on some
// platform, pick a temp and load the receiver from stack.
- assert(false, "receiver always in a register");
+ fatal("receiver always in a register");
receiver_reg = j_rarg0; // known to be free at this point
__ movptr(receiver_reg, Address(rsp, r->reg2stack() * VMRegImpl::stack_slot_size + wordSize));
} else {
@@ -1672,7 +1707,7 @@ static void gen_special_dispatch(MacroAssembler* masm,
}
// Figure out which address we are really jumping to:
- MethodHandles::generate_method_handle_dispatch(masm, special_dispatch,
+ MethodHandles::generate_method_handle_dispatch(masm, iid,
receiver_reg, member_reg, /*for_compiler_entry:*/ true);
}
@@ -1708,8 +1743,6 @@ static void gen_special_dispatch(MacroAssembler* masm,
nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
methodHandle method,
int compile_id,
- int total_in_args,
- int comp_args_on_stack,
BasicType* in_sig_bt,
VMRegPair* in_regs,
BasicType ret_type) {
@@ -1718,9 +1751,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
intptr_t start = (intptr_t)__ pc();
int vep_offset = ((intptr_t)__ pc()) - start;
gen_special_dispatch(masm,
- total_in_args,
- comp_args_on_stack,
- method->intrinsic_id(),
+ method,
in_sig_bt,
in_regs);
int frame_complete = ((intptr_t)__ pc()) - start; // not complete, period
@@ -1754,6 +1785,7 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
// we convert the java signature to a C signature by inserting
// the hidden arguments as arg[0] and possibly arg[1] (static method)
+ const int total_in_args = method->size_of_parameters();
int total_c_args = total_in_args;
if (!is_critical_native) {
total_c_args += 1;
@@ -3241,7 +3273,6 @@ uint SharedRuntime::out_preserve_stack_slots() {
return 0;
}
-
//------------------------------generate_deopt_blob----------------------------
void SharedRuntime::generate_deopt_blob() {
// Allocate space for the code
@@ -3746,7 +3777,7 @@ void SharedRuntime::generate_uncommon_trap_blob() {
// Generate a special Compile2Runtime blob that saves all registers,
// and setup oopmap.
//
-SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause_return) {
+SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, int poll_type) {
assert(StubRoutines::forward_exception_entry() != NULL,
"must be generated before");
@@ -3761,6 +3792,8 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
address start = __ pc();
address call_pc = NULL;
int frame_size_in_words;
+ bool cause_return = (poll_type == POLL_AT_RETURN);
+ bool save_vectors = (poll_type == POLL_AT_VECTOR_LOOP);
// Make room for return address (or push it again)
if (!cause_return) {
@@ -3768,7 +3801,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
}
// Save registers, fpu state, and flags
- map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words);
+ map = RegisterSaver::save_live_registers(masm, 0, &frame_size_in_words, save_vectors);
// The following is basically a call_VM. However, we need the precise
// address of the call in order to generate an oopmap. Hence, we do all the
@@ -3805,7 +3838,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
// Exception pending
- RegisterSaver::restore_live_registers(masm);
+ RegisterSaver::restore_live_registers(masm, save_vectors);
__ jump(RuntimeAddress(StubRoutines::forward_exception_entry()));
@@ -3813,7 +3846,7 @@ SafepointBlob* SharedRuntime::generate_handler_blob(address call_ptr, bool cause
__ bind(noException);
// Normal exit, restore registers and exit.
- RegisterSaver::restore_live_registers(masm);
+ RegisterSaver::restore_live_registers(masm, save_vectors);
__ ret(0);
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
index 8a9de37e1e8..f149fde83ab 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_32.cpp
@@ -1801,7 +1801,7 @@ class StubGenerator: public StubCodeGenerator {
assert_different_registers(src, src_pos, dst, dst_pos, rcx_lh);
arraycopy_range_checks(src, src_pos, dst, dst_pos, LENGTH, L_failed);
- // typeArrayKlass
+ // TypeArrayKlass
//
// src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
// dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
@@ -1864,7 +1864,7 @@ class StubGenerator: public StubCodeGenerator {
__ leave(); // required for proper stackwalking of RuntimeStub frame
__ ret(0);
- // objArrayKlass
+ // ObjArrayKlass
__ BIND(L_objArray);
// live at this point: rcx_src_klass, src[_pos], dst[_pos]
@@ -1894,7 +1894,7 @@ class StubGenerator: public StubCodeGenerator {
// live at this point: rcx_src_klass, dst[_pos], src[_pos]
{
// Handy offsets:
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
int sco_offset = in_bytes(Klass::super_check_offset_offset());
Register rsi_dst_klass = rsi;
diff --git a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
index de60df86f2a..8ae595a56da 100644
--- a/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/stubGenerator_x86_64.cpp
@@ -2604,7 +2604,7 @@ class StubGenerator: public StubCodeGenerator {
arraycopy_range_checks(src, src_pos, dst, dst_pos, r11_length,
r10, L_failed);
- // typeArrayKlass
+ // TypeArrayKlass
//
// src_addr = (src + array_header_in_bytes()) + (src_pos << log2elemsize);
// dst_addr = (dst + array_header_in_bytes()) + (dst_pos << log2elemsize);
@@ -2670,7 +2670,7 @@ class StubGenerator: public StubCodeGenerator {
__ movl2ptr(count, r11_length); // length
__ jump(RuntimeAddress(long_copy_entry));
- // objArrayKlass
+ // ObjArrayKlass
__ BIND(L_objArray);
// live at this point: r10_src_klass, r11_length, src[_pos], dst[_pos]
@@ -2723,8 +2723,8 @@ class StubGenerator: public StubCodeGenerator {
assert_clean_int(sco_temp, rax);
generate_type_check(r10_src_klass, sco_temp, r11_dst_klass, L_plain_copy);
- // Fetch destination element klass from the objArrayKlass header.
- int ek_offset = in_bytes(objArrayKlass::element_klass_offset());
+ // Fetch destination element klass from the ObjArrayKlass header.
+ int ek_offset = in_bytes(ObjArrayKlass::element_klass_offset());
__ movptr(r11_dst_klass, Address(r11_dst_klass, ek_offset));
__ movl( sco_temp, Address(r11_dst_klass, sco_offset));
assert_clean_int(sco_temp, rax);
diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp
index 782dc906399..084bbf8fb82 100644
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 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
diff --git a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
index 7737c4eee6e..9b9cede4f2d 100644
--- a/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
+++ b/hotspot/src/cpu/x86/vm/stubRoutines_x86_64.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, 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
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
index 441738b5e7c..24d138e4917 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.cpp
@@ -949,7 +949,7 @@ void TemplateTable::aastore() {
__ load_klass(rbx, rax);
// Move superklass into EAX
__ load_klass(rax, rdx);
- __ movptr(rax, Address(rax, objArrayKlass::element_klass_offset()));
+ __ movptr(rax, Address(rax, ObjArrayKlass::element_klass_offset()));
// Compress array+index*wordSize+12 into a single register. Frees ECX.
__ lea(rdx, element_address);
@@ -2139,7 +2139,7 @@ void TemplateTable::load_invoke_cp_cache_entry(int byte_no,
const int index_offset = in_bytes(ConstantPoolCache::base_offset() +
ConstantPoolCacheEntry::f2_offset());
- size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2));
+ size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2));
resolve_cache_and_index(byte_no, cache, index, index_size);
__ movptr(method, Address(cache, index, Address::times_ptr, method_offset));
@@ -2876,6 +2876,7 @@ void TemplateTable::prepare_invoke(int byte_no,
// since the parameter_size includes it.
__ push(rbx);
__ mov(rbx, index);
+ assert(ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset == 0, "appendix expected at index+0");
__ load_resolved_reference_at_index(index, rbx);
__ pop(rbx);
__ push(index); // push appendix (MethodType, CallSite, etc.)
@@ -3093,8 +3094,8 @@ void TemplateTable::invokeinterface(int byte_no) {
void TemplateTable::invokehandle(int byte_no) {
transition(vtos, vtos);
assert(byte_no == f1_byte, "use this argument");
- const Register rbx_method = rbx; // (from f2)
- const Register rax_mtype = rax; // (from f1)
+ const Register rbx_method = rbx;
+ const Register rax_mtype = rax;
const Register rcx_recv = rcx;
const Register rdx_flags = rdx;
@@ -3104,13 +3105,14 @@ void TemplateTable::invokehandle(int byte_no) {
return;
}
- prepare_invoke(byte_no,
- rbx_method, rax_mtype, // get f2 Method*, f1 MethodType
- rcx_recv);
+ prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
__ verify_method_ptr(rbx_method);
__ verify_oop(rcx_recv);
__ null_check(rcx_recv);
+ // rax: MethodType object (from cpool->resolved_references[f1], if necessary)
+ // rbx: MH.invokeExact_MT method (from f2)
+
// Note: rax_mtype is already pushed (if necessary) by prepare_invoke
// FIXME: profile the LambdaForm also
@@ -3140,7 +3142,7 @@ void TemplateTable::invokedynamic(int byte_no) {
prepare_invoke(byte_no, rbx_method, rax_callsite);
- // rax: CallSite object (from cpool->resolved_references[])
+ // rax: CallSite object (from cpool->resolved_references[f1])
// rbx: MH.linkToCallSite method (from f2)
// Note: rax_callsite is already pushed by prepare_invoke
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
index c0ff89796cf..dea3d7f5aaf 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_32.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
index bf5fd9be460..bb9b86f2473 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp
@@ -970,7 +970,7 @@ void TemplateTable::aastore() {
// Move superklass into rax
__ load_klass(rax, rdx);
__ movptr(rax, Address(rax,
- objArrayKlass::element_klass_offset()));
+ ObjArrayKlass::element_klass_offset()));
// Compress array + index*oopSize + 12 into a single register. Frees rcx.
__ lea(rdx, element_address);
@@ -2184,7 +2184,7 @@ void TemplateTable::load_invoke_cp_cache_entry(int byte_no,
const int index_offset = in_bytes(ConstantPoolCache::base_offset() +
ConstantPoolCacheEntry::f2_offset());
- size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2));
+ size_t index_size = (is_invokedynamic ? sizeof(u4) : sizeof(u2));
resolve_cache_and_index(byte_no, cache, index, index_size);
__ movptr(method, Address(cache, index, Address::times_ptr, method_offset));
@@ -2926,6 +2926,7 @@ void TemplateTable::prepare_invoke(int byte_no,
// since the parameter_size includes it.
__ push(rbx);
__ mov(rbx, index);
+ assert(ConstantPoolCacheEntry::_indy_resolved_references_appendix_offset == 0, "appendix expected at index+0");
__ load_resolved_reference_at_index(index, rbx);
__ pop(rbx);
__ push(index); // push appendix (MethodType, CallSite, etc.)
@@ -3144,8 +3145,8 @@ void TemplateTable::invokeinterface(int byte_no) {
void TemplateTable::invokehandle(int byte_no) {
transition(vtos, vtos);
assert(byte_no == f1_byte, "use this argument");
- const Register rbx_method = rbx; // f2
- const Register rax_mtype = rax; // f1
+ const Register rbx_method = rbx;
+ const Register rax_mtype = rax;
const Register rcx_recv = rcx;
const Register rdx_flags = rdx;
@@ -3155,13 +3156,14 @@ void TemplateTable::invokehandle(int byte_no) {
return;
}
- prepare_invoke(byte_no,
- rbx_method, rax_mtype, // get f2 Method*, f1 MethodType
- rcx_recv);
+ prepare_invoke(byte_no, rbx_method, rax_mtype, rcx_recv);
__ verify_method_ptr(rbx_method);
__ verify_oop(rcx_recv);
__ null_check(rcx_recv);
+ // rax: MethodType object (from cpool->resolved_references[f1], if necessary)
+ // rbx: MH.invokeExact_MT method (from f2)
+
// Note: rax_mtype is already pushed (if necessary) by prepare_invoke
// FIXME: profile the LambdaForm also
@@ -3191,7 +3193,7 @@ void TemplateTable::invokedynamic(int byte_no) {
prepare_invoke(byte_no, rbx_method, rax_callsite);
- // rax: CallSite object (from cpool->resolved_references[])
+ // rax: CallSite object (from cpool->resolved_references[f1])
// rbx: MH.linkToCallSite method (from f2)
// Note: rax_callsite is already pushed by prepare_invoke
diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp
index 15c4c005620..fa506a094f8 100644
--- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp
+++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 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
diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
index 12f3f258415..bf7b3c213f1 100644
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp
@@ -363,6 +363,11 @@ void VM_Version::get_processor_features() {
}
_supports_cx8 = supports_cmpxchg8();
+ // xchg and xadd instructions
+ _supports_atomic_getset4 = true;
+ _supports_atomic_getadd4 = true;
+ LP64_ONLY(_supports_atomic_getset8 = true);
+ LP64_ONLY(_supports_atomic_getadd8 = true);
#ifdef _LP64
// OS should support SSE for x64 and hardware should support at least SSE2.
@@ -562,10 +567,10 @@ void VM_Version::get_processor_features() {
AllocatePrefetchInstr = 3;
}
// On family 15h processors use XMM and UnalignedLoadStores for Array Copy
- if( supports_sse2() && FLAG_IS_DEFAULT(UseXMMForArrayCopy) ) {
+ if (supports_sse2() && FLAG_IS_DEFAULT(UseXMMForArrayCopy)) {
UseXMMForArrayCopy = true;
}
- if( FLAG_IS_DEFAULT(UseUnalignedLoadStores) && UseXMMForArrayCopy ) {
+ if (supports_sse2() && FLAG_IS_DEFAULT(UseUnalignedLoadStores)) {
UseUnalignedLoadStores = true;
}
}
@@ -612,16 +617,16 @@ void VM_Version::get_processor_features() {
MaxLoopPad = 11;
}
#endif // COMPILER2
- if( FLAG_IS_DEFAULT(UseXMMForArrayCopy) ) {
+ if (FLAG_IS_DEFAULT(UseXMMForArrayCopy)) {
UseXMMForArrayCopy = true; // use SSE2 movq on new Intel cpus
}
- if( supports_sse4_2() && supports_ht() ) { // Newest Intel cpus
- if( FLAG_IS_DEFAULT(UseUnalignedLoadStores) && UseXMMForArrayCopy ) {
+ if (supports_sse4_2() && supports_ht()) { // Newest Intel cpus
+ if (FLAG_IS_DEFAULT(UseUnalignedLoadStores)) {
UseUnalignedLoadStores = true; // use movdqu on newest Intel cpus
}
}
- if( supports_sse4_2() && UseSSE >= 4 ) {
- if( FLAG_IS_DEFAULT(UseSSE42Intrinsics)) {
+ if (supports_sse4_2() && UseSSE >= 4) {
+ if (FLAG_IS_DEFAULT(UseSSE42Intrinsics)) {
UseSSE42Intrinsics = true;
}
}
@@ -638,6 +643,13 @@ void VM_Version::get_processor_features() {
FLAG_SET_DEFAULT(UsePopCountInstruction, false);
}
+#ifdef COMPILER2
+ if (FLAG_IS_DEFAULT(AlignVector)) {
+ // Modern processors allow misaligned memory operations for vectors.
+ AlignVector = !UseUnalignedLoadStores;
+ }
+#endif // COMPILER2
+
assert(0 <= ReadPrefetchInstr && ReadPrefetchInstr <= 3, "invalid value");
assert(0 <= AllocatePrefetchInstr && AllocatePrefetchInstr <= 3, "invalid value");
diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp
index 7e309772af0..92cdbd3fd03 100644
--- a/hotspot/src/cpu/x86/vm/vm_version_x86.hpp
+++ b/hotspot/src/cpu/x86/vm/vm_version_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
index 578023ab4ad..867ebfa152f 100644
--- a/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
+++ b/hotspot/src/cpu/x86/vm/vtableStubs_x86_64.cpp
@@ -212,11 +212,11 @@ int VtableStub::pd_code_size_limit(bool is_vtable_stub) {
if (is_vtable_stub) {
// Vtable stub size
return (DebugVtables ? 512 : 24) + (CountCompiledCalls ? 13 : 0) +
- (UseCompressedOops ? 16 : 0); // 1 leaq can be 3 bytes + 1 long
+ (UseCompressedKlassPointers ? 16 : 0); // 1 leaq can be 3 bytes + 1 long
} else {
// Itable stub size
return (DebugVtables ? 512 : 74) + (CountCompiledCalls ? 13 : 0) +
- (UseCompressedOops ? 32 : 0); // 2 leaqs
+ (UseCompressedKlassPointers ? 32 : 0); // 2 leaqs
}
// In order to tune these parameters, run the JVM with VM options
// +PrintMiscellaneous and +WizardMode to see information about
diff --git a/hotspot/src/cpu/x86/vm/x86.ad b/hotspot/src/cpu/x86/vm/x86.ad
index 71e26fb2007..a2cf6f7945d 100644
--- a/hotspot/src/cpu/x86/vm/x86.ad
+++ b/hotspot/src/cpu/x86/vm/x86.ad
@@ -498,10 +498,18 @@ const bool Matcher::match_rule_supported(int opcode) {
case Op_PopCountL:
if (!UsePopCountInstruction)
return false;
+ break;
case Op_MulVI:
if ((UseSSE < 4) && (UseAVX < 1)) // only with SSE4_1 or AVX
return false;
break;
+ case Op_CompareAndSwapL:
+#ifdef _LP64
+ case Op_CompareAndSwapP:
+#endif
+ if (!VM_Version::supports_cx8())
+ return false;
+ break;
}
return true; // Per default match rules are supported.
@@ -563,6 +571,11 @@ const int Matcher::vector_ideal_reg(int size) {
return 0;
}
+// Only lowest bits of xmm reg are used for vector shift count.
+const int Matcher::vector_shift_count_ideal_reg(int size) {
+ return Op_VecS;
+}
+
// x86 supports misaligned vectors store/load.
const bool Matcher::misaligned_vectors_ok() {
return !AlignVector; // can be changed by flag
@@ -3750,10 +3763,24 @@ instruct vdiv4D_mem(vecY dst, vecY src, memory mem) %{
ins_pipe( pipe_slow );
%}
+// ------------------------------ Shift ---------------------------------------
+
+// Left and right shift count vectors are the same on x86
+// (only lowest bits of xmm reg are used for count).
+instruct vshiftcnt(vecS dst, rRegI cnt) %{
+ match(Set dst (LShiftCntV cnt));
+ match(Set dst (RShiftCntV cnt));
+ format %{ "movd $dst,$cnt\t! load shift count" %}
+ ins_encode %{
+ __ movdl($dst$$XMMRegister, $cnt$$Register);
+ %}
+ ins_pipe( pipe_slow );
+%}
+
// ------------------------------ LeftShift -----------------------------------
// Shorts/Chars vector left shift
-instruct vsll2S(vecS dst, regF shift) %{
+instruct vsll2S(vecS dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (LShiftVS dst shift));
format %{ "psllw $dst,$shift\t! left shift packed2S" %}
@@ -3773,7 +3800,7 @@ instruct vsll2S_imm(vecS dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll2S_reg(vecS dst, vecS src, regF shift) %{
+instruct vsll2S_reg(vecS dst, vecS src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (LShiftVS src shift));
format %{ "vpsllw $dst,$src,$shift\t! left shift packed2S" %}
@@ -3795,7 +3822,7 @@ instruct vsll2S_reg_imm(vecS dst, vecS src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll4S(vecD dst, regF shift) %{
+instruct vsll4S(vecD dst, vecS shift) %{
predicate(n->as_Vector()->length() == 4);
match(Set dst (LShiftVS dst shift));
format %{ "psllw $dst,$shift\t! left shift packed4S" %}
@@ -3815,7 +3842,7 @@ instruct vsll4S_imm(vecD dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll4S_reg(vecD dst, vecD src, regF shift) %{
+instruct vsll4S_reg(vecD dst, vecD src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 4);
match(Set dst (LShiftVS src shift));
format %{ "vpsllw $dst,$src,$shift\t! left shift packed4S" %}
@@ -3837,7 +3864,7 @@ instruct vsll4S_reg_imm(vecD dst, vecD src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll8S(vecX dst, regF shift) %{
+instruct vsll8S(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 8);
match(Set dst (LShiftVS dst shift));
format %{ "psllw $dst,$shift\t! left shift packed8S" %}
@@ -3857,7 +3884,7 @@ instruct vsll8S_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll8S_reg(vecX dst, vecX src, regF shift) %{
+instruct vsll8S_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 8);
match(Set dst (LShiftVS src shift));
format %{ "vpsllw $dst,$src,$shift\t! left shift packed8S" %}
@@ -3879,7 +3906,7 @@ instruct vsll8S_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll16S_reg(vecY dst, vecY src, regF shift) %{
+instruct vsll16S_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 16);
match(Set dst (LShiftVS src shift));
format %{ "vpsllw $dst,$src,$shift\t! left shift packed16S" %}
@@ -3902,7 +3929,7 @@ instruct vsll16S_reg_imm(vecY dst, vecY src, immI8 shift) %{
%}
// Integers vector left shift
-instruct vsll2I(vecD dst, regF shift) %{
+instruct vsll2I(vecD dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (LShiftVI dst shift));
format %{ "pslld $dst,$shift\t! left shift packed2I" %}
@@ -3922,7 +3949,7 @@ instruct vsll2I_imm(vecD dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll2I_reg(vecD dst, vecD src, regF shift) %{
+instruct vsll2I_reg(vecD dst, vecD src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (LShiftVI src shift));
format %{ "vpslld $dst,$src,$shift\t! left shift packed2I" %}
@@ -3944,7 +3971,7 @@ instruct vsll2I_reg_imm(vecD dst, vecD src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll4I(vecX dst, regF shift) %{
+instruct vsll4I(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 4);
match(Set dst (LShiftVI dst shift));
format %{ "pslld $dst,$shift\t! left shift packed4I" %}
@@ -3964,7 +3991,7 @@ instruct vsll4I_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll4I_reg(vecX dst, vecX src, regF shift) %{
+instruct vsll4I_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 4);
match(Set dst (LShiftVI src shift));
format %{ "vpslld $dst,$src,$shift\t! left shift packed4I" %}
@@ -3986,7 +4013,7 @@ instruct vsll4I_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll8I_reg(vecY dst, vecY src, regF shift) %{
+instruct vsll8I_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 8);
match(Set dst (LShiftVI src shift));
format %{ "vpslld $dst,$src,$shift\t! left shift packed8I" %}
@@ -4009,7 +4036,7 @@ instruct vsll8I_reg_imm(vecY dst, vecY src, immI8 shift) %{
%}
// Longs vector left shift
-instruct vsll2L(vecX dst, regF shift) %{
+instruct vsll2L(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (LShiftVL dst shift));
format %{ "psllq $dst,$shift\t! left shift packed2L" %}
@@ -4029,7 +4056,7 @@ instruct vsll2L_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll2L_reg(vecX dst, vecX src, regF shift) %{
+instruct vsll2L_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (LShiftVL src shift));
format %{ "vpsllq $dst,$src,$shift\t! left shift packed2L" %}
@@ -4051,7 +4078,7 @@ instruct vsll2L_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsll4L_reg(vecY dst, vecY src, regF shift) %{
+instruct vsll4L_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 4);
match(Set dst (LShiftVL src shift));
format %{ "vpsllq $dst,$src,$shift\t! left shift packed4L" %}
@@ -4080,7 +4107,7 @@ instruct vsll4L_reg_imm(vecY dst, vecY src, immI8 shift) %{
// sign extension before a shift.
// Integers vector logical right shift
-instruct vsrl2I(vecD dst, regF shift) %{
+instruct vsrl2I(vecD dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (URShiftVI dst shift));
format %{ "psrld $dst,$shift\t! logical right shift packed2I" %}
@@ -4100,7 +4127,7 @@ instruct vsrl2I_imm(vecD dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsrl2I_reg(vecD dst, vecD src, regF shift) %{
+instruct vsrl2I_reg(vecD dst, vecD src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (URShiftVI src shift));
format %{ "vpsrld $dst,$src,$shift\t! logical right shift packed2I" %}
@@ -4122,7 +4149,7 @@ instruct vsrl2I_reg_imm(vecD dst, vecD src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsrl4I(vecX dst, regF shift) %{
+instruct vsrl4I(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 4);
match(Set dst (URShiftVI dst shift));
format %{ "psrld $dst,$shift\t! logical right shift packed4I" %}
@@ -4142,7 +4169,7 @@ instruct vsrl4I_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsrl4I_reg(vecX dst, vecX src, regF shift) %{
+instruct vsrl4I_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 4);
match(Set dst (URShiftVI src shift));
format %{ "vpsrld $dst,$src,$shift\t! logical right shift packed4I" %}
@@ -4164,7 +4191,7 @@ instruct vsrl4I_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsrl8I_reg(vecY dst, vecY src, regF shift) %{
+instruct vsrl8I_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 8);
match(Set dst (URShiftVI src shift));
format %{ "vpsrld $dst,$src,$shift\t! logical right shift packed8I" %}
@@ -4187,7 +4214,7 @@ instruct vsrl8I_reg_imm(vecY dst, vecY src, immI8 shift) %{
%}
// Longs vector logical right shift
-instruct vsrl2L(vecX dst, regF shift) %{
+instruct vsrl2L(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (URShiftVL dst shift));
format %{ "psrlq $dst,$shift\t! logical right shift packed2L" %}
@@ -4207,7 +4234,7 @@ instruct vsrl2L_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsrl2L_reg(vecX dst, vecX src, regF shift) %{
+instruct vsrl2L_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (URShiftVL src shift));
format %{ "vpsrlq $dst,$src,$shift\t! logical right shift packed2L" %}
@@ -4229,7 +4256,7 @@ instruct vsrl2L_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsrl4L_reg(vecY dst, vecY src, regF shift) %{
+instruct vsrl4L_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 4);
match(Set dst (URShiftVL src shift));
format %{ "vpsrlq $dst,$src,$shift\t! logical right shift packed4L" %}
@@ -4254,7 +4281,7 @@ instruct vsrl4L_reg_imm(vecY dst, vecY src, immI8 shift) %{
// ------------------- ArithmeticRightShift -----------------------------------
// Shorts/Chars vector arithmetic right shift
-instruct vsra2S(vecS dst, regF shift) %{
+instruct vsra2S(vecS dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (RShiftVS dst shift));
format %{ "psraw $dst,$shift\t! arithmetic right shift packed2S" %}
@@ -4274,7 +4301,7 @@ instruct vsra2S_imm(vecS dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra2S_reg(vecS dst, vecS src, regF shift) %{
+instruct vsra2S_reg(vecS dst, vecS src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (RShiftVS src shift));
format %{ "vpsraw $dst,$src,$shift\t! arithmetic right shift packed2S" %}
@@ -4296,7 +4323,7 @@ instruct vsra2S_reg_imm(vecS dst, vecS src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra4S(vecD dst, regF shift) %{
+instruct vsra4S(vecD dst, vecS shift) %{
predicate(n->as_Vector()->length() == 4);
match(Set dst (RShiftVS dst shift));
format %{ "psraw $dst,$shift\t! arithmetic right shift packed4S" %}
@@ -4316,7 +4343,7 @@ instruct vsra4S_imm(vecD dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra4S_reg(vecD dst, vecD src, regF shift) %{
+instruct vsra4S_reg(vecD dst, vecD src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 4);
match(Set dst (RShiftVS src shift));
format %{ "vpsraw $dst,$src,$shift\t! arithmetic right shift packed4S" %}
@@ -4338,7 +4365,7 @@ instruct vsra4S_reg_imm(vecD dst, vecD src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra8S(vecX dst, regF shift) %{
+instruct vsra8S(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 8);
match(Set dst (RShiftVS dst shift));
format %{ "psraw $dst,$shift\t! arithmetic right shift packed8S" %}
@@ -4358,7 +4385,7 @@ instruct vsra8S_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra8S_reg(vecX dst, vecX src, regF shift) %{
+instruct vsra8S_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 8);
match(Set dst (RShiftVS src shift));
format %{ "vpsraw $dst,$src,$shift\t! arithmetic right shift packed8S" %}
@@ -4380,7 +4407,7 @@ instruct vsra8S_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra16S_reg(vecY dst, vecY src, regF shift) %{
+instruct vsra16S_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 16);
match(Set dst (RShiftVS src shift));
format %{ "vpsraw $dst,$src,$shift\t! arithmetic right shift packed16S" %}
@@ -4403,7 +4430,7 @@ instruct vsra16S_reg_imm(vecY dst, vecY src, immI8 shift) %{
%}
// Integers vector arithmetic right shift
-instruct vsra2I(vecD dst, regF shift) %{
+instruct vsra2I(vecD dst, vecS shift) %{
predicate(n->as_Vector()->length() == 2);
match(Set dst (RShiftVI dst shift));
format %{ "psrad $dst,$shift\t! arithmetic right shift packed2I" %}
@@ -4423,7 +4450,7 @@ instruct vsra2I_imm(vecD dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra2I_reg(vecD dst, vecD src, regF shift) %{
+instruct vsra2I_reg(vecD dst, vecD src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 2);
match(Set dst (RShiftVI src shift));
format %{ "vpsrad $dst,$src,$shift\t! arithmetic right shift packed2I" %}
@@ -4445,7 +4472,7 @@ instruct vsra2I_reg_imm(vecD dst, vecD src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra4I(vecX dst, regF shift) %{
+instruct vsra4I(vecX dst, vecS shift) %{
predicate(n->as_Vector()->length() == 4);
match(Set dst (RShiftVI dst shift));
format %{ "psrad $dst,$shift\t! arithmetic right shift packed4I" %}
@@ -4465,7 +4492,7 @@ instruct vsra4I_imm(vecX dst, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra4I_reg(vecX dst, vecX src, regF shift) %{
+instruct vsra4I_reg(vecX dst, vecX src, vecS shift) %{
predicate(UseAVX > 0 && n->as_Vector()->length() == 4);
match(Set dst (RShiftVI src shift));
format %{ "vpsrad $dst,$src,$shift\t! arithmetic right shift packed4I" %}
@@ -4487,7 +4514,7 @@ instruct vsra4I_reg_imm(vecX dst, vecX src, immI8 shift) %{
ins_pipe( pipe_slow );
%}
-instruct vsra8I_reg(vecY dst, vecY src, regF shift) %{
+instruct vsra8I_reg(vecY dst, vecY src, vecS shift) %{
predicate(UseAVX > 1 && n->as_Vector()->length() == 8);
match(Set dst (RShiftVI src shift));
format %{ "vpsrad $dst,$src,$shift\t! arithmetic right shift packed8I" %}
diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad
index e82d799ec08..dafac776c56 100644
--- a/hotspot/src/cpu/x86/vm/x86_32.ad
+++ b/hotspot/src/cpu/x86/vm/x86_32.ad
@@ -1424,6 +1424,11 @@ bool Matcher::narrow_oop_use_complex_address() {
return true;
}
+bool Matcher::narrow_klass_use_complex_address() {
+ ShouldNotCallThis();
+ return true;
+}
+
// Is it better to copy float constants, or load them directly from memory?
// Intel can load a float constant from a direct address, requiring no
@@ -1553,9 +1558,6 @@ const RegMask Matcher::method_handle_invoke_SP_save_mask() {
// Returns true if the high 32 bits of the value is known to be zero.
bool is_operand_hi32_zero(Node* n) {
int opc = n->Opcode();
- if (opc == Op_LoadUI2L) {
- return true;
- }
if (opc == Op_AndL) {
Node* o2 = n->in(2);
if (o2->is_Con() && (o2->get_long() & 0xFFFFFFFF00000000LL) == 0LL) {
@@ -6147,8 +6149,8 @@ instruct loadI2L_immI(eRegL dst, memory mem, immI mask, eFlagsReg cr) %{
%}
// Load Unsigned Integer into Long Register
-instruct loadUI2L(eRegL dst, memory mem, eFlagsReg cr) %{
- match(Set dst (LoadUI2L mem));
+instruct loadUI2L(eRegL dst, memory mem, immL_32bits mask, eFlagsReg cr) %{
+ match(Set dst (AndL (ConvI2L (LoadI mem)) mask));
effect(KILL cr);
ins_cost(250);
@@ -7762,6 +7764,7 @@ instruct storeLConditional( memory mem, eADXRegL oldval, eBCXRegL newval, eFlags
// No flag versions for CompareAndSwap{P,I,L} because matcher can't match them
instruct compareAndSwapL( rRegI res, eSIRegP mem_ptr, eADXRegL oldval, eBCXRegL newval, eFlagsReg cr ) %{
+ predicate(VM_Version::supports_cx8());
match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
format %{ "CMPXCHG8 [$mem_ptr],$newval\t# If EDX:EAX==[$mem_ptr] Then store $newval into [$mem_ptr]\n\t"
@@ -7798,6 +7801,47 @@ instruct compareAndSwapI( rRegI res, pRegP mem_ptr, eAXRegI oldval, eCXRegI newv
ins_pipe( pipe_cmpxchg );
%}
+instruct xaddI_no_res( memory mem, Universe dummy, immI add, eFlagsReg cr) %{
+ predicate(n->as_LoadStore()->result_not_used());
+ match(Set dummy (GetAndAddI mem add));
+ effect(KILL cr);
+ format %{ "ADDL [$mem],$add" %}
+ ins_encode %{
+ if (os::is_MP()) { __ lock(); }
+ __ addl($mem$$Address, $add$$constant);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xaddI( memory mem, rRegI newval, eFlagsReg cr) %{
+ match(Set newval (GetAndAddI mem newval));
+ effect(KILL cr);
+ format %{ "XADDL [$mem],$newval" %}
+ ins_encode %{
+ if (os::is_MP()) { __ lock(); }
+ __ xaddl($mem$$Address, $newval$$Register);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xchgI( memory mem, rRegI newval) %{
+ match(Set newval (GetAndSetI mem newval));
+ format %{ "XCHGL $newval,[$mem]" %}
+ ins_encode %{
+ __ xchgl($newval$$Register, $mem$$Address);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xchgP( memory mem, pRegP newval) %{
+ match(Set newval (GetAndSetP mem newval));
+ format %{ "XCHGL $newval,[$mem]" %}
+ ins_encode %{
+ __ xchgl($newval$$Register, $mem$$Address);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
//----------Subtraction Instructions-------------------------------------------
// Integer Subtraction Instructions
instruct subI_eReg(rRegI dst, rRegI src, eFlagsReg cr) %{
@@ -12103,8 +12147,8 @@ instruct partialSubtypeCheck( eDIRegP result, eSIRegP sub, eAXRegP super, eCXReg
ins_cost(1100); // slightly larger than the next version
format %{ "MOV EDI,[$sub+Klass::secondary_supers]\n\t"
- "MOV ECX,[EDI+arrayKlass::length]\t# length to scan\n\t"
- "ADD EDI,arrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
+ "MOV ECX,[EDI+ArrayKlass::length]\t# length to scan\n\t"
+ "ADD EDI,ArrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
"REPNE SCASD\t# Scan *EDI++ for a match with EAX while CX-- != 0\n\t"
"JNE,s miss\t\t# Missed: EDI not-zero\n\t"
"MOV [$sub+Klass::secondary_super_cache],$super\t# Hit: update cache\n\t"
@@ -12122,8 +12166,8 @@ instruct partialSubtypeCheck_vs_Zero( eFlagsReg cr, eSIRegP sub, eAXRegP super,
ins_cost(1000);
format %{ "MOV EDI,[$sub+Klass::secondary_supers]\n\t"
- "MOV ECX,[EDI+arrayKlass::length]\t# length to scan\n\t"
- "ADD EDI,arrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
+ "MOV ECX,[EDI+ArrayKlass::length]\t# length to scan\n\t"
+ "ADD EDI,ArrayKlass::base_offset\t# Skip to start of data; set NZ in case count is zero\n\t"
"REPNE SCASD\t# Scan *EDI++ for a match with EAX while CX-- != 0\n\t"
"JNE,s miss\t\t# Missed: flags NZ\n\t"
"MOV [$sub+Klass::secondary_super_cache],$super\t# Hit: update cache, flags Z\n\t"
diff --git a/hotspot/src/cpu/x86/vm/x86_64.ad b/hotspot/src/cpu/x86/vm/x86_64.ad
index 8c0fb376f3b..5b05ec22293 100644
--- a/hotspot/src/cpu/x86/vm/x86_64.ad
+++ b/hotspot/src/cpu/x86/vm/x86_64.ad
@@ -1409,10 +1409,10 @@ uint reloc_java_to_interp()
#ifndef PRODUCT
void MachUEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
{
- if (UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
st->print_cr("movl rscratch1, [j_rarg0 + oopDesc::klass_offset_in_bytes()]\t# compressed klass");
- if (Universe::narrow_oop_shift() != 0) {
- st->print_cr("\tdecode_heap_oop_not_null rscratch1, rscratch1");
+ if (Universe::narrow_klass_shift() != 0) {
+ st->print_cr("\tdecode_klass_not_null rscratch1, rscratch1");
}
st->print_cr("\tcmpq rax, rscratch1\t # Inline cache check");
} else {
@@ -1428,7 +1428,7 @@ void MachUEPNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const
{
MacroAssembler masm(&cbuf);
uint insts_size = cbuf.insts_size();
- if (UseCompressedOops) {
+ if (UseCompressedKlassPointers) {
masm.load_klass(rscratch1, j_rarg0);
masm.cmpptr(rax, rscratch1);
} else {
@@ -1576,6 +1576,11 @@ bool Matcher::narrow_oop_use_complex_address() {
return (LogMinObjAlignmentInBytes <= 3);
}
+bool Matcher::narrow_klass_use_complex_address() {
+ assert(UseCompressedKlassPointers, "only for compressed klass code");
+ return (LogKlassAlignmentInBytes <= 3);
+}
+
// Is it better to copy float constants, or load them directly from
// memory? Intel can load a float constant from a direct address,
// requiring no extra registers. Most RISCs will have to materialize
@@ -3139,6 +3144,14 @@ operand immN() %{
interface(CONST_INTER);
%}
+operand immNKlass() %{
+ match(ConNKlass);
+
+ op_cost(10);
+ format %{ %}
+ interface(CONST_INTER);
+%}
+
// NULL Pointer Immediate
operand immN0() %{
predicate(n->get_narrowcon() == 0);
@@ -4038,6 +4051,145 @@ operand indPosIndexScaleOffsetNarrow(rRegN reg, immL32 off, rRegI idx, immI2 sca
%}
%}
+operand indirectNarrowKlass(rRegN reg)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(DecodeNKlass reg);
+
+ format %{ "[$reg]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x4);
+ scale(0x0);
+ disp(0x0);
+ %}
+%}
+
+operand indOffset8NarrowKlass(rRegN reg, immL8 off)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) off);
+
+ format %{ "[$reg + $off (8-bit)]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x4);
+ scale(0x0);
+ disp($off);
+ %}
+%}
+
+operand indOffset32NarrowKlass(rRegN reg, immL32 off)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) off);
+
+ format %{ "[$reg + $off (32-bit)]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index(0x4);
+ scale(0x0);
+ disp($off);
+ %}
+%}
+
+operand indIndexOffsetNarrowKlass(rRegN reg, rRegL lreg, immL32 off)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (AddP (DecodeNKlass reg) lreg) off);
+
+ op_cost(10);
+ format %{"[$reg + $off + $lreg]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale(0x0);
+ disp($off);
+ %}
+%}
+
+operand indIndexNarrowKlass(rRegN reg, rRegL lreg)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) lreg);
+
+ op_cost(10);
+ format %{"[$reg + $lreg]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale(0x0);
+ disp(0x0);
+ %}
+%}
+
+operand indIndexScaleNarrowKlass(rRegN reg, rRegL lreg, immI2 scale)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) (LShiftL lreg scale));
+
+ op_cost(10);
+ format %{"[$reg + $lreg << $scale]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale($scale);
+ disp(0x0);
+ %}
+%}
+
+operand indIndexScaleOffsetNarrowKlass(rRegN reg, immL32 off, rRegL lreg, immI2 scale)
+%{
+ predicate(Universe::narrow_klass_shift() == 0);
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (AddP (DecodeNKlass reg) (LShiftL lreg scale)) off);
+
+ op_cost(10);
+ format %{"[$reg + $off + $lreg << $scale]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($lreg);
+ scale($scale);
+ disp($off);
+ %}
+%}
+
+operand indCompressedKlassOffset(rRegN reg, immL32 off) %{
+ predicate(UseCompressedKlassPointers && (Universe::narrow_klass_shift() == Address::times_8));
+ constraint(ALLOC_IN_RC(ptr_reg));
+ match(AddP (DecodeNKlass reg) off);
+
+ op_cost(10);
+ format %{"[R12 + $reg << 3 + $off] (compressed klass addressing)" %}
+ interface(MEMORY_INTER) %{
+ base(0xc); // R12
+ index($reg);
+ scale(0x3);
+ disp($off);
+ %}
+%}
+
+operand indPosIndexScaleOffsetNarrowKlass(rRegN reg, immL32 off, rRegI idx, immI2 scale)
+%{
+ constraint(ALLOC_IN_RC(ptr_reg));
+ predicate(Universe::narrow_klass_shift() == 0 && n->in(2)->in(3)->in(1)->as_Type()->type()->is_long()->_lo >= 0);
+ match(AddP (AddP (DecodeNKlass reg) (LShiftL (ConvI2L idx) scale)) off);
+
+ op_cost(10);
+ format %{"[$reg + $off + $idx << $scale]" %}
+ interface(MEMORY_INTER) %{
+ base($reg);
+ index($idx);
+ scale($scale);
+ disp($off);
+ %}
+%}
//----------Special Memory Operands--------------------------------------------
// Stack Slot Operand - This operand is used for loading and storing temporary
@@ -4209,7 +4361,11 @@ opclass memory(indirect, indOffset8, indOffset32, indIndexOffset, indIndex,
indCompressedOopOffset,
indirectNarrow, indOffset8Narrow, indOffset32Narrow,
indIndexOffsetNarrow, indIndexNarrow, indIndexScaleNarrow,
- indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow);
+ indIndexScaleOffsetNarrow, indPosIndexScaleOffsetNarrow,
+ indCompressedKlassOffset,
+ indirectNarrowKlass, indOffset8NarrowKlass, indOffset32NarrowKlass,
+ indIndexOffsetNarrowKlass, indIndexNarrowKlass, indIndexScaleNarrowKlass,
+ indIndexScaleOffsetNarrowKlass, indPosIndexScaleOffsetNarrowKlass);
//----------PIPELINE-----------------------------------------------------------
// Rules which define the behavior of the target architectures pipeline.
@@ -5044,9 +5200,9 @@ instruct loadI2L_immI(rRegL dst, memory mem, immI mask, rFlagsReg cr) %{
%}
// Load Unsigned Integer into Long Register
-instruct loadUI2L(rRegL dst, memory mem)
+instruct loadUI2L(rRegL dst, memory mem, immL_32bits mask)
%{
- match(Set dst (LoadUI2L mem));
+ match(Set dst (AndL (ConvI2L (LoadI mem)) mask));
ins_cost(125);
format %{ "movl $dst, $mem\t# uint -> long" %}
@@ -5469,6 +5625,22 @@ instruct loadConN(rRegN dst, immN src) %{
ins_pipe(ialu_reg_fat); // XXX
%}
+instruct loadConNKlass(rRegN dst, immNKlass src) %{
+ match(Set dst src);
+
+ ins_cost(125);
+ format %{ "movl $dst, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ address con = (address)$src$$constant;
+ if (con == NULL) {
+ ShouldNotReachHere();
+ } else {
+ __ set_narrow_klass($dst$$Register, (Klass*)$src$$constant);
+ }
+ %}
+ ins_pipe(ialu_reg_fat); // XXX
+%}
+
instruct loadConF0(regF dst, immF0 src)
%{
match(Set dst src);
@@ -5738,7 +5910,7 @@ instruct storeP(memory mem, any_RegP src)
instruct storeImmP0(memory mem, immP0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreP mem zero));
ins_cost(125); // XXX
@@ -5774,9 +5946,21 @@ instruct storeN(memory mem, rRegN src)
ins_pipe(ialu_mem_reg);
%}
+instruct storeNKlass(memory mem, rRegN src)
+%{
+ match(Set mem (StoreNKlass mem src));
+
+ ins_cost(125); // XXX
+ format %{ "movl $mem, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ __ movl($mem$$Address, $src$$Register);
+ %}
+ ins_pipe(ialu_mem_reg);
+%}
+
instruct storeImmN0(memory mem, immN0 zero)
%{
- predicate(Universe::narrow_oop_base() == NULL);
+ predicate(Universe::narrow_oop_base() == NULL && Universe::narrow_klass_base() == NULL);
match(Set mem (StoreN mem zero));
ins_cost(125); // XXX
@@ -5804,10 +5988,22 @@ instruct storeImmN(memory mem, immN src)
ins_pipe(ialu_mem_imm);
%}
+instruct storeImmNKlass(memory mem, immNKlass src)
+%{
+ match(Set mem (StoreNKlass mem src));
+
+ ins_cost(150); // XXX
+ format %{ "movl $mem, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ __ set_narrow_klass($mem$$Address, (Klass*)$src$$constant);
+ %}
+ ins_pipe(ialu_mem_imm);
+%}
+
// Store Integer Immediate
instruct storeImmI0(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreI mem zero));
ins_cost(125); // XXX
@@ -5832,7 +6028,7 @@ instruct storeImmI(memory mem, immI src)
// Store Long Immediate
instruct storeImmL0(memory mem, immL0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreL mem zero));
ins_cost(125); // XXX
@@ -5857,7 +6053,7 @@ instruct storeImmL(memory mem, immL32 src)
// Store Short/Char Immediate
instruct storeImmC0(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreC mem zero));
ins_cost(125); // XXX
@@ -5883,7 +6079,7 @@ instruct storeImmI16(memory mem, immI16 src)
// Store Byte Immediate
instruct storeImmB0(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreB mem zero));
ins_cost(125); // XXX
@@ -5908,7 +6104,7 @@ instruct storeImmB(memory mem, immI8 src)
// Store CMS card-mark Immediate
instruct storeImmCM0_reg(memory mem, immI0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreCM mem zero));
ins_cost(125); // XXX
@@ -5946,7 +6142,7 @@ instruct storeF(memory mem, regF src)
// Store immediate Float value (it is faster than store from XMM register)
instruct storeF0(memory mem, immF0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreF mem zero));
ins_cost(25); // XXX
@@ -5996,7 +6192,7 @@ instruct storeD0_imm(memory mem, immD0 src)
instruct storeD0(memory mem, immD0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set mem (StoreD mem zero));
ins_cost(25); // XXX
@@ -6482,6 +6678,32 @@ instruct decodeHeapOop_not_null(rRegP dst, rRegN src, rFlagsReg cr) %{
ins_pipe(ialu_reg_long);
%}
+instruct encodeKlass_not_null(rRegN dst, rRegP src, rFlagsReg cr) %{
+ match(Set dst (EncodePKlass src));
+ effect(KILL cr);
+ format %{ "encode_heap_oop_not_null $dst,$src" %}
+ ins_encode %{
+ __ encode_klass_not_null($dst$$Register, $src$$Register);
+ %}
+ ins_pipe(ialu_reg_long);
+%}
+
+instruct decodeKlass_not_null(rRegP dst, rRegN src, rFlagsReg cr) %{
+ match(Set dst (DecodeNKlass src));
+ effect(KILL cr);
+ format %{ "decode_heap_oop_not_null $dst,$src" %}
+ ins_encode %{
+ Register s = $src$$Register;
+ Register d = $dst$$Register;
+ if (s != d) {
+ __ decode_klass_not_null(d, s);
+ } else {
+ __ decode_klass_not_null(d);
+ }
+ %}
+ ins_pipe(ialu_reg_long);
+%}
+
//----------Conditional Move---------------------------------------------------
// Jump
@@ -7242,6 +7464,7 @@ instruct compareAndSwapP(rRegI res,
rax_RegP oldval, rRegP newval,
rFlagsReg cr)
%{
+ predicate(VM_Version::supports_cx8());
match(Set res (CompareAndSwapP mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
@@ -7265,6 +7488,7 @@ instruct compareAndSwapL(rRegI res,
rax_RegL oldval, rRegL newval,
rFlagsReg cr)
%{
+ predicate(VM_Version::supports_cx8());
match(Set res (CompareAndSwapL mem_ptr (Binary oldval newval)));
effect(KILL cr, KILL oldval);
@@ -7329,6 +7553,88 @@ instruct compareAndSwapN(rRegI res,
ins_pipe( pipe_cmpxchg );
%}
+instruct xaddI_no_res( memory mem, Universe dummy, immI add, rFlagsReg cr) %{
+ predicate(n->as_LoadStore()->result_not_used());
+ match(Set dummy (GetAndAddI mem add));
+ effect(KILL cr);
+ format %{ "ADDL [$mem],$add" %}
+ ins_encode %{
+ if (os::is_MP()) { __ lock(); }
+ __ addl($mem$$Address, $add$$constant);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xaddI( memory mem, rRegI newval, rFlagsReg cr) %{
+ match(Set newval (GetAndAddI mem newval));
+ effect(KILL cr);
+ format %{ "XADDL [$mem],$newval" %}
+ ins_encode %{
+ if (os::is_MP()) { __ lock(); }
+ __ xaddl($mem$$Address, $newval$$Register);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xaddL_no_res( memory mem, Universe dummy, immL add, rFlagsReg cr) %{
+ predicate(n->as_LoadStore()->result_not_used());
+ match(Set dummy (GetAndAddL mem add));
+ effect(KILL cr);
+ format %{ "ADDQ [$mem],$add" %}
+ ins_encode %{
+ if (os::is_MP()) { __ lock(); }
+ __ addq($mem$$Address, $add$$constant);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xaddL( memory mem, rRegL newval, rFlagsReg cr) %{
+ match(Set newval (GetAndAddL mem newval));
+ effect(KILL cr);
+ format %{ "XADDQ [$mem],$newval" %}
+ ins_encode %{
+ if (os::is_MP()) { __ lock(); }
+ __ xaddq($mem$$Address, $newval$$Register);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xchgI( memory mem, rRegI newval) %{
+ match(Set newval (GetAndSetI mem newval));
+ format %{ "XCHGL $newval,[$mem]" %}
+ ins_encode %{
+ __ xchgl($newval$$Register, $mem$$Address);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xchgL( memory mem, rRegL newval) %{
+ match(Set newval (GetAndSetL mem newval));
+ format %{ "XCHGL $newval,[$mem]" %}
+ ins_encode %{
+ __ xchgq($newval$$Register, $mem$$Address);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xchgP( memory mem, rRegP newval) %{
+ match(Set newval (GetAndSetP mem newval));
+ format %{ "XCHGQ $newval,[$mem]" %}
+ ins_encode %{
+ __ xchgq($newval$$Register, $mem$$Address);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
+instruct xchgN( memory mem, rRegN newval) %{
+ match(Set newval (GetAndSetN mem newval));
+ format %{ "XCHGL $newval,$mem]" %}
+ ins_encode %{
+ __ xchgl($newval$$Register, $mem$$Address);
+ %}
+ ins_pipe( pipe_cmpxchg );
+%}
+
//----------Subtraction Instructions-------------------------------------------
// Integer Subtraction Instructions
@@ -10368,7 +10674,7 @@ instruct testP_mem(rFlagsReg cr, memory op, immP0 zero)
instruct testP_mem_reg0(rFlagsReg cr, memory mem, immP0 zero)
%{
- predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL));
+ predicate(UseCompressedOops && (Universe::narrow_oop_base() == NULL) && (Universe::narrow_klass_base() == NULL));
match(Set cr (CmpP (LoadP mem) zero));
format %{ "cmpq R12, $mem\t# ptr (R12_heapbase==0)" %}
@@ -10419,6 +10725,27 @@ instruct compN_mem_imm(rFlagsRegU cr, memory mem, immN src)
ins_pipe(ialu_cr_reg_mem);
%}
+instruct compN_rReg_imm_klass(rFlagsRegU cr, rRegN op1, immNKlass op2) %{
+ match(Set cr (CmpN op1 op2));
+
+ format %{ "cmpl $op1, $op2\t# compressed klass ptr" %}
+ ins_encode %{
+ __ cmp_narrow_klass($op1$$Register, (Klass*)$op2$$constant);
+ %}
+ ins_pipe(ialu_cr_reg_imm);
+%}
+
+instruct compN_mem_imm_klass(rFlagsRegU cr, memory mem, immNKlass src)
+%{
+ match(Set cr (CmpN src (LoadNKlass mem)));
+
+ format %{ "cmpl $mem, $src\t# compressed klass ptr" %}
+ ins_encode %{
+ __ cmp_narrow_klass($mem$$Address, (Klass*)$src$$constant);
+ %}
+ ins_pipe(ialu_cr_reg_mem);
+%}
+
instruct testN_reg(rFlagsReg cr, rRegN src, immN0 zero) %{
match(Set cr (CmpN src zero));
@@ -10442,7 +10769,7 @@ instruct testN_mem(rFlagsReg cr, memory mem, immN0 zero)
instruct testN_mem_reg0(rFlagsReg cr, memory mem, immN0 zero)
%{
- predicate(Universe::narrow_oop_base() == NULL);
+ predicate(Universe::narrow_oop_base() == NULL && (Universe::narrow_klass_base() == NULL));
match(Set cr (CmpN (LoadN mem) zero));
format %{ "cmpl R12, $mem\t# compressed ptr (R12_heapbase==0)" %}
diff --git a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp
index 322f62ce8cc..eb170370630 100644
--- a/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/interpreterGenerator_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
diff --git a/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp b/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp
index 086f3375f6d..a71fce34f12 100644
--- a/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp
+++ b/hotspot/src/cpu/zero/vm/methodHandles_zero.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
diff --git a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp
index 7f2960fbdf1..a21245afdc1 100644
--- a/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp
+++ b/hotspot/src/os/bsd/dtrace/generateJvmOffsets.cpp
@@ -267,8 +267,8 @@ int generateJvmOffsets(GEN_variant gen_variant) {
printf("\n");
- GEN_OFFS(NarrowOopStruct, _base);
- GEN_OFFS(NarrowOopStruct, _shift);
+ GEN_OFFS(NarrowPtrStruct, _base);
+ GEN_OFFS(NarrowPtrStruct, _shift);
printf("\n");
GEN_VALUE(SIZE_HeapBlockHeader, (int) sizeof(HeapBlock::Header));
diff --git a/hotspot/src/os/bsd/dtrace/jhelper.d b/hotspot/src/os/bsd/dtrace/jhelper.d
index a5cb9b7de8f..9ff6bd5434d 100644
--- a/hotspot/src/os/bsd/dtrace/jhelper.d
+++ b/hotspot/src/os/bsd/dtrace/jhelper.d
@@ -45,10 +45,6 @@ extern pointer __JvmOffsets;
extern pointer __1cJCodeCacheF_heap_;
extern pointer __1cIUniverseO_collectedHeap_;
-extern pointer __1cIUniverseL_narrow_oop_;
-#ifdef _LP64
-extern pointer UseCompressedOops;
-#endif
extern pointer __1cHnmethodG__vtbl_;
extern pointer __1cNMethodG__vtbl_;
@@ -136,8 +132,8 @@ dtrace:helper:ustack:
copyin_offset(SIZE_oopDesc);
copyin_offset(SIZE_ConstantPool);
- copyin_offset(OFFSET_NarrowOopStruct_base);
- copyin_offset(OFFSET_NarrowOopStruct_shift);
+ copyin_offset(OFFSET_NarrowPtrStruct_base);
+ copyin_offset(OFFSET_NarrowPtrStruct_shift);
/*
* The PC to translate is in arg0.
@@ -159,17 +155,6 @@ dtrace:helper:ustack:
this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
/* Reading volatile values */
-#ifdef _LP64
- this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
-#else
- this->Use_Compressed_Oops = 0;
-#endif
-
- this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_base);
- this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_shift);
-
this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
diff --git a/hotspot/src/os/bsd/launcher/Info-privileged.plist b/hotspot/src/os/bsd/launcher/Info-privileged.plist
new file mode 100644
index 00000000000..9b2fc0a32fc
--- /dev/null
+++ b/hotspot/src/os/bsd/launcher/Info-privileged.plist
@@ -0,0 +1,18 @@
+
+
+
+
+ CFBundleIdentifier
+ net.java.openjdk.cmd
+ CFBundleInfoDictionaryVersion
+ 6.0
+ CFBundleName
+ OpenJDK Command
+ CFBundleShortVersionString
+ 1.0
+ CFBundleVersion
+ 1.0
+ SecTaskAccess
+ allowed
+
+
diff --git a/hotspot/src/os/bsd/vm/decoder_machO.cpp b/hotspot/src/os/bsd/vm/decoder_machO.cpp
index 75250d19514..b475f23ff94 100644
--- a/hotspot/src/os/bsd/vm/decoder_machO.cpp
+++ b/hotspot/src/os/bsd/vm/decoder_machO.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp
index a1c41218270..984e25cb942 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp
@@ -82,12 +82,6 @@
# include "assembler_ppc.inline.hpp"
# include "nativeInst_ppc.hpp"
#endif
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
// put OS-includes here
# include
diff --git a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp
index 9980d4631a2..651059fbe8a 100644
--- a/hotspot/src/os/bsd/vm/os_bsd.inline.hpp
+++ b/hotspot/src/os/bsd/vm/os_bsd.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
index e9db634135f..123e6e289bf 100644
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
+++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
diff --git a/hotspot/src/os/linux/vm/decoder_linux.cpp b/hotspot/src/os/linux/vm/decoder_linux.cpp
index e4623969456..915593a4e9a 100644
--- a/hotspot/src/os/linux/vm/decoder_linux.cpp
+++ b/hotspot/src/os/linux/vm/decoder_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp
index df6eb0e71c8..d2f92f8f51b 100644
--- a/hotspot/src/os/linux/vm/os_linux.cpp
+++ b/hotspot/src/os/linux/vm/os_linux.cpp
@@ -82,12 +82,6 @@
# include "assembler_ppc.inline.hpp"
# include "nativeInst_ppc.hpp"
#endif
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
// put OS-includes here
# include
diff --git a/hotspot/src/os/linux/vm/os_linux.inline.hpp b/hotspot/src/os/linux/vm/os_linux.inline.hpp
index c663c9b6961..ba56240dc8e 100644
--- a/hotspot/src/os/linux/vm/os_linux.inline.hpp
+++ b/hotspot/src/os/linux/vm/os_linux.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp
index 8839aac6c10..2adae8d18af 100644
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
diff --git a/hotspot/src/os/linux/vm/vmError_linux.cpp b/hotspot/src/os/linux/vm/vmError_linux.cpp
index 8ec6ca04c25..378c9a6ab6a 100644
--- a/hotspot/src/os/linux/vm/vmError_linux.cpp
+++ b/hotspot/src/os/linux/vm/vmError_linux.cpp
@@ -44,7 +44,7 @@ void VMError::show_message_box(char *buf, int buflen) {
jio_snprintf(p, buflen - len,
"\n\n"
"Do you want to debug the problem?\n\n"
- "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " INTX_FORMAT " (" INTPTR_FORMAT ")\n"
+ "To debug, run 'gdb /proc/%d/exe %d'; then switch to thread " UINTX_FORMAT " (" INTPTR_FORMAT ")\n"
"Enter 'yes' to launch gdb automatically (PATH must include gdb)\n"
"Otherwise, press RETURN to abort...",
os::current_process_id(), os::current_process_id(),
diff --git a/hotspot/src/os/posix/launcher/java_md.c b/hotspot/src/os/posix/launcher/java_md.c
index 8b1542e8d9e..970222c4fd3 100644
--- a/hotspot/src/os/posix/launcher/java_md.c
+++ b/hotspot/src/os/posix/launcher/java_md.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os/posix/launcher/launcher.script b/hotspot/src/os/posix/launcher/launcher.script
index 4f5fff8b13e..0a2ae5f4d6b 100644
--- a/hotspot/src/os/posix/launcher/launcher.script
+++ b/hotspot/src/os/posix/launcher/launcher.script
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 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
diff --git a/hotspot/src/os/posix/vm/os_posix.cpp b/hotspot/src/os/posix/vm/os_posix.cpp
index ce355c1cc9f..cbffa3279af 100644
--- a/hotspot/src/os/posix/vm/os_posix.cpp
+++ b/hotspot/src/os/posix/vm/os_posix.cpp
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+* Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os/posix/vm/os_posix.hpp b/hotspot/src/os/posix/vm/os_posix.hpp
index 62ec7135d14..c7d1d6bd741 100644
--- a/hotspot/src/os/posix/vm/os_posix.hpp
+++ b/hotspot/src/os/posix/vm/os_posix.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
index 2626559d46c..1a269539695 100644
--- a/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
+++ b/hotspot/src/os/solaris/dtrace/generateJvmOffsets.cpp
@@ -262,8 +262,8 @@ int generateJvmOffsets(GEN_variant gen_variant) {
printf("\n");
- GEN_OFFS(NarrowOopStruct, _base);
- GEN_OFFS(NarrowOopStruct, _shift);
+ GEN_OFFS(NarrowPtrStruct, _base);
+ GEN_OFFS(NarrowPtrStruct, _shift);
printf("\n");
GEN_VALUE(SIZE_HeapBlockHeader, sizeof(HeapBlock::Header));
diff --git a/hotspot/src/os/solaris/dtrace/hs_private.d b/hotspot/src/os/solaris/dtrace/hs_private.d
index df395e5c045..89304368ddb 100644
--- a/hotspot/src/os/solaris/dtrace/hs_private.d
+++ b/hotspot/src/os/solaris/dtrace/hs_private.d
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 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
diff --git a/hotspot/src/os/solaris/dtrace/jhelper.d b/hotspot/src/os/solaris/dtrace/jhelper.d
index c6e8cd7438f..976a832107f 100644
--- a/hotspot/src/os/solaris/dtrace/jhelper.d
+++ b/hotspot/src/os/solaris/dtrace/jhelper.d
@@ -45,10 +45,6 @@ extern pointer __JvmOffsets;
extern pointer __1cJCodeCacheF_heap_;
extern pointer __1cIUniverseO_collectedHeap_;
-extern pointer __1cIUniverseL_narrow_oop_;
-#ifdef _LP64
-extern pointer UseCompressedOops;
-#endif
extern pointer __1cHnmethodG__vtbl_;
extern pointer __1cGMethodG__vtbl_;
@@ -136,8 +132,8 @@ dtrace:helper:ustack:
copyin_offset(SIZE_oopDesc);
copyin_offset(SIZE_ConstantPool);
- copyin_offset(OFFSET_NarrowOopStruct_base);
- copyin_offset(OFFSET_NarrowOopStruct_shift);
+ copyin_offset(OFFSET_NarrowPtrStruct_base);
+ copyin_offset(OFFSET_NarrowPtrStruct_shift);
/*
* The PC to translate is in arg0.
@@ -158,18 +154,6 @@ dtrace:helper:ustack:
this->CodeCache_heap_address = copyin_ptr(&``__1cJCodeCacheF_heap_);
- /* Reading volatile values */
-#ifdef _LP64
- this->Use_Compressed_Oops = copyin_uint8(&``UseCompressedOops);
-#else
- this->Use_Compressed_Oops = 0;
-#endif
-
- this->Universe_narrow_oop_base = copyin_ptr(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_base);
- this->Universe_narrow_oop_shift = copyin_int32(&``__1cIUniverseL_narrow_oop_ +
- OFFSET_NarrowOopStruct_shift);
-
this->CodeCache_low = copyin_ptr(this->CodeCache_heap_address +
OFFSET_CodeHeap_memory + OFFSET_VirtualSpace_low);
diff --git a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
index b5b38bdc814..f90538efe77 100644
--- a/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/attachListener_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2010, 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
diff --git a/hotspot/src/os/solaris/vm/decoder_solaris.cpp b/hotspot/src/os/solaris/vm/decoder_solaris.cpp
index d700706a067..32b6e949531 100644
--- a/hotspot/src/os/solaris/vm/decoder_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/decoder_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp
index 68bd830cf1b..0483dcbfb34 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.cpp
@@ -70,12 +70,6 @@
# include "assembler_sparc.inline.hpp"
# include "nativeInst_sparc.hpp"
#endif
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
// put OS-includes here
# include
@@ -1488,11 +1482,11 @@ void _handle_uncaught_cxx_exception() {
// First crack at OS-specific initialization, from inside the new thread.
-void os::initialize_thread() {
+void os::initialize_thread(Thread* thr) {
int r = thr_main() ;
guarantee (r == 0 || r == 1, "CR6501650 or CR6493689") ;
if (r) {
- JavaThread* jt = (JavaThread *)Thread::current();
+ JavaThread* jt = (JavaThread *)thr;
assert(jt != NULL,"Sanity check");
size_t stack_size;
address base = jt->stack_base();
@@ -5876,15 +5870,6 @@ extern "C" {
}
}
-// Just to get the Kernel build to link on solaris for testing.
-
-extern "C" {
-class ASGCT_CallTrace;
-void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext)
- KERNEL_RETURN;
-}
-
-
// ObjectMonitor park-unpark infrastructure ...
//
// We implement Solaris and Linux PlatformEvents with the
diff --git a/hotspot/src/os/solaris/vm/os_solaris.hpp b/hotspot/src/os/solaris/vm/os_solaris.hpp
index 174f2529dbe..c1dff0cf193 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.hpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
index 2468100fc43..3454f6d7ba4 100644
--- a/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
+++ b/hotspot/src/os/solaris/vm/os_solaris.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
index c841ff8a1b6..c24789cbb17 100644
--- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
+++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
diff --git a/hotspot/src/os/windows/vm/decoder_windows.cpp b/hotspot/src/os/windows/vm/decoder_windows.cpp
index 6500e59302f..82ba909bc5c 100644
--- a/hotspot/src/os/windows/vm/decoder_windows.cpp
+++ b/hotspot/src/os/windows/vm/decoder_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/os/windows/vm/decoder_windows.hpp b/hotspot/src/os/windows/vm/decoder_windows.hpp
index ad80e5b9c12..b2c2638d8ab 100644
--- a/hotspot/src/os/windows/vm/decoder_windows.hpp
+++ b/hotspot/src/os/windows/vm/decoder_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/src/os/windows/vm/jvm_windows.h b/hotspot/src/os/windows/vm/jvm_windows.h
index 91039821558..737f34dddf2 100644
--- a/hotspot/src/os/windows/vm/jvm_windows.h
+++ b/hotspot/src/os/windows/vm/jvm_windows.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -61,8 +61,6 @@ typedef struct _MODULEINFO {
typedef int socklen_t;
-// #include "jni.h"
-
#define JNI_ONLOAD_SYMBOLS {"_JNI_OnLoad@8", "JNI_OnLoad"}
#define JNI_ONUNLOAD_SYMBOLS {"_JNI_OnUnload@8", "JNI_OnUnload"}
#define JVM_ONLOAD_SYMBOLS {"_JVM_OnLoad@12", "JVM_OnLoad"}
@@ -108,10 +106,7 @@ JVM_GetThreadInterruptEvent();
* File I/O
*/
-// #include
-// #include
-// #include
-// #include
+#include
/* O Flags */
diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp
index 5534a1ea0a1..dc31e27a6b7 100644
--- a/hotspot/src/os/windows/vm/os_windows.cpp
+++ b/hotspot/src/os/windows/vm/os_windows.cpp
@@ -69,12 +69,6 @@
# include "assembler_x86.inline.hpp"
# include "nativeInst_x86.hpp"
#endif
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
#ifdef _DEBUG
#include
diff --git a/hotspot/src/os/windows/vm/os_windows.hpp b/hotspot/src/os/windows/vm/os_windows.hpp
index 33ea7064ba6..f3196af9afc 100644
--- a/hotspot/src/os/windows/vm/os_windows.hpp
+++ b/hotspot/src/os/windows/vm/os_windows.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
diff --git a/hotspot/src/os/windows/vm/perfMemory_windows.cpp b/hotspot/src/os/windows/vm/perfMemory_windows.cpp
index 2358171b78a..2c75539d86a 100644
--- a/hotspot/src/os/windows/vm/perfMemory_windows.cpp
+++ b/hotspot/src/os/windows/vm/perfMemory_windows.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 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
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
index c6d31ab4f9a..b7b3e4c726f 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp
@@ -52,12 +52,6 @@
#include "thread_bsd.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
// put OS-includes here
# include
@@ -297,7 +291,7 @@ char* os::non_memory_address_word() {
return (char*) -1;
}
-void os::initialize_thread() {
+void os::initialize_thread(Thread* thr) {
// Nothing to do.
}
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp
index f109e246fae..cf83423bf3d 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.inline.hpp b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.inline.hpp
index 67b2482aaf3..145e608f547 100644
--- a/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.inline.hpp
+++ b/hotspot/src/os_cpu/bsd_x86/vm/os_bsd_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
index 4bb5a8abb24..51ea6e3f24e 100644
--- a/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
+++ b/hotspot/src/os_cpu/bsd_zero/vm/os_bsd_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -58,12 +58,6 @@
#include "thread_bsd.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
address os::current_stack_pointer() {
address dummy = (address) &dummy;
@@ -103,7 +97,7 @@ char* os::non_memory_address_word() {
#endif // SPARC
}
-void os::initialize_thread() {
+void os::initialize_thread(Thread* thr) {
// Nothing to do.
}
diff --git a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
index 11c90e522fc..894aec58868 100644
--- a/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
+++ b/hotspot/src/os_cpu/linux_sparc/vm/os_linux_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,13 +52,6 @@
#include "thread_linux.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
-
// Linux/Sparc has rather obscure naming of registers in sigcontext
// different between 32 and 64 bits
@@ -225,7 +218,7 @@ char* os::non_memory_address_word() {
return (char*) 0;
}
-void os::initialize_thread() {}
+void os::initialize_thread(Thread* thr) {}
void os::print_context(outputStream *st, void *context) {
if (context == NULL) return;
diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
index 93bb1f45919..126b2ab2a53 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,12 +52,6 @@
#include "thread_linux.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
// put OS-includes here
# include
@@ -114,7 +108,7 @@ char* os::non_memory_address_word() {
return (char*) -1;
}
-void os::initialize_thread() {
+void os::initialize_thread(Thread* thr) {
// Nothing to do.
}
diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp
index 9bb22f8e6ba..1d3fd350c68 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.inline.hpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.inline.hpp
index fee719b01b8..f6996fd1a25 100644
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.inline.hpp
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
index 203090ce079..86cb2b4eebb 100644
--- a/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
+++ b/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -53,12 +53,6 @@
#include "thread_linux.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
address os::current_stack_pointer() {
address dummy = (address) &dummy;
@@ -98,7 +92,7 @@ char* os::non_memory_address_word() {
#endif // SPARC
}
-void os::initialize_thread() {
+void os::initialize_thread(Thread * thr){
// Nothing to do.
}
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
index 752daf7bf67..0c8116166d4 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/os_solaris_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,13 +52,6 @@
#include "thread_solaris.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
-
# include // needed first to avoid name collision for "std" with SC 5.0
diff --git a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
index edf46ce4a30..e46e2150095 100644
--- a/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
+++ b/hotspot/src/os_cpu/solaris_sparc/vm/vm_version_solaris_sparc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 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
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
index ec047c16b58..3491bbed119 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,12 +52,6 @@
#include "thread_solaris.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
// put OS-includes here
# include
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp
index fd4f15282b4..90bff295ea0 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.inline.hpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.inline.hpp
index 986884e031f..cedbe5e5033 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.inline.hpp
+++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il
index 9b0f07da315..281711d4b3a 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il
+++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_32.il
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2003, 2011, 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
diff --git a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il
index 89809bc54dd..16bd3541079 100644
--- a/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il
+++ b/hotspot/src/os_cpu/solaris_x86/vm/solaris_x86_64.il
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
+// Copyright (c) 2004, 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
diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
index 52fe243ee0e..434929f30d2 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -52,12 +52,6 @@
#include "thread_windows.inline.hpp"
#include "utilities/events.hpp"
#include "utilities/vmError.hpp"
-#ifdef COMPILER1
-#include "c1/c1_Runtime1.hpp"
-#endif
-#ifdef COMPILER2
-#include "opto/runtime.hpp"
-#endif
# include "unwind_windows_x86.hpp"
#undef REG_SP
@@ -219,7 +213,7 @@ bool os::register_code_area(char *low, char *high) {
return true;
}
-void os::initialize_thread() {
+void os::initialize_thread(Thread* thr) {
// Nothing to do.
}
diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp
index 74e3519c901..41814b6c61b 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
diff --git a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.inline.hpp b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.inline.hpp
index d108e3e4202..1bf7c1a30a6 100644
--- a/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.inline.hpp
+++ b/hotspot/src/os_cpu/windows_x86/vm/os_windows_x86.inline.hpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 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
diff --git a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java
index 92fbf7746b5..00441dfb220 100644
--- a/hotspot/src/share/tools/ProjectCreator/BuildConfig.java
+++ b/hotspot/src/share/tools/ProjectCreator/BuildConfig.java
@@ -22,15 +22,14 @@
*
*/
-import java.io.File;
import java.util.Enumeration;
import java.util.Hashtable;
-import java.util.Iterator;
import java.util.Vector;
class BuildConfig {
+ @SuppressWarnings("rawtypes")
Hashtable vars;
- Vector basicNames, basicPaths;
+ Vector basicNames, basicPaths;
String[] context;
static CompilerInterface ci;
@@ -47,6 +46,7 @@ class BuildConfig {
return ci;
}
+ @SuppressWarnings("rawtypes")
protected void initNames(String flavour, String build, String outDll) {
if (vars == null) vars = new Hashtable();
@@ -63,26 +63,28 @@ class BuildConfig {
// ones mentioned above were needed to expand format
String buildBase = expandFormat(getFieldString(null, "BuildBase"));
String sourceBase = getFieldString(null, "SourceBase");
+ String buildSpace = getFieldString(null, "BuildSpace");
String outDir = buildBase;
put("Id", flavourBuild);
put("OutputDir", outDir);
put("SourceBase", sourceBase);
put("BuildBase", buildBase);
+ put("BuildSpace", buildSpace);
put("OutputDll", outDir + Util.sep + outDll);
context = new String [] {flavourBuild, flavour, build, null};
}
- protected void init(Vector includes, Vector defines) {
+ protected void init(Vector includes, Vector defines) {
initDefaultDefines(defines);
initDefaultCompilerFlags(includes);
initDefaultLinkerFlags();
- handleDB();
+ //handleDB();
}
- protected void initDefaultCompilerFlags(Vector includes) {
+ protected void initDefaultCompilerFlags(Vector includes) {
Vector compilerFlags = new Vector();
compilerFlags.addAll(getCI().getBaseCompilerFlags(getV("Define"),
@@ -100,143 +102,48 @@ class BuildConfig {
put("LinkerFlags", linkerFlags);
}
- DirectoryTree getSourceTree(String sourceBase, String startAt) {
- DirectoryTree tree = new DirectoryTree();
-
- tree.addSubdirToIgnore("Codemgr_wsdata");
- tree.addSubdirToIgnore("deleted_files");
- tree.addSubdirToIgnore("SCCS");
- tree.setVerbose(true);
- if (startAt != null) {
- tree.readDirectory(sourceBase + File.separator + startAt);
- } else {
- tree.readDirectory(sourceBase);
- }
-
- return tree;
- }
-
-
- Vector getPreferredPaths() {
- Vector preferredPaths = new Vector();
-
- // In the case of multiple files with the same name in
- // different subdirectories, prefer these versions
- preferredPaths.add("windows");
- preferredPaths.add("x86");
- preferredPaths.add("closed");
-
- // Also prefer "opto" over "adlc" for adlcVMDeps.hpp
- preferredPaths.add("opto");
-
- return preferredPaths;
- }
-
-
- void handleDB() {
- WinGammaPlatform platform = (WinGammaPlatform)getField(null, "PlatformObject");
-
- putSpecificField("AllFilesHash", computeAllFiles(platform));
- }
-
-
- private boolean matchesIgnoredPath(String prefixedName) {
- Vector rv = new Vector();
+ public boolean matchesIgnoredPath(String path) {
+ Vector rv = new Vector();
collectRelevantVectors(rv, "IgnorePath");
- for (Iterator i = rv.iterator(); i.hasNext(); ) {
- String pathPart = (String) i.next();
- if (prefixedName.contains(Util.normalize(pathPart))) {
+ for (String pathPart : rv) {
+ if (path.contains(pathPart)) {
return true;
}
}
return false;
}
- void addAll(Iterator i, Hashtable hash,
- WinGammaPlatform platform, DirectoryTree tree,
- Vector preferredPaths, Vector filesNotFound, Vector filesDuplicate) {
- for (; i.hasNext(); ) {
- String fileName = (String) i.next();
- if (lookupHashFieldInContext("IgnoreFile", fileName) == null) {
- String prefixedName = platform.envVarPrefixedFileName(fileName,
- 0, /* ignored */
- tree,
- preferredPaths,
- filesNotFound,
- filesDuplicate);
- if (prefixedName != null) {
- prefixedName = Util.normalize(prefixedName);
- if (!matchesIgnoredPath(prefixedName)) {
- addTo(hash, prefixedName, fileName);
- }
+ public boolean matchesHidePath(String path) {
+ Vector rv = new Vector();
+ collectRelevantVectors(rv, "HidePath");
+ for (String pathPart : rv) {
+ if (path.contains(Util.normalize(pathPart))) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public Vector matchesAdditionalGeneratedPath(String fullPath) {
+ Vector rv = new Vector();
+ Hashtable v = (Hashtable)BuildConfig.getField(this.toString(), "AdditionalGeneratedFile");
+ if (v != null) {
+ for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
+ String key = e.nextElement();
+ String val = v.get(key);
+
+ if (fullPath.endsWith(expandFormat(key))) {
+ rv.add(expandFormat(val));
}
}
}
+ return rv;
}
void addTo(Hashtable ht, String key, String value) {
ht.put(expandFormat(key), expandFormat(value));
}
- Hashtable computeAllFiles(WinGammaPlatform platform) {
- Hashtable rv = new Hashtable();
- DirectoryTree tree = getSourceTree(get("SourceBase"), getFieldString(null, "StartAt"));
- Vector preferredPaths = getPreferredPaths();
-
- // Hold errors until end
- Vector filesNotFound = new Vector();
- Vector filesDuplicate = new Vector();
-
- Vector includedFiles = new Vector();
-
- // find all files
- Vector dirs = getSourceIncludes();
- for (Iterator i = dirs.iterator(); i.hasNext(); ) {
- String dir = (String)i.next();
- DirectoryTree subtree = getSourceTree(dir, null);
- for (Iterator fi = subtree.getFileIterator(); fi.hasNext(); ) {
- String name = ((File)fi.next()).getName();
- includedFiles.add(name);
- }
- }
- addAll(includedFiles.iterator(), rv,
- platform, tree,
- preferredPaths, filesNotFound, filesDuplicate);
-
- Vector addFiles = new Vector();
- collectRelevantVectors(addFiles, "AdditionalFile");
- addAll(addFiles.iterator(), rv,
- platform, tree,
- preferredPaths, filesNotFound, filesDuplicate);
-
- collectRelevantHashes(rv, "AdditionalGeneratedFile");
-
- if ((filesNotFound.size() != 0) ||
- (filesDuplicate.size() != 0)) {
- System.err.println("Error: some files were not found or " +
- "appeared in multiple subdirectories of " +
- "directory " + get("SourceBase") + " and could not " +
- "be resolved with os_family and arch.");
- if (filesNotFound.size() != 0) {
- System.err.println("Files not found:");
- for (Iterator iter = filesNotFound.iterator();
- iter.hasNext(); ) {
- System.err.println(" " + (String) iter.next());
- }
- }
- if (filesDuplicate.size() != 0) {
- System.err.println("Duplicate files:");
- for (Iterator iter = filesDuplicate.iterator();
- iter.hasNext(); ) {
- System.err.println(" " + (String) iter.next());
- }
- }
- throw new RuntimeException();
- }
-
- return rv;
- }
-
void initDefaultDefines(Vector defines) {
Vector sysDefines = new Vector();
sysDefines.add("WIN32");
@@ -324,20 +231,19 @@ class BuildConfig {
}
void collectRelevantVectors(Vector rv, String field) {
- for (int i = 0; i < context.length; i++) {
- Vector v = getFieldVector(context[i], field);
+ for (String ctx : context) {
+ Vector v = getFieldVector(ctx, field);
if (v != null) {
- for (Iterator j=v.iterator(); j.hasNext(); ) {
- String val = (String)j.next();
- rv.add(expandFormat(val));
+ for (String val : v) {
+ rv.add(expandFormat(val).replace('/', '\\'));
}
}
}
}
void collectRelevantHashes(Hashtable rv, String field) {
- for (int i = 0; i < context.length; i++) {
- Hashtable v = (Hashtable)getField(context[i], field);
+ for (String ctx : context) {
+ Hashtable v = (Hashtable)getField(ctx, field);
if (v != null) {
for (Enumeration e=v.keys(); e.hasMoreElements(); ) {
String key = (String)e.nextElement();
@@ -357,21 +263,17 @@ class BuildConfig {
Vector getIncludes() {
Vector rv = new Vector();
-
collectRelevantVectors(rv, "AbsoluteInclude");
-
rv.addAll(getSourceIncludes());
-
return rv;
}
private Vector getSourceIncludes() {
- Vector rv = new Vector();
- Vector ri = new Vector();
+ Vector rv = new Vector();
+ Vector ri = new Vector();
String sourceBase = getFieldString(null, "SourceBase");
collectRelevantVectors(ri, "RelativeInclude");
- for (Iterator i = ri.iterator(); i.hasNext(); ) {
- String f = (String)i.next();
+ for (String f : ri) {
rv.add(sourceBase + Util.sep + f);
}
return rv;
@@ -604,7 +506,6 @@ class TieredFastDebugConfig extends GenericDebugNonKernelConfig {
}
}
-
abstract class ProductConfig extends BuildConfig {
protected void init(Vector includes, Vector defines) {
defines.add("NDEBUG");
@@ -638,7 +539,6 @@ class TieredProductConfig extends ProductConfig {
}
}
-
class CoreDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getNoOptFlag();
@@ -650,7 +550,6 @@ class CoreDebugConfig extends GenericDebugNonKernelConfig {
}
}
-
class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
String getOptFlag() {
return getCI().getOptFlag();
@@ -662,7 +561,6 @@ class CoreFastDebugConfig extends GenericDebugNonKernelConfig {
}
}
-
class CoreProductConfig extends ProductConfig {
CoreProductConfig() {
initNames("core", "product", "jvm.dll");
@@ -700,6 +598,7 @@ class KernelProductConfig extends ProductConfig {
init(getIncludes(), getDefines());
}
}
+
abstract class CompilerInterface {
abstract Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir);
abstract Vector getBaseLinkerFlags(String outDir, String outDll, String platformName);
diff --git a/hotspot/src/share/tools/ProjectCreator/DirectoryTree.java b/hotspot/src/share/tools/ProjectCreator/DirectoryTree.java
deleted file mode 100644
index 76a5e4668ae..00000000000
--- a/hotspot/src/share/tools/ProjectCreator/DirectoryTree.java
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-/** Encapsulates a notion of a directory tree. Designed to allow fast
- querying of full paths for unique filenames in the hierarchy. */
-
-import java.io.*;
-import java.util.*;
-
-public class DirectoryTree {
-
- /** The root of the read directoryTree */
- private Node rootNode;
-
- /** Subdirs to ignore; Vector of Strings */
- private Vector subdirsToIgnore;
-
- /** This maps file names to Lists of nodes. */
- private Hashtable nameToNodeListTable;
-
- /** Output "."'s as directories are read. Defaults to false. */
- private boolean verbose;
-
- public DirectoryTree() {
- subdirsToIgnore = new Vector();
- verbose = false;
- }
-
- public void addSubdirToIgnore(String subdir) {
- subdirsToIgnore.add(subdir);
- }
-
- private class FileIterator implements Iterator {
- private Vector nodes = new Vector();
-
- public FileIterator(Node rootNode) {
- if(rootNode == null) {
- return;
- }
- nodes.add(rootNode);
- prune();
- }
- public boolean hasNext() {
- return nodes.size() > 0;
- }
- public Object next() {
- Node last = (Node)nodes.remove(nodes.size() - 1);
- prune();
- return new File(last.getName());
- }
-
- public void remove() {
- throw new RuntimeException();
- }
-
- private void prune() {
- while (nodes.size() > 0) {
- Node last = (Node)nodes.get(nodes.size() - 1);
-
- if (last.isDirectory()) {
- nodes.remove(nodes.size() - 1);
- nodes.addAll(last.children);
- } else {
- // Is at file
- return;
- }
- }
- }
- }
-
- public Iterator getFileIterator() {
- return new FileIterator(rootNode);
- }
-
- /** Output "."'s to System.out as directories are read. Defaults
- to false. */
- public void setVerbose(boolean newValue) {
- verbose = newValue;
- }
-
- public boolean getVerbose() {
- return verbose;
- }
-
- public String getRootNodeName() {
- return rootNode.getName();
- }
-
- /** Takes an absolute path to the root directory of this
- DirectoryTree. Throws IllegalArgumentException if the given
- string represents a plain file or nonexistent directory. */
-
- public void readDirectory(String baseDirectory)
- throws IllegalArgumentException {
- File root = new File(Util.normalize(baseDirectory));
- if (!root.isDirectory()) {
- return;
- }
- try {
- root = root.getCanonicalFile();
- }
- catch (IOException e) {
- throw new RuntimeException(e.toString());
- }
- rootNode = new Node(root);
- readDirectory(rootNode, root);
- }
-
- /** Queries the DirectoryTree for a file or directory name. Takes
- only the name of the file or directory itself (i.e., no parent
- directory information should be in the passed name). Returns a
- List of DirectoryTreeNodes specifying the full paths of all of
- the files or directories of this name in the DirectoryTree.
- Returns null if the directory tree has not been read from disk
- yet or if the file was not found in the tree. */
- public List findFile(String name) {
- if (rootNode == null) {
- return null;
- }
-
- if (nameToNodeListTable == null) {
- nameToNodeListTable = new Hashtable();
- try {
- buildNameToNodeListTable(rootNode);
- } catch (IOException e) {
- e.printStackTrace();
- return null;
- }
- }
-
- return (List) nameToNodeListTable.get(name);
- }
-
- private void buildNameToNodeListTable(Node curNode)
- throws IOException {
- String fullName = curNode.getName();
- String parent = curNode.getParent();
- String separator = System.getProperty("file.separator");
-
- if (parent != null) {
- if (!fullName.startsWith(parent)) {
- throw new RuntimeException(
- "Internal error: parent of file name \"" + fullName +
- "\" does not match file name \"" + parent + "\""
- );
- }
-
- int len = parent.length();
- if (!parent.endsWith(separator)) {
- len += separator.length();
- }
-
- String fileName = fullName.substring(len);
-
- if (fileName == null) {
- throw new RuntimeException(
- "Internal error: file name was empty"
- );
- }
-
- List nodeList = (List) nameToNodeListTable.get(fileName);
- if (nodeList == null) {
- nodeList = new Vector();
- nameToNodeListTable.put(fileName, nodeList);
- }
-
- nodeList.add(curNode);
- } else {
- if (curNode != rootNode) {
- throw new RuntimeException(
- "Internal error: parent of file + \"" + fullName + "\"" +
- " was null"
- );
- }
- }
-
- if (curNode.isDirectory()) {
- Iterator iter = curNode.getChildren();
- if (iter != null) {
- while (iter.hasNext()) {
- buildNameToNodeListTable((Node) iter.next());
- }
- }
- }
- }
-
- /** Reads all of the files in the given directory and adds them as
- children of the directory tree node. Requires that the passed
- node represents a directory. */
-
- private void readDirectory(Node parentNode, File parentDir) {
- File[] children = parentDir.listFiles();
- if (children == null)
- return;
- if (verbose) {
- System.out.print(".");
- System.out.flush();
- }
- for (int i = 0; i < children.length; i++) {
- File child = children[i];
- children[i] = null;
- boolean isDir = child.isDirectory();
- boolean mustSkip = false;
- if (isDir) {
- for (Iterator iter = subdirsToIgnore.iterator();
- iter.hasNext(); ) {
- if (child.getName().equals((String) iter.next())) {
- mustSkip = true;
- break;
- }
- }
- }
- if (!mustSkip) {
- Node childNode = new Node(child);
- parentNode.addChild(childNode);
- if (isDir) {
- readDirectory(childNode, child);
- }
- }
- }
- }
-
- private class Node implements DirectoryTreeNode {
- private File file;
- private Vector children;
-
- /** file must be a canonical file */
- Node(File file) {
- this.file = file;
- children = new Vector();
- }
-
- public boolean isFile() {
- return file.isFile();
- }
-
- public boolean isDirectory() {
- return file.isDirectory();
- }
-
- public String getName() {
- return file.getPath();
- }
-
- public String getParent() {
- return file.getParent();
- }
-
- public void addChild(Node n) {
- children.add(n);
- }
-
- public Iterator getChildren() throws IllegalArgumentException {
- return children.iterator();
- }
-
- public int getNumChildren() throws IllegalArgumentException {
- return children.size();
- }
-
- public DirectoryTreeNode getChild(int i)
- throws IllegalArgumentException, ArrayIndexOutOfBoundsException {
- return (DirectoryTreeNode) children.get(i);
- }
- }
-}
diff --git a/hotspot/src/share/tools/ProjectCreator/DirectoryTreeNode.java b/hotspot/src/share/tools/ProjectCreator/DirectoryTreeNode.java
deleted file mode 100644
index f198dc24b52..00000000000
--- a/hotspot/src/share/tools/ProjectCreator/DirectoryTreeNode.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.util.*;
-
-public interface DirectoryTreeNode {
- public boolean isFile();
- public boolean isDirectory();
- public String getName();
- public String getParent();
- public Iterator getChildren() throws IllegalArgumentException;
- public int getNumChildren() throws IllegalArgumentException;
- public DirectoryTreeNode getChild(int i)
- throws IllegalArgumentException, ArrayIndexOutOfBoundsException;
-}
diff --git a/hotspot/src/share/tools/ProjectCreator/FileFormatException.java b/hotspot/src/share/tools/ProjectCreator/FileFormatException.java
deleted file mode 100644
index 077886f85dd..00000000000
--- a/hotspot/src/share/tools/ProjectCreator/FileFormatException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-@SuppressWarnings("serial")
-public class FileFormatException extends Exception {
-
- public FileFormatException() {
- super();
- }
-
- public FileFormatException(String s) {
- super(s);
- }
-}
diff --git a/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java b/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java
new file mode 100644
index 00000000000..3643c572e99
--- /dev/null
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreator.java
@@ -0,0 +1,72 @@
+import java.nio.file.FileSystems;
+import java.nio.file.Path;
+import java.nio.file.SimpleFileVisitor;
+import java.util.HashSet;
+import java.util.Stack;
+import java.util.Vector;
+
+public class FileTreeCreator extends SimpleFileVisitor
+{
+ Path vcProjLocation;
+ Path startDir;
+ final int startDirLength;
+ Stack attributes = new Stack();
+ Vector allConfigs;
+ WinGammaPlatformVC10 wg;
+
+ public FileTreeCreator(Path startDir, Vector allConfigs, WinGammaPlatformVC10 wg) {
+ super();
+ this.wg = wg;
+ this.allConfigs = allConfigs;
+ this.startDir = startDir;
+ startDirLength = startDir.toAbsolutePath().toString().length();
+ vcProjLocation = FileSystems.getDefault().getPath(allConfigs.firstElement().get("BuildSpace"));
+ attributes.push(new DirAttributes());
+ }
+
+ public class DirAttributes {
+
+ private HashSet ignores;
+ private HashSet disablePch;
+
+ public DirAttributes() {
+ ignores = new HashSet();
+ disablePch = new HashSet();
+ }
+
+ public DirAttributes(HashSet excludes2, HashSet disablePch2) {
+ ignores = excludes2;
+ disablePch = disablePch2;
+ }
+
+ @SuppressWarnings("unchecked")
+ public DirAttributes clone() {
+ return new DirAttributes((HashSet)this.ignores.clone(), (HashSet)this.disablePch.clone());
+ }
+
+ public void setIgnore(BuildConfig conf) {
+ ignores.add(conf);
+ }
+
+ public boolean hasIgnore(BuildConfig cfg) {
+ return ignores.contains(cfg);
+ }
+
+ public void removeFromIgnored(BuildConfig cfg) {
+ ignores.remove(cfg);
+ }
+
+ public void setDisablePch(BuildConfig conf) {
+ disablePch.add(conf);
+ }
+
+ public boolean hasDisablePch(BuildConfig cfg) {
+ return disablePch.contains(cfg);
+ }
+
+ public void removeFromDisablePch(BuildConfig cfg) {
+ disablePch.remove(cfg);
+ }
+
+ }
+}
diff --git a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java
new file mode 100644
index 00000000000..837eef1a566
--- /dev/null
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC10.java
@@ -0,0 +1,142 @@
+import static java.nio.file.FileVisitResult.CONTINUE;
+
+import java.io.IOException;
+import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Stack;
+import java.util.Vector;
+
+public class FileTreeCreatorVC10 extends FileTreeCreator {
+
+ public FileTreeCreatorVC10(Path startDir, Vector allConfigs, WinGammaPlatformVC10 wg) {
+ super(startDir, allConfigs, wg);
+ }
+
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {
+ DirAttributes currentFileAttr = attributes.peek().clone();
+ boolean usePch = false;
+ boolean disablePch = false;
+ boolean useIgnore = false;
+ String fileName = file.getFileName().toString();
+
+ // TODO hideFile
+
+ // usePch applies to all configs for a file.
+ if (fileName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"))) {
+ usePch = true;
+ }
+
+ for (BuildConfig cfg : allConfigs) {
+ if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
+ useIgnore = true;
+ currentFileAttr.setIgnore(cfg);
+ } else if (cfg.matchesIgnoredPath(file.toAbsolutePath().toString())) {
+ useIgnore = true;
+ currentFileAttr.setIgnore(cfg);
+ }
+
+ if (cfg.lookupHashFieldInContext("DisablePch", fileName) != null) {
+ disablePch = true;
+ currentFileAttr.setDisablePch(cfg);
+ }
+
+ Vector rv = new Vector();
+ cfg.collectRelevantVectors(rv, "AdditionalFile");
+ for(String addFile : rv) {
+ if (addFile.equals(fileName)) {
+ // supress any ignore
+ // TODO - may need some adjustments
+ if (file.toAbsolutePath().toString().contains(cfg.get("Flavour"))) {
+ currentFileAttr.removeFromIgnored(cfg);
+ }
+ }
+ }
+ }
+
+ String tagName = wg.getFileTagFromSuffix(fileName);
+ String fileLoc = vcProjLocation.relativize(file).toString();
+
+ if (!useIgnore && !disablePch && !usePch) {
+ wg.tag(tagName, new String[] { "Include", fileLoc});
+ } else {
+ wg.startTag(
+ tagName,
+ new String[] { "Include", fileLoc});
+
+ for (BuildConfig cfg : allConfigs) {
+ boolean ignore = currentFileAttr.hasIgnore(cfg);
+ if (ignore) {
+ wg.tagData("ExcludedFromBuild", "true", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
+ }
+ if (usePch) {
+ wg.tagData("PrecompiledHeader", "Create", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
+ }
+ if (disablePch) {
+ wg.tag("PrecompiledHeader", "Condition", "'$(Configuration)|$(Platform)'=='" + cfg.get("Name") + "'");
+ }
+ }
+ wg.endTag();
+ }
+
+ String filter = startDir.relativize(file.getParent().toAbsolutePath()).toString();
+ wg.addFilterDependency(fileLoc, filter);
+
+ return CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
+ throws IOException {
+ Boolean hide = false;
+ // TODO remove attrs, if path is matched in this dir, then it is too in every subdir.
+ // And we will check anyway
+ DirAttributes newAttr = attributes.peek().clone();
+
+ // check per config ignorePaths!
+ for (BuildConfig cfg : allConfigs) {
+ if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
+ newAttr.setIgnore(cfg);
+ }
+
+ // Hide is always on all configs. And additional files are never hiddden
+ if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
+ hide = true;
+ break;
+ }
+ }
+
+ if (!hide) {
+ String name = startDir.relativize(path.toAbsolutePath()).toString();
+ if (!"".equals(name)) {
+ wg.addFilter(name);
+ }
+
+ attributes.push(newAttr);
+ return super.preVisitDirectory(path, attrs);
+ } else {
+ return FileVisitResult.SKIP_SUBTREE;
+ }
+ }
+
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
+ //end matching attributes set by ignorepath
+ attributes.pop();
+ return CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult visitFileFailed(Path file, IOException exc) {
+ return CONTINUE;
+ }
+
+ public void writeFileTree() throws IOException {
+ Files.walkFileTree(this.startDir, this);
+ }
+
+
+ }
\ No newline at end of file
diff --git a/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java
new file mode 100644
index 00000000000..b36e0121f8a
--- /dev/null
+++ b/hotspot/src/share/tools/ProjectCreator/FileTreeCreatorVC7.java
@@ -0,0 +1,156 @@
+import static java.nio.file.FileVisitResult.CONTINUE;
+
+import java.io.IOException;
+import java.nio.file.FileSystems;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Stack;
+import java.util.Vector;
+
+public class FileTreeCreatorVC7 extends FileTreeCreator {
+
+ public FileTreeCreatorVC7(Path startDir, Vector allConfigs, WinGammaPlatform wg) {
+ super(startDir, allConfigs, null);
+ }
+
+ @Override
+ public FileVisitResult visitFile(Path file, BasicFileAttributes attr) {
+ DirAttributes currentFileAttr = attributes.peek().clone();
+ boolean usePch = false;
+ boolean disablePch = false;
+ boolean useIgnore = false;
+ String fileName = file.getFileName().toString();
+
+ // usePch applies to all configs for a file.
+ if (fileName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"))) {
+ usePch = true;
+ }
+
+ for (BuildConfig cfg : allConfigs) {
+ if (cfg.lookupHashFieldInContext("IgnoreFile", fileName) != null) {
+ useIgnore = true;
+ currentFileAttr.setIgnore(cfg);
+ } else if (cfg.matchesIgnoredPath(file.toAbsolutePath().toString())) {
+ useIgnore = true;
+ currentFileAttr.setIgnore(cfg);
+ }
+
+ if (cfg.lookupHashFieldInContext("DisablePch", fileName) != null) {
+ disablePch = true;
+ currentFileAttr.setDisablePch(cfg);
+ }
+
+ Vector rv = new Vector();
+ cfg.collectRelevantVectors(rv, "AdditionalFile");
+ for(String addFile : rv) {
+ if (addFile.equals(fileName)) {
+ // supress any ignore
+ currentFileAttr.removeFromIgnored(cfg);
+ }
+ }
+ }
+
+ if (!useIgnore && !disablePch && !usePch) {
+ wg.tag("File", new String[] { "RelativePath", vcProjLocation.relativize(file).toString()});
+ } else {
+ wg.startTag(
+ "File",
+ new String[] { "RelativePath", vcProjLocation.relativize(file).toString()});
+
+ for (BuildConfig cfg : allConfigs) {
+ boolean ignore = currentFileAttr.hasIgnore(cfg);
+ String [] fileConfAttr;
+
+ if (ignore) {
+ fileConfAttr = new String[] {"Name", cfg.get("Name"), "ExcludedFromBuild", "TRUE" };
+ } else {
+ fileConfAttr = new String[] {"Name", cfg.get("Name")};
+ }
+
+ if (!disablePch && !usePch && !ignore) {
+ continue;
+ } else if (!disablePch && !usePch) {
+ wg.tag("FileConfiguration", fileConfAttr);
+ } else {
+ wg.startTag("FileConfiguration", fileConfAttr);
+ if (usePch) {
+ // usePch always applies to all configs, might not always be so.
+ wg.tag("Tool", new String[] {
+ "Name", "VCCLCompilerTool", "UsePrecompiledHeader",
+ "1" });
+ assert(!disablePch);
+ }
+ if (disablePch) {
+ if (currentFileAttr.hasDisablePch(cfg)) {
+ wg.tag("Tool", new String[] {
+ "Name", "VCCLCompilerTool", "UsePrecompiledHeader",
+ "0" });
+ }
+ assert(!usePch);
+ }
+ wg.endTag();
+ }
+ }
+ wg.endTag();
+ }
+
+ return CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs)
+ throws IOException {
+ Boolean hide = false;
+ DirAttributes newAttr = attributes.peek().clone();
+
+ String rPath;
+ if (path.toAbsolutePath().toString().equals(this.startDir.toAbsolutePath().toString())){
+ rPath = startDir.toString();
+ } else {
+ rPath = path.getFileName().toString();
+ }
+
+ // check per config ignorePaths!
+ for (BuildConfig cfg : allConfigs) {
+ if (cfg.matchesIgnoredPath(path.toAbsolutePath().toString())) {
+ newAttr.setIgnore(cfg);
+ }
+
+ // Hide is always on all configs. And additional files are never hiddden
+ if (cfg.matchesHidePath(path.toAbsolutePath().toString())) {
+ hide = true;
+ break;
+ }
+ }
+
+ if (!hide) {
+ wg.startTag("Filter", new String[] {
+ "Name", rPath});
+
+ attributes.push(newAttr);
+ return super.preVisitDirectory(path, attrs);
+ } else {
+ return FileVisitResult.SKIP_SUBTREE;
+ }
+ }
+
+ @Override
+ public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
+ //end matching attributes set by ignorepath
+ wg.endTag();
+ attributes.pop();
+
+ return CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult visitFileFailed(Path file, IOException exc) {
+ return CONTINUE;
+ }
+
+ public void writeFileTree() throws IOException {
+ Files.walkFileTree(this.startDir, this);
+ }
+ }
\ No newline at end of file
diff --git a/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
index 5203c5a36ed..daa7a41ab81 100644
--- a/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
+++ b/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -24,75 +24,76 @@
public class ProjectCreator {
- public static void usage() {
- System.out.println("ProjectCreator options:");
- System.err.println("WinGammaPlatform platform-specific options:");
- System.err.println(" -sourceBase ");
- System.err.println(" -dspFileName ");
- System.err.println(" -envVar ");
- System.err.println(" -dllLoc ");
- System.err.println(" If any of the above are specified, "+
- "they must all be.");
- System.err.println(" Additional, optional arguments, which can be " +
- "specified multiple times:");
- System.err.println(" -absoluteInclude ");
- System.err.println(" -relativeInclude ");
- System.err.println(" -define ");
- System.err.println(" -perFileLine ");
- System.err.println(" -conditionalPerFileLine ");
- System.err.println(" (NOTE: To work around a bug in nmake, where " +
- "you can't have a '#' character in a quoted " +
- "string, all of the lines outputted have \"#\"" +
- "prepended)");
- System.err.println(" -startAt ");
- System.err.println(" -ignoreFile ");
- System.err.println(" -additionalFile ");
- System.err.println(" -additionalGeneratedFile " +
- "");
- System.err.println(" -prelink :");
- System.err.println(" Generate a set of prelink commands for the given BUILD");
- System.err.println(" (\"Debug\" or \"Release\"). The prelink description and commands");
- System.err.println(" are both quoted strings.");
- System.err.println(" Default includes: \".\"");
- System.err.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
- }
+ public static void usage() {
+ System.out.println("ProjectCreator options:");
+ System.err.println("WinGammaPlatform platform-specific options:");
+ System.err.println(" -sourceBase ");
+ System.err.println(" -dspFileName ");
+ System.err.println(" -envVar ");
+ System.err.println(" -dllLoc ");
+ System.err.println(" If any of the above are specified, "
+ + "they must all be.");
+ System.err.println(" Additional, optional arguments, which can be "
+ + "specified multiple times:");
+ System.err.println(" -absoluteInclude ");
+ System.err.println(" -relativeInclude ");
+ System.err.println(" -define ");
+ System.err.println(" -perFileLine ");
+ System.err.println(" -conditionalPerFileLine ");
+ System.err.println(" (NOTE: To work around a bug in nmake, where "
+ + "you can't have a '#' character in a quoted "
+ + "string, all of the lines outputted have \"#\"" + "prepended)");
+ System.err.println(" -startAt ");
+ System.err.println(" -ignoreFile ");
+ System.err.println(" -additionalFile ");
+ System.err
+ .println(" -additionalGeneratedFile "
+ + "");
+ System.err.println(" -prelink :");
+ System.err
+ .println(" Generate a set of prelink commands for the given BUILD");
+ System.err
+ .println(" (\"Debug\" or \"Release\"). The prelink description and commands");
+ System.err.println(" are both quoted strings.");
+ System.err.println(" Default includes: \".\"");
+ System.err
+ .println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
+ }
- public static void main(String[] args) {
- try {
- if (args.length < 3) {
- usage();
- System.exit(1);
- }
+ public static void main(String[] args) {
+ try {
+ if (args.length < 3) {
+ usage();
+ System.exit(1);
+ }
- String platformName = args[0];
- Class platformClass = Class.forName(platformName);
- WinGammaPlatform platform = (WinGammaPlatform) platformClass.newInstance();
+ String platformName = args[0];
+ Class platformClass = Class.forName(platformName);
+ WinGammaPlatform platform = (WinGammaPlatform) platformClass
+ .newInstance();
- String[] platformArgs = new String[args.length - 1];
- System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
+ String[] platformArgs = new String[args.length - 1];
+ System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
- // Allow the platform to write platform-specific files
- platform.createVcproj(platformArgs);
- }
- catch (Exception e) {
- e.printStackTrace();
- System.exit(1);
- }
- }
+ // Allow the platform to write platform-specific files
+ platform.createVcproj(platformArgs);
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
}
diff --git a/hotspot/src/share/tools/ProjectCreator/Util.java b/hotspot/src/share/tools/ProjectCreator/Util.java
index 466a099749d..ca830780048 100644
--- a/hotspot/src/share/tools/ProjectCreator/Util.java
+++ b/hotspot/src/share/tools/ProjectCreator/Util.java
@@ -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
@@ -26,18 +26,19 @@ import java.util.*;
import java.io.File;
public class Util {
- static String join(String padder, Vector v) {
+
+ static String join(String padder, Vector v) {
return join(padder, v, false);
}
- static String join(String padder, Vector v, boolean quoted) {
+ static String join(String padder, Vector v, boolean quoted) {
StringBuffer sb = new StringBuffer();
- for (Iterator iter = v.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = v.iterator(); iter.hasNext(); ) {
if (quoted) {
sb.append('"');
}
- sb.append((String)iter.next());
+ sb.append(iter.next());
if (quoted) {
sb.append('"');
}
@@ -48,10 +49,10 @@ public class Util {
}
- static String prefixed_join(String padder, Vector v, boolean quoted) {
+ static String prefixed_join(String padder, Vector v, boolean quoted) {
StringBuffer sb = new StringBuffer();
- for (Iterator iter = v.iterator(); iter.hasNext(); ) {
+ for (Iterator iter = v.iterator(); iter.hasNext(); ) {
sb.append(padder);
if (quoted) {
diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java
index 7c4dc53e2c2..2cc6f542ee5 100644
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatform.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -29,6 +29,7 @@ import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
+import java.util.Stack;
import java.util.TreeSet;
import java.util.Vector;
@@ -218,69 +219,6 @@ public abstract class WinGammaPlatform {
return false;
}
- /* This returns a String containing the full path to the passed
- file name, or null if an error occurred. If the file was not
- found or was a duplicate and couldn't be resolved using the
- preferred paths, the file name is added to the appropriate
- Vector of Strings. */
- private String findFileInDirectory(String fileName,
- DirectoryTree directory,
- Vector preferredPaths,
- Vector filesNotFound,
- Vector filesDuplicate) {
- List locationsInTree = directory.findFile(fileName);
- int rootNameLength = directory.getRootNodeName().length();
- String name = null;
- if ((locationsInTree == null) ||
- (locationsInTree.size() == 0)) {
- filesNotFound.add(fileName);
- } else if (locationsInTree.size() > 1) {
- // Iterate through them, trying to find one with a
- // preferred path
- search:
- {
- for (Iterator locIter = locationsInTree.iterator();
- locIter.hasNext(); ) {
- DirectoryTreeNode node =
- (DirectoryTreeNode) locIter.next();
- String tmpName = node.getName();
- for (Iterator prefIter = preferredPaths.iterator();
- prefIter.hasNext(); ) {
- // We need to make sure the preferred path is
- // found from the file path not including the root node name.
- if (tmpName.indexOf((String)prefIter.next(),
- rootNameLength) != -1) {
- name = tmpName;
- break search;
- }
- }
- }
- }
-
- if (name == null) {
- filesDuplicate.add(fileName);
- }
- } else {
- name = ((DirectoryTreeNode) locationsInTree.get(0)).getName();
- }
-
- return name;
- }
-
- protected String envVarPrefixedFileName(String fileName,
- int sourceBaseLen,
- DirectoryTree tree,
- Vector preferredPaths,
- Vector filesNotFound,
- Vector filesDuplicate) {
- String fullName = findFileInDirectory(fileName,
- tree,
- preferredPaths,
- filesNotFound,
- filesDuplicate);
- return fullName;
- }
-
String getProjectName(String fullPath, String extension)
throws IllegalArgumentException, IOException {
File file = new File(fullPath).getCanonicalFile();
@@ -369,6 +307,12 @@ public abstract class WinGammaPlatform {
HsArgHandler.STRING
),
+ new HsArgRule("-buildSpace",
+ "BuildSpace",
+ null,
+ HsArgHandler.STRING
+ ),
+
new HsArgRule("-platformName",
"PlatformName",
null,
@@ -405,6 +349,18 @@ public abstract class WinGammaPlatform {
HsArgHandler.VECTOR
),
+ new HsArgRule("-absoluteSrcInclude",
+ "AbsoluteSrcInclude",
+ null,
+ HsArgHandler.VECTOR
+ ),
+
+ new HsArgRule("-relativeSrcInclude",
+ "RelativeSrcInclude",
+ null,
+ HsArgHandler.VECTOR
+ ),
+
new HsArgRule("-define",
"Define",
null,
@@ -494,6 +450,12 @@ public abstract class WinGammaPlatform {
HsArgHandler.VECTOR
),
+ new HsArgRule("-hidePath",
+ "HidePath",
+ null,
+ HsArgHandler.VECTOR
+ ),
+
new HsArgRule("-additionalFile",
"AdditionalFile",
null,
@@ -611,107 +573,101 @@ public abstract class WinGammaPlatform {
return allConfigs;
}
- class FileAttribute {
- int numConfigs;
- Vector configs;
- String shortName;
- boolean noPch, pchRoot;
-
- FileAttribute(String shortName, BuildConfig cfg, int numConfigs) {
- this.shortName = shortName;
- this.noPch = (cfg.lookupHashFieldInContext("DisablePch", shortName) != null);
- this.pchRoot = shortName.equals(BuildConfig.getFieldString(null, "UseToGeneratePch"));
- this.numConfigs = numConfigs;
-
- configs = new Vector();
- add(cfg.get("Name"));
- }
-
- void add(String confName) {
- configs.add(confName);
-
- // if presented in all configs
- if (configs.size() == numConfigs) {
- configs = null;
- }
- }
- }
-
- class FileInfo implements Comparable {
- String full;
- FileAttribute attr;
-
- FileInfo(String full, FileAttribute attr) {
- this.full = full;
- this.attr = attr;
- }
-
- public int compareTo(Object o) {
- FileInfo oo = (FileInfo)o;
- return full.compareTo(oo.full);
- }
-
- boolean isHeader() {
- return attr.shortName.endsWith(".h") || attr.shortName.endsWith(".hpp");
- }
-
- boolean isCpp() {
- return attr.shortName.endsWith(".cpp");
- }
- }
-
-
- TreeSet sortFiles(Hashtable allFiles) {
- TreeSet rv = new TreeSet();
- Enumeration e = allFiles.keys();
- while (e.hasMoreElements()) {
- String fullPath = (String)e.nextElement();
- rv.add(new FileInfo(fullPath, (FileAttribute)allFiles.get(fullPath)));
- }
- return rv;
- }
-
- Hashtable computeAttributedFiles(Vector allConfigs) {
- Hashtable ht = new Hashtable();
- int numConfigs = allConfigs.size();
-
- for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
- BuildConfig bc = (BuildConfig)i.next();
- Hashtable confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
- String confName = bc.get("Name");
-
- for (Enumeration e=confFiles.keys(); e.hasMoreElements(); ) {
- String filePath = (String)e.nextElement();
- FileAttribute fa = (FileAttribute)ht.get(filePath);
-
- if (fa == null) {
- fa = new FileAttribute((String)confFiles.get(filePath), bc, numConfigs);
- ht.put(filePath, fa);
- } else {
- fa.add(confName);
- }
- }
- }
-
- return ht;
- }
-
- Hashtable computeAttributedFiles(BuildConfig bc) {
- Hashtable ht = new Hashtable();
- Hashtable confFiles = (Hashtable)bc.getSpecificField("AllFilesHash");
-
- for (Enumeration e = confFiles.keys(); e.hasMoreElements(); ) {
- String filePath = (String)e.nextElement();
- ht.put(filePath, new FileAttribute((String)confFiles.get(filePath), bc, 1));
- }
-
- return ht;
- }
-
PrintWriter printWriter;
public void writeProjectFile(String projectFileName, String projectName,
Vector allConfigs) throws IOException {
throw new RuntimeException("use compiler version specific version");
}
+
+ int indent;
+ private Stack tagStack = new Stack();
+
+ private void startTagPrim(String name, String[] attrs, boolean close) {
+ startTagPrim(name, attrs, close, true);
+ }
+
+ private void startTagPrim(String name, String[] attrs, boolean close,
+ boolean newline) {
+ doIndent();
+ printWriter.print("<" + name);
+ indent++;
+
+ if (attrs != null && attrs.length > 0) {
+ for (int i = 0; i < attrs.length; i += 2) {
+ printWriter.print(" " + attrs[i] + "=\"" + attrs[i + 1] + "\"");
+ if (i < attrs.length - 2) {
+ }
+ }
+ }
+
+ if (close) {
+ indent--;
+ printWriter.print(" />");
+ } else {
+ // TODO push tag name, and change endTag to pop and print.
+ tagStack.push(name);
+ printWriter.print(">");
+ }
+ if (newline) {
+ printWriter.println();
+ }
+ }
+
+ void startTag(String name, String... attrs) {
+ startTagPrim(name, attrs, false);
+ }
+
+ void startTagV(String name, Vector attrs) {
+ String s[] = new String[attrs.size()];
+ for (int i = 0; i < attrs.size(); i++) {
+ s[i] = (String) attrs.elementAt(i);
+ }
+ startTagPrim(name, s, false);
+ }
+
+ void endTag() {
+ String name = tagStack.pop();
+ indent--;
+ doIndent();
+ printWriter.println("" + name + ">");
+ }
+
+ private void endTagNoIndent() {
+ String name = tagStack.pop();
+ indent--;
+ printWriter.println("" + name + ">");
+ }
+
+ void tag(String name, String... attrs) {
+ startTagPrim(name, attrs, true);
+ }
+
+ void tagData(String name, String data) {
+ startTagPrim(name, null, false, false);
+ printWriter.print(data);
+ endTagNoIndent();
+ }
+
+ void tagData(String name, String data, String... attrs) {
+ startTagPrim(name, attrs, false, false);
+ printWriter.print(data);
+ endTagNoIndent();
+ }
+
+ void tagV(String name, Vector attrs) {
+ String s[] = new String[attrs.size()];
+ for (int i = 0; i < attrs.size(); i++) {
+ s[i] = (String) attrs.elementAt(i);
+ }
+ startTagPrim(name, s, true);
+ }
+
+ void doIndent() {
+ for (int i = 0; i < indent; i++) {
+ printWriter.print(" ");
+ }
+ }
+
+
}
diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
index 4a96981e76d..137abdc30e9 100644
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java
@@ -3,14 +3,18 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
-import java.util.Hashtable;
+import java.nio.file.FileSystems;
import java.util.Iterator;
-import java.util.TreeSet;
+import java.util.LinkedList;
import java.util.UUID;
import java.util.Vector;
public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
+
+ LinkedList filters = new LinkedList();
+ LinkedList filterDeps = new LinkedList();
+
@Override
protected String getProjectExt() {
return ".vcxproj";
@@ -37,15 +41,15 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
"Include", cfg.get("Name"));
tagData("Configuration", cfg.get("Id"));
tagData("Platform", cfg.get("PlatformName"));
- endTag("ProjectConfiguration");
+ endTag();
}
- endTag("ItemGroup");
+ endTag();
startTag("PropertyGroup", "Label", "Globals");
tagData("ProjectGuid", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}");
tag("SccProjectName");
tag("SccLocalPath");
- endTag("PropertyGroup");
+ endTag();
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");
@@ -53,19 +57,19 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
startTag(cfg, "PropertyGroup", "Label", "Configuration");
tagData("ConfigurationType", "DynamicLibrary");
tagData("UseOfMfc", "false");
- endTag("PropertyGroup");
+ endTag();
}
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");
startTag("ImportGroup", "Label", "ExtensionSettings");
- endTag("ImportGroup");
+ endTag();
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "ImportGroup", "Label", "PropertySheets");
tag("Import",
"Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props",
"Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')",
"Label", "LocalAppDataPlatform");
- endTag("ImportGroup");
+ endTag();
}
tag("PropertyGroup", "Label", "UserMacros");
@@ -82,38 +86,38 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
tag(cfg, "CodeAnalysisRules");
tag(cfg, "CodeAnalysisRuleAssemblies");
}
- endTag("PropertyGroup");
+ endTag();
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "ItemDefinitionGroup");
startTag("ClCompile");
tagV(cfg.getV("CompilerFlags"));
- endTag("ClCompile");
+ endTag();
startTag("Link");
tagV(cfg.getV("LinkerFlags"));
- endTag("Link");
+ endTag();
startTag("PostBuildEvent");
tagData("Message", BuildConfig.getFieldString(null, "PostbuildDescription"));
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace("\t", "\r\n")));
- endTag("PostBuildEvent");
+ endTag();
startTag("PreLinkEvent");
tagData("Message", BuildConfig.getFieldString(null, "PrelinkDescription"));
tagData("Command", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace("\t", "\r\n")));
- endTag("PreLinkEvent");
+ endTag();
- endTag("ItemDefinitionGroup");
+ endTag();
}
writeFiles(allConfigs, projDir);
tag("Import", "Project", "$(VCTargetsPath)\\Microsoft.Cpp.targets");
startTag("ImportGroup", "Label", "ExtensionTargets");
- endTag("ImportGroup");
+ endTag();
- endTag("Project");
+ endTag();
printWriter.close();
System.out.println(" Done.");
@@ -138,14 +142,22 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
for (BuildConfig cfg : allConfigs) {
startTag(cfg, "PropertyGroup");
tagData("LocalDebuggerCommand", "$(TargetDir)/hotspot.exe");
- endTag("PropertyGroup");
+ endTag();
}
- endTag("Project");
+ endTag();
printWriter.close();
System.out.println(" Done.");
}
+ public void addFilter(String rPath) {
+ filters.add(rPath);
+ }
+
+ public void addFilterDependency(String fileLoc, String filter) {
+ filterDeps.add(new String[] {fileLoc, filter});
+ }
+
private void writeFilterFile(String projectFileName, String projectName,
Vector allConfigs, String base) throws FileNotFoundException, UnsupportedEncodingException {
String filterFileName = projectFileName + ".filters";
@@ -157,210 +169,92 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
"ToolsVersion", "4.0",
"xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");
- Hashtable allFiles = computeAttributedFiles(allConfigs);
- TreeSet sortedFiles = sortFiles(allFiles);
- Vector filters = makeFilters(sortedFiles);
-
- // first all filters
startTag("ItemGroup");
- for (NameFilter filter : filters) {
- doWriteFilter(filter, "");
+ for (String filter : filters) {
+ startTag("Filter", "Include",filter);
+ UUID uuid = UUID.randomUUID();
+ tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
+ endTag();
}
startTag("Filter", "Include", "Resource Files");
UUID uuid = UUID.randomUUID();
tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
tagData("Extensions", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe");
- endTag("Filter");
- endTag("ItemGroup");
+ endTag();
+ endTag();
- // then all cpp files
+ //TODO - do I need to split cpp and hpp files?
+
+ // then all files
startTag("ItemGroup");
- for (NameFilter filter : filters) {
- doWriteFiles(sortedFiles, filter, "", "ClCompile", new Evaluator() {
- public boolean pick(FileInfo fi) {
- return fi.isCpp();
- }
- }, base);
- }
- endTag("ItemGroup");
+ for (String[] dep : filterDeps) {
+ String tagName = getFileTagFromSuffix(dep[0]);
- // then all header files
- startTag("ItemGroup");
- for (NameFilter filter : filters) {
- doWriteFiles(sortedFiles, filter, "", "ClInclude", new Evaluator() {
- public boolean pick(FileInfo fi) {
- return fi.isHeader();
- }
- }, base);
+ startTag(tagName, "Include", dep[0]);
+ tagData("Filter", dep[1]);
+ endTag();
}
- endTag("ItemGroup");
+ endTag();
- // then all other files
- startTag("ItemGroup");
- for (NameFilter filter : filters) {
- doWriteFiles(sortedFiles, filter, "", "None", new Evaluator() {
- public boolean pick(FileInfo fi) {
- return true;
- }
- }, base);
- }
- endTag("ItemGroup");
-
- endTag("Project");
+ endTag();
printWriter.close();
System.out.println(" Done.");
}
-
- private void doWriteFilter(NameFilter filter, String start) {
- startTag("Filter", "Include", start + filter.fname);
- UUID uuid = UUID.randomUUID();
- tagData("UniqueIdentifier", "{" + uuid.toString() + "}");
- endTag("Filter");
- if (filter instanceof ContainerFilter) {
- Iterator i = ((ContainerFilter)filter).babies();
- while (i.hasNext()) {
- doWriteFilter((NameFilter)i.next(), start + filter.fname + "\\");
- }
- }
+ public String getFileTagFromSuffix(String fileName) {
+ if (fileName.endsWith(".cpp")) {
+ return"ClCompile";
+ } else if (fileName.endsWith(".c")) {
+ return "ClCompile";
+ } else if (fileName.endsWith(".hpp")) {
+ return"ClInclude";
+ } else if (fileName.endsWith(".h")) {
+ return "ClInclude";
+ } else {
+ return"None";
+ }
}
- interface Evaluator {
- boolean pick(FileInfo fi);
- }
-
- private void doWriteFiles(TreeSet allFiles, NameFilter filter, String start, String tool, Evaluator eval, String base) {
- if (filter instanceof ContainerFilter) {
- Iterator i = ((ContainerFilter)filter).babies();
- while (i.hasNext()) {
- doWriteFiles(allFiles, (NameFilter)i.next(), start + filter.fname + "\\", tool, eval, base);
- }
- }
- else {
- Iterator i = allFiles.iterator();
- while (i.hasNext()) {
- FileInfo fi = (FileInfo)i.next();
-
- if (!filter.match(fi)) {
- continue;
- }
- if (eval.pick(fi)) {
- startTag(tool, "Include", rel(fi.full, base));
- tagData("Filter", start + filter.fname);
- endTag(tool);
-
- // we not gonna look at this file anymore (sic!)
- i.remove();
- }
- }
- }
- }
-
-
void writeFiles(Vector allConfigs, String projDir) {
- Hashtable allFiles = computeAttributedFiles(allConfigs);
- TreeSet sortedFiles = sortFiles(allFiles);
+ // This code assummes there are no config specific includes.
+ startTag("ItemGroup");
- // first cpp-files
- startTag("ItemGroup");
- for (FileInfo fi : sortedFiles) {
- if (!fi.isCpp()) {
- continue;
- }
- writeFile("ClCompile", allConfigs, fi, projDir);
- }
- endTag("ItemGroup");
+ String sourceBase = BuildConfig.getFieldString(null, "SourceBase");
- // then header-files
- startTag("ItemGroup");
- for (FileInfo fi : sortedFiles) {
- if (!fi.isHeader()) {
- continue;
- }
- writeFile("ClInclude", allConfigs, fi, projDir);
- }
- endTag("ItemGroup");
+ // Use first config for all global absolute includes.
+ BuildConfig baseConfig = allConfigs.firstElement();
+ Vector rv = new Vector();
- // then others
- startTag("ItemGroup");
- for (FileInfo fi : sortedFiles) {
- if (fi.isHeader() || fi.isCpp()) {
- continue;
- }
- writeFile("None", allConfigs, fi, projDir);
- }
- endTag("ItemGroup");
+ // Then use first config for all relative includes
+ Vector ri = new Vector();
+ baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude");
+ for (String f : ri) {
+ rv.add(sourceBase + Util.sep + f);
+ }
+
+ baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude");
+
+ handleIncludes(rv, allConfigs);
+
+ endTag();
}
- /**
- * Make "path" into a relative path using "base" as the base.
- *
- * path and base are assumed to be normalized with / as the file separator.
- * returned path uses "\\" as file separator
- */
- private String rel(String path, String base)
- {
- if(!base.endsWith("/")) {
- base += "/";
- }
- String[] pathTok = path.split("/");
- String[] baseTok = base.split("/");
- int pi = 0;
- int bi = 0;
- StringBuilder newPath = new StringBuilder();
-
- // first step past all path components that are the same
- while (pi < pathTok.length &&
- bi < baseTok.length &&
- pathTok[pi].equals(baseTok[bi])) {
- pi++;
- bi++;
- }
-
- // for each path component left in base, add "../"
- while (bi < baseTok.length) {
- bi++;
- newPath.append("..\\");
- }
-
- // now add everything left in path
- while (pi < pathTok.length) {
- newPath.append(pathTok[pi]);
- pi++;
- if (pi != pathTok.length) {
- newPath.append("\\");
- }
- }
- return newPath.toString();
- }
-
- private void writeFile(String tool, Vector allConfigs, FileInfo fi, String base) {
- if (fi.attr.configs == null && fi.attr.pchRoot == false && fi.attr.noPch == false) {
- tag(tool, "Include", rel(fi.full, base));
- }
- else {
- startTag(tool, "Include", rel(fi.full, base));
- for (BuildConfig cfg : allConfigs) {
- if (fi.attr.configs != null && !fi.attr.configs.contains(cfg.get("Name"))) {
- tagData(cfg, "ExcludedFromBuild", "true");
- }
- if (fi.attr.pchRoot) {
- tagData(cfg, "PrecompiledHeader", "Create");
- }
- if (fi.attr.noPch) {
- startTag(cfg, "PrecompiledHeader");
- endTag("PrecompiledHeader");
- }
- }
- endTag(tool);
- }
+ // Will visit file tree for each include
+ private void handleIncludes(Vector includes, Vector allConfigs) {
+ for (String path : includes) {
+ FileTreeCreatorVC10 ftc = new FileTreeCreatorVC10(FileSystems.getDefault().getPath(path) , allConfigs, this);
+ try {
+ ftc.writeFileTree();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
String buildCond(BuildConfig cfg) {
return "'$(Configuration)|$(Platform)'=='"+cfg.get("Name")+"'";
}
-
void tagV(Vector v) {
Iterator i = v.iterator();
while(i.hasNext()) {
@@ -391,6 +285,7 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 {
startTag(name, ss);
}
+
}
class CompilerInterfaceVC10 extends CompilerInterface {
diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java
deleted file mode 100644
index f29abc051e4..00000000000
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC6.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- *
- */
-
-import java.io.*;
-import java.util.*;
-
-public class WinGammaPlatformVC6 extends WinGammaPlatform {
- public void writeProjectFile(String projectFileName, String projectName,
- Vector allConfigs) throws IOException {
- Vector allConfigNames = new Vector();
-
- printWriter = new PrintWriter(new FileWriter(projectFileName));
- String cfg = ((BuildConfig)allConfigs.get(0)).get("Name");
-
- printWriter.println("# Microsoft Developer Studio Project File - Name=\"" + projectName + "\" - Package Owner=<4>");
- printWriter.println("# Microsoft Developer Studio Generated Build File, Format Version 6.00");
- printWriter.println("# ** DO NOT EDIT **");
- printWriter.println("");
- printWriter.println("# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102");
- printWriter.println("CFG=" + cfg);
- printWriter.println("");
-
- printWriter.println("!MESSAGE This is not a valid makefile. To build this project using NMAKE,");
- printWriter.println("!MESSAGE use the Export Makefile command and run");
- printWriter.println("!MESSAGE ");
- printWriter.println("!MESSAGE NMAKE /f \"" + projectName + ".mak\".");
- printWriter.println("!MESSAGE ");
- printWriter.println("!MESSAGE You can specify a configuration when running NMAKE");
- printWriter.println("!MESSAGE by defining the macro CFG on the command line. For example:");
- printWriter.println("!MESSAGE ");
- printWriter.println("!MESSAGE NMAKE /f \"" + projectName + ".mak\" CFG=\"" + cfg + "\"");
- printWriter.println("!MESSAGE ");
- printWriter.println("!MESSAGE Possible choices for configuration are:");
- printWriter.println("!MESSAGE ");
- for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
- String name = ((BuildConfig)i.next()).get("Name");
- printWriter.println("!MESSAGE \""+ name + "\" (based on \"Win32 (x86) Dynamic-Link Library\")");
- allConfigNames.add(name);
- }
- printWriter.println("!MESSAGE ");
- printWriter.println("");
-
- printWriter.println("# Begin Project");
- printWriter.println("# PROP AllowPerConfigDependencies 0");
- printWriter.println("# PROP Scc_ProjName \"\"");
- printWriter.println("# PROP Scc_LocalPath \"\"");
- printWriter.println("CPP=cl.exe");
- printWriter.println("MTL=midl.exe");
- printWriter.println("RSC=rc.exe");
-
-
- String keyword = "!IF";
- for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
- BuildConfig bcfg = (BuildConfig)i.next();
- printWriter.println(keyword + " \"$(CFG)\" == \"" + bcfg.get("Name") + "\"");
- writeConfigHeader(bcfg);
- keyword = "!ELSEIF";
- if (!i.hasNext()) printWriter.println("!ENDIF");
- }
-
-
- TreeSet sortedFiles = sortFiles(computeAttributedFiles(allConfigs));
-
- printWriter.println("# Begin Target");
-
- for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
- printWriter.println("# Name \"" + ((BuildConfig)i.next()).get("Name") + "\"");
- }
- printWriter.println("# Begin Group \"Header Files\"");
- printWriter.println("# PROP Default_Filter \"h;hpp;hxx;hm;inl;fi;fd\"");
-
- Iterator i = sortedFiles.iterator();
-
- while (i.hasNext()) {
- FileInfo fi = (FileInfo)i.next();
-
- // skip sources
- if (!fi.isHeader()) {
- continue;
- }
-
- printFile(fi, allConfigNames);
- }
- printWriter.println("# End Group");
- printWriter.println("");
-
- printWriter.println("# Begin Group \"Source Files\"");
- printWriter.println("# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90\"");
-
- i = sortedFiles.iterator();
- while (i.hasNext()) {
- FileInfo fi = (FileInfo)i.next();
-
- // skip headers
- if (fi.isHeader()) {
- continue;
- }
-
- printFile(fi, allConfigNames);
- }
- printWriter.println("# End Group");
- printWriter.println("");
-
-
- printWriter.println("# Begin Group \"Resource Files\"");
- printWriter.println("# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe\"");
- printWriter.println("# End Group");
- printWriter.println("");
- printWriter.println("# End Target");
-
- printWriter.println("# End Project");
-
- printWriter.close();
- }
-
-
- void printFile(FileInfo fi, Vector allConfigNames) {
- printWriter.println("# Begin Source File");
- printWriter.println("");
- printWriter.println("SOURCE=\"" + fi.full + "\"");
- FileAttribute attr = fi.attr;
-
- if (attr.noPch) {
- printWriter.println("# SUBTRACT CPP /YX /Yc /Yu");
- }
-
- if (attr.pchRoot) {
- printWriter.println("# ADD CPP /Yc\"incls/_precompiled.incl\"");
- }
- if (attr.configs != null) {
- String keyword = "!IF";
- for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
- String cfg = (String)j.next();
- if (!attr.configs.contains(cfg)) {
- printWriter.println(keyword+" \"$(CFG)\" == \"" + cfg +"\"");
- printWriter.println("# PROP BASE Exclude_From_Build 1");
- printWriter.println("# PROP Exclude_From_Build 1");
- keyword = "!ELSEIF";
- }
- }
- printWriter.println("!ENDIF");
- }
-
- printWriter.println("# End Source File");
- }
-
- void writeConfigHeader(BuildConfig cfg) {
- printWriter.println("# Begin Special Build Tool");
- printWriter.println("SOURCE=\"$(InputPath)\"");
- printWriter.println("PreLink_Desc=" + BuildConfig.getFieldString(null, "PrelinkDescription"));
- printWriter.println("PreLink_Cmds=" +
- cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand")));
- printWriter.println("# End Special Build Tool");
- printWriter.println("");
-
- for (Iterator i = cfg.getV("CompilerFlags").iterator(); i.hasNext(); ) {
- printWriter.println("# "+(String)i.next());
- }
-
-
- printWriter.println("LINK32=link.exe");
-
- for (Iterator i = cfg.getV("LinkerFlags").iterator(); i.hasNext(); ) {
- printWriter.println("# "+(String)i.next());
- }
-
- printWriter.println("ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32");
- printWriter.println("ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32");
- printWriter.println("ADD BASE RSC /l 0x409 /d \"_DEBUG\"");
- printWriter.println("ADD RSC /l 0x409 /d \"_DEBUG\"");
- printWriter.println("BSC32=bscmake.exe");
- printWriter.println("ADD BASE BSC32 /nologo");
- printWriter.println("ADD BSC32 /nologo");
- printWriter.println("");
- }
-
- protected String getProjectExt() {
- return ".dsp";
- }
-}
-
-
-class CompilerInterfaceVC6 extends CompilerInterface {
- Vector getBaseCompilerFlags(Vector defines, Vector includes, String outDir) {
- Vector rv = new Vector();
-
- rv.add("PROP BASE Use_MFC 0");
- rv.add("PROP Use_MFC 0");
- rv.add("ADD CPP /nologo /MT /W3 /WX /GX /YX /Fr /FD /c");
- rv.add("PROP BASE Output_Dir \""+outDir+"\"");
- rv.add("PROP Output_Dir \""+outDir+"\"");
- rv.add("PROP BASE Intermediate_Dir \""+outDir+"\"");
- rv.add("PROP Intermediate_Dir \""+outDir+"\"");
- rv.add("PROP BASE Target_Dir \"\"");
- rv.add("PROP Target_Dir \"\"");
- rv.add("ADD BASE CPP "+Util.prefixed_join(" /I ", includes, true));
- rv.add("ADD CPP "+Util.prefixed_join(" /I ", includes, true));
- rv.add("ADD BASE CPP "+Util.prefixed_join(" /D ", defines, true));
- rv.add("ADD CPP "+Util.prefixed_join(" /D ", defines, true));
- rv.add("ADD CPP /Yu\"incls/_precompiled.incl\"");
-
- return rv;
- }
-
- Vector getBaseLinkerFlags(String outDir, String outDll, String platformName) {
- Vector rv = new Vector();
-
- rv.add("PROP Ignore_Export_Lib 0");
- rv.add("ADD BASE CPP /MD");
- rv.add("ADD CPP /MD");
- rv.add("ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib " +
- " advapi32.lib shell32.lib ole32.lib oleaut32.lib winmm.lib");
- String machine = "/machine:I386";
- if (platformName.equals("x64")) {
- machine = "/machine:X64";
- }
- rv.add("ADD LINK32 /out:\""+outDll+"\" "+
- " /nologo /subsystem:windows /machine:" + machine +
- " /nologo /base:\"0x8000000\" /subsystem:windows /dll" +
- " /export:JNI_GetDefaultJavaVMInitArgs /export:JNI_CreateJavaVM /export:JNI_GetCreatedJavaVMs "+
- " /export:jio_snprintf /export:jio_printf /export:jio_fprintf /export:jio_vfprintf "+
- " /export:jio_vsnprintf ");
- rv.add("SUBTRACT LINK32 /pdb:none /map");
-
- return rv;
- }
-
- Vector getDebugCompilerFlags(String opt) {
- Vector rv = new Vector();
-
- rv.add("ADD BASE CPP /Gm /Zi /O"+opt);
-
- return rv;
- }
-
- Vector getDebugLinkerFlags() {
- Vector rv = new Vector();
-
- rv.add("PROP BASE Use_Debug_Libraries 1");
- rv.add("PROP Use_Debug_Libraries 1");
- rv.add("ADD LINK32 /debug");
-
- return rv;
- }
-
- void getAdditionalNonKernelLinkerFlags(Vector rv) {}
-
- Vector getProductCompilerFlags() {
- Vector rv = new Vector();
-
- rv.add("ADD CPP /O"+getOptFlag());
-
- return rv;
- }
-
- Vector getProductLinkerFlags() {
- Vector rv = new Vector();
-
- rv.add("PROP BASE Use_Debug_Libraries 0");
- rv.add("PROP Use_Debug_Libraries 0");
-
- return rv;
- }
-
- String getOptFlag() {
- return "2";
- }
-
- String getNoOptFlag() {
- return "d";
- }
-
- String makeCfgName(String flavourBuild, String platform) {
- return "vm - "+ platform + " " + flavourBuild;
- }
-}
diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
index d1d63c84734..09e961cbfa0 100644
--- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
+++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC7.java
@@ -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
@@ -25,758 +25,326 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.TreeSet;
+import java.nio.file.FileSystems;
import java.util.Vector;
public class WinGammaPlatformVC7 extends WinGammaPlatform {
- String projectVersion() {return "7.10";};
-
- public void writeProjectFile(String projectFileName, String projectName,
- Vector allConfigs) throws IOException {
- System.out.println();
- System.out.println(" Writing .vcproj file: "+projectFileName);
- // If we got this far without an error, we're safe to actually
- // write the .vcproj file
- printWriter = new PrintWriter(new FileWriter(projectFileName));
-
- printWriter.println("");
- startTag(
- "VisualStudioProject",
- new String[] {
- "ProjectType", "Visual C++",
- "Version", projectVersion(),
- "Name", projectName,
- "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
- "SccProjectName", "",
- "SccLocalPath", ""
- }
- );
- startTag("Platforms");
- tag("Platform", new String[] {"Name", (String) BuildConfig.getField(null, "PlatformName")});
- endTag("Platforms");
-
- startTag("Configurations");
-
- for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
- writeConfiguration((BuildConfig)i.next());
- }
-
- endTag("Configurations");
-
- tag("References");
-
- writeFiles(allConfigs);
-
- tag("Globals");
-
- endTag("VisualStudioProject");
- printWriter.close();
-
- System.out.println(" Done.");
- }
-
-
- abstract class NameFilter {
- protected String fname;
-
- abstract boolean match(FileInfo fi);
-
- String filterString() { return ""; }
- String name() { return this.fname;}
-
- @Override
- // eclipse auto-generated
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + getOuterType().hashCode();
- result = prime * result + ((fname == null) ? 0 : fname.hashCode());
- return result;
- }
-
- @Override
- // eclipse auto-generated
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- NameFilter other = (NameFilter) obj;
- if (!getOuterType().equals(other.getOuterType()))
- return false;
- if (fname == null) {
- if (other.fname != null)
- return false;
- } else if (!fname.equals(other.fname))
- return false;
- return true;
- }
-
- // eclipse auto-generated
- private WinGammaPlatformVC7 getOuterType() {
- return WinGammaPlatformVC7.this;
- }
- }
-
- class DirectoryFilter extends NameFilter {
- String dir;
- int baseLen, dirLen;
-
- DirectoryFilter(String dir, String sbase) {
- this.dir = dir;
- this.baseLen = sbase.length();
- this.dirLen = dir.length();
- this.fname = dir;
- }
-
- DirectoryFilter(String fname, String dir, String sbase) {
- this.dir = dir;
- this.baseLen = sbase.length();
- this.dirLen = dir.length();
- this.fname = fname;
- }
-
-
- boolean match(FileInfo fi) {
- int lastSlashIndex = fi.full.lastIndexOf('/');
- String fullDir = fi.full.substring(0, lastSlashIndex);
- return fullDir.endsWith(dir);
- }
-
- @Override
- // eclipse auto-generated
- public int hashCode() {
- final int prime = 31;
- int result = super.hashCode();
- result = prime * result + getOuterType().hashCode();
- result = prime * result + baseLen;
- result = prime * result + ((dir == null) ? 0 : dir.hashCode());
- result = prime * result + dirLen;
- return result;
- }
-
- @Override
- // eclipse auto-generated
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (!super.equals(obj))
- return false;
- if (getClass() != obj.getClass())
- return false;
- DirectoryFilter other = (DirectoryFilter) obj;
- if (!getOuterType().equals(other.getOuterType()))
- return false;
- if (baseLen != other.baseLen)
- return false;
- if (dir == null) {
- if (other.dir != null)
- return false;
- } else if (!dir.equals(other.dir))
- return false;
- if (dirLen != other.dirLen)
- return false;
- return true;
- }
-
- // eclipse auto-generated
- private WinGammaPlatformVC7 getOuterType() {
- return WinGammaPlatformVC7.this;
- }
- }
-
- class TerminatorFilter extends NameFilter {
- TerminatorFilter(String fname) {
- this.fname = fname;
-
- }
- boolean match(FileInfo fi) {
- return true;
- }
-
- }
-
- class SpecificNameFilter extends NameFilter {
- String pats[];
-
- SpecificNameFilter(String fname, String[] pats) {
- this.fname = fname;
- this.pats = pats;
- }
-
- boolean match(FileInfo fi) {
- for (int i=0; i makeFilters(TreeSet files) {
- Vector rv = new Vector();
- String sbase = Util.normalize(BuildConfig.getFieldString(null, "SourceBase")+"/src/");
-
- String currentDir = "";
- DirectoryFilter container = null;
- for(FileInfo fileInfo : files) {
-
- if (!fileInfo.full.startsWith(sbase)) {
- continue;
- }
-
- int lastSlash = fileInfo.full.lastIndexOf('/');
- String dir = fileInfo.full.substring(sbase.length(), lastSlash);
- if(dir.equals("share/vm")) {
- // skip files directly in share/vm - should only be precompiled.hpp which is handled below
- continue;
- }
- if (!dir.equals(currentDir)) {
- currentDir = dir;
- if (container != null && !rv.contains(container)) {
- rv.add(container);
- }
-
- // remove "share/vm/" from names
- String name = dir;
- if (dir.startsWith("share/vm/")) {
- name = dir.substring("share/vm/".length(), dir.length());
- }
- DirectoryFilter newfilter = new DirectoryFilter(name, dir, sbase);
- int i = rv.indexOf(newfilter);
- if(i == -1) {
- container = newfilter;
- } else {
- // if the filter already exists, reuse it
- container = (DirectoryFilter) rv.get(i);
- }
- }
- }
- if (container != null && !rv.contains(container)) {
- rv.add(container);
- }
-
- ContainerFilter generated = new ContainerFilter("Generated");
- ContainerFilter c1Generated = new ContainerFilter("C1");
- c1Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler1/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
- c1Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler1/generated/jvmtifiles/.*"}));
- generated.add(c1Generated);
- ContainerFilter c2Generated = new ContainerFilter("C2");
- c2Generated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*compiler2/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
- c2Generated.add(new SpecificPathFilter("adfiles", new String[] {".*compiler2/generated/adfiles/.*"}));
- c2Generated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*compiler2/generated/jvmtifiles/.*"}));
- generated.add(c2Generated);
- ContainerFilter coreGenerated = new ContainerFilter("Core");
- coreGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*core/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
- coreGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*core/generated/jvmtifiles/.*"}));
- generated.add(coreGenerated);
- ContainerFilter tieredGenerated = new ContainerFilter("Tiered");
- tieredGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*tiered/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
- tieredGenerated.add(new SpecificPathFilter("adfiles", new String[] {".*tiered/generated/adfiles/.*"}));
- tieredGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*tiered/generated/jvmtifiles/.*"}));
- generated.add(tieredGenerated);
- ContainerFilter kernelGenerated = new ContainerFilter("Kernel");
- kernelGenerated.add(new SpecificPathFilter("C++ Interpreter Generated", new String[] {".*kernel/generated/jvmtifiles/bytecodeInterpreterWithChecks.+"}));
- kernelGenerated.add(new SpecificPathFilter("jvmtifiles", new String[] {".*kernel/generated/jvmtifiles/.*"}));
- generated.add(kernelGenerated);
- rv.add(generated);
-
- rv.add(new SpecificNameFilter("Precompiled Header", new String[] {"precompiled.hpp"}));
-
- // this one is to catch files not caught by other filters
- rv.add(new TerminatorFilter("Source Files"));
-
- return rv;
- }
-
- void writeFiles(Vector allConfigs) {
-
- Hashtable allFiles = computeAttributedFiles(allConfigs);
-
- Vector allConfigNames = new Vector();
- for (Iterator i = allConfigs.iterator(); i.hasNext(); ) {
- allConfigNames.add(((BuildConfig)i.next()).get("Name"));
- }
-
- TreeSet sortedFiles = sortFiles(allFiles);
-
- startTag("Files");
-
- for (Iterator i = makeFilters(sortedFiles).iterator(); i.hasNext(); ) {
- doWriteFiles(sortedFiles, allConfigNames, (NameFilter)i.next());
- }
-
-
- startTag("Filter",
- new String[] {
- "Name", "Resource Files",
- "Filter", "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
- }
- );
- endTag("Filter");
-
- endTag("Files");
- }
-
- void doWriteFiles(TreeSet allFiles, Vector allConfigNames, NameFilter filter) {
- startTag("Filter",
- new String[] {
- "Name", filter.name(),
- "Filter", filter.filterString()
- }
- );
-
- if (filter instanceof ContainerFilter) {
-
- Iterator i = ((ContainerFilter)filter).babies();
- while (i.hasNext()) {
- doWriteFiles(allFiles, allConfigNames, (NameFilter)i.next());
- }
-
- } else {
-
- Iterator i = allFiles.iterator();
- while (i.hasNext()) {
- FileInfo fi = (FileInfo)i.next();
-
- if (!filter.match(fi)) {
- continue;
- }
-
- startTag("File",
- new String[] {
- "RelativePath", fi.full.replace('/', '\\')
- }
- );
-
- FileAttribute a = fi.attr;
- if (a.pchRoot) {
- writeCustomToolConfig(allConfigNames,
- new String[] {
- "Name", "VCCLCompilerTool",
- "UsePrecompiledHeader", "1"
- });
- }
-
- if (a.noPch) {
- writeCustomToolConfig(allConfigNames,
- new String[] {
- "Name", "VCCLCompilerTool",
- "UsePrecompiledHeader", "0"
- });
- }
-
- if (a.configs != null) {
- for (Iterator j=allConfigNames.iterator(); j.hasNext();) {
- String cfg = (String)j.next();
- if (!a.configs.contains(cfg)) {
- startTag("FileConfiguration",
- new String[] {
- "Name", cfg,
- "ExcludedFromBuild", "TRUE"
- });
- endTag("FileConfiguration");
-
- }
- }
- }
-
- endTag("File");
-
- // we not gonna look at this file anymore
- i.remove();
- }
- }
-
- endTag("Filter");
- }
-
-
- void writeConfiguration(BuildConfig cfg) {
- startTag("Configuration",
- new String[] {
- "Name", cfg.get("Name"),
- "OutputDirectory", cfg.get("OutputDir"),
- "IntermediateDirectory", cfg.get("OutputDir"),
- "ConfigurationType", "2",
- "UseOfMFC", "0",
- "ATLMinimizesCRunTimeLibraryUsage", "FALSE"
- }
- );
-
-
-
- tagV("Tool", cfg.getV("CompilerFlags"));
-
- tag("Tool",
- new String[] {
- "Name", "VCCustomBuildTool"
- }
- );
-
- tagV("Tool", cfg.getV("LinkerFlags"));
-
- tag("Tool",
- new String[] {
- "Name", "VCPostBuildEventTool",
- "Description", BuildConfig.getFieldString(null, "PostbuildDescription"),
- //Caution: String.replace(String,String) is available from JDK5 onwards only
- "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PostbuildCommand").replace
- ("\t", "
"))
- }
- );
-
- tag("Tool",
- new String[] {
- "Name", "VCPreBuildEventTool"
- }
- );
-
- tag("Tool",
- new String[] {
- "Name", "VCPreLinkEventTool",
- "Description", BuildConfig.getFieldString(null, "PrelinkDescription"),
- //Caution: String.replace(String,String) is available from JDK5 onwards only
- "CommandLine", cfg.expandFormat(BuildConfig.getFieldString(null, "PrelinkCommand").replace
- ("\t", "
"))
- }
- );
-
- tag("Tool",
- new String[] {
- "Name", "VCResourceCompilerTool",
- // XXX???
- "PreprocessorDefinitions", "NDEBUG",
- "Culture", "1033"
- }
- );
-
- tag("Tool",
- new String[] {
- "Name", "VCMIDLTool",
- "PreprocessorDefinitions", "NDEBUG",
- "MkTypLibCompatible", "TRUE",
- "SuppressStartupBanner", "TRUE",
- "TargetEnvironment", "1",
- "TypeLibraryName", cfg.get("OutputDir") + Util.sep + "vm.tlb",
- "HeaderFileName", ""
- }
- );
-
- endTag("Configuration");
- }
-
- int indent;
-
- private void startTagPrim(String name,
- String[] attrs,
- boolean close) {
- startTagPrim(name, attrs, close, true);
- }
-
- private void startTagPrim(String name,
- String[] attrs,
- boolean close,
- boolean newline) {
- doIndent();
- printWriter.print("<"+name);
- indent++;
-
- if (attrs != null && attrs.length > 0) {
- for (int i=0; i");
- } else {
- printWriter.print(">");
- }
- if(newline) {
- printWriter.println();
- }
- }
-
- void startTag(String name, String... attrs) {
- startTagPrim(name, attrs, false);
- }
-
- void startTagV(String name, Vector attrs) {
- String s[] = new String [attrs.size()];
- for (int i=0; i allConfigs) throws IOException {
+ System.out.println();
+ System.out.println(" Writing .vcproj file: " + projectFileName);
+ // If we got this far without an error, we're safe to actually
+ // write the .vcproj file
+ printWriter = new PrintWriter(new FileWriter(projectFileName));
+
+ printWriter
+ .println("");
+ startTag("VisualStudioProject", new String[] { "ProjectType",
+ "Visual C++", "Version", projectVersion(), "Name", projectName,
+ "ProjectGUID", "{8822CB5C-1C41-41C2-8493-9F6E1994338B}",
+ "SccProjectName", "", "SccLocalPath", "" });
+ startTag("Platforms");
+ tag("Platform",
+ new String[] { "Name",
+ (String) BuildConfig.getField(null, "PlatformName") });
+ endTag();
+
+ startTag("Configurations");
+
+ for (BuildConfig cfg : allConfigs) {
+ writeConfiguration(cfg);
+ }
+
+ endTag();
+
+ tag("References");
+
+ writeFiles(allConfigs);
+
+ tag("Globals");
+
+ endTag();
+ printWriter.close();
+
+ System.out.println(" Done.");
+ }
+
+ void writeCustomToolConfig(Vector configs, String[] customToolAttrs) {
+ for (BuildConfig cfg : configs) {
+ startTag("FileConfiguration",
+ new String[] { "Name", (String) cfg.get("Name") });
+ tag("Tool", customToolAttrs);
+
+ endTag();
+ }
+ }
+
+ void writeFiles(Vector allConfigs) {
+
+ // This code assummes there are no config specific includes.
+ startTag("Files");
+ String sourceBase = BuildConfig.getFieldString(null, "SourceBase");
+
+ // Use first config for all global absolute includes.
+ BuildConfig baseConfig = allConfigs.firstElement();
+ Vector rv = new Vector();
+
+ // Then use first config for all relative includes
+ Vector ri = new Vector();
+ baseConfig.collectRelevantVectors(ri, "RelativeSrcInclude");
+ for (String f : ri) {
+ rv.add(sourceBase + Util.sep + f);
+ }
+
+ baseConfig.collectRelevantVectors(rv, "AbsoluteSrcInclude");
+
+ handleIncludes(rv, allConfigs);
+
+ startTag("Filter", new String[] { "Name", "Resource Files", "Filter",
+ "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" });
+ endTag();
+
+ endTag();
+ }
+
+ // Will visit file tree for each include
+ private void handleIncludes(Vector includes, Vector allConfigs) {
+ for (String path : includes) {
+ FileTreeCreatorVC7 ftc = new FileTreeCreatorVC7(FileSystems.getDefault().getPath(path) , allConfigs, this);
+ try {
+ ftc.writeFileTree();
+ } catch (IOException e) {
+ e.printStackTrace();
}
- startTagPrim(name, s, false);
- }
+ }
+ }
- void endTag(String name) {
- indent--;
- doIndent();
- printWriter.println(""+name+">");
- }
+ void writeConfiguration(BuildConfig cfg) {
+ startTag("Configuration", new String[] { "Name", cfg.get("Name"),
+ "OutputDirectory", cfg.get("OutputDir"),
+ "IntermediateDirectory", cfg.get("OutputDir"),
+ "ConfigurationType", "2", "UseOfMFC", "0",
+ "ATLMinimizesCRunTimeLibraryUsage", "FALSE" });
- void tag(String name, String... attrs) {
- startTagPrim(name, attrs, true);
- }
+ tagV("Tool", cfg.getV("CompilerFlags"));
- void tagData(String name, String data) {
- doIndent();
- printWriter.print("<"+name+">");
- printWriter.print(data);
- printWriter.println(""+name+">");
- }
+ tag("Tool", new String[] { "Name", "VCCustomBuildTool" });
- void tagData(String name, String data, String... attrs) {
- startTagPrim(name, attrs, false, false);
- printWriter.print(data);
- printWriter.println(""+name+">");
- indent--;
- }
+ tagV("Tool", cfg.getV("LinkerFlags"));
- void tagV(String name, Vector attrs) {
- String s[] = new String [attrs.size()];
- for (int i=0; i Windows
+else # !SunOS, !Linux => Darwin or Windows
+ifeq ($(OS),Darwin)
+CPU = $(shell uname -m)
+ARCH1=$(CPU:x86_64=amd64)
+ARCH=$(ARCH1:i686=i386)
+ifdef LP64
+CFLAGS/sparcv9 += -m64
+CFLAGS/amd64 += -m64
+else
+ARCH=$(ARCH1:amd64=i386)
+CFLAGS/i386 += -m32
+CFLAGS/sparc += -m32
+endif # LP64
+CFLAGS += $(CFLAGS/$(ARCH))
+CFLAGS += -fPIC
+OS = macosx
+LIB_EXT = .dylib
+CC = gcc
+CFLAGS += -O
+# CFLAGS += -DZ_PREFIX
+DLDFLAGS += -shared
+DLDFLAGS += -lz
+LDFLAGS += -ldl
+OUTFLAGS += -o $@
+else #Windows
OS = windows
CC = gcc
#CPPFLAGS += /D"WIN32" /D"_WINDOWS" /D"DEBUG" /D"NDEBUG"
CFLAGS += /nologo /MD /W3 /WX /O2 /Fo$(@:.dll=.obj) /Gi-
-CFLAGS += LIBARCH=\"$(LIBARCH)\""
+CFLAGS += LIBARCH=\"$(LIBARCH)\"
DLDFLAGS += /dll /subsystem:windows /incremental:no \
/export:decode_instruction
OUTFLAGS += /link /out:$@
LIB_EXT = .dll
+endif # Darwin
endif # Linux
endif # SunOS
@@ -118,7 +147,7 @@ else
BINUTILSDIR = $(shell cd $(BINUTILS);pwd)
endif
-CPPFLAGS += -I$(BINUTILSDIR)/include -I$(BINUTILS)/bfd -I$(TARGET_DIR)/bfd
+CPPFLAGS += -I$(BINUTILSDIR)/include -I$(BINUTILSDIR)/bfd -I$(TARGET_DIR)/bfd
CPPFLAGS += -DLIBARCH_$(LIBARCH) -DLIBARCH=\"$(LIBARCH)\" -DLIB_EXT=\"$(LIB_EXT)\"
TARGET_DIR = build/$(OS)-$(JDKARCH)
diff --git a/hotspot/src/share/tools/hsdis/README b/hotspot/src/share/tools/hsdis/README
index f3080cbfcc9..51caa4051e9 100644
--- a/hotspot/src/share/tools/hsdis/README
+++ b/hotspot/src/share/tools/hsdis/README
@@ -1,4 +1,4 @@
-Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+Copyright (c) 2008, 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
@@ -38,8 +38,14 @@ copy of the software from http://directory.fsf.org/project/binutils or
one of it's mirrors. Builds targetting windows should use at least
2.19 and currently requires the use of a cross compiler.
+Binutils should be configured with the '--disable-nls' flag to disable
+Native Language Support, otherwise you might get an "undefined
+reference to `libintl_gettext'" if you try to load hsdis.so on systems
+which don't have NLS by default. It also avoids build problems on
+other configurations that don't include the full NLS support.
+
The makefile looks for the sources in build/binutils or you can
-specify it's location to the makefile using BINTUILS=path. It will
+specify it's location to the makefile using BINUTILS=path. It will
configure binutils and build it first and then build and link the
disasembly adapter. Make all will build the default target for your
platform. If you platform support both 32 and 64 simultaneously then
diff --git a/hotspot/src/share/tools/hsdis/hsdis-demo.c b/hotspot/src/share/tools/hsdis/hsdis-demo.c
index e83a0425c50..2f7b67d3649 100644
--- a/hotspot/src/share/tools/hsdis/hsdis-demo.c
+++ b/hotspot/src/share/tools/hsdis/hsdis-demo.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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,14 +26,16 @@
This demonstrates the protocol required by the HotSpot PrintAssembly option.
*/
+#include
+#include
+#include
+#include
+
#include "hsdis.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "string.h"
void greet(const char*);
-void disassemble(void*, void*);
+void disassemble(uintptr_t, uintptr_t);
void end_of_file();
const char* options = NULL;
@@ -62,7 +64,14 @@ int main(int ac, char** av) {
if (!greeted)
greet("world");
printf("...And now for something completely different:\n");
- disassemble((void*) &main, (void*) &end_of_file);
+ void *start = (void*) &main;
+ void *end = (void*) &end_of_file;
+#if defined(__ia64) || defined(__powerpc__)
+ /* On IA64 and PPC function pointers are pointers to function descriptors */
+ start = *((void**)start);
+ end = *((void**)end);
+#endif
+ disassemble(start, (end > start) ? end : start + 64);
printf("Cheers!\n");
}
@@ -76,7 +85,7 @@ void end_of_file() { }
#include "dlfcn.h"
-#define DECODE_INSTRUCTIONS_NAME "decode_instructions"
+#define DECODE_INSTRUCTIONS_NAME "decode_instructions_virtual"
#define HSDIS_NAME "hsdis"
static void* decode_instructions_pv = 0;
static const char* hsdis_path[] = {
@@ -108,8 +117,14 @@ static const char* load_decode_instructions() {
static const char* lookup(void* addr) {
+#if defined(__ia64) || defined(__powerpc__)
+ /* On IA64 and PPC function pointers are pointers to function descriptors */
+#define CHECK_NAME(fn) \
+ if (addr == *((void**) &fn)) return #fn;
+#else
#define CHECK_NAME(fn) \
if (addr == (void*) &fn) return #fn;
+#endif
CHECK_NAME(main);
CHECK_NAME(greet);
@@ -123,6 +138,14 @@ static const char* lookup(void* addr) {
static const char event_cookie[] = "event_cookie"; /* demo placeholder */
+static void* simple_handle_event(void* cookie, const char* event, void* arg) {
+ if (MATCH(event, "/insn")) {
+ // follow each complete insn by a nice newline
+ printf("\n");
+ }
+ return NULL;
+}
+
static void* handle_event(void* cookie, const char* event, void* arg) {
#define NS_DEMO "demo:"
if (cookie != event_cookie)
@@ -162,10 +185,8 @@ static void* handle_event(void* cookie, const char* event, void* arg) {
printf(" %p\t", arg);
} else if (MATCH(event, "/insn")) {
- /* basic action for :
- (none, plugin puts the newline for us
- */
-
+ // follow each complete insn by a nice newline
+ printf("\n");
} else if (MATCH(event, "mach")) {
printf("Decoding for CPU '%s'\n", (char*) arg);
@@ -186,7 +207,7 @@ static void* handle_event(void* cookie, const char* event, void* arg) {
#define fprintf_callback \
(decode_instructions_printf_callback_ftype)&fprintf
-void disassemble(void* from, void* to) {
+void disassemble(uintptr_t from, uintptr_t to) {
const char* err = load_decode_instructions();
if (err != NULL) {
printf("%s: %s\n", err, dlerror());
@@ -197,15 +218,15 @@ void disassemble(void* from, void* to) {
= (decode_instructions_ftype) decode_instructions_pv;
void* res;
if (raw && xml) {
- res = (*decode_instructions)(from, to, NULL, stdout, NULL, stdout, options);
+ res = (*decode_instructions)(from, to, (unsigned char*)from, to - from, simple_handle_event, stdout, NULL, stdout, options);
} else if (raw) {
- res = (*decode_instructions)(from, to, NULL, NULL, NULL, stdout, options);
+ res = (*decode_instructions)(from, to, (unsigned char*)from, to - from, simple_handle_event, stdout, NULL, stdout, options);
} else {
- res = (*decode_instructions)(from, to,
+ res = (*decode_instructions)(from, to, (unsigned char*)from, to - from,
handle_event, (void*) event_cookie,
fprintf_callback, stdout,
options);
}
- if (res != to)
+ if (res != (void*)to)
printf("*** Result was %p!\n", res);
}
diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c
index 8034ac15af5..251344e0ce8 100644
--- a/hotspot/src/share/tools/hsdis/hsdis.c
+++ b/hotspot/src/share/tools/hsdis/hsdis.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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,13 +27,13 @@
HotSpot PrintAssembly option.
*/
-#include "hsdis.h"
-
-#include
#include
#include
#include
#include
+#include
+#include
+#include "hsdis.h"
#ifndef bool
#define bool int
@@ -47,11 +47,15 @@ typedef decode_instructions_printf_callback_ftype printf_callback_t;
/* disassemble_info.application_data object */
struct hsdis_app_data {
- /* the arguments to decode_instructions */
- uintptr_t start; uintptr_t end;
+ /* virtual address of data */
+ uintptr_t start_va, end_va;
+ /* the instructions to be decoded */
+ unsigned char* buffer;
+ uintptr_t length;
event_callback_t event_callback; void* event_stream;
printf_callback_t printf_callback; void* printf_stream;
bool losing;
+ bool do_newline;
/* the architecture being disassembled */
const char* arch_name;
@@ -65,6 +69,8 @@ struct hsdis_app_data {
char insn_options[256];
};
+static void* decode(struct hsdis_app_data* app_data, const char* options);
+
#define DECL_APP_DATA(dinfo) \
struct hsdis_app_data* app_data = (struct hsdis_app_data*) (dinfo)->application_data
@@ -89,59 +95,91 @@ void*
#ifdef DLL_ENTRY
DLL_ENTRY
#endif
-decode_instructions(void* start_pv, void* end_pv,
- event_callback_t event_callback_arg, void* event_stream_arg,
- printf_callback_t printf_callback_arg, void* printf_stream_arg,
- const char* options) {
+decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
+ unsigned char* buffer, uintptr_t length,
+ event_callback_t event_callback_arg, void* event_stream_arg,
+ printf_callback_t printf_callback_arg, void* printf_stream_arg,
+ const char* options) {
struct hsdis_app_data app_data;
memset(&app_data, 0, sizeof(app_data));
- app_data.start = (uintptr_t) start_pv;
- app_data.end = (uintptr_t) end_pv;
+ app_data.start_va = start_va;
+ app_data.end_va = end_va;
+ app_data.buffer = buffer;
+ app_data.length = length;
app_data.event_callback = event_callback_arg;
app_data.event_stream = event_stream_arg;
app_data.printf_callback = printf_callback_arg;
app_data.printf_stream = printf_stream_arg;
+ app_data.do_newline = false;
- setup_app_data(&app_data, options);
+ return decode(&app_data, options);
+}
+
+/* This is the compatability interface for older version of hotspot */
+void*
+#ifdef DLL_ENTRY
+ DLL_ENTRY
+#endif
+decode_instructions(void* start_pv, void* end_pv,
+ event_callback_t event_callback_arg, void* event_stream_arg,
+ printf_callback_t printf_callback_arg, void* printf_stream_arg,
+ const char* options) {
+ decode_instructions_virtual((uintptr_t)start_pv,
+ (uintptr_t)end_pv,
+ (unsigned char*)start_pv,
+ (uintptr_t)end_pv - (uintptr_t)start_pv,
+ event_callback_arg,
+ event_stream_arg,
+ printf_callback_arg,
+ printf_stream_arg,
+ options);
+}
+
+static void* decode(struct hsdis_app_data* app_data, const char* options) {
+ setup_app_data(app_data, options);
char buf[128];
{
/* now reload everything from app_data: */
- DECL_EVENT_CALLBACK(&app_data);
- DECL_PRINTF_CALLBACK(&app_data);
- uintptr_t start = app_data.start;
- uintptr_t end = app_data.end;
+ DECL_EVENT_CALLBACK(app_data);
+ DECL_PRINTF_CALLBACK(app_data);
+ uintptr_t start = app_data->start_va;
+ uintptr_t end = app_data->end_va;
uintptr_t p = start;
(*event_callback)(event_stream, "insns", (void*)start);
(*event_callback)(event_stream, "mach name='%s'",
- (void*) app_data.arch_info->printable_name);
- if (app_data.dinfo.bytes_per_line != 0) {
+ (void*) app_data->arch_info->printable_name);
+ if (app_data->dinfo.bytes_per_line != 0) {
(*event_callback)(event_stream, "format bytes-per-line='%p'/",
- (void*)(intptr_t) app_data.dinfo.bytes_per_line);
+ (void*)(intptr_t) app_data->dinfo.bytes_per_line);
}
- while (p < end && !app_data.losing) {
+ while (p < end && !app_data->losing) {
(*event_callback)(event_stream, "insn", (void*) p);
/* reset certain state, so we can read it with confidence */
- app_data.dinfo.insn_info_valid = 0;
- app_data.dinfo.branch_delay_insns = 0;
- app_data.dinfo.data_size = 0;
- app_data.dinfo.insn_type = 0;
+ app_data->dinfo.insn_info_valid = 0;
+ app_data->dinfo.branch_delay_insns = 0;
+ app_data->dinfo.data_size = 0;
+ app_data->dinfo.insn_type = 0;
- int size = (*app_data.dfn)((bfd_vma) p, &app_data.dinfo);
+ int size = (*app_data->dfn)((bfd_vma) p, &app_data->dinfo);
if (size > 0) p += size;
- else app_data.losing = true;
+ else app_data->losing = true;
- const char* insn_close = format_insn_close("/insn", &app_data.dinfo,
- buf, sizeof(buf));
- (*event_callback)(event_stream, insn_close, (void*) p);
+ if (!app_data->losing) {
+ const char* insn_close = format_insn_close("/insn", &app_data->dinfo,
+ buf, sizeof(buf));
+ (*event_callback)(event_stream, insn_close, (void*) p) != NULL;
- /* follow each complete insn by a nice newline */
- (*printf_callback)(printf_stream, "\n");
+ if (app_data->do_newline) {
+ /* follow each complete insn by a nice newline */
+ (*printf_callback)(printf_stream, "\n");
+ }
+ }
}
(*event_callback)(event_stream, "/insns", (void*) p);
@@ -150,7 +188,7 @@ decode_instructions(void* start_pv, void* end_pv,
}
/* take the address of the function, for luck, and also test the typedef: */
-const decode_instructions_ftype decode_instructions_address = &decode_instructions;
+const decode_instructions_ftype decode_instructions_address = &decode_instructions_virtual;
static const char* format_insn_close(const char* close,
disassemble_info* dinfo,
@@ -189,13 +227,14 @@ hsdis_read_memory_func(bfd_vma memaddr,
bfd_byte* myaddr,
unsigned int length,
struct disassemble_info* dinfo) {
- uintptr_t memaddr_p = (uintptr_t) memaddr;
DECL_APP_DATA(dinfo);
- if (memaddr_p + length > app_data->end) {
+ /* convert the virtual address memaddr into an address within memory buffer */
+ uintptr_t offset = ((uintptr_t) memaddr) - app_data->start_va;
+ if (offset + length > app_data->length) {
/* read is out of bounds */
return EIO;
} else {
- memcpy(myaddr, (bfd_byte*) memaddr_p, length);
+ memcpy(myaddr, (bfd_byte*) (app_data->buffer + offset), length);
return 0;
}
}
@@ -407,16 +446,16 @@ static const bfd_arch_info_type* find_arch_info(const char* arch_name) {
static const char* native_arch_name() {
const char* res = NULL;
#ifdef LIBARCH_i386
- res = "i386";
+ res = "i386";
#endif
#ifdef LIBARCH_amd64
- res = "i386:x86-64";
+ res = "i386:x86-64";
#endif
#ifdef LIBARCH_sparc
- res = "sparc:v8plusb";
+ res = "sparc:v8plusb";
#endif
#ifdef LIBARCH_sparcv9
- res = "sparc:v9b";
+ res = "sparc:v9b";
#endif
if (res == NULL)
res = "architecture not set in Makefile!";
@@ -468,7 +507,7 @@ static void parse_fake_insn(disassembler_ftype dfn,
dinfo->fprintf_func = &print_to_dev_null;
(*dfn)(0, dinfo);
- // put it back:
+ /* put it back */
dinfo->read_memory_func = read_memory_func;
dinfo->fprintf_func = fprintf_func;
}
diff --git a/hotspot/src/share/tools/hsdis/hsdis.h b/hotspot/src/share/tools/hsdis/hsdis.h
index d1b2dd96476..5ab26ef086c 100644
--- a/hotspot/src/share/tools/hsdis/hsdis.h
+++ b/hotspot/src/share/tools/hsdis/hsdis.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 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
@@ -25,7 +25,10 @@
/* decode_instructions -- dump a range of addresses as native instructions
This implements the protocol required by the HotSpot PrintAssembly option.
- The starting and ending addresses are within the current process's address space.
+ The start_va, end_va is the virtual address the region of memory to
+ disasemble and buffer contains the instructions to decode,
+ Disassembling instructions in the current address space is done by
+ having start_va == buffer.
The option string, if not empty, is interpreted by the disassembler implementation.
@@ -48,18 +51,20 @@ extern
#ifdef DLL_EXPORT
DLL_EXPORT
#endif
-void* decode_instructions(void* start, void* end,
- void* (*event_callback)(void*, const char*, void*),
- void* event_stream,
- int (*printf_callback)(void*, const char*, ...),
- void* printf_stream,
- const char* options);
+void* decode_instructions_virtual(uintptr_t start_va, uintptr_t end_va,
+ unsigned char* buffer, 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);
/* convenience typedefs */
typedef void* (*decode_instructions_event_callback_ftype) (void*, const char*, void*);
typedef int (*decode_instructions_printf_callback_ftype) (void*, const char*, ...);
-typedef void* (*decode_instructions_ftype) (void* start, void* end,
+typedef void* (*decode_instructions_ftype) (uintptr_t start_va, uintptr_t end_va,
+ unsigned char* buffer, uintptr_t length,
decode_instructions_event_callback_ftype event_callback,
void* event_stream,
decode_instructions_printf_callback_ftype printf_callback,
diff --git a/hotspot/src/share/vm/adlc/adlparse.cpp b/hotspot/src/share/vm/adlc/adlparse.cpp
index ff486733efc..6d08eab8010 100644
--- a/hotspot/src/share/vm/adlc/adlparse.cpp
+++ b/hotspot/src/share/vm/adlc/adlparse.cpp
@@ -1392,7 +1392,7 @@ void ADLParser::pipe_parse(void) {
_AD.addForm(machnode);
}
else if (!strcmp(ident, "attributes")) {
- bool vsi_seen = false, bhds_seen = false;
+ bool vsi_seen = false;
skipws();
if ( (_curchar != '%')
@@ -1436,7 +1436,6 @@ void ADLParser::pipe_parse(void) {
}
pipeline->_branchHasDelaySlot = true;
- bhds_seen = true;
continue;
}
@@ -1639,6 +1638,12 @@ void ADLParser::resource_parse(PipelineForm &pipeline) {
next_char(); // Skip "(" or ","
ident = get_ident(); // Grab next identifier
+ if (_AD._adl_debug > 1) {
+ if (ident != NULL) {
+ fprintf(stderr, "resource_parse: identifier: %s\n", ident);
+ }
+ }
+
if (ident == NULL) {
parse_err(SYNERR, "keyword identifier expected at \"%c\"\n", _curchar);
return;
@@ -2427,7 +2432,6 @@ InstructForm *ADLParser::peep_match_child_parse(PeepMatch &match, int parent, in
int lparen = 0; // keep track of parenthesis nesting depth
int rparen = 0; // position of instruction at this depth
InstructForm *inst_seen = NULL;
- InstructForm *child_seen = NULL;
// Walk the match tree,
// Record
@@ -2437,7 +2441,7 @@ InstructForm *ADLParser::peep_match_child_parse(PeepMatch &match, int parent, in
if (_curchar == '(') {
++lparen;
next_char();
- child_seen = peep_match_child_parse(match, parent, position, rparen);
+ ( void ) peep_match_child_parse(match, parent, position, rparen);
}
// Right paren signals end of an input, may be more
else if (_curchar == ')') {
@@ -3154,6 +3158,9 @@ void ADLParser::constant_parse_expression(EncClass* encoding, char* ec_name) {
//------------------------------size_parse-----------------------------------
+// Parse a 'size()' attribute which specifies the size of the
+// emitted instructions in bytes. can be a C++ expression,
+// e.g. a constant.
char* ADLParser::size_parse(InstructForm *instr) {
char* sizeOfInstr = NULL;
@@ -4274,7 +4281,17 @@ char *ADLParser::get_ident_common(bool do_preproc) {
|| ((c >= '0') && (c <= '9'))
|| ((c == '_')) || ((c == ':')) || ((c == '#')) );
if (start == end) { // We popped out on the first try
- parse_err(SYNERR, "identifier expected at %c\n", c);
+ // It can occur that `start' contains the rest of the input file.
+ // In this case the output should be truncated.
+ if (strlen(start) > 24) {
+ char buf[32];
+ strncpy(buf, start, 20);
+ buf[20] = '\0';
+ strcat(buf, "[...]");
+ parse_err(SYNERR, "Identifier expected, but found '%s'.", buf);
+ } else {
+ parse_err(SYNERR, "Identifier expected, but found '%s'.", start);
+ }
start = NULL;
}
else {
diff --git a/hotspot/src/share/vm/adlc/archDesc.cpp b/hotspot/src/share/vm/adlc/archDesc.cpp
index 23cbb1e007b..a8983ebaee0 100644
--- a/hotspot/src/share/vm/adlc/archDesc.cpp
+++ b/hotspot/src/share/vm/adlc/archDesc.cpp
@@ -221,6 +221,7 @@ ArchDesc::ArchDesc()
_register = NULL;
_encode = NULL;
_pipeline = NULL;
+ _frame = NULL;
}
ArchDesc::~ArchDesc() {
@@ -648,7 +649,10 @@ int ArchDesc::instructFormCount() {
// Return the textual binding for a given CPP flag name.
// Return NULL if there is no binding, or it has been #undef-ed.
char* ArchDesc::get_preproc_def(const char* flag) {
- SourceForm* deff = (SourceForm*) _preproc_table[flag];
+ // In case of syntax errors, flag may take the value NULL.
+ SourceForm* deff = NULL;
+ if (flag != NULL)
+ deff = (SourceForm*) _preproc_table[flag];
return (deff == NULL) ? NULL : deff->_code;
}
@@ -803,7 +807,9 @@ int ArchDesc::emit_msg(int quiet, int flag, int line, const char *fmt,
while (i++ <= 15) fputc(' ', errfile);
fprintf(errfile, "%-8s:", pref);
vfprintf(errfile, fmt, args);
- fprintf(errfile, "\n"); }
+ fprintf(errfile, "\n");
+ fflush(errfile);
+ }
return 1;
}
@@ -855,8 +861,14 @@ const char *ArchDesc::reg_mask(OperandForm &opForm) {
// Check constraints on result's register class
const char *result_class = opForm.constrained_reg_class();
- if (!result_class) opForm.dump();
- assert( result_class, "Resulting register class was not defined for operand");
+ if (result_class == NULL) {
+ opForm.dump();
+ syntax_err(opForm._linenum,
+ "Use of an undefined result class for operand: %s",
+ opForm._ident);
+ abort();
+ }
+
regMask = reg_class_to_reg_mask( result_class );
return regMask;
@@ -865,8 +877,14 @@ const char *ArchDesc::reg_mask(OperandForm &opForm) {
// Obtain the name of the RegMask for an InstructForm
const char *ArchDesc::reg_mask(InstructForm &inForm) {
const char *result = inForm.reduce_result();
- assert( result,
- "Did not find result operand or RegMask for this instruction");
+
+ if (result == NULL) {
+ syntax_err(inForm._linenum,
+ "Did not find result operand or RegMask"
+ " for this instruction: %s",
+ inForm._ident);
+ abort();
+ }
// Instructions producing 'Universe' use RegMask::Empty
if( strcmp(result,"Universe")==0 ) {
@@ -875,10 +893,17 @@ const char *ArchDesc::reg_mask(InstructForm &inForm) {
// Lookup this result operand and get its register class
Form *form = (Form*)_globalNames[result];
- assert( form, "Result operand must be defined");
+ if (form == NULL) {
+ syntax_err(inForm._linenum,
+ "Did not find result operand for result: %s", result);
+ abort();
+ }
OperandForm *oper = form->is_operand();
- if (oper == NULL) form->dump();
- assert( oper, "Result must be an OperandForm");
+ if (oper == NULL) {
+ syntax_err(inForm._linenum, "Form is not an OperandForm:");
+ form->dump();
+ abort();
+ }
return reg_mask( *oper );
}
@@ -887,7 +912,13 @@ const char *ArchDesc::reg_mask(InstructForm &inForm) {
char *ArchDesc::stack_or_reg_mask(OperandForm &opForm) {
// name of cisc_spillable version
const char *reg_mask_name = reg_mask(opForm);
- assert( reg_mask_name != NULL, "called with incorrect opForm");
+
+ if (reg_mask_name == NULL) {
+ syntax_err(opForm._linenum,
+ "Did not find reg_mask for opForm: %s",
+ opForm._ident);
+ abort();
+ }
const char *stack_or = "STACK_OR_";
int length = (int)strlen(stack_or) + (int)strlen(reg_mask_name) + 1;
@@ -968,7 +999,8 @@ void ArchDesc::initBaseOpTypes() {
// Create InstructForm and assign type for each ideal instruction.
for ( int j = _last_machine_leaf+1; j < _last_opcode; ++j) {
char *ident = (char *)NodeClassNames[j];
- if(!strcmp(ident, "ConI") || !strcmp(ident, "ConP") || !strcmp(ident, "ConN") ||
+ if(!strcmp(ident, "ConI") || !strcmp(ident, "ConP") ||
+ !strcmp(ident, "ConN") || !strcmp(ident, "ConNKlass") ||
!strcmp(ident, "ConF") || !strcmp(ident, "ConD") ||
!strcmp(ident, "ConL") || !strcmp(ident, "Con" ) ||
!strcmp(ident, "Bool") ) {
diff --git a/hotspot/src/share/vm/adlc/archDesc.hpp b/hotspot/src/share/vm/adlc/archDesc.hpp
index ad8f454be5a..f6ae35a9e97 100644
--- a/hotspot/src/share/vm/adlc/archDesc.hpp
+++ b/hotspot/src/share/vm/adlc/archDesc.hpp
@@ -365,13 +365,14 @@ protected:
// A derived class defines the appropriate output for a specific mapping.
class OutputMap {
protected:
- FILE *_hpp;
- FILE *_cpp;
- FormDict &_globals;
- ArchDesc &_AD;
+ FILE *_hpp;
+ FILE *_cpp;
+ FormDict &_globals;
+ ArchDesc &_AD;
+ const char *_name;
public:
- OutputMap (FILE *decl_file, FILE *def_file, FormDict &globals, ArchDesc &AD)
- : _hpp(decl_file), _cpp(def_file), _globals(globals), _AD(AD) {};
+ OutputMap (FILE *decl_file, FILE *def_file, FormDict &globals, ArchDesc &AD, const char *name)
+ : _hpp(decl_file), _cpp(def_file), _globals(globals), _AD(AD), _name(name) {};
// Access files used by this routine
FILE *decl_file() { return _hpp; }
FILE *def_file() { return _cpp; }
diff --git a/hotspot/src/share/vm/adlc/dict2.cpp b/hotspot/src/share/vm/adlc/dict2.cpp
index 22ec13d2c38..c7797c74223 100644
--- a/hotspot/src/share/vm/adlc/dict2.cpp
+++ b/hotspot/src/share/vm/adlc/dict2.cpp
@@ -33,7 +33,7 @@
// String hash tables
#define MAXID 20
static char initflag = 0; // True after 1st initialization
-static char shft[MAXID] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6};
+static char shft[MAXID + 1] = {1,2,3,4,5,6,7,1,2,3,4,5,6,7,1,2,3,4,5,6,7};
static short xsum[MAXID];
//------------------------------bucket---------------------------------------
diff --git a/hotspot/src/share/vm/adlc/filebuff.hpp b/hotspot/src/share/vm/adlc/filebuff.hpp
index 3d8bdad8fe0..894a2c5bad2 100644
--- a/hotspot/src/share/vm/adlc/filebuff.hpp
+++ b/hotspot/src/share/vm/adlc/filebuff.hpp
@@ -31,10 +31,14 @@
using namespace std;
// STRUCTURE FOR HANDLING INPUT AND OUTPUT FILES
-typedef struct {
+
+class BufferedFile {
+ public:
const char *_name;
FILE *_fp;
-} BufferedFile;
+ inline BufferedFile() { _name = NULL; _fp = NULL; };
+ inline ~BufferedFile() {};
+};
class ArchDesc;
diff --git a/hotspot/src/share/vm/adlc/forms.cpp b/hotspot/src/share/vm/adlc/forms.cpp
index 70b8bd96253..7833ecb6dc8 100644
--- a/hotspot/src/share/vm/adlc/forms.cpp
+++ b/hotspot/src/share/vm/adlc/forms.cpp
@@ -215,6 +215,7 @@ Form::DataType Form::ideal_to_const_type(const char *name) const {
if (strcmp(name,"ConI")==0) return Form::idealI;
if (strcmp(name,"ConP")==0) return Form::idealP;
if (strcmp(name,"ConN")==0) return Form::idealN;
+ if (strcmp(name,"ConNKlass")==0) return Form::idealNKlass;
if (strcmp(name,"ConL")==0) return Form::idealL;
if (strcmp(name,"ConF")==0) return Form::idealF;
if (strcmp(name,"ConD")==0) return Form::idealD;
@@ -255,9 +256,8 @@ Form::DataType Form::is_load_from_memory(const char *opType) const {
if( strcmp(opType,"LoadD_unaligned")==0 ) return Form::idealD;
if( strcmp(opType,"LoadF")==0 ) return Form::idealF;
if( strcmp(opType,"LoadI")==0 ) return Form::idealI;
- if( strcmp(opType,"LoadUI2L")==0 ) return Form::idealI;
if( strcmp(opType,"LoadKlass")==0 ) return Form::idealP;
- if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealN;
+ if( strcmp(opType,"LoadNKlass")==0 ) return Form::idealNKlass;
if( strcmp(opType,"LoadL")==0 ) return Form::idealL;
if( strcmp(opType,"LoadL_unaligned")==0 ) return Form::idealL;
if( strcmp(opType,"LoadPLocked")==0 ) return Form::idealP;
@@ -280,6 +280,7 @@ Form::DataType Form::is_store_to_memory(const char *opType) const {
if( strcmp(opType,"StoreL")==0) return Form::idealL;
if( strcmp(opType,"StoreP")==0) return Form::idealP;
if( strcmp(opType,"StoreN")==0) return Form::idealN;
+ if( strcmp(opType,"StoreNKlass")==0) return Form::idealNKlass;
if( strcmp(opType,"StoreVector")==0 ) return Form::idealV;
assert( strcmp(opType,"Store") != 0, "Must type Stores" );
return Form::none;
diff --git a/hotspot/src/share/vm/adlc/forms.hpp b/hotspot/src/share/vm/adlc/forms.hpp
index aa13845d38f..a682e65a36f 100644
--- a/hotspot/src/share/vm/adlc/forms.hpp
+++ b/hotspot/src/share/vm/adlc/forms.hpp
@@ -173,7 +173,8 @@ public:
idealC = 7, // Char type
idealS = 8, // String type
idealN = 9, // Narrow oop types
- idealV = 10 // Vector type
+ idealNKlass = 10, // Narrow klass types
+ idealV = 11 // Vector type
};
// Convert ideal name to a DataType, return DataType::none if not a 'ConX'
Form::DataType ideal_to_const_type(const char *ideal_type_name) const;
@@ -448,11 +449,11 @@ public:
// Return number of USEs + number of DEFs
int num_operands();
// Return zero-based position in list; -1 if not in list.
- int operand_position(const char *name, int usedef);
+ int operand_position(const char *name, int usedef, Form *fm);
// Find position for this name, regardless of use/def information
int operand_position(const char *name);
// Find position for this name when looked up for output via "format"
- int operand_position_format(const char *name);
+ int operand_position_format(const char *name, Form *fm);
// Find position for the Label when looked up for output via "format"
int label_position();
// Find position for the Method when looked up for output via "format"
diff --git a/hotspot/src/share/vm/adlc/formssel.cpp b/hotspot/src/share/vm/adlc/formssel.cpp
index cccce31c28f..f7f48b4a2dc 100644
--- a/hotspot/src/share/vm/adlc/formssel.cpp
+++ b/hotspot/src/share/vm/adlc/formssel.cpp
@@ -567,7 +567,7 @@ bool InstructForm::rematerialize(FormDict &globals, RegisterForm *registers ) {
if( strcmp(rc_name,"stack_slots") ) {
// Check for ideal_type of RegFlags
const char *type = opform->ideal_type( globals, registers );
- if( !strcmp(type,"RegFlags") )
+ if( (type != NULL) && !strcmp(type, "RegFlags") )
rematerialize = true;
} else
rematerialize = false; // Do not rematerialize things target stk
@@ -746,13 +746,16 @@ int InstructForm::memory_operand(FormDict &globals) const {
// Expected use is for pointer vs oop determination for LoadP
bool InstructForm::captures_bottom_type(FormDict &globals) const {
if( _matrule && _matrule->_rChild &&
- (!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
- !strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
- !strcmp(_matrule->_rChild->_opType,"DecodeN") ||
- !strcmp(_matrule->_rChild->_opType,"EncodeP") ||
- !strcmp(_matrule->_rChild->_opType,"LoadN") ||
- !strcmp(_matrule->_rChild->_opType,"LoadNKlass") ||
- !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception
+ (!strcmp(_matrule->_rChild->_opType,"CastPP") || // new result type
+ !strcmp(_matrule->_rChild->_opType,"CastX2P") || // new result type
+ !strcmp(_matrule->_rChild->_opType,"DecodeN") ||
+ !strcmp(_matrule->_rChild->_opType,"EncodeP") ||
+ !strcmp(_matrule->_rChild->_opType,"DecodeNKlass") ||
+ !strcmp(_matrule->_rChild->_opType,"EncodePKlass") ||
+ !strcmp(_matrule->_rChild->_opType,"LoadN") ||
+ !strcmp(_matrule->_rChild->_opType,"GetAndSetN") ||
+ !strcmp(_matrule->_rChild->_opType,"LoadNKlass") ||
+ !strcmp(_matrule->_rChild->_opType,"CreateEx") || // type of exception
!strcmp(_matrule->_rChild->_opType,"CheckCastPP")) ) return true;
else if ( is_ideal_load() == Form::idealP ) return true;
else if ( is_ideal_store() != Form::none ) return true;
@@ -792,6 +795,20 @@ uint InstructForm::num_opnds() {
return num_opnds;
}
+const char *InstructForm::opnd_ident(int idx) {
+ return _components.at(idx)->_name;
+}
+
+const char *InstructForm::unique_opnd_ident(int idx) {
+ uint i;
+ for (i = 1; i < num_opnds(); ++i) {
+ if (unique_opnds_idx(i) == idx) {
+ break;
+ }
+ }
+ return (_components.at(i) != NULL) ? _components.at(i)->_name : "";
+}
+
// Return count of unmatched operands.
uint InstructForm::num_post_match_opnds() {
uint num_post_match_opnds = _components.count();
@@ -863,6 +880,9 @@ uint InstructForm::oper_input_base(FormDict &globals) {
return base;
}
+// This function determines the order of the MachOper in _opnds[]
+// by writing the operand names into the _components list.
+//
// Implementation does not modify state of internal structures
void InstructForm::build_components() {
// Add top-level operands to the components
@@ -958,11 +978,11 @@ void InstructForm::build_components() {
// Return zero-based position in component list; -1 if not in list.
int InstructForm::operand_position(const char *name, int usedef) {
- return unique_opnds_idx(_components.operand_position(name, usedef));
+ return unique_opnds_idx(_components.operand_position(name, usedef, this));
}
int InstructForm::operand_position_format(const char *name) {
- return unique_opnds_idx(_components.operand_position_format(name));
+ return unique_opnds_idx(_components.operand_position_format(name, this));
}
// Return zero-based position in component list; -1 if not in list.
@@ -1222,7 +1242,7 @@ bool InstructForm::check_branch_variant(ArchDesc &AD, InstructForm *short_branch
if (different) {
globalAD->syntax_err(short_branch->_linenum, "Instruction %s and its short form %s have different parameters\n", _ident, short_branch->_ident);
}
- if (AD._short_branch_debug) {
+ if (AD._adl_debug > 1 || AD._short_branch_debug) {
fprintf(stderr, "Instruction %s has short form %s\n", _ident, short_branch->_ident);
}
_short_branch_form = short_branch;
@@ -1254,16 +1274,19 @@ void InstructForm::rep_var_format(FILE *fp, const char *rep_var) {
// Find replacement variable's type
const Form *form = _localNames[rep_var];
if (form == NULL) {
- fprintf(stderr, "unknown replacement variable in format statement: '%s'\n", rep_var);
- assert(false, "ShouldNotReachHere()");
+ globalAD->syntax_err(_linenum, "Unknown replacement variable %s in format statement of %s.",
+ rep_var, _ident);
+ return;
}
OpClassForm *opc = form->is_opclass();
assert( opc, "replacement variable was not found in local names");
// Lookup the index position of the replacement variable
int idx = operand_position_format(rep_var);
if ( idx == -1 ) {
- assert( strcmp(opc->_ident,"label")==0, "Unimplemented");
- assert( false, "ShouldNotReachHere()");
+ globalAD->syntax_err(_linenum, "Could not find replacement variable %s in format statement of %s.\n",
+ rep_var, _ident);
+ assert(strcmp(opc->_ident, "label") == 0, "Unimplemented");
+ return;
}
if (is_noninput_operand(idx)) {
@@ -1272,7 +1295,7 @@ void InstructForm::rep_var_format(FILE *fp, const char *rep_var) {
OperandForm* oper = form->is_operand();
if (oper != NULL && oper->is_bound_register()) {
const RegDef* first = oper->get_RegClass()->find_first_elem();
- fprintf(fp, " tty->print(\"%s\");\n", first->_regname);
+ fprintf(fp, " st->print(\"%s\");\n", first->_regname);
} else {
globalAD->syntax_err(_linenum, "In %s can't find format for %s %s", _ident, opc->_ident, rep_var);
}
@@ -1370,26 +1393,28 @@ void InstructForm::index_temps(FILE *fp, FormDict &globals, const char *prefix,
// idx0=0 is used to indicate that info comes from this same node, not from input edge.
// idx1 starts at oper_input_base()
if ( cur_num_opnds >= 1 ) {
- fprintf(fp," // Start at oper_input_base() and count operands\n");
- fprintf(fp," unsigned %sidx0 = %d;\n", prefix, oper_input_base(globals));
- fprintf(fp," unsigned %sidx1 = %d;\n", prefix, oper_input_base(globals));
+ fprintf(fp," // Start at oper_input_base() and count operands\n");
+ fprintf(fp," unsigned %sidx0 = %d;\n", prefix, oper_input_base(globals));
+ fprintf(fp," unsigned %sidx1 = %d;", prefix, oper_input_base(globals));
+ fprintf(fp," \t// %s\n", unique_opnd_ident(1));
// Generate starting points for other unique operands if they exist
for ( idx = 2; idx < num_unique_opnds(); ++idx ) {
if( *receiver == 0 ) {
- fprintf(fp," unsigned %sidx%d = %sidx%d + opnd_array(%d)->num_edges();\n",
+ fprintf(fp," unsigned %sidx%d = %sidx%d + opnd_array(%d)->num_edges();",
prefix, idx, prefix, idx-1, idx-1 );
} else {
- fprintf(fp," unsigned %sidx%d = %sidx%d + %s_opnds[%d]->num_edges();\n",
+ fprintf(fp," unsigned %sidx%d = %sidx%d + %s_opnds[%d]->num_edges();",
prefix, idx, prefix, idx-1, receiver, idx-1 );
}
+ fprintf(fp," \t// %s\n", unique_opnd_ident(idx));
}
}
if( *receiver != 0 ) {
// This value is used by generate_peepreplace when copying a node.
// Don't emit it in other cases since it can hide bugs with the
// use invalid idx's.
- fprintf(fp," unsigned %sidx%d = %sreq(); \n", prefix, idx, receiver);
+ fprintf(fp," unsigned %sidx%d = %sreq(); \n", prefix, idx, receiver);
}
}
@@ -1773,9 +1798,25 @@ static int effect_lookup(const char *name) {
return Component::INVALID;
}
+const char *Component::getUsedefName() {
+ switch (_usedef) {
+ case Component::INVALID: return "INVALID"; break;
+ case Component::USE: return "USE"; break;
+ case Component::USE_DEF: return "USE_DEF"; break;
+ case Component::USE_KILL: return "USE_KILL"; break;
+ case Component::KILL: return "KILL"; break;
+ case Component::TEMP: return "TEMP"; break;
+ case Component::DEF: return "DEF"; break;
+ case Component::CALL: return "CALL"; break;
+ default: assert(false, "unknown effect");
+ }
+ return "Undefined Use/Def info";
+}
+
Effect::Effect(const char *name) : _name(name), _use_def(effect_lookup(name)) {
_ftype = Form::EFF;
}
+
Effect::~Effect() {
}
@@ -2272,7 +2313,7 @@ void OperandForm::build_components() {
}
int OperandForm::operand_position(const char *name, int usedef) {
- return _components.operand_position(name, usedef);
+ return _components.operand_position(name, usedef, this);
}
@@ -2398,20 +2439,20 @@ void OperandForm::int_format(FILE *fp, FormDict &globals, uint index) {
if (_matrule && (_matrule->is_base_register(globals) ||
strcmp(ideal_type(globalAD->globalNames()), "RegFlags") == 0)) {
// !!!!! !!!!!
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node,reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node,reg_str);\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else if (_matrule && (dtype = _matrule->is_base_constant(globals)) != Form::none) {
format_constant( fp, index, dtype );
} else if (ideal_to_sReg_type(_ident) != Form::none) {
// Special format for Stack Slot Register
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node,reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node,reg_str);\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else {
- fprintf(fp,"tty->print(\"No format defined for %s\n\");\n", _ident);
+ fprintf(fp," st->print(\"No format defined for %s\n\");\n", _ident);
fflush(fp);
fprintf(stderr,"No format defined for %s\n", _ident);
dump();
@@ -2425,36 +2466,37 @@ void OperandForm::ext_format(FILE *fp, FormDict &globals, uint index) {
Form::DataType dtype;
if (_matrule && (_matrule->is_base_register(globals) ||
strcmp(ideal_type(globalAD->globalNames()), "RegFlags") == 0)) {
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node->in(idx");
- if ( index != 0 ) fprintf(fp, "+%d",index);
- fprintf(fp, "),reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node->in(idx");
+ if ( index != 0 ) fprintf(fp, "+%d",index);
+ fprintf(fp, "),reg_str);\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else if (_matrule && (dtype = _matrule->is_base_constant(globals)) != Form::none) {
format_constant( fp, index, dtype );
} else if (ideal_to_sReg_type(_ident) != Form::none) {
// Special format for Stack Slot Register
- fprintf(fp, "{ char reg_str[128];\n");
- fprintf(fp," ra->dump_register(node->in(idx");
+ fprintf(fp," { char reg_str[128];\n");
+ fprintf(fp," ra->dump_register(node->in(idx");
if ( index != 0 ) fprintf(fp, "+%d",index);
fprintf(fp, "),reg_str);\n");
- fprintf(fp," tty->print(\"%cs\",reg_str);\n",'%');
- fprintf(fp," }\n");
+ fprintf(fp," st->print(\"%cs\",reg_str);\n",'%');
+ fprintf(fp," }\n");
} else {
- fprintf(fp,"tty->print(\"No format defined for %s\n\");\n", _ident);
+ fprintf(fp," st->print(\"No format defined for %s\n\");\n", _ident);
assert( false,"Internal error:\n output_external_operand() attempting to output other than a Register or Constant");
}
}
void OperandForm::format_constant(FILE *fp, uint const_index, uint const_type) {
switch(const_type) {
- case Form::idealI: fprintf(fp,"st->print(\"#%%d\", _c%d);\n", const_index); break;
- case Form::idealP: fprintf(fp,"_c%d->dump_on(st);\n", const_index); break;
- case Form::idealN: fprintf(fp,"_c%d->dump_on(st);\n", const_index); break;
- case Form::idealL: fprintf(fp,"st->print(\"#%%lld\", _c%d);\n", const_index); break;
- case Form::idealF: fprintf(fp,"st->print(\"#%%f\", _c%d);\n", const_index); break;
- case Form::idealD: fprintf(fp,"st->print(\"#%%f\", _c%d);\n", const_index); break;
+ case Form::idealI: fprintf(fp," st->print(\"#%%d\", _c%d);\n", const_index); break;
+ case Form::idealP: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
+ case Form::idealNKlass:
+ case Form::idealN: fprintf(fp," if (_c%d) _c%d->dump_on(st);\n", const_index, const_index); break;
+ case Form::idealL: fprintf(fp," st->print(\"#%%lld\", _c%d);\n", const_index); break;
+ case Form::idealF: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
+ case Form::idealD: fprintf(fp," st->print(\"#%%f\", _c%d);\n", const_index); break;
default:
assert( false, "ShouldNotReachHere()");
}
@@ -2824,17 +2866,8 @@ void Component::output(FILE *fp) {
fprintf(fp,"Component:"); // Write to output files
fprintf(fp, " name = %s", _name);
fprintf(fp, ", type = %s", _type);
- const char * usedef = "Undefined Use/Def info";
- switch (_usedef) {
- case USE: usedef = "USE"; break;
- case USE_DEF: usedef = "USE_DEF"; break;
- case USE_KILL: usedef = "USE_KILL"; break;
- case KILL: usedef = "KILL"; break;
- case TEMP: usedef = "TEMP"; break;
- case DEF: usedef = "DEF"; break;
- default: assert(false, "unknown effect");
- }
- fprintf(fp, ", use/def = %s\n", usedef);
+ assert(_usedef != 0, "unknown effect");
+ fprintf(fp, ", use/def = %s\n", getUsedefName());
}
@@ -2926,9 +2959,9 @@ int ComponentList::num_operands() {
return count;
}
-// Return zero-based position in list; -1 if not in list.
+// Return zero-based position of operand 'name' in list; -1 if not in list.
// if parameter 'usedef' is ::USE, it will match USE, USE_DEF, ...
-int ComponentList::operand_position(const char *name, int usedef) {
+int ComponentList::operand_position(const char *name, int usedef, Form *fm) {
PreserveIter pi(this);
int position = 0;
int num_opnds = num_operands();
@@ -2951,10 +2984,18 @@ int ComponentList::operand_position(const char *name, int usedef) {
return position+1;
} else {
if( preceding_non_use && strcmp(component->_name, preceding_non_use->_name) ) {
- fprintf(stderr, "the name '%s' should not precede the name '%s'\n", preceding_non_use->_name, name);
+ fprintf(stderr, "the name '%s(%s)' should not precede the name '%s(%s)'",
+ preceding_non_use->_name, preceding_non_use->getUsedefName(),
+ name, component->getUsedefName());
+ if (fm && fm->is_instruction()) fprintf(stderr, "in form '%s'", fm->is_instruction()->_ident);
+ if (fm && fm->is_operand()) fprintf(stderr, "in form '%s'", fm->is_operand()->_ident);
+ fprintf(stderr, "\n");
}
if( position >= num_opnds ) {
- fprintf(stderr, "the name '%s' is too late in its name list\n", name);
+ fprintf(stderr, "the name '%s' is too late in its name list", name);
+ if (fm && fm->is_instruction()) fprintf(stderr, "in form '%s'", fm->is_instruction()->_ident);
+ if (fm && fm->is_operand()) fprintf(stderr, "in form '%s'", fm->is_operand()->_ident);
+ fprintf(stderr, "\n");
}
assert(position < num_opnds, "advertised index in bounds");
return position;
@@ -3000,10 +3041,10 @@ int ComponentList::operand_position(const char *name) {
return Not_in_list;
}
-int ComponentList::operand_position_format(const char *name) {
+int ComponentList::operand_position_format(const char *name, Form *fm) {
PreserveIter pi(this);
int first_position = operand_position(name);
- int use_position = operand_position(name, Component::USE);
+ int use_position = operand_position(name, Component::USE, fm);
return ((first_position < use_position) ? use_position : first_position);
}
@@ -3266,8 +3307,8 @@ const char *MatchNode::reduce_right(FormDict &globals) const {
// If we are a "Set", start from the right child.
const MatchNode *const mnode = sets_result() ?
- (const MatchNode *const)this->_rChild :
- (const MatchNode *const)this;
+ (const MatchNode *)this->_rChild :
+ (const MatchNode *)this;
// If our right child exists, it is the right reduction
if ( mnode->_rChild ) {
@@ -3284,8 +3325,8 @@ const char *MatchNode::reduce_left(FormDict &globals) const {
// If we are a "Set", start from the right child.
const MatchNode *const mnode = sets_result() ?
- (const MatchNode *const)this->_rChild :
- (const MatchNode *const)this;
+ (const MatchNode *)this->_rChild :
+ (const MatchNode *)this;
// If our left child exists, it is the left reduction
if ( mnode->_lChild ) {
@@ -3389,9 +3430,9 @@ void MatchNode::output(FILE *fp) {
int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
static const char *needs_ideal_memory_list[] = {
- "StoreI","StoreL","StoreP","StoreN","StoreD","StoreF" ,
+ "StoreI","StoreL","StoreP","StoreN","StoreNKlass","StoreD","StoreF" ,
"StoreB","StoreC","Store" ,"StoreFP",
- "LoadI", "LoadUI2L", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
+ "LoadI", "LoadL", "LoadP" ,"LoadN", "LoadD" ,"LoadF" ,
"LoadB" , "LoadUB", "LoadUS" ,"LoadS" ,"Load" ,
"StoreVector", "LoadVector",
"LoadRange", "LoadKlass", "LoadNKlass", "LoadL_unaligned", "LoadD_unaligned",
@@ -3399,7 +3440,9 @@ int MatchNode::needs_ideal_memory_edge(FormDict &globals) const {
"StorePConditional", "StoreIConditional", "StoreLConditional",
"CompareAndSwapI", "CompareAndSwapL", "CompareAndSwapP", "CompareAndSwapN",
"StoreCM",
- "ClearArray"
+ "ClearArray",
+ "GetAndAddI", "GetAndSetI", "GetAndSetP",
+ "GetAndAddL", "GetAndSetL", "GetAndSetN",
};
int cnt = sizeof(needs_ideal_memory_list)/sizeof(char*);
if( strcmp(_opType,"PrefetchRead")==0 ||
@@ -3944,6 +3987,8 @@ int MatchRule::is_expensive() const {
strcmp(opType,"ConvL2I")==0 ||
strcmp(opType,"DecodeN")==0 ||
strcmp(opType,"EncodeP")==0 ||
+ strcmp(opType,"EncodePKlass")==0 ||
+ strcmp(opType,"DecodeNKlass")==0 ||
strcmp(opType,"RoundDouble")==0 ||
strcmp(opType,"RoundFloat")==0 ||
strcmp(opType,"ReverseBytesI")==0 ||
@@ -4040,18 +4085,28 @@ Form::DataType MatchRule::is_ideal_load() const {
}
bool MatchRule::is_vector() const {
- if( _rChild ) {
+ static const char *vector_list[] = {
+ "AddVB","AddVS","AddVI","AddVL","AddVF","AddVD",
+ "SubVB","SubVS","SubVI","SubVL","SubVF","SubVD",
+ "MulVS","MulVI","MulVF","MulVD",
+ "DivVF","DivVD",
+ "AndV" ,"XorV" ,"OrV",
+ "LShiftCntV","RShiftCntV",
+ "LShiftVB","LShiftVS","LShiftVI","LShiftVL",
+ "RShiftVB","RShiftVS","RShiftVI","RShiftVL",
+ "URShiftVB","URShiftVS","URShiftVI","URShiftVL",
+ "ReplicateB","ReplicateS","ReplicateI","ReplicateL","ReplicateF","ReplicateD",
+ "LoadVector","StoreVector",
+ // Next are not supported currently.
+ "PackB","PackS","PackI","PackL","PackF","PackD","Pack2L","Pack2D",
+ "ExtractB","ExtractUB","ExtractC","ExtractS","ExtractI","ExtractL","ExtractF","ExtractD"
+ };
+ int cnt = sizeof(vector_list)/sizeof(char*);
+ if (_rChild) {
const char *opType = _rChild->_opType;
- if( strcmp(opType,"ReplicateB")==0 ||
- strcmp(opType,"ReplicateS")==0 ||
- strcmp(opType,"ReplicateI")==0 ||
- strcmp(opType,"ReplicateL")==0 ||
- strcmp(opType,"ReplicateF")==0 ||
- strcmp(opType,"ReplicateD")==0 ||
- strcmp(opType,"LoadVector")==0 ||
- strcmp(opType,"StoreVector")==0 ||
- 0 /* 0 to line up columns nicely */ )
- return true;
+ for (int i=0; ioutput(fp);
if (_rChild) _rChild->output(fp);
- fprintf(fp," )\n");
- fprintf(fp," nesting depth = %d\n", _depth);
+ fprintf(fp," )");
+}
+
+void MatchRule::output(FILE *fp) {
+ output_short(fp);
+ fprintf(fp,"\n nesting depth = %d\n", _depth);
if (_result) fprintf(fp," Result Type = %s", _result);
fprintf(fp,"\n");
}
diff --git a/hotspot/src/share/vm/adlc/formssel.hpp b/hotspot/src/share/vm/adlc/formssel.hpp
index 93b43b1f08b..6f2975fc3a3 100644
--- a/hotspot/src/share/vm/adlc/formssel.hpp
+++ b/hotspot/src/share/vm/adlc/formssel.hpp
@@ -76,7 +76,7 @@ class InstructForm : public Form {
private:
bool _ideal_only; // Not a user-defined instruction
// Members used for tracking CISC-spilling
- uint _cisc_spill_operand;// Which operand may cisc-spill
+ int _cisc_spill_operand;// Which operand may cisc-spill
void set_cisc_spill_operand(uint op_index) { _cisc_spill_operand = op_index; }
bool _is_cisc_alternate;
InstructForm *_cisc_spill_alternate;// cisc possible replacement
@@ -103,7 +103,7 @@ public:
RewriteRule *_rewrule; // Rewrite rule for this instruction
FormatRule *_format; // Format for assembly generation
Peephole *_peephole; // List of peephole rules for instruction
- const char *_ins_pipe; // Instruction Scheduline description class
+ const char *_ins_pipe; // Instruction Scheduling description class
uint *_uniq_idx; // Indexes of unique operands
int _uniq_idx_length; // Length of _uniq_idx array
@@ -198,6 +198,7 @@ public:
virtual const char *cost(); // Access ins_cost attribute
virtual uint num_opnds(); // Count of num_opnds for MachNode class
+ // Counts USE_DEF opnds twice. See also num_unique_opnds().
virtual uint num_post_match_opnds();
virtual uint num_consts(FormDict &globals) const;// Constants in match rule
// Constants in match rule with specified type
@@ -228,6 +229,7 @@ public:
// Return number of relocation entries needed for this instruction.
virtual uint reloc(FormDict &globals);
+ const char *opnd_ident(int idx); // Name of operand #idx.
const char *reduce_result();
// Return the name of the operand on the right hand side of the binary match
// Return NULL if there is no right hand side
@@ -240,7 +242,7 @@ public:
// Check if this instruction can cisc-spill to 'alternate'
bool cisc_spills_to(ArchDesc &AD, InstructForm *alternate);
InstructForm *cisc_spill_alternate() { return _cisc_spill_alternate; }
- uint cisc_spill_operand() const { return _cisc_spill_operand; }
+ int cisc_spill_operand() const { return _cisc_spill_operand; }
bool is_cisc_alternate() const { return _is_cisc_alternate; }
void set_cisc_alternate(bool val) { _is_cisc_alternate = val; }
const char *cisc_reg_mask_name() const { return _cisc_reg_mask_name; }
@@ -277,6 +279,7 @@ public:
return idx;
}
}
+ const char *unique_opnd_ident(int idx); // Name of operand at unique idx.
// Operands which are only KILLs aren't part of the input array and
// require special handling in some cases. Their position in this
@@ -889,6 +892,7 @@ public:
void dump(); // Debug printer
void output(FILE *fp); // Write to output files
+ const char* getUsedefName();
public:
// Implementation depends upon working bit intersection and union.
@@ -1030,6 +1034,7 @@ public:
void matchrule_swap_commutative_op(const char* instr_ident, int count, int& match_rules_cnt);
void dump();
+ void output_short(FILE *fp);
void output(FILE *fp);
};
diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp
index b8a5271dfa2..3bfa0695e5b 100644
--- a/hotspot/src/share/vm/adlc/main.cpp
+++ b/hotspot/src/share/vm/adlc/main.cpp
@@ -341,14 +341,20 @@ int main(int argc, char *argv[])
static void usage(ArchDesc& AD)
{
printf("Architecture Description Language Compiler\n\n");
- printf("Usage: adl [-doqw] [-Dflag[=def]] [-Uflag] [-cFILENAME] [-hFILENAME] [-aDFAFILE] ADLFILE\n");
+ printf("Usage: adlc [-doqwTs] [-#]* [-D[=]] [-U] [-c] [-h] [-a] [-v] \n");
printf(" d produce DFA debugging info\n");
printf(" o no output produced, syntax and semantic checking only\n");
printf(" q quiet mode, supresses all non-essential messages\n");
printf(" w suppress warning messages\n");
+ printf(" T make DFA as many subroutine calls\n");
+ printf(" s output which instructions are cisc-spillable\n");
+ printf(" D define preprocessor symbol\n");
+ printf(" U undefine preprocessor symbol\n");
printf(" c specify CPP file name (default: %s)\n", AD._CPP_file._name);
printf(" h specify HPP file name (default: %s)\n", AD._HPP_file._name);
printf(" a specify DFA output file name\n");
+ printf(" v specify adGlobals output file name\n");
+ printf(" # increment ADL debug level\n");
printf("\n");
}
@@ -450,22 +456,6 @@ static char *strip_ext(char *fname)
return fname;
}
-//------------------------------strip_path_and_ext------------------------------
-static char *strip_path_and_ext(char *fname)
-{
- char *ep;
- char *sp;
-
- if (fname) {
- for (sp = fname; *sp; sp++)
- if (*sp == '/') fname = sp+1;
- ep = fname; // start at first character and look for '.'
- while (ep <= (fname + strlen(fname) - 1) && *ep != '.') ep++;
- if (*ep == '.') *ep = '\0'; // truncate string at '.'
- }
- return fname;
-}
-
//------------------------------base_plus_suffix-------------------------------
// New concatenated string
static char *base_plus_suffix(const char* base, const char *suffix)
@@ -477,18 +467,6 @@ static char *base_plus_suffix(const char* base, const char *suffix)
return fname;
}
-
-//------------------------------prefix_plus_base_plus_suffix-------------------
-// New concatenated string
-static char *prefix_plus_base_plus_suffix(const char* prefix, const char* base, const char *suffix)
-{
- int len = (int)strlen(prefix) + (int)strlen(base) + (int)strlen(suffix) + 1;
-
- char* fname = new char[len];
- sprintf(fname,"%s%s%s",prefix,base,suffix);
- return fname;
-}
-
//------------------------------get_legal_text---------------------------------
// Get pointer to legal text at the beginning of AD file.
// This code assumes that a legal text starts at the beginning of .ad files,
diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp
index 68a0ff818f8..36b7157bdea 100644
--- a/hotspot/src/share/vm/adlc/output_c.cpp
+++ b/hotspot/src/share/vm/adlc/output_c.cpp
@@ -518,6 +518,14 @@ static int pipeline_res_mask_initializer(
int cycles = piperesource->_cycles;
uint stage = pipeline->_stages.index(piperesource->_stage);
+ if (NameList::Not_in_list == stage) {
+ fprintf(stderr,
+ "pipeline_res_mask_initializer: "
+ "semantic error: "
+ "pipeline stage undeclared: %s\n",
+ piperesource->_stage);
+ exit(1);
+ }
uint upper_limit = stage+cycles-1;
uint lower_limit = stage-1;
uint upper_idx = upper_limit >> 5;
@@ -1000,7 +1008,7 @@ void ArchDesc::build_pipe_classes(FILE *fp_cpp) {
}
fprintf(fp_cpp, "};\n\n");
fprintf(fp_cpp, "#ifndef PRODUCT\n");
- fprintf(fp_cpp, "void Bundle::dump() const {\n");
+ fprintf(fp_cpp, "void Bundle::dump(outputStream *st) const {\n");
fprintf(fp_cpp, " static const char * bundle_flags[] = {\n");
fprintf(fp_cpp, " \"\",\n");
fprintf(fp_cpp, " \"use nop delay\",\n");
@@ -1019,22 +1027,22 @@ void ArchDesc::build_pipe_classes(FILE *fp_cpp) {
// See if the same string is in the table
fprintf(fp_cpp, " bool needs_comma = false;\n\n");
fprintf(fp_cpp, " if (_flags) {\n");
- fprintf(fp_cpp, " tty->print(\"%%s\", bundle_flags[_flags]);\n");
+ fprintf(fp_cpp, " st->print(\"%%s\", bundle_flags[_flags]);\n");
fprintf(fp_cpp, " needs_comma = true;\n");
fprintf(fp_cpp, " };\n");
fprintf(fp_cpp, " if (instr_count()) {\n");
- fprintf(fp_cpp, " tty->print(\"%%s%%d instr%%s\", needs_comma ? \", \" : \"\", instr_count(), instr_count() != 1 ? \"s\" : \"\");\n");
+ fprintf(fp_cpp, " st->print(\"%%s%%d instr%%s\", needs_comma ? \", \" : \"\", instr_count(), instr_count() != 1 ? \"s\" : \"\");\n");
fprintf(fp_cpp, " needs_comma = true;\n");
fprintf(fp_cpp, " };\n");
fprintf(fp_cpp, " uint r = resources_used();\n");
fprintf(fp_cpp, " if (r) {\n");
- fprintf(fp_cpp, " tty->print(\"%%sresource%%s:\", needs_comma ? \", \" : \"\", (r & (r-1)) != 0 ? \"s\" : \"\");\n");
+ fprintf(fp_cpp, " st->print(\"%%sresource%%s:\", needs_comma ? \", \" : \"\", (r & (r-1)) != 0 ? \"s\" : \"\");\n");
fprintf(fp_cpp, " for (uint i = 0; i < %d; i++)\n", _pipeline->_rescount);
fprintf(fp_cpp, " if ((r & (1 << i)) != 0)\n");
- fprintf(fp_cpp, " tty->print(\" %%s\", resource_names[i]);\n");
+ fprintf(fp_cpp, " st->print(\" %%s\", resource_names[i]);\n");
fprintf(fp_cpp, " needs_comma = true;\n");
fprintf(fp_cpp, " };\n");
- fprintf(fp_cpp, " tty->print(\"\\n\");\n");
+ fprintf(fp_cpp, " st->print(\"\\n\");\n");
fprintf(fp_cpp, "}\n");
fprintf(fp_cpp, "#endif\n");
}
@@ -1048,39 +1056,6 @@ static void defineOut_RegMask(FILE *fp, const char *node, const char *regMask) {
node, regMask);
}
-// Scan the peepmatch and output a test for each instruction
-static void check_peepmatch_instruction_tree(FILE *fp, PeepMatch *pmatch, PeepConstraint *pconstraint) {
- int parent = -1;
- int inst_position = 0;
- const char* inst_name = NULL;
- int input = 0;
- fprintf(fp, " // Check instruction sub-tree\n");
- pmatch->reset();
- for( pmatch->next_instruction( parent, inst_position, inst_name, input );
- inst_name != NULL;
- pmatch->next_instruction( parent, inst_position, inst_name, input ) ) {
- // If this is not a placeholder
- if( ! pmatch->is_placeholder() ) {
- // Define temporaries 'inst#', based on parent and parent's input index
- if( parent != -1 ) { // root was initialized
- fprintf(fp, " inst%d = inst%d->in(%d);\n",
- inst_position, parent, input);
- }
-
- // When not the root
- // Test we have the correct instruction by comparing the rule
- if( parent != -1 ) {
- fprintf(fp, " matches = matches && ( inst%d->rule() == %s_rule );",
- inst_position, inst_name);
- }
- } else {
- // Check that user did not try to constrain a placeholder
- assert( ! pconstraint->constrains_instruction(inst_position),
- "fatal(): Can not constrain a placeholder instruction");
- }
- }
-}
-
static void print_block_index(FILE *fp, int inst_position) {
assert( inst_position >= 0, "Instruction number less than zero");
fprintf(fp, "block_index");
@@ -1242,7 +1217,7 @@ static void check_peepconstraints(FILE *fp, FormDict &globals, PeepMatch *pmatch
if( left_op_index != 0 ) {
assert( (left_index <= 9999) && (left_op_index <= 9999), "exceed string size");
// Must have index into operands
- sprintf(left_reg_index,",inst%d_idx%d", left_index, left_op_index);
+ sprintf(left_reg_index,",inst%d_idx%d", (int)left_index, left_op_index);
} else {
strcpy(left_reg_index, "");
}
@@ -1255,7 +1230,7 @@ static void check_peepconstraints(FILE *fp, FormDict &globals, PeepMatch *pmatch
if( right_op_index != 0 ) {
assert( (right_index <= 9999) && (right_op_index <= 9999), "exceed string size");
// Must have index into operands
- sprintf(right_reg_index,",inst%d_idx%d", right_index, right_op_index);
+ sprintf(right_reg_index,",inst%d_idx%d", (int)right_index, right_op_index);
} else {
strcpy(right_reg_index, "");
}
@@ -1606,6 +1581,12 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
fprintf(fp, " ((MachFastLockNode*)n%d)->_counters = _counters;\n",cnt);
}
+ // Fill in the bottom_type where requested
+ if (node->captures_bottom_type(_globalNames) &&
+ new_inst->captures_bottom_type(_globalNames)) {
+ fprintf(fp, " ((MachTypeNode*)n%d)->_bottom_type = bottom_type();\n", cnt);
+ }
+
const char *resultOper = new_inst->reduce_result();
fprintf(fp," n%d->set_opnd_array(0, state->MachOperGenerator( %s, C ));\n",
cnt, machOperEnum(resultOper));
@@ -1639,7 +1620,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
new_pos = new_inst->operand_position(parameter,Component::USE);
exp_pos += node->num_opnds();
// If there is no use of the created operand, just skip it
- if (new_pos != -1) {
+ if (new_pos != NameList::Not_in_list) {
//Copy the operand from the original made above
fprintf(fp," n%d->set_opnd_array(%d, op%d->clone(C)); // %s\n",
cnt, new_pos, exp_pos-node->num_opnds(), opid);
@@ -1767,7 +1748,7 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
}
fprintf(fp," kill = ");
- fprintf(fp,"new (C, 1) MachProjNode( %s, %d, (%s), Op_%s );\n",
+ fprintf(fp,"new (C) MachProjNode( %s, %d, (%s), Op_%s );\n",
machNode, proj_no++, regmask, ideal_type);
fprintf(fp," proj_list.push(kill);\n");
}
@@ -1783,7 +1764,8 @@ void ArchDesc::defineExpand(FILE *fp, InstructForm *node) {
// Build mapping from num_edges to local variables
fprintf(fp," unsigned num0 = 0;\n");
for( i = 1; i < cur_num_opnds; i++ ) {
- fprintf(fp," unsigned num%d = opnd_array(%d)->num_edges();\n",i,i);
+ fprintf(fp," unsigned num%d = opnd_array(%d)->num_edges();",i,i);
+ fprintf(fp, " \t// %s\n", node->opnd_ident(i));
}
// Build a mapping from operand index to input edges
fprintf(fp," unsigned idx0 = oper_input_base();\n");
@@ -1928,6 +1910,7 @@ public:
}
// Track necessary state when identifying a replacement variable
+ // @arg rep_var: The formal parameter of the encoding.
void update_state(const char *rep_var) {
// A replacement variable or one of its subfields
// Obtain replacement variable from list
@@ -1949,7 +1932,7 @@ public:
}
}
else {
- // Lookup its position in parameter list
+ // Lookup its position in (formal) parameter list of encoding
int param_no = _encoding.rep_var_index(rep_var);
if ( param_no == -1 ) {
_AD.syntax_err( _encoding._linenum,
@@ -1958,6 +1941,7 @@ public:
}
// Lookup the corresponding ins_encode parameter
+ // This is the argument (actual parameter) to the encoding.
const char *inst_rep_var = _ins_encode.rep_var_name(_inst, param_no);
if (inst_rep_var == NULL) {
_AD.syntax_err( _ins_encode._linenum,
@@ -2323,6 +2307,7 @@ private:
// Add parameter for index position, if not result operand
if( _operand_idx != 0 ) fprintf(_fp,",idx%d", _operand_idx);
fprintf(_fp,")");
+ fprintf(_fp, "/* %s */", _operand_name);
}
} else {
assert( _reg_status == LITERAL_OUTPUT, "should have output register literal in emit_rep_var");
@@ -2362,7 +2347,7 @@ private:
}
} else {
assert( _constant_status == LITERAL_OUTPUT, "should have output constant literal in emit_rep_var");
- // Cosntant literal has already been sent to output file, nothing more needed
+ // Constant literal has already been sent to output file, nothing more needed
}
}
else if ( strcmp(rep_var,"$disp") == 0 ) {
@@ -2381,6 +2366,8 @@ private:
}
else {
printf("emit_field: %s\n",rep_var);
+ globalAD->syntax_err(_inst._linenum, "Unknown replacement variable %s in format statement of %s.",
+ rep_var, _inst._ident);
assert( false, "UnImplemented()");
}
}
@@ -2478,14 +2465,14 @@ void ArchDesc::defineSize(FILE *fp, InstructForm &inst) {
//(1)
// Output instruction's emit prototype
- fprintf(fp,"uint %sNode::size(PhaseRegAlloc *ra_) const {\n",
+ fprintf(fp,"uint %sNode::size(PhaseRegAlloc *ra_) const {\n",
inst._ident);
- fprintf(fp, " assert(VerifyOops || MachNode::size(ra_) <= %s, \"bad fixed size\");\n", inst._size);
+ fprintf(fp, " assert(VerifyOops || MachNode::size(ra_) <= %s, \"bad fixed size\");\n", inst._size);
//(2)
// Print the size
- fprintf(fp, " return (VerifyOops ? MachNode::size(ra_) : %s);\n", inst._size);
+ fprintf(fp, " return (VerifyOops ? MachNode::size(ra_) : %s);\n", inst._size);
// (3) and (4)
fprintf(fp,"}\n");
@@ -2573,7 +2560,7 @@ void ArchDesc::defineEmit(FILE* fp, InstructForm& inst) {
}
// (3) and (4)
- fprintf(fp, "}\n");
+ fprintf(fp, "}\n\n");
}
// defineEvalConstant ---------------------------------------------------------
@@ -2721,12 +2708,12 @@ static void defineIn_RegMask(FILE *fp, FormDict &globals, OperandForm &oper) {
// (2) }
//
static void defineClone(FILE *fp, FormDict &globalNames, OperandForm &oper) {
- fprintf(fp,"MachOper *%sOper::clone(Compile* C) const {\n", oper._ident);
+ fprintf(fp,"MachOper *%sOper::clone(Compile* C) const {\n", oper._ident);
// Check for constants that need to be copied over
const int num_consts = oper.num_consts(globalNames);
const bool is_ideal_bool = oper.is_ideal_bool();
if( (num_consts > 0) ) {
- fprintf(fp," return new (C) %sOper(", oper._ident);
+ fprintf(fp," return new (C) %sOper(", oper._ident);
// generate parameters for constants
int i = 0;
fprintf(fp,"_c%d", i);
@@ -2738,21 +2725,12 @@ static void defineClone(FILE *fp, FormDict &globalNames, OperandForm &oper) {
}
else {
assert( num_consts == 0, "Currently support zero or one constant per operand clone function");
- fprintf(fp," return new (C) %sOper();\n", oper._ident);
+ fprintf(fp," return new (C) %sOper();\n", oper._ident);
}
// finish method
fprintf(fp,"}\n");
}
-static void define_hash(FILE *fp, char *operand) {
- fprintf(fp,"uint %sOper::hash() const { return 5; }\n", operand);
-}
-
-static void define_cmp(FILE *fp, char *operand) {
- fprintf(fp,"uint %sOper::cmp( const MachOper &oper ) const { return opcode() == oper.opcode(); }\n", operand);
-}
-
-
// Helper functions for bug 4796752, abstracted with minimal modification
// from define_oper_interface()
OperandForm *rep_var_to_operand(const char *encoding, OperandForm &oper, FormDict &globals) {
@@ -2846,14 +2824,14 @@ void ArchDesc::define_oper_interface(FILE *fp, OperandForm &oper, FormDict &glob
} else if ( (strcmp(name,"disp") == 0) ) {
fprintf(fp,"(PhaseRegAlloc *ra_, const Node *node, int idx) const { \n");
} else {
- fprintf(fp,"() const { ");
+ fprintf(fp,"() const { \n");
}
// Check for hexadecimal value OR replacement variable
if( *encoding == '$' ) {
// Replacement variable
const char *rep_var = encoding + 1;
- fprintf(fp,"// Replacement variable: %s\n", encoding+1);
+ fprintf(fp," // Replacement variable: %s\n", encoding+1);
// Lookup replacement variable, rep_var, in operand's component list
const Component *comp = oper._components.search(rep_var);
assert( comp != NULL, "Replacement variable not found in components");
@@ -2874,10 +2852,10 @@ void ArchDesc::define_oper_interface(FILE *fp, OperandForm &oper, FormDict &glob
} else if ( op->ideal_to_sReg_type(op->_ident) != Form::none ) {
// StackSlot for an sReg comes either from input node or from self, when idx==0
fprintf(fp," if( idx != 0 ) {\n");
- fprintf(fp," // Access register number for input operand\n");
+ fprintf(fp," // Access stack offset (register number) for input operand\n");
fprintf(fp," return ra_->reg2offset(ra_->get_reg_first(node->in(idx)));/* sReg */\n");
fprintf(fp," }\n");
- fprintf(fp," // Access register number from myself\n");
+ fprintf(fp," // Access stack offset (register number) from myself\n");
fprintf(fp," return ra_->reg2offset(ra_->get_reg_first(node));/* sReg */\n");
} else if (op->_matrule && op->_matrule->is_base_constant(globals)) {
// Constant
@@ -2894,7 +2872,7 @@ void ArchDesc::define_oper_interface(FILE *fp, OperandForm &oper, FormDict &glob
}
else if( *encoding == '0' && *(encoding+1) == 'x' ) {
// Hex value
- fprintf(fp,"return %s;", encoding);
+ fprintf(fp," return %s;\n", encoding);
} else {
assert( false, "Do not support octal or decimal encode constants");
}
@@ -3127,8 +3105,8 @@ void ArchDesc::defineClasses(FILE *fp) {
// Output the definition for number of relocation entries
uint reloc_size = instr->reloc(_globalNames);
if ( reloc_size != 0 ) {
- fprintf(fp,"int %sNode::reloc() const {\n", instr->_ident);
- fprintf(fp, " return %d;\n", reloc_size );
+ fprintf(fp,"int %sNode::reloc() const {\n", instr->_ident);
+ fprintf(fp," return %d;\n", reloc_size);
fprintf(fp,"}\n");
fprintf(fp,"\n");
}
@@ -3235,7 +3213,7 @@ void ArchDesc::defineClasses(FILE *fp) {
class OutputReduceOp : public OutputMap {
public:
OutputReduceOp(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "reduceOp") {};
void declaration() { fprintf(_hpp, "extern const int reduceOp[];\n"); }
void definition() { fprintf(_cpp, "const int reduceOp[] = {\n"); }
@@ -3270,7 +3248,7 @@ public:
class OutputLeftOp : public OutputMap {
public:
OutputLeftOp(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "leftOp") {};
void declaration() { fprintf(_hpp, "extern const int leftOp[];\n"); }
void definition() { fprintf(_cpp, "const int leftOp[] = {\n"); }
@@ -3300,7 +3278,7 @@ public:
class OutputRightOp : public OutputMap {
public:
OutputRightOp(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "rightOp") {};
void declaration() { fprintf(_hpp, "extern const int rightOp[];\n"); }
void definition() { fprintf(_cpp, "const int rightOp[] = {\n"); }
@@ -3330,11 +3308,11 @@ public:
class OutputRuleName : public OutputMap {
public:
OutputRuleName(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "ruleName") {};
void declaration() { fprintf(_hpp, "extern const char *ruleName[];\n"); }
void definition() { fprintf(_cpp, "const char *ruleName[] = {\n"); }
- void closing() { fprintf(_cpp, " \"no trailing comma\"\n");
+ void closing() { fprintf(_cpp, " \"invalid rule name\" // no trailing comma\n");
OutputMap::closing();
}
void map(OpClassForm &opc) { fprintf(_cpp, " \"%s\"", _AD.machOperEnum(opc._ident) ); }
@@ -3348,7 +3326,7 @@ public:
class OutputSwallowed : public OutputMap {
public:
OutputSwallowed(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "swallowed") {};
void declaration() { fprintf(_hpp, "extern const bool swallowed[];\n"); }
void definition() { fprintf(_cpp, "const bool swallowed[] = {\n"); }
@@ -3369,7 +3347,7 @@ public:
class OutputInstChainRule : public OutputMap {
public:
OutputInstChainRule(FILE *hpp, FILE *cpp, FormDict &globals, ArchDesc &AD)
- : OutputMap(hpp, cpp, globals, AD) {};
+ : OutputMap(hpp, cpp, globals, AD, "instruction_chain_rule") {};
void declaration() { fprintf(_hpp, "extern const bool instruction_chain_rule[];\n"); }
void definition() { fprintf(_cpp, "const bool instruction_chain_rule[] = {\n"); }
@@ -3410,7 +3388,7 @@ void ArchDesc::build_map(OutputMap &map) {
if ( op->ideal_only() ) continue;
// Generate the entry for this opcode
- map.map(*op); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*op); fprintf(fp_cpp, ",\n");
++idx;
};
fprintf(fp_cpp, " // last operand\n");
@@ -3419,7 +3397,7 @@ void ArchDesc::build_map(OutputMap &map) {
map.record_position(OutputMap::BEGIN_OPCLASSES, idx );
_opclass.reset();
for(; (opc = (OpClassForm*)_opclass.iter()) != NULL; ) {
- map.map(*opc); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*opc); fprintf(fp_cpp, ",\n");
++idx;
};
fprintf(fp_cpp, " // last operand class\n");
@@ -3429,7 +3407,7 @@ void ArchDesc::build_map(OutputMap &map) {
_internalOpNames.reset();
char *name = NULL;
for(; (name = (char *)_internalOpNames.iter()) != NULL; ) {
- map.map(name); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(name); fprintf(fp_cpp, ",\n");
++idx;
};
fprintf(fp_cpp, " // last internally defined operand\n");
@@ -3447,7 +3425,7 @@ void ArchDesc::build_map(OutputMap &map) {
if ( ! inst->is_simple_chain_rule(_globalNames) ) continue;
if ( inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
map.record_position(OutputMap::BEGIN_REMATERIALIZE, idx );
@@ -3458,7 +3436,7 @@ void ArchDesc::build_map(OutputMap &map) {
if ( ! inst->is_simple_chain_rule(_globalNames) ) continue;
if ( ! inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
map.record_position(OutputMap::END_INST_CHAIN_RULES, idx );
@@ -3472,7 +3450,7 @@ void ArchDesc::build_map(OutputMap &map) {
if ( inst->is_simple_chain_rule(_globalNames) ) continue;
if ( ! inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
map.record_position(OutputMap::END_REMATERIALIZE, idx );
@@ -3483,7 +3461,7 @@ void ArchDesc::build_map(OutputMap &map) {
if ( inst->is_simple_chain_rule(_globalNames) ) continue;
if ( inst->rematerialize(_globalNames, get_registers()) ) continue;
- map.map(*inst); fprintf(fp_cpp, ", // %d\n", idx);
+ fprintf(fp_cpp, " /* %4d */", idx); map.map(*inst); fprintf(fp_cpp, ",\n");
++idx;
};
}
@@ -3565,7 +3543,7 @@ void ArchDesc::buildReduceMaps(FILE *fp_hpp, FILE *fp_cpp) {
next = _register->iter_RegDefs();
char policy = reg_save_policy(rdef->_callconv);
const char *comma = (next != NULL) ? "," : " // no trailing comma";
- fprintf(fp_cpp, " '%c'%s\n", policy, comma);
+ fprintf(fp_cpp, " '%c'%s // %s\n", policy, comma, rdef->_regname);
}
fprintf(fp_cpp, "};\n\n");
@@ -3577,7 +3555,7 @@ void ArchDesc::buildReduceMaps(FILE *fp_hpp, FILE *fp_cpp) {
next = _register->iter_RegDefs();
char policy = reg_save_policy(rdef->_c_conv);
const char *comma = (next != NULL) ? "," : " // no trailing comma";
- fprintf(fp_cpp, " '%c'%s\n", policy, comma);
+ fprintf(fp_cpp, " '%c'%s // %s\n", policy, comma, rdef->_regname);
}
fprintf(fp_cpp, "};\n\n");
@@ -3638,6 +3616,8 @@ static void path_to_constant(FILE *fp, FormDict &globals,
fprintf(fp, "_leaf->bottom_type()->is_ptr()");
} else if ( (strcmp(optype,"ConN") == 0) ) {
fprintf(fp, "_leaf->bottom_type()->is_narrowoop()");
+ } else if ( (strcmp(optype,"ConNKlass") == 0) ) {
+ fprintf(fp, "_leaf->bottom_type()->is_narrowklass()");
} else if ( (strcmp(optype,"ConF") == 0) ) {
fprintf(fp, "_leaf->getf()");
} else if ( (strcmp(optype,"ConD") == 0) ) {
@@ -3786,7 +3766,7 @@ void ArchDesc::buildMachNode(FILE *fp_cpp, InstructForm *inst, const char *inden
// For each operand not in the match rule, call MachOperGenerator
// with the enum for the opcode that needs to be built.
ComponentList clist = inst->_components;
- int index = clist.operand_position(comp->_name, comp->_usedef);
+ int index = clist.operand_position(comp->_name, comp->_usedef, inst);
const char *opcode = machOperEnum(comp->_type);
fprintf(fp_cpp, "%s node->set_opnd_array(%d, ", indent, index);
fprintf(fp_cpp, "MachOperGenerator(%s, C));\n", opcode);
@@ -3981,7 +3961,7 @@ void ArchDesc::buildMachNodeGenerator(FILE *fp_cpp) {
fprintf(fp_cpp, " case %s_rule:", opClass);
// Start local scope
- fprintf(fp_cpp, " {\n");
+ fprintf(fp_cpp, " {\n");
// Generate code to construct the new MachNode
buildMachNode(fp_cpp, inst, " ");
// Return result and exit scope
@@ -4131,6 +4111,9 @@ static int PrintAdlcCisc = 0;
// Get info for the CISC_oracle and MachNode::cisc_version()
void ArchDesc::identify_cisc_spill_instructions() {
+ if (_frame == NULL)
+ return;
+
// Find the user-defined operand for cisc-spilling
if( _frame->_cisc_spilling_operand_name != NULL ) {
const Form *form = _globalNames[_frame->_cisc_spilling_operand_name];
diff --git a/hotspot/src/share/vm/adlc/output_h.cpp b/hotspot/src/share/vm/adlc/output_h.cpp
index 8aea9287116..bf538baddf3 100644
--- a/hotspot/src/share/vm/adlc/output_h.cpp
+++ b/hotspot/src/share/vm/adlc/output_h.cpp
@@ -25,6 +25,8 @@
// output_h.cpp - Class HPP file output routines for architecture definition
#include "adlc.hpp"
+// The comment delimiter used in format statements after assembler instructions.
+#define commentSeperator "!"
// Generate the #define that describes the number of registers.
static void defineRegCount(FILE *fp, RegisterForm *registers) {
@@ -79,10 +81,15 @@ void ArchDesc::buildMachRegisterNumbers(FILE *fp_hpp) {
_register->reset_RegDefs();
int i = 0;
while( (reg_def = _register->iter_RegDefs()) != NULL ) {
- fprintf(fp_hpp," %s_num,\t\t// %d\n", reg_def->_regname, i++);
+ fprintf(fp_hpp," %s_num,", reg_def->_regname);
+ for (int j = 0; j < 20-(int)strlen(reg_def->_regname); j++) fprintf(fp_hpp, " ");
+ fprintf(fp_hpp," // enum %3d, regnum %3d, reg encode %3s\n",
+ i++,
+ reg_def->register_num(),
+ reg_def->register_encode());
}
// Finish defining enumeration
- fprintf(fp_hpp, " _last_Mach_Reg\t// %d\n", i);
+ fprintf(fp_hpp, " _last_Mach_Reg // %d\n", i);
fprintf(fp_hpp, "};\n");
}
@@ -121,13 +128,24 @@ void ArchDesc::buildMachRegisterEncodes(FILE *fp_hpp) {
fprintf(fp_hpp, "// in the order of occurrence in the alloc_class(es).\n");
fprintf(fp_hpp, "enum MachRegisterEncodes {\n");
+ // Find max enum string length.
+ size_t maxlen = 0;
+ _register->reset_RegDefs();
+ reg_def = _register->iter_RegDefs();
+ while (reg_def != NULL) {
+ size_t len = strlen(reg_def->_regname);
+ if (len > maxlen) maxlen = len;
+ reg_def = _register->iter_RegDefs();
+ }
+
// Output the register encoding for each register in the allocation classes
_register->reset_RegDefs();
reg_def_next = _register->iter_RegDefs();
while( (reg_def = reg_def_next) != NULL ) {
reg_def_next = _register->iter_RegDefs();
- fprintf(fp_hpp," %s_enc = %s%s\n",
- reg_def->_regname, reg_def->register_encode(), reg_def_next == NULL? "" : "," );
+ fprintf(fp_hpp," %s_enc", reg_def->_regname);
+ for (size_t i = strlen(reg_def->_regname); i < maxlen; i++) fprintf(fp_hpp, " ");
+ fprintf(fp_hpp," = %3s%s\n", reg_def->register_encode(), reg_def_next == NULL? "" : "," );
}
// Finish defining enumeration
fprintf(fp_hpp, "};\n");
@@ -177,14 +195,6 @@ static void in_RegMask(FILE *fp) {
fprintf(fp," virtual const RegMask *in_RegMask(int index) const;\n");
}
-static void declare_hash(FILE *fp) {
- fprintf(fp," virtual uint hash() const;\n");
-}
-
-static void declare_cmp(FILE *fp) {
- fprintf(fp," virtual uint cmp( const MachOper &oper ) const;\n");
-}
-
static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper) {
int i = 0;
Component *comp;
@@ -207,6 +217,10 @@ static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper)
if (i > 0) fprintf(fp,", ");
fprintf(fp," const TypeNarrowOop *_c%d;\n", i);
}
+ else if (!strcmp(type, "ConNKlass")) {
+ if (i > 0) fprintf(fp,", ");
+ fprintf(fp," const TypeNarrowKlass *_c%d;\n", i);
+ }
else if (!strcmp(type, "ConL")) {
if (i > 0) fprintf(fp,", ");
fprintf(fp," jlong _c%d;\n", i);
@@ -243,6 +257,10 @@ static void declareConstStorage(FILE *fp, FormDict &globals, OperandForm *oper)
fprintf(fp," const TypePtr *_c%d;\n", i);
i++;
}
+ else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
+ fprintf(fp," const TypePtr *_c%d;\n", i);
+ i++;
+ }
else if (!strcmp(comp->base_type(globals), "ConL")) {
fprintf(fp," jlong _c%d;\n", i);
i++;
@@ -288,11 +306,12 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
fprintf(fp,is_ideal_bool ? "BoolTest::mask c%d" : "int32 c%d", i);
break;
}
- case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
- case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; }
- case Form::idealL : { fprintf(fp,"jlong c%d", i); break; }
- case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; }
- case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; }
+ case Form::idealN : { fprintf(fp,"const TypeNarrowOop *c%d", i); break; }
+ case Form::idealNKlass : { fprintf(fp,"const TypeNarrowKlass *c%d", i); break; }
+ case Form::idealP : { fprintf(fp,"const TypePtr *c%d", i); break; }
+ case Form::idealL : { fprintf(fp,"jlong c%d", i); break; }
+ case Form::idealF : { fprintf(fp,"jfloat c%d", i); break; }
+ case Form::idealD : { fprintf(fp,"jdouble c%d", i); break; }
default:
assert(!is_ideal_bool, "Non-constant operand lacks component list.");
break;
@@ -316,6 +335,11 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
fprintf(fp,"const TypePtr *c%d", i);
i++;
}
+ else if (!strcmp(comp->base_type(globals), "ConNKlass")) {
+ if (i > 0) fprintf(fp,", ");
+ fprintf(fp,"const TypePtr *c%d", i);
+ i++;
+ }
else if (!strcmp(comp->base_type(globals), "ConL")) {
if (i > 0) fprintf(fp,", ");
fprintf(fp,"jlong c%d", i);
@@ -358,18 +382,19 @@ static void defineConstructor(FILE *fp, const char *name, uint num_consts,
static void defineCCodeDump(OperandForm* oper, FILE *fp, int i) {
assert(oper != NULL, "what");
CondInterface* cond = oper->_interface->is_CondInterface();
- fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
- fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
- fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
+ fprintf(fp, " if( _c%d == BoolTest::eq ) st->print(\"%s\");\n",i,cond->_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::ne ) st->print(\"%s\");\n",i,cond->_not_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::le ) st->print(\"%s\");\n",i,cond->_less_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::ge ) st->print(\"%s\");\n",i,cond->_greater_equal_format);
+ fprintf(fp, " else if( _c%d == BoolTest::lt ) st->print(\"%s\");\n",i,cond->_less_format);
+ fprintf(fp, " else if( _c%d == BoolTest::gt ) st->print(\"%s\");\n",i,cond->_greater_format);
}
// Output code that dumps constant values, increment "i" if type is constant
static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, OperandForm* oper) {
if (!strcmp(ideal_type, "ConI")) {
fprintf(fp," st->print(\"#%%d\", _c%d);\n", i);
+ fprintf(fp," st->print(\"/0x%%08x\", _c%d);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConP")) {
@@ -380,16 +405,25 @@ static uint dump_spec_constant(FILE *fp, const char *ideal_type, uint i, Operand
fprintf(fp," _c%d->dump_on(st);\n", i);
++i;
}
+ else if (!strcmp(ideal_type, "ConNKlass")) {
+ fprintf(fp," _c%d->dump_on(st);\n", i);
+ ++i;
+ }
else if (!strcmp(ideal_type, "ConL")) {
fprintf(fp," st->print(\"#\" INT64_FORMAT, _c%d);\n", i);
+ fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%d);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConF")) {
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
+ fprintf(fp," jint _c%di = JavaValue(_c%d).get_jint();\n", i, i);
+ fprintf(fp," st->print(\"/0x%%x/\", _c%di);\n", i);
++i;
}
else if (!strcmp(ideal_type, "ConD")) {
fprintf(fp," st->print(\"#%%f\", _c%d);\n", i);
+ fprintf(fp," jlong _c%dl = JavaValue(_c%d).get_jlong();\n", i, i);
+ fprintf(fp," st->print(\"/\" PTR64_FORMAT, _c%dl);\n", i);
++i;
}
else if (!strcmp(ideal_type, "Bool")) {
@@ -411,7 +445,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
}
// Local pointer indicates remaining part of format rule
- uint idx = 0; // position of operand in match rule
+ int idx = 0; // position of operand in match rule
// Generate internal format function, used when stored locally
fprintf(fp, "\n#ifndef PRODUCT\n");
@@ -426,13 +460,12 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
oper._format->_rep_vars.reset();
oper._format->_strings.reset();
while ( (string = oper._format->_strings.iter()) != NULL ) {
- fprintf(fp," ");
// Check if this is a standard string or a replacement variable
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
- fprintf(fp,"st->print(\"%s\");\n", string);
+ fprintf(fp," st->print(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@@ -455,7 +488,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
}
// output invocation of "$..."s format function
- if ( op != NULL ) op->int_format(fp, globals, idx);
+ if ( op != NULL ) op->int_format(fp, globals, idx);
if ( idx == -1 ) {
fprintf(stderr,
@@ -498,13 +531,12 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
oper._format->_rep_vars.reset();
oper._format->_strings.reset();
while ( (string = oper._format->_strings.iter()) != NULL ) {
- fprintf(fp," ");
// Check if this is a standard string or a replacement variable
if ( string != NameList::_signal ) {
// Normal string
// Pass through to st->print
- fprintf(fp,"st->print(\"%s\");\n", string);
+ fprintf(fp," st->print(\"%s\");\n", string);
} else {
// Replacement variable
const char *rep_var = oper._format->_rep_vars.iter();
@@ -529,7 +561,7 @@ void gen_oper_format(FILE *fp, FormDict &globals, OperandForm &oper, bool for_c_
if ( op != NULL ) op->ext_format(fp, globals, idx);
// Lookup the index position of the replacement variable
- idx = oper._components.operand_position_format(rep_var);
+ idx = oper._components.operand_position_format(rep_var, &oper);
if ( idx == -1 ) {
fprintf(stderr,
"Using a name, %s, that isn't in match rule\n", rep_var);
@@ -583,7 +615,7 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
inst._format->_rep_vars.reset();
inst._format->_strings.reset();
while( (string = inst._format->_strings.iter()) != NULL ) {
- fprintf(fp," ");
+ fprintf(fp," ");
// Check if this is a standard string or a replacement variable
if( string == NameList::_signal ) { // Replacement variable
const char* rep_var = inst._format->_rep_vars.iter();
@@ -640,11 +672,12 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
if( call_type != Form::invalid_type ) {
switch( call_type ) {
case Form::JAVA_DYNAMIC:
- fprintf(fp," _method->print_short_name();\n");
+ fprintf(fp," _method->print_short_name(st);\n");
break;
case Form::JAVA_STATIC:
- fprintf(fp," if( _method ) _method->print_short_name(st); else st->print(\" wrapper for: %%s\", _name);\n");
- fprintf(fp," if( !_method ) dump_trap_args(st);\n");
+ fprintf(fp," if( _method ) _method->print_short_name(st);\n");
+ fprintf(fp," else st->print(\" wrapper for: %%s\", _name);\n");
+ fprintf(fp," if( !_method ) dump_trap_args(st);\n");
break;
case Form::JAVA_COMPILED:
case Form::JAVA_INTERP:
@@ -652,52 +685,46 @@ void gen_inst_format(FILE *fp, FormDict &globals, InstructForm &inst, bool for_c
case Form::JAVA_RUNTIME:
case Form::JAVA_LEAF:
case Form::JAVA_NATIVE:
- fprintf(fp," st->print(\" %%s\", _name);");
+ fprintf(fp," st->print(\" %%s\", _name);");
break;
default:
- assert(0,"ShouldNotReacHere");
+ assert(0,"ShouldNotReachHere");
}
- fprintf(fp, " st->print_cr(\"\");\n" );
- fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
- fprintf(fp, " st->print(\" # \");\n" );
- fprintf(fp, " if( _jvms ) _oop_map->print_on(st);\n");
+ fprintf(fp, " st->print_cr(\"\");\n" );
+ fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
+ fprintf(fp, " st->print(\" # \");\n" );
+ fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
}
else if(inst.is_ideal_safepoint()) {
- fprintf(fp, " st->print(\"\");\n" );
- fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
- fprintf(fp, " st->print(\" # \");\n" );
- fprintf(fp, " if( _jvms ) _oop_map->print_on(st);\n");
+ fprintf(fp, " st->print(\"\");\n" );
+ fprintf(fp, " if (_jvms) _jvms->format(ra, this, st); else st->print_cr(\" No JVM State Info\");\n" );
+ fprintf(fp, " st->print(\" # \");\n" );
+ fprintf(fp, " if( _jvms && _oop_map ) _oop_map->print_on(st);\n");
}
else if( inst.is_ideal_if() ) {
- fprintf(fp, " st->print(\" P=%%f C=%%f\",_prob,_fcnt);\n" );
+ fprintf(fp, " st->print(\" P=%%f C=%%f\",_prob,_fcnt);\n" );
}
else if( inst.is_ideal_mem() ) {
// Print out the field name if available to improve readability
- fprintf(fp, " if (ra->C->alias_type(adr_type())->field() != NULL) {\n");
- fprintf(fp, " ciField* f = ra->C->alias_type(adr_type())->field();\n");
- fprintf(fp, " st->print(\" ! Field: \");\n");
- fprintf(fp, " if (f->is_volatile())\n");
- fprintf(fp, " st->print(\"volatile \");\n");
- fprintf(fp, " f->holder()->name()->print_symbol_on(st);\n");
- fprintf(fp, " st->print(\".\");\n");
- fprintf(fp, " f->name()->print_symbol_on(st);\n");
- fprintf(fp, " if (f->is_constant())\n");
- fprintf(fp, " st->print(\" (constant)\");\n");
- fprintf(fp, " } else\n");
+ fprintf(fp, " if (ra->C->alias_type(adr_type())->field() != NULL) {\n");
+ fprintf(fp, " ciField* f = ra->C->alias_type(adr_type())->field();\n");
+ fprintf(fp, " st->print(\" %s Field: \");\n", commentSeperator);
+ fprintf(fp, " if (f->is_volatile())\n");
+ fprintf(fp, " st->print(\"volatile \");\n");
+ fprintf(fp, " f->holder()->name()->print_symbol_on(st);\n");
+ fprintf(fp, " st->print(\".\");\n");
+ fprintf(fp, " f->name()->print_symbol_on(st);\n");
+ fprintf(fp, " if (f->is_constant())\n");
+ fprintf(fp, " st->print(\" (constant)\");\n");
+ fprintf(fp, " } else {\n");
// Make sure 'Volatile' gets printed out
fprintf(fp, " if (ra->C->alias_type(adr_type())->is_volatile())\n");
fprintf(fp, " st->print(\" volatile!\");\n");
+ fprintf(fp, " }\n");
}
// Complete the definition of the format function
- fprintf(fp, " }\n#endif\n");
-}
-
-static bool is_non_constant(char* x) {
- // Tells whether the string (part of an operator interface) is non-constant.
- // Simply detect whether there is an occurrence of a formal parameter,
- // which will always begin with '$'.
- return strchr(x, '$') == 0;
+ fprintf(fp, "}\n#endif\n");
}
void ArchDesc::declare_pipe_classes(FILE *fp_hpp) {
@@ -1089,7 +1116,7 @@ void ArchDesc::declare_pipe_classes(FILE *fp_hpp) {
fprintf(fp_hpp, " static void initialize_nops(MachNode *nop_list[%d], Compile* C);\n\n",
_pipeline->_nopcnt);
fprintf(fp_hpp, "#ifndef PRODUCT\n");
- fprintf(fp_hpp, " void dump() const;\n");
+ fprintf(fp_hpp, " void dump(outputStream *st = tty) const;\n");
fprintf(fp_hpp, "#endif\n");
fprintf(fp_hpp, "};\n\n");
@@ -1234,12 +1261,12 @@ void ArchDesc::declareClasses(FILE *fp) {
unsigned int position = 0;
const char *opret, *opname, *optype;
oper->_matrule->base_operand(position,_globalNames,opret,opname,optype);
- fprintf(fp," virtual const Type *type() const {");
+ fprintf(fp," virtual const Type *type() const {");
const char *type = getIdealType(optype);
if( type != NULL ) {
Form::DataType data_type = oper->is_base_constant(_globalNames);
// Check if we are an ideal pointer type
- if( data_type == Form::idealP || data_type == Form::idealN ) {
+ if( data_type == Form::idealP || data_type == Form::idealN || data_type == Form::idealNKlass ) {
// Return the ideal type we already have:
fprintf(fp," return _c0;");
} else {
@@ -1377,6 +1404,16 @@ void ArchDesc::declareClasses(FILE *fp) {
fprintf(fp, " return _c0->get_ptrtype()->reloc();");
fprintf(fp, " }\n");
}
+ else if (!strcmp(oper->ideal_type(_globalNames), "ConNKlass")) {
+ // Access the locally stored constant
+ fprintf(fp," virtual intptr_t constant() const {");
+ fprintf(fp, " return _c0->get_ptrtype()->get_con();");
+ fprintf(fp, " }\n");
+ // Generate query to determine if this pointer is an oop
+ fprintf(fp," virtual relocInfo::relocType constant_reloc() const {");
+ fprintf(fp, " return _c0->get_ptrtype()->reloc();");
+ fprintf(fp, " }\n");
+ }
else if (!strcmp(oper->ideal_type(_globalNames), "ConL")) {
fprintf(fp," virtual intptr_t constant() const {");
// We don't support addressing modes with > 4Gig offsets.
@@ -1503,12 +1540,19 @@ void ArchDesc::declareClasses(FILE *fp) {
fprintf(fp, " GrowableArray