src/share/vm/ci/ciReplay.hpp

Wed, 31 Jan 2018 19:24:57 -0500

author
dbuck
date
Wed, 31 Jan 2018 19:24:57 -0500
changeset 9289
427b2fb1944f
parent 6217
849eb7bfceac
child 6876
710a3c8b516e
permissions
-rw-r--r--

8189170: Add option to disable stack overflow checking in primordial thread for use with JNI_CreateJavaJVM
Reviewed-by: dcubed

minqi@4267 1 /*
minqi@4267 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
minqi@4267 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
minqi@4267 4 *
minqi@4267 5 * This code is free software; you can redistribute it and/or modify it
minqi@4267 6 * under the terms of the GNU General Public License version 2 only, as
minqi@4267 7 * published by the Free Software Foundation.
minqi@4267 8 *
minqi@4267 9 * This code is distributed in the hope that it will be useful, but WITHOUT
minqi@4267 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
minqi@4267 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
minqi@4267 12 * version 2 for more details (a copy is included in the LICENSE file that
minqi@4267 13 * accompanied this code).
minqi@4267 14 *
minqi@4267 15 * You should have received a copy of the GNU General Public License version
minqi@4267 16 * 2 along with this work; if not, write to the Free Software Foundation,
minqi@4267 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
minqi@4267 18 *
minqi@4267 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
minqi@4267 20 * or visit www.oracle.com if you need additional information or have any
minqi@4267 21 * questions.
minqi@4267 22 *
minqi@4267 23 */
minqi@4267 24
minqi@4267 25 #ifndef SHARE_VM_CI_CIREPLAY_HPP
minqi@4267 26 #define SHARE_VM_CI_CIREPLAY_HPP
minqi@4267 27
minqi@4267 28 #include "ci/ciMethod.hpp"
minqi@4267 29
minqi@4267 30 // ciReplay
minqi@4267 31
kvn@6217 32 //
kvn@6217 33 // Replay compilation of a java method by using an information in replay file.
kvn@6217 34 // Replay inlining decisions during compilation by using an information in inline file.
kvn@6217 35 //
kvn@6217 36 // NOTE: these replay functions only exist in debug version of VM.
kvn@6217 37 //
kvn@6217 38 // Replay compilation.
kvn@6217 39 // -------------------
kvn@6217 40 //
kvn@6217 41 // Replay data file replay.txt can be created by Serviceability Agent
kvn@6217 42 // from a core file, see agent/doc/cireplay.html
kvn@6217 43 //
kvn@6217 44 // $ java -cp <jdk>/lib/sa-jdi.jar sun.jvm.hotspot.CLHSDB
kvn@6217 45 // hsdb> attach <jdk>/bin/java ./core
kvn@6217 46 // hsdb> threads
kvn@6217 47 // t@10 Service Thread
kvn@6217 48 // t@9 C2 CompilerThread0
kvn@6217 49 // t@8 Signal Dispatcher
kvn@6217 50 // t@7 Finalizer
kvn@6217 51 // t@6 Reference Handler
kvn@6217 52 // t@2 main
kvn@6217 53 // hsdb> dumpreplaydata t@9 > replay.txt
kvn@6217 54 // hsdb> quit
kvn@6217 55 //
kvn@6217 56 // (Note: SA could be also used to extract app.jar and boot.jar files
kvn@6217 57 // from core file to replay compilation if only core file is available)
kvn@6217 58 //
kvn@6217 59 // Replay data file replay_pid%p.log is also created when VM crashes
kvn@6217 60 // in Compiler thread during compilation. It is controlled by
kvn@6217 61 // DumpReplayDataOnError flag which is ON by default.
kvn@6217 62 //
kvn@6217 63 // Replay file replay_pid%p_compid%d.log can be created
kvn@6217 64 // for the specified java method during normal execution using
kvn@6217 65 // CompileCommand option DumpReplay:
kvn@6217 66 //
kvn@6217 67 // -XX:CompileCommand=option,Benchmark::test,DumpReplay
kvn@6217 68 //
kvn@6217 69 // In this case the file name has additional compilation id "_compid%d"
kvn@6217 70 // because the method could be compiled several times.
kvn@6217 71 //
kvn@6217 72 // To replay compilation the replay file should be specified:
kvn@6217 73 //
kvn@6217 74 // -XX:+ReplayCompiles -XX:ReplayDataFile=replay_pid2133.log
kvn@6217 75 //
kvn@6217 76 // VM thread reads data from the file immediately after VM initialization
kvn@6217 77 // and puts the compilation task on compile queue. After that it goes into
kvn@6217 78 // wait state (BackgroundCompilation flag is set to false) since there is no
kvn@6217 79 // a program to execute. VM exits when the compilation is finished.
kvn@6217 80 //
kvn@6217 81 //
kvn@6217 82 // Replay inlining.
kvn@6217 83 // ----------------
kvn@6217 84 //
kvn@6217 85 // Replay inlining file inline_pid%p_compid%d.log is created for
kvn@6217 86 // a specific java method during normal execution of a java program
kvn@6217 87 // using CompileCommand option DumpInline:
kvn@6217 88 //
kvn@6217 89 // -XX:CompileCommand=option,Benchmark::test,DumpInline
kvn@6217 90 //
kvn@6217 91 // To replay inlining the replay file and the method should be specified:
kvn@6217 92 //
kvn@6217 93 // -XX:CompileCommand=option,Benchmark::test,ReplayInline -XX:InlineDataFile=inline_pid3244_compid6.log
kvn@6217 94 //
kvn@6217 95 // The difference from replay compilation is that replay inlining
kvn@6217 96 // is performed during normal java program execution.
kvn@6217 97 //
kvn@6217 98
minqi@4267 99 class ciReplay {
minqi@4267 100 CI_PACKAGE_ACCESS
minqi@4267 101
coleenp@4304 102 #ifndef PRODUCT
minqi@4267 103 private:
minqi@4267 104 static int replay_impl(TRAPS);
minqi@4267 105
minqi@4267 106 public:
kvn@6217 107 // Replay specified compilation and exit VM.
minqi@4267 108 static void replay(TRAPS);
kvn@6217 109 // Load inlining decisions from file and use them
kvn@6217 110 // during compilation of specified method.
kvn@6217 111 static void* load_inline_data(ciMethod* method, int entry_bci, int comp_level);
minqi@4267 112
minqi@4267 113 // These are used by the CI to fill in the cached data from the
minqi@4267 114 // replay file when replaying compiles.
minqi@4267 115 static void initialize(ciMethodData* method);
minqi@4267 116 static void initialize(ciMethod* method);
minqi@4267 117
minqi@4267 118 static bool is_loaded(Method* method);
minqi@4267 119 static bool is_loaded(Klass* klass);
minqi@4267 120
minqi@4267 121 static bool should_not_inline(ciMethod* method);
kvn@6217 122 static bool should_inline(void* data, ciMethod* method, int bci, int inline_depth);
kvn@6217 123 static bool should_not_inline(void* data, ciMethod* method, int bci, int inline_depth);
minqi@4267 124
minqi@4267 125 #endif
minqi@4267 126 };
minqi@4267 127
minqi@4267 128 #endif // SHARE_VM_CI_CIREPLAY_HPP

mercurial