# HG changeset patch # User Doug Simon # Date 1381871187 -7200 # Node ID 90494fdf11c809c112e8a8613015765bdd1871cf # Parent 7080a96be216a933b419bb3aa7114449fdb272ee# Parent 15141192206d58f5702feb3cbf3e57b49a32160f Merge. diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotReplacementsImpl.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/ForeignCallStub.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/FixedGuardNode.java Tue Oct 15 23:06:27 2013 +0200 @@ -99,8 +99,9 @@ DeoptimizeNode deopt = graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, reason)); deopt.setDeoptimizationState(getDeoptimizationState()); setNext(deopt); + } else { + this.replaceAtUsages(null); } - this.replaceAtUsages(null); graph().removeFixed(this); } } diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/EscapeObjectState.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/EscapeObjectState.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/virtual/EscapeObjectState.java Tue Oct 15 23:06:27 2013 +0200 @@ -22,10 +22,9 @@ */ package com.oracle.graal.nodes.virtual; -import com.oracle.graal.graph.Node.*; import com.oracle.graal.nodes.*; -public abstract class EscapeObjectState extends VirtualState implements ValueNumberable { +public abstract class EscapeObjectState extends VirtualState { @Input private VirtualObjectNode object; diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ObjectAccessTest.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/WordTest.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.replacements/src/com/oracle/graal/replacements/ReplacementsImpl.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java --- a/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.truffle.test/src/com/oracle/graal/truffle/test/PartialEvaluationTest.java Tue Oct 15 23:06:27 2013 +0200 @@ -22,8 +22,6 @@ */ package com.oracle.graal.truffle.test; -import static com.oracle.graal.truffle.TruffleCompilerOptions.*; - import java.util.*; import java.util.concurrent.*; @@ -44,7 +42,6 @@ import com.oracle.graal.phases.util.*; import com.oracle.graal.printer.*; import com.oracle.graal.truffle.*; -import com.oracle.graal.truffle.printer.*; import com.oracle.graal.virtual.phases.ea.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.frame.*; @@ -59,7 +56,7 @@ // Make sure Truffle runtime is initialized. Assert.assertTrue(Truffle.getRuntime() instanceof GraalTruffleRuntime); Replacements truffleReplacements = ((GraalTruffleRuntime) Truffle.getRuntime()).getReplacements(); - Providers providers = new Providers(getMetaAccess(), getCodeCache(), getConstantReflection(), getForeignCalls(), getLowerer(), truffleReplacements); + Providers providers = getProviders().copyWith(truffleReplacements); TruffleCache truffleCache = new TruffleCache(providers, GraphBuilderConfiguration.getDefault(), TruffleCompilerImpl.Optimizations); this.partialEvaluator = new PartialEvaluator(providers, truffleCache); @@ -136,10 +133,6 @@ new DeadCodeEliminationPhase().apply(resultGraph); new PartialEscapePhase(true, canonicalizer).apply(resultGraph, context); - if (TruffleInlinePrinter.getValue()) { - InlinePrinterProcessor.printTree(); - } - return resultGraph; } diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Tue Oct 15 23:06:27 2013 +0200 @@ -55,8 +55,6 @@ import com.oracle.graal.truffle.nodes.frame.*; import com.oracle.graal.truffle.nodes.frame.NewFrameNode.VirtualOnlyInstanceNode; import com.oracle.graal.truffle.phases.*; -import com.oracle.graal.truffle.printer.*; -import com.oracle.graal.truffle.printer.method.*; import com.oracle.graal.virtual.phases.ea.*; import com.oracle.truffle.api.*; import com.oracle.truffle.api.frame.*; @@ -107,10 +105,6 @@ final StructuredGraph graph = new StructuredGraph(executeHelperMethod); - if (TruffleInlinePrinter.getValue()) { - InlinePrinterProcessor.initialize(); - } - Debug.scope("createGraph", graph, new Runnable() { @Override @@ -140,11 +134,6 @@ new VerifyFrameDoesNotEscapePhase().apply(graph, false); - if (TruffleInlinePrinter.getValue()) { - InlinePrinterProcessor.printTree(); - InlinePrinterProcessor.reset(); - } - if (TraceTruffleCompilationDetails.getValue() && constantReceivers != null) { DebugHistogram histogram = Debug.createHistogram("Expanded Truffle Nodes"); for (Constant c : constantReceivers) { @@ -196,9 +185,6 @@ for (MethodCallTargetNode methodCallTargetNode : graph.getNodes(MethodCallTargetNode.class)) { InvokeKind kind = methodCallTargetNode.invokeKind(); if (kind == InvokeKind.Static || (kind == InvokeKind.Special && (methodCallTargetNode.receiver().isConstant() || methodCallTargetNode.receiver() instanceof NewFrameNode))) { - if (TruffleInlinePrinter.getValue()) { - InlinePrinterProcessor.addInlining(MethodHolder.getNewTruffleExecuteMethod(methodCallTargetNode)); - } if (TraceTruffleCompilationDetails.getValue() && kind == InvokeKind.Special) { ConstantNode constantNode = (ConstantNode) methodCallTargetNode.arguments().first(); constantReceivers.add(constantNode.asConstant()); diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerOptions.java Tue Oct 15 23:06:27 2013 +0200 @@ -79,8 +79,6 @@ @Option(help = "") public static final OptionValue TraceTruffleCacheDetails = new OptionValue<>(false); @Option(help = "") - public static final OptionValue TruffleInlinePrinter = new OptionValue<>(false); - @Option(help = "") public static final OptionValue TraceTruffleCompilationExceptions = new OptionValue<>(true); @Option(help = "") public static final OptionValue TruffleCompilationExceptionsAreFatal = new OptionValue<>(true); diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleReplacements.java diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/MaterializedObjectState.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/MaterializedObjectState.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/MaterializedObjectState.java Tue Oct 15 23:06:27 2013 +0200 @@ -44,7 +44,7 @@ @Override public MaterializedObjectState duplicateWithVirtualState() { - return graph().unique(new MaterializedObjectState(object(), materializedValue)); + return graph().addWithoutUnique(new MaterializedObjectState(object(), materializedValue)); } @Override diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/VirtualObjectState.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/VirtualObjectState.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/nodes/VirtualObjectState.java Tue Oct 15 23:06:27 2013 +0200 @@ -53,7 +53,7 @@ @Override public VirtualObjectState duplicateWithVirtualState() { - return graph().unique(new VirtualObjectState(object(), fieldValues)); + return graph().addWithoutUnique(new VirtualObjectState(object(), fieldValues)); } @Override diff -r 7080a96be216 -r 90494fdf11c8 graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/GraphEffectList.java --- a/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/GraphEffectList.java Tue Oct 15 22:21:01 2013 +0200 +++ b/graal/com.oracle.graal.virtual/src/com/oracle/graal/virtual/phases/ea/GraphEffectList.java Tue Oct 15 23:06:27 2013 +0200 @@ -178,7 +178,7 @@ stateAfter.virtualObjectMappings().remove(i); } } - stateAfter.addVirtualObjectMapping(graph.unique(state)); + stateAfter.addVirtualObjectMapping(graph.addWithoutUnique(state)); } @Override diff -r 7080a96be216 -r 90494fdf11c8 make/bsd/makefiles/fastdebug.make --- a/make/bsd/makefiles/fastdebug.make Tue Oct 15 22:21:01 2013 +0200 +++ b/make/bsd/makefiles/fastdebug.make Tue Oct 15 23:06:27 2013 +0200 @@ -59,6 +59,5 @@ MAPFILE = $(GAMMADIR)/make/bsd/makefiles/mapfile-vers-debug VERSION = fastdebug -#SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS -SYSDEFS += -DASSERT +SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff -r 7080a96be216 -r 90494fdf11c8 make/linux/makefiles/fastdebug.make --- a/make/linux/makefiles/fastdebug.make Tue Oct 15 22:21:01 2013 +0200 +++ b/make/linux/makefiles/fastdebug.make Tue Oct 15 23:06:27 2013 +0200 @@ -59,6 +59,5 @@ MAPFILE = $(GAMMADIR)/make/linux/makefiles/mapfile-vers-debug VERSION = optimized -#SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS -SYSDEFS += -DASSERT +SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff -r 7080a96be216 -r 90494fdf11c8 make/solaris/makefiles/fastdebug.make --- a/make/solaris/makefiles/fastdebug.make Tue Oct 15 22:21:01 2013 +0200 +++ b/make/solaris/makefiles/fastdebug.make Tue Oct 15 23:06:27 2013 +0200 @@ -126,6 +126,5 @@ MAPFILE_DTRACE = $(GAMMADIR)/make/solaris/makefiles/mapfile-vers-$(TYPE) VERSION = optimized -#SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS -SYSDEFS += -DASSERT +SYSDEFS += -DASSERT -DCHECK_UNHANDLED_OOPS PICFLAGS = DEFAULT diff -r 7080a96be216 -r 90494fdf11c8 make/windows/makefiles/fastdebug.make --- a/make/windows/makefiles/fastdebug.make Tue Oct 15 22:21:01 2013 +0200 +++ b/make/windows/makefiles/fastdebug.make Tue Oct 15 23:06:27 2013 +0200 @@ -38,8 +38,7 @@ !include ../local.make !include compile.make -#CXX_FLAGS=$(CXX_FLAGS) $(FASTDEBUG_OPT_OPTION) /D "CHECK_UNHANDLED_OOPS" -CXX_FLAGS=$(CXX_FLAGS) $(FASTDEBUG_OPT_OPTION) +CXX_FLAGS=$(CXX_FLAGS) $(FASTDEBUG_OPT_OPTION) /D "CHECK_UNHANDLED_OOPS" !include $(WorkSpace)/make/windows/makefiles/vm.make !include local.make diff -r 7080a96be216 -r 90494fdf11c8 mx/projects --- a/mx/projects Tue Oct 15 22:21:01 2013 +0200 +++ b/mx/projects Tue Oct 15 23:06:27 2013 +0200 @@ -28,7 +28,7 @@ library@OKRA@urls=http://cr.openjdk.java.net/~tdeneau/okra-1.2.jar distribution@GRAAL@path=graal.jar -distribution@GRAAL@dependencies=com.oracle.graal.hotspot.amd64,com.oracle.graal.hotspot.ptx,com.oracle.graal.truffle,com.oracle.graal.truffle.printer,com.oracle.graal.hotspot.sparc,com.oracle.graal.hotspot,com.oracle.graal.hotspot.hsail +distribution@GRAAL@dependencies=com.oracle.graal.hotspot.amd64,com.oracle.graal.hotspot.ptx,com.oracle.graal.truffle,com.oracle.graal.hotspot.sparc,com.oracle.graal.hotspot,com.oracle.graal.compiler.hsail # graal.api.runtime project@com.oracle.graal.api.runtime@subDir=graal @@ -622,7 +622,7 @@ # graal.truffle project@com.oracle.graal.truffle@subDir=graal project@com.oracle.graal.truffle@sourceDirs=src -project@com.oracle.graal.truffle@dependencies=com.oracle.truffle.api,com.oracle.graal.truffle.printer,com.oracle.graal.hotspot +project@com.oracle.graal.truffle@dependencies=com.oracle.truffle.api,com.oracle.graal.hotspot project@com.oracle.graal.truffle@checkstyle=com.oracle.graal.graph project@com.oracle.graal.truffle@javaCompliance=1.7 project@com.oracle.graal.truffle@workingSets=Graal,Truffle @@ -635,12 +635,4 @@ project@com.oracle.graal.truffle.test@javaCompliance=1.7 project@com.oracle.graal.truffle.test@workingSets=Graal,Truffle,Test -# graal.truffle.printer -project@com.oracle.graal.truffle.printer@subDir=graal -project@com.oracle.graal.truffle.printer@sourceDirs=src -project@com.oracle.graal.truffle.printer@dependencies=com.oracle.graal.nodes -project@com.oracle.graal.truffle.printer@checkstyle=com.oracle.graal.graph -project@com.oracle.graal.truffle.printer@javaCompliance=1.7 -project@com.oracle.graal.truffle.printer@workingSets=Graal,Truffle - diff -r 7080a96be216 -r 90494fdf11c8 src/share/vm/graal/graalRuntime.cpp --- a/src/share/vm/graal/graalRuntime.cpp Tue Oct 15 22:21:01 2013 +0200 +++ b/src/share/vm/graal/graalRuntime.cpp Tue Oct 15 23:06:27 2013 +0200 @@ -108,7 +108,7 @@ thread->set_vm_result(obj); JRT_END -JRT_ENTRY(void, GraalRuntime::dynamic_new_array(JavaThread* thread, oop element_mirror, jint length)) +JRT_ENTRY(void, GraalRuntime::dynamic_new_array(JavaThread* thread, oopDesc* element_mirror, jint length)) oop obj = Reflection::reflect_new_array(element_mirror, length, CHECK); thread->set_vm_result(obj); JRT_END @@ -348,7 +348,7 @@ } JRT_END -JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oop obj, jint flags)) +JRT_ENTRY(void, GraalRuntime::log_object(JavaThread* thread, oopDesc* obj, jint flags)) bool string = mask_bits_are_true(flags, LOG_OBJECT_STRING); bool addr = mask_bits_are_true(flags, LOG_OBJECT_ADDRESS); bool newline = mask_bits_are_true(flags, LOG_OBJECT_NEWLINE); @@ -393,7 +393,7 @@ return (jint)ret; JRT_END -JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oop where, oop format, jlong value)) +JRT_ENTRY(void, GraalRuntime::vm_error(JavaThread* thread, oopDesc* where, oopDesc* format, jlong value)) ResourceMark rm; assert(where == NULL || java_lang_String::is_instance(where), "must be"); const char *error_msg = where == NULL ? "" : java_lang_String::as_utf8_string(where); @@ -407,7 +407,7 @@ report_vm_error(__FILE__, __LINE__, error_msg, detail_msg); JRT_END -JRT_LEAF(oop, GraalRuntime::load_and_clear_exception(JavaThread* thread)) +JRT_LEAF(oopDesc*, GraalRuntime::load_and_clear_exception(JavaThread* thread)) oop exception = thread->exception_oop(); assert(exception != NULL, "npe"); thread->set_exception_oop(NULL); @@ -415,7 +415,7 @@ return exception; JRT_END -JRT_LEAF(void, GraalRuntime::log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3)) +JRT_LEAF(void, GraalRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3)) ResourceMark rm; assert(format != NULL && java_lang_String::is_instance(format), "must be"); char *buf = java_lang_String::as_utf8_string(format); @@ -485,14 +485,14 @@ } JRT_END -JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oop obj)) +JRT_ENTRY(jint, GraalRuntime::identity_hash_code(JavaThread* thread, oopDesc* obj)) return (jint) obj->identity_hash(); JRT_END -JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oop receiver, jboolean clear_interrupted)) +JRT_ENTRY(jboolean, GraalRuntime::thread_is_interrupted(JavaThread* thread, oopDesc* receiver, jboolean clear_interrupted)) // Ensure that the C++ Thread and OSThread structures aren't freed before we operate Handle receiverHandle(thread, receiver); - MutexLockerEx ml(thread->threadObj() == receiver ? NULL : Threads_lock); + MutexLockerEx ml(thread->threadObj() == (void*)receiver ? NULL : Threads_lock); JavaThread* receiverThread = java_lang_Thread::thread(receiverHandle()); return (jint) Thread::is_interrupted(receiverThread, clear_interrupted != 0); JRT_END diff -r 7080a96be216 -r 90494fdf11c8 src/share/vm/graal/graalRuntime.hpp --- a/src/share/vm/graal/graalRuntime.hpp Tue Oct 15 22:21:01 2013 +0200 +++ b/src/share/vm/graal/graalRuntime.hpp Tue Oct 15 23:06:27 2013 +0200 @@ -33,18 +33,18 @@ static void new_instance(JavaThread* thread, Klass* klass); static void new_array(JavaThread* thread, Klass* klass, jint length); static void new_multi_array(JavaThread* thread, Klass* klass, int rank, jint* dims); - static void dynamic_new_array(JavaThread* thread, oop element_mirror, jint length); - static jboolean thread_is_interrupted(JavaThread* thread, oop obj, jboolean clear_interrupted); + static void dynamic_new_array(JavaThread* thread, oopDesc* element_mirror, jint length); + static jboolean thread_is_interrupted(JavaThread* thread, oopDesc* obj, jboolean clear_interrupted); static void vm_message(jboolean vmError, jlong format, jlong v1, jlong v2, jlong v3); - static jint identity_hash_code(JavaThread* thread, oop obj); + static jint identity_hash_code(JavaThread* thread, oopDesc* obj); static address exception_handler_for_pc(JavaThread* thread); static void monitorenter(JavaThread* thread, oopDesc* obj, BasicLock* lock); static void monitorexit (JavaThread* thread, oopDesc* obj, BasicLock* lock); static void create_null_exception(JavaThread* thread); static void create_out_of_bounds_exception(JavaThread* thread, jint index); - static void vm_error(JavaThread* thread, oop where, oop format, jlong value); - static oop load_and_clear_exception(JavaThread* thread); - static void log_printf(JavaThread* thread, oop format, jlong v1, jlong v2, jlong v3); + static void vm_error(JavaThread* thread, oopDesc* where, oopDesc* format, jlong value); + static oopDesc* load_and_clear_exception(JavaThread* thread); + static void log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3); static void log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline); // Note: Must be kept in sync with constants in com.oracle.graal.replacements.Log enum { @@ -52,7 +52,7 @@ LOG_OBJECT_STRING = 0x02, LOG_OBJECT_ADDRESS = 0x04 }; - static void log_object(JavaThread* thread, oop msg, jint flags); + static void log_object(JavaThread* thread, oopDesc* msg, jint flags); static void write_barrier_pre(JavaThread* thread, oopDesc* obj); static void write_barrier_post(JavaThread* thread, void* card); static jboolean validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child); diff -r 7080a96be216 -r 90494fdf11c8 src/share/vm/runtime/vframeArray.cpp --- a/src/share/vm/runtime/vframeArray.cpp Tue Oct 15 22:21:01 2013 +0200 +++ b/src/share/vm/runtime/vframeArray.cpp Tue Oct 15 23:06:27 2013 +0200 @@ -338,7 +338,7 @@ #ifndef PRODUCT if (PrintDeoptimizationDetails) { tty->print("Reconstructed expression %d (OBJECT): ", i); - oop o = (oop)(*addr); + oop o = (oop)(address)(*addr); if (o == NULL) { tty->print_cr("NULL"); } else { @@ -375,7 +375,7 @@ #ifndef PRODUCT if (PrintDeoptimizationDetails) { tty->print("Reconstructed local %d (OBJECT): ", i); - oop o = (oop)(*addr); + oop o = (oop)(address)(*addr); if (o == NULL) { tty->print_cr("NULL"); } else {