mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 03:58:21 +00:00
8366875: CompileTaskTimeout should be reset for each iteration of RepeatCompilation
Reviewed-by: dlong, epeter
This commit is contained in:
parent
937e19e86a
commit
94a301a70e
@ -46,6 +46,10 @@ class CompilerThreadTimeoutLinux : public CHeapObj<mtCompiler> {
|
||||
bool init_timeout();
|
||||
void arm();
|
||||
void disarm();
|
||||
void reset() {
|
||||
disarm();
|
||||
arm();
|
||||
};
|
||||
};
|
||||
|
||||
#endif //LINUX_COMPILER_THREAD_TIMEOUT_LINUX_HPP
|
||||
|
||||
@ -2349,6 +2349,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
||||
while (repeat_compilation_count > 0) {
|
||||
ResourceMark rm(thread);
|
||||
task->print_ul("NO CODE INSTALLED");
|
||||
thread->timeout()->reset();
|
||||
comp->compile_method(&ci_env, target, osr_bci, false, directive);
|
||||
repeat_compilation_count--;
|
||||
}
|
||||
|
||||
@ -51,6 +51,7 @@ class CompilerThreadTimeoutGeneric : public CHeapObj<mtCompiler> {
|
||||
CompilerThreadTimeoutGeneric() {};
|
||||
void arm() {};
|
||||
void disarm() {};
|
||||
void reset() {};
|
||||
bool init_timeout() { return true; };
|
||||
};
|
||||
#endif // !LINUX
|
||||
|
||||
@ -25,7 +25,7 @@ package compiler.arguments;
|
||||
|
||||
/*
|
||||
* @test TestCompileTaskTimeout
|
||||
* @bug 8308094 8365909
|
||||
* @bug 8308094 8365909 8366875
|
||||
* @requires vm.debug & vm.flagless & os.name == "Linux"
|
||||
* @summary Check functionality of CompileTaskTimeout
|
||||
* @library /test/lib
|
||||
@ -42,6 +42,7 @@ public class TestCompileTaskTimeout {
|
||||
timeoutFactor = Double.parseDouble(System.getProperty("test.timeout.factor", "1.0"));
|
||||
} catch (NumberFormatException ignored) {}
|
||||
|
||||
// Short timeouts crash the VM.
|
||||
ProcessTools.executeTestJava("-Xcomp", "-XX:CompileTaskTimeout=1", "--version")
|
||||
.shouldHaveExitValue(134)
|
||||
.shouldContain("timed out after");
|
||||
@ -54,8 +55,17 @@ public class TestCompileTaskTimeout {
|
||||
.shouldHaveExitValue(134)
|
||||
.shouldContain("timed out after");
|
||||
|
||||
// A long enough timeout succeeds.
|
||||
int timeout = (int)(500.0 * timeoutFactor);
|
||||
ProcessTools.executeTestJava("-Xcomp", "-XX:CompileTaskTimeout=" + timeout, "--version")
|
||||
.shouldHaveExitValue(0);
|
||||
|
||||
// Each repeated compilation has a new timeout.
|
||||
ProcessTools.executeTestJava("-Xcomp",
|
||||
"-XX:CompileTaskTimeout=" + timeout,
|
||||
"-XX:RepeatCompilation=100",
|
||||
"-XX:CompileCommand=compileonly,java/util/concurrent/ConcurrentHashMap.*",
|
||||
"--version")
|
||||
.shouldHaveExitValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user