changeset 16243:fb77eab05bd3

Respect the VM's wish to record non-safepoint debug info
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 26 Jun 2014 11:56:21 +0200
parents e9998e2be7f5
children 5a3d6bb7a48f
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java src/share/vm/graal/graalCompilerToVM.cpp
diffstat 5 files changed, 22 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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<HighTierContext> getGraphBuilderSuite(HotSpotProviders providers) {
         PhaseSuite<HighTierContext> 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();
--- 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();
 }
--- 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();
 }
--- 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);
     }
--- 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() {