# HG changeset patch # User Thomas Wuerthinger # Date 1305212409 -7200 # Node ID 50b181d88c9fa21f9743be0482a411916d0b9848 # Parent 405e7947a940a9d3483338a9db8fd2fa6bb35c99# Parent 32e8315bb6e41951f7b7c0cbe75d4ae65c0fdfba Merge. diff -r 405e7947a940 -r 50b181d88c9f .hgignore --- a/.hgignore Thu May 12 16:55:03 2011 +0200 +++ b/.hgignore Thu May 12 17:00:09 2011 +0200 @@ -21,3 +21,4 @@ ^src/share/tools/IdealGraphVisualizer/[a-zA-Z0-9]*/build/ ^src/share/tools/IdealGraphVisualizer/build/ ^src/share/tools/IdealGraphVisualizer/dist/ +^make/solaris/solaris_amd64_compiler1/ diff -r 405e7947a940 -r 50b181d88c9f domake --- a/domake Thu May 12 16:55:03 2011 +0200 +++ b/domake Thu May 12 17:00:09 2011 +0200 @@ -28,7 +28,7 @@ exit 1 fi -java_link="$graal_home/c1x4hotspotsrc/hotspot/java" +java_link="$graal_home/graal/hotspot/java" if [ ! -e $java_link ]; then echo "Creating link: $java_link -> $JDK7/jre/bin/java" ln -s $JDK7/jre/bin/java $java_link diff -r 405e7947a940 -r 50b181d88c9f graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java --- a/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 12 16:55:03 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/gen/LIRGenerator.java Thu May 12 17:00:09 2011 +0200 @@ -448,38 +448,19 @@ } protected FrameState stateBeforeInvoke(Invoke invoke) { - FrameState stateAfter = invoke.stateAfter(); - FrameStateBuilder builder = new FrameStateBuilder(compilation.method, invoke.graph()); - builder.initializeFrom(stateAfter); - if (invoke.kind != CiKind.Void) { - builder.pop(invoke.kind); + Value[] args = new Value[invoke.argumentCount()]; + for (int i = 0; i < invoke.argumentCount(); i++) { + args[i] = invoke.argument(i); } - int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable? - for (int i = 0; i < argumentCount; i++) { - Value arg = invoke.argument(i); - if (arg != null) { - //builder.push(arg.kind, arg); - } - } - return builder.create(invoke.bci()); + return invoke.stateAfter().duplicateModified(invoke.bci(), invoke.kind/*, args*/); } protected FrameState stateBeforeInvokeWithArguments(Invoke invoke) { - - FrameState stateAfter = invoke.stateAfter(); - FrameStateBuilder builder = new FrameStateBuilder(compilation.method, invoke.graph()); - builder.initializeFrom(stateAfter); - if (invoke.kind != CiKind.Void) { - builder.pop(invoke.kind); + Value[] args = new Value[invoke.argumentCount()]; + for (int i = 0; i < invoke.argumentCount(); i++) { + args[i] = invoke.argument(i); } - int argumentCount = invoke.argumentCount(); // invoke.arguments() iterable? - for (int i = 0; i < argumentCount; i++) { - Value arg = invoke.argument(i); - if (arg != null) { - builder.push(arg.kind, arg); - } - } - return builder.create(invoke.bci()); + return invoke.stateAfter().duplicateModified(invoke.bci(), invoke.kind, args); } @Override diff -r 405e7947a940 -r 50b181d88c9f graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java --- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Thu May 12 16:55:03 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java Thu May 12 17:00:09 2011 +0200 @@ -86,7 +86,7 @@ inputs().set(i, locals[i]); } for (int i = 0; i < stackSize; i++) { - inputs().set(i + localsSize, stack[i]); + inputs().set(localsSize + i, stack[i]); } for (int i = 0; i < locks.size(); i++) { inputs().set(locals.length + stackSize + i, locks.get(i)); @@ -116,6 +116,31 @@ return other; } + /** + * Creates a copy of this frame state with one stack element of type popKind popped from the stack and the + * values in pushedValues pushed on the stack. The pushedValues are expected to be in slot encoding: a long + * or double is followed by a null slot. + */ + public FrameState duplicateModified(int bci, CiKind popKind, Value... pushedValues) { + int popSlots = popKind.sizeInSlots(); + int pushSlots = pushedValues.length; + FrameState other = new FrameState(bci, localsSize, stackSize - popSlots + pushSlots, locksSize(), graph()); + for (int i = 0; i < localsSize; i++) { + other.inputs().set(i, localAt(i)); + } + for (int i = 0; i < stackSize - popSlots; i++) { + other.inputs().set(localsSize + i, stackAt(i)); + } + int slot = localsSize + stackSize - popSlots; + for (int i = 0; i < pushSlots; i++) { + other.inputs().set(slot++, pushedValues[i]); + } + for (int i = 0; i < locksSize; i++) { + other.inputs().set(localsSize + other.stackSize + i, lockAt(i)); + } + return other; + } + public boolean isCompatibleWith(FrameStateAccess other) { if (stackSize() != other.stackSize() || localsSize() != other.localsSize() || locksSize() != other.locksSize()) { return false; diff -r 405e7947a940 -r 50b181d88c9f graal/GraalCompiler/src/com/sun/c1x/value/FrameStateBuilder.java --- a/graal/GraalCompiler/src/com/sun/c1x/value/FrameStateBuilder.java Thu May 12 16:55:03 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/value/FrameStateBuilder.java Thu May 12 17:00:09 2011 +0200 @@ -187,6 +187,7 @@ * @return the instruction on the top of the stack */ public Value pop(CiKind kind) { + assert kind != CiKind.Void; if (kind.sizeInSlots() == 2) { xpop(); } diff -r 405e7947a940 -r 50b181d88c9f make/solaris/build.sh diff -r 405e7947a940 -r 50b181d88c9f runbootstrap.sh --- a/runbootstrap.sh Thu May 12 16:55:03 2011 +0200 +++ b/runbootstrap.sh Thu May 12 17:00:09 2011 +0200 @@ -15,5 +15,5 @@ echo "GRAAL is not defined. It must point to a maxine repository directory." exit 1; fi -${JDK7}/bin/java -client -graal -version -${JDK7G}/bin/java -client -graal -version +${JDK7}/bin/java -client -d64 -graal -version +${JDK7G}/bin/java -client -d64 -graal -version diff -r 405e7947a940 -r 50b181d88c9f rundacapo.sh --- a/rundacapo.sh Thu May 12 16:55:03 2011 +0200 +++ b/rundacapo.sh Thu May 12 17:00:09 2011 +0200 @@ -15,4 +15,4 @@ echo "DACAPO is not defined. It must point to a Dacapo benchmark directory." exit 1; fi -${JDK7}/bin/java -client -graal -XX:-C1XBailoutIsFatal -C1X:+QuietBailout -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness $* +${JDK7}/bin/java -client -d64 -graal -XX:-C1XBailoutIsFatal -XX:+PrintCompilation -C1X:-QuietBailout -Xms1g -Xmx2g -esa -classpath ${DACAPO}/dacapo-9.12-bach.jar Harness $* diff -r 405e7947a940 -r 50b181d88c9f runscimark.sh --- a/runscimark.sh Thu May 12 16:55:03 2011 +0200 +++ b/runscimark.sh Thu May 12 17:00:09 2011 +0200 @@ -22,5 +22,5 @@ for (( i = 1; i <= ${COUNT}; i++ )) ### Outer for loop ### do echo "$i " - ${JDK7}/jre/bin/java -client -graal -esa -ea -Xms32m -Xmx100m -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers jnt.scimark2.commandline -large + ${JDK7}/jre/bin/java -client -d64 -graal -esa -ea -Xms32m -Xmx100m -Xbootclasspath/a:${SCIMARK} -C1X:+PrintTimers jnt.scimark2.commandline -large done diff -r 405e7947a940 -r 50b181d88c9f runtests.sh --- a/runtests.sh Thu May 12 16:55:03 2011 +0200 +++ b/runtests.sh Thu May 12 17:00:09 2011 +0200 @@ -11,4 +11,4 @@ echo "GRAAL is not defined. It must point to a maxine repository directory." exit 1; fi -${JDK7}/bin/java -client -graal -ea -esa -Xcomp -XX:+PrintCompilation -XX:CompileOnly=jtt -Xbootclasspath/p:"${MAXINE}/VM/bin" -Xbootclasspath/p:"${MAXINE}/Base/bin" $1 test.com.sun.max.vm.compiler.JavaTester -verbose=1 -gen-run-scheme=false -run-scheme-package=all ${MAXINE}/VM/test/jtt/bytecode ${MAXINE}/VM/test/jtt/except ${MAXINE}/VM/test/jtt/hotpath ${MAXINE}/VM/test/jtt/jdk ${MAXINE}/VM/test/jtt/lang ${MAXINE}/VM/test/jtt/loop ${MAXINE}/VM/test/jtt/micro ${MAXINE}/VM/test/jtt/optimize ${MAXINE}/VM/test/jtt/reflect ${MAXINE}/VM/test/jtt/threads +${JDK7}/bin/java -client -d64 -graal -ea -esa -Xcomp -XX:+PrintCompilation -XX:CompileOnly=jtt -Xbootclasspath/p:"${MAXINE}/VM/bin" -Xbootclasspath/p:"${MAXINE}/Base/bin" $1 test.com.sun.max.vm.compiler.JavaTester -verbose=1 -gen-run-scheme=false -run-scheme-package=all ${MAXINE}/VM/test/jtt/bytecode ${MAXINE}/VM/test/jtt/except ${MAXINE}/VM/test/jtt/hotpath ${MAXINE}/VM/test/jtt/jdk ${MAXINE}/VM/test/jtt/lang ${MAXINE}/VM/test/jtt/loop ${MAXINE}/VM/test/jtt/micro ${MAXINE}/VM/test/jtt/optimize ${MAXINE}/VM/test/jtt/reflect ${MAXINE}/VM/test/jtt/threads diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_Compiler.cpp --- a/src/share/vm/c1x/c1x_Compiler.cpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_Compiler.cpp Thu May 12 17:00:09 2011 +0200 @@ -28,6 +28,7 @@ #include "c1x/c1x_VMEntries.hpp" #include "c1x/c1x_VmIds.hpp" #include "c1/c1_Runtime1.hpp" +#include "runtime/arguments.hpp" C1XCompiler* C1XCompiler::_instance = NULL; diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_JavaAccess.cpp --- a/src/share/vm/c1x/c1x_JavaAccess.cpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_JavaAccess.cpp Thu May 12 17:00:09 2011 +0200 @@ -23,7 +23,8 @@ #include "precompiled.hpp" #include "c1x/c1x_JavaAccess.hpp" - +#include "runtime/jniHandles.hpp" +#include "classfile/symbolTable.hpp" // This function is similar to javaClasses.cpp, it computes the field offset of a (static or instance) field. // It looks up the name and signature symbols without creating new ones, all the symbols of these classes need to be already loaded. diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_JavaAccess.hpp --- a/src/share/vm/c1x/c1x_JavaAccess.hpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_JavaAccess.hpp Thu May 12 17:00:09 2011 +0200 @@ -23,6 +23,7 @@ void c1x_compute_offsets(); +#include "classfile/systemDictionary.hpp" #include "oops/instanceMirrorKlass.hpp" /* This macro defines the structure of the CiTargetMethod - classes. diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_VMEntries.cpp --- a/src/share/vm/c1x/c1x_VMEntries.cpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_VMEntries.cpp Thu May 12 17:00:09 2011 +0200 @@ -29,6 +29,7 @@ #include "c1x/c1x_VMExits.hpp" #include "c1x/c1x_VmIds.hpp" #include "c1/c1_Runtime1.hpp" +#include "memory/oopFactory.hpp" // public byte[] RiMethod_code(long vmId); JNIEXPORT jbyteArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code(JNIEnv *env, jobject, jlong vmId) { @@ -641,13 +642,13 @@ } // public void recordBailout(String reason); -JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_recordBailout(JNIEnv *jniEnv, jobject message) { +JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) { if (C1XBailoutIsFatal) { Handle msg = JNIHandles::resolve(message); if (!msg.is_null()) { java_lang_String::print(msg, tty); } - fatal("Bailout in C1X"); + vm_abort(false); } } diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_VMEntries.hpp --- a/src/share/vm/c1x/c1x_VMEntries.hpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_VMEntries.hpp Thu May 12 17:00:09 2011 +0200 @@ -21,6 +21,8 @@ * questions. */ +#include "prims/jni.h" + extern JNINativeMethod VMEntries_methods[]; int VMEntries_methods_count(); diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_VMExits.hpp --- a/src/share/vm/c1x/c1x_VMExits.hpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_VMExits.hpp Thu May 12 17:00:09 2011 +0200 @@ -21,6 +21,14 @@ * questions. */ +#include "memory/allocation.hpp" +#include "oops/oop.hpp" +#include "runtime/handles.hpp" +#include "runtime/thread.hpp" +#include "classfile/javaClasses.hpp" +#include "runtime/jniHandles.hpp" +#include "runtime/javaCalls.hpp" + class VMExits : public AllStatic { private: diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_VmIds.cpp --- a/src/share/vm/c1x/c1x_VmIds.cpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_VmIds.cpp Thu May 12 17:00:09 2011 +0200 @@ -23,6 +23,7 @@ #include "precompiled.hpp" #include "c1x/c1x_VmIds.hpp" +#include "ci/ciUtilities.hpp" // VmIds implementation diff -r 405e7947a940 -r 50b181d88c9f src/share/vm/c1x/c1x_VmIds.hpp --- a/src/share/vm/c1x/c1x_VmIds.hpp Thu May 12 16:55:03 2011 +0200 +++ b/src/share/vm/c1x/c1x_VmIds.hpp Thu May 12 17:00:09 2011 +0200 @@ -21,7 +21,13 @@ * questions. */ -class Thread; +#include "memory/allocation.hpp" +#include "utilities/growableArray.hpp" +#include "oops/oop.hpp" +#include "runtime/handles.hpp" +#include "runtime/thread.hpp" +#include "classfile/javaClasses.hpp" +#include "runtime/jniHandles.hpp" class VmIds : public AllStatic {