8269342: CICrashAt=1 does not always catch first Java method
Reviewed-by: kvn, thartmann
This commit is contained in:
parent
8785737ba5
commit
fcc7d59b99
@ -140,6 +140,7 @@ CompileLog** CompileBroker::_compiler2_logs = NULL;
|
||||
// These counters are used to assign an unique ID to each compilation.
|
||||
volatile jint CompileBroker::_compilation_id = 0;
|
||||
volatile jint CompileBroker::_osr_compilation_id = 0;
|
||||
volatile jint CompileBroker::_native_compilation_id = 0;
|
||||
|
||||
// Performance counters
|
||||
PerfCounter* CompileBroker::_perf_total_compilation = NULL;
|
||||
@ -1588,7 +1589,7 @@ int CompileBroker::assign_compile_id(const methodHandle& method, int osr_bci) {
|
||||
assert(!is_osr, "can't be osr");
|
||||
// Adapters, native wrappers and method handle intrinsics
|
||||
// should be generated always.
|
||||
return Atomic::add(&_compilation_id, 1);
|
||||
return Atomic::add(CICountNative ? &_native_compilation_id : &_compilation_id, 1);
|
||||
} else if (CICountOSR && is_osr) {
|
||||
id = Atomic::add(&_osr_compilation_id, 1);
|
||||
if (CIStartOSR <= id && id < CIStopOSR) {
|
||||
@ -2474,6 +2475,8 @@ void CompileBroker::update_compile_perf_data(CompilerThread* thread, const metho
|
||||
int last_compile_type = normal_compile;
|
||||
if (CICountOSR && is_osr) {
|
||||
last_compile_type = osr_compile;
|
||||
} else if (CICountNative && method->is_native()) {
|
||||
last_compile_type = native_compile;
|
||||
}
|
||||
|
||||
CompilerCounters* counters = thread->counters();
|
||||
|
@ -174,6 +174,7 @@ class CompileBroker: AllStatic {
|
||||
// These counters are used for assigning id's to each compilation
|
||||
static volatile jint _compilation_id;
|
||||
static volatile jint _osr_compilation_id;
|
||||
static volatile jint _native_compilation_id;
|
||||
|
||||
static CompileQueue* _c2_compile_queue;
|
||||
static CompileQueue* _c1_compile_queue;
|
||||
|
@ -72,6 +72,10 @@
|
||||
develop(bool, CICountOSR, false, \
|
||||
"use a separate counter when assigning ids to osr compilations") \
|
||||
\
|
||||
develop(bool, CICountNative, false, \
|
||||
"use a separate counter when assigning ids to native " \
|
||||
"compilations") \
|
||||
\
|
||||
develop(bool, CICompileNatives, true, \
|
||||
"compile native methods if supported by the compiler") \
|
||||
\
|
||||
|
@ -68,17 +68,24 @@ public abstract class CiReplayBase {
|
||||
"-XX:CompilerThreadStackSize=512", "-XX:ParallelGCThreads=1", "-XX:CICompilerCount=2",
|
||||
"-XX:-BackgroundCompilation", "-XX:CompileCommand=inline,java.io.PrintStream::*",
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-XX:TypeProfileLevel=222", // extra profile data as a stress test
|
||||
"-XX:CICrashAt=1", "-XX:+DumpReplayDataOnError",
|
||||
"-XX:+PreferInterpreterNativeStubs", REPLAY_FILE_OPTION};
|
||||
"-XX:+CICountNative", "-XX:CICrashAt=1", "-XX:+DumpReplayDataOnError",
|
||||
REPLAY_FILE_OPTION};
|
||||
private static final String[] REPLAY_OPTIONS = new String[]{DISABLE_COREDUMP_ON_CRASH,
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-XX:TypeProfileLevel=222",
|
||||
"-XX:+ReplayCompiles", REPLAY_FILE_OPTION};
|
||||
protected final Optional<Boolean> runServer;
|
||||
private static int dummy;
|
||||
|
||||
static interface Lambda {
|
||||
int value();
|
||||
}
|
||||
|
||||
public static class TestMain {
|
||||
public static void main(String[] args) {
|
||||
for (int i = 0; i < 20_000; i++) {
|
||||
// explicitly trigger native compilation
|
||||
Lambda start = () -> 0;
|
||||
|
||||
for (int i = start.value(); i < 20_000; i++) {
|
||||
test(i);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user