# HG changeset patch # User Gilles Duboscq # Date 1429889252 -7200 # Node ID 294ed4ce1fa0b682299e7a4222c44a0dd0b2d15b # Parent ae4941602cfa11aa98ef1fe9d33ad9b0d057561a PrintStreamOption: also forward flushes to the VM diff -r ae4941602cfa -r 294ed4ce1fa0 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java Mon Apr 27 12:04:10 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java Fri Apr 24 17:27:32 2015 +0200 @@ -111,6 +111,11 @@ public void write(int b) throws IOException { write(new byte[]{(byte) b}, 0, 1); } + + @Override + public void flush() throws IOException { + compilerToVM.flushDebugOutput(); + } }; ps = new PrintStream(ttyOut); } diff -r ae4941602cfa -r 294ed4ce1fa0 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 Mon Apr 27 12:04:10 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java Fri Apr 24 17:27:32 2015 +0200 @@ -387,4 +387,6 @@ boolean shouldDebugNonSafepoints(); void writeDebugOutput(byte[] bytes, int offset, int length); + + void flushDebugOutput(); } diff -r ae4941602cfa -r 294ed4ce1fa0 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 Mon Apr 27 12:04:10 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java Fri Apr 24 17:27:32 2015 +0200 @@ -206,4 +206,6 @@ public native boolean shouldDebugNonSafepoints(); public native void writeDebugOutput(byte[] bytes, int offset, int length); + + public native void flushDebugOutput(); } diff -r ae4941602cfa -r 294ed4ce1fa0 src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Mon Apr 27 12:04:10 2015 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Fri Apr 24 17:27:32 2015 +0200 @@ -1019,6 +1019,10 @@ } C2V_END +C2V_VMENTRY(void, flushDebugOutput, (JNIEnv*, jobject)) + tty->flush(); +C2V_END + #define CC (char*) /*cast a literal from (const char*)*/ #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) @@ -1099,6 +1103,7 @@ {CC"materializeVirtualObjects", CC"("HS_STACK_FRAME_REF"Z)V", FN_PTR(materializeVirtualObjects)}, {CC"shouldDebugNonSafepoints", CC"()Z", FN_PTR(shouldDebugNonSafepoints)}, {CC"writeDebugOutput", CC"([BII)V", FN_PTR(writeDebugOutput)}, + {CC"flushDebugOutput", CC"()V", FN_PTR(flushDebugOutput)}, }; int CompilerToVM_methods_count() {