# HG changeset patch # User Gilles Duboscq # Date 1403776581 -7200 # Node ID fb77eab05bd3de0d2a01ec74720936698ad1c183 # Parent e9998e2be7f5a3b1650fc55c50dd27433412698a Respect the VM's wish to record non-safepoint debug info diff -r e9998e2be7f5 -r fb77eab05bd3 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Thu Jun 26 18:25:35 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Thu Jun 26 11:56:21 2014 +0200 @@ -241,6 +241,11 @@ protected PhaseSuite getGraphBuilderSuite(HotSpotProviders providers) { PhaseSuite suite = providers.getSuites().getDefaultGraphBuilderSuite(); + if (HotSpotGraalRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints()) { + // need to tweak the graph builder config + suite.findPhase(GraphBuilderPhase.class).set(new GraphBuilderPhase(GraphBuilderConfiguration.getInfopointDefault())); + } + boolean osrCompilation = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI; if (osrCompilation) { suite = suite.copy(); diff -r e9998e2be7f5 -r fb77eab05bd3 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Thu Jun 26 18:25:35 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Thu Jun 26 11:56:21 2014 +0200 @@ -359,4 +359,6 @@ void resolveInvokeDynamic(long metaspaceConstantPool, int index); int getVtableIndexForInterface(long metaspaceKlass, long metaspaceMethod); + + boolean shouldDebugNonSafepoints(); } diff -r e9998e2be7f5 -r fb77eab05bd3 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Thu Jun 26 18:25:35 2014 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Thu Jun 26 11:56:21 2014 +0200 @@ -197,4 +197,6 @@ public native void resolveInvokeDynamic(long metaspaceConstantPool, int index); public native int getVtableIndexForInterface(long metaspaceKlass, long metaspaceMethod); + + public native boolean shouldDebugNonSafepoints(); } diff -r e9998e2be7f5 -r fb77eab05bd3 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java Thu Jun 26 18:25:35 2014 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java Thu Jun 26 11:56:21 2014 +0200 @@ -72,6 +72,10 @@ return new GraphBuilderConfiguration(false, false, false); } + public static GraphBuilderConfiguration getInfopointDefault() { + return new GraphBuilderConfiguration(false, false, true); + } + public static GraphBuilderConfiguration getEagerDefault() { return new GraphBuilderConfiguration(true, false, false); } diff -r e9998e2be7f5 -r fb77eab05bd3 src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Thu Jun 26 18:25:35 2014 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Thu Jun 26 11:56:21 2014 +0200 @@ -881,6 +881,14 @@ cp_cache_entry->set_dynamic_call(cp, callInfo); C2V_END +C2V_VMENTRY(jboolean, shouldDebugNonSafepoints, (JNIEnv*, jobject)) + //see compute_recording_non_safepoints in debugInfroRec.cpp + if (JvmtiExport::should_post_compiled_method_load() && FLAG_IS_DEFAULT(DebugNonSafepoints)) { + return true; + } + return DebugNonSafepoints; +C2V_END + // public native void materializeVirtualObjects(HotSpotStackFrameReference stackFrame, boolean invalidate); C2V_VMENTRY(void, materializeVirtualObjects, (JNIEnv*, jobject, jobject hs_frame, bool invalidate)) ResourceMark rm; @@ -1052,6 +1060,7 @@ {CC"getTimeStamp", CC"()J", FN_PTR(getTimeStamp)}, {CC"getNextStackFrame", CC"("HS_STACK_FRAME_REF "[JI)"HS_STACK_FRAME_REF, FN_PTR(getNextStackFrame)}, {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)}, + {CC"shouldDebugNonSafepoints", CC"()Z", FN_PTR(shouldDebugNonSafepoints)}, }; int CompilerToVM_methods_count() {