1.1 --- a/src/share/vm/ci/ciReplay.hpp Wed Jan 08 12:05:19 2014 +0100 1.2 +++ b/src/share/vm/ci/ciReplay.hpp Wed Jan 08 10:25:50 2014 -0800 1.3 @@ -29,6 +29,73 @@ 1.4 1.5 // ciReplay 1.6 1.7 +// 1.8 +// Replay compilation of a java method by using an information in replay file. 1.9 +// Replay inlining decisions during compilation by using an information in inline file. 1.10 +// 1.11 +// NOTE: these replay functions only exist in debug version of VM. 1.12 +// 1.13 +// Replay compilation. 1.14 +// ------------------- 1.15 +// 1.16 +// Replay data file replay.txt can be created by Serviceability Agent 1.17 +// from a core file, see agent/doc/cireplay.html 1.18 +// 1.19 +// $ java -cp <jdk>/lib/sa-jdi.jar sun.jvm.hotspot.CLHSDB 1.20 +// hsdb> attach <jdk>/bin/java ./core 1.21 +// hsdb> threads 1.22 +// t@10 Service Thread 1.23 +// t@9 C2 CompilerThread0 1.24 +// t@8 Signal Dispatcher 1.25 +// t@7 Finalizer 1.26 +// t@6 Reference Handler 1.27 +// t@2 main 1.28 +// hsdb> dumpreplaydata t@9 > replay.txt 1.29 +// hsdb> quit 1.30 +// 1.31 +// (Note: SA could be also used to extract app.jar and boot.jar files 1.32 +// from core file to replay compilation if only core file is available) 1.33 +// 1.34 +// Replay data file replay_pid%p.log is also created when VM crashes 1.35 +// in Compiler thread during compilation. It is controlled by 1.36 +// DumpReplayDataOnError flag which is ON by default. 1.37 +// 1.38 +// Replay file replay_pid%p_compid%d.log can be created 1.39 +// for the specified java method during normal execution using 1.40 +// CompileCommand option DumpReplay: 1.41 +// 1.42 +// -XX:CompileCommand=option,Benchmark::test,DumpReplay 1.43 +// 1.44 +// In this case the file name has additional compilation id "_compid%d" 1.45 +// because the method could be compiled several times. 1.46 +// 1.47 +// To replay compilation the replay file should be specified: 1.48 +// 1.49 +// -XX:+ReplayCompiles -XX:ReplayDataFile=replay_pid2133.log 1.50 +// 1.51 +// VM thread reads data from the file immediately after VM initialization 1.52 +// and puts the compilation task on compile queue. After that it goes into 1.53 +// wait state (BackgroundCompilation flag is set to false) since there is no 1.54 +// a program to execute. VM exits when the compilation is finished. 1.55 +// 1.56 +// 1.57 +// Replay inlining. 1.58 +// ---------------- 1.59 +// 1.60 +// Replay inlining file inline_pid%p_compid%d.log is created for 1.61 +// a specific java method during normal execution of a java program 1.62 +// using CompileCommand option DumpInline: 1.63 +// 1.64 +// -XX:CompileCommand=option,Benchmark::test,DumpInline 1.65 +// 1.66 +// To replay inlining the replay file and the method should be specified: 1.67 +// 1.68 +// -XX:CompileCommand=option,Benchmark::test,ReplayInline -XX:InlineDataFile=inline_pid3244_compid6.log 1.69 +// 1.70 +// The difference from replay compilation is that replay inlining 1.71 +// is performed during normal java program execution. 1.72 +// 1.73 + 1.74 class ciReplay { 1.75 CI_PACKAGE_ACCESS 1.76 1.77 @@ -37,7 +104,11 @@ 1.78 static int replay_impl(TRAPS); 1.79 1.80 public: 1.81 + // Replay specified compilation and exit VM. 1.82 static void replay(TRAPS); 1.83 + // Load inlining decisions from file and use them 1.84 + // during compilation of specified method. 1.85 + static void* load_inline_data(ciMethod* method, int entry_bci, int comp_level); 1.86 1.87 // These are used by the CI to fill in the cached data from the 1.88 // replay file when replaying compiles. 1.89 @@ -48,6 +119,8 @@ 1.90 static bool is_loaded(Klass* klass); 1.91 1.92 static bool should_not_inline(ciMethod* method); 1.93 + static bool should_inline(void* data, ciMethod* method, int bci, int inline_depth); 1.94 + static bool should_not_inline(void* data, ciMethod* method, int bci, int inline_depth); 1.95 1.96 #endif 1.97 };