mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8190415: [JVMCI] JVMCIRuntime::adjust_comp_level must not swallow ThreadDeath
Reviewed-by: never, thartmann
This commit is contained in:
parent
16963a0d5c
commit
18e9e80688
2 changed files with 26 additions and 22 deletions
|
@ -42,11 +42,6 @@ _suite = mx.suite('jvmci')
|
||||||
|
|
||||||
JVMCI_VERSION = 9
|
JVMCI_VERSION = 9
|
||||||
|
|
||||||
"""
|
|
||||||
Top level directory of the JDK source workspace.
|
|
||||||
"""
|
|
||||||
_jdkSourceRoot = dirname(_suite.dir)
|
|
||||||
|
|
||||||
_JVMCI_JDK_TAG = 'jvmci'
|
_JVMCI_JDK_TAG = 'jvmci'
|
||||||
|
|
||||||
_minVersion = mx.VersionSpec('1.9')
|
_minVersion = mx.VersionSpec('1.9')
|
||||||
|
@ -145,7 +140,7 @@ def isJVMCIEnabled(vm):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def _makehelp():
|
def _makehelp():
|
||||||
return subprocess.check_output([mx.gmake_cmd(), 'help'], cwd=_jdkSourceRoot)
|
return subprocess.check_output([mx.gmake_cmd(), 'help'], cwd=_get_jdk_dir())
|
||||||
|
|
||||||
def _runmake(args):
|
def _runmake(args):
|
||||||
"""run the JDK make process
|
"""run the JDK make process
|
||||||
|
@ -155,12 +150,12 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot"
|
||||||
|
|
||||||
jdkBuildDir = _get_jdk_build_dir()
|
jdkBuildDir = _get_jdk_build_dir()
|
||||||
if not exists(jdkBuildDir):
|
if not exists(jdkBuildDir):
|
||||||
# JDK9 must be bootstrapped with a JDK8
|
# JDK10 must be bootstrapped with a JDK9
|
||||||
compliance = mx.JavaCompliance('8')
|
compliance = mx.JavaCompliance('9')
|
||||||
jdk8 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value)
|
jdk9 = mx.get_jdk(compliance.exactMatch, versionDescription=compliance.value)
|
||||||
cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', '--with-jvm-features=graal',
|
cmd = ['sh', 'configure', '--with-debug-level=' + _vm.debugLevel, '--with-native-debug-symbols=external', '--disable-precompiled-headers', '--with-jvm-features=graal',
|
||||||
'--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk8.home, '--with-jvm-features=graal']
|
'--with-jvm-variants=' + _vm.jvmVariant, '--disable-warnings-as-errors', '--with-boot-jdk=' + jdk9.home, '--with-jvm-features=graal']
|
||||||
mx.run(cmd, cwd=_jdkSourceRoot)
|
mx.run(cmd, cwd=_get_jdk_dir())
|
||||||
cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel]
|
cmd = [mx.gmake_cmd(), 'CONF=' + _vm.debugLevel]
|
||||||
if mx.get_opts().verbose:
|
if mx.get_opts().verbose:
|
||||||
cmd.append('LOG=debug')
|
cmd.append('LOG=debug')
|
||||||
|
@ -170,11 +165,11 @@ To build hotspot and import it into the JDK: "mx make hotspot import-hotspot"
|
||||||
|
|
||||||
if not mx.get_opts().verbose:
|
if not mx.get_opts().verbose:
|
||||||
mx.log('--------------- make execution ----------------------')
|
mx.log('--------------- make execution ----------------------')
|
||||||
mx.log('Working directory: ' + _jdkSourceRoot)
|
mx.log('Working directory: ' + _get_jdk_dir())
|
||||||
mx.log('Command line: ' + ' '.join(cmd))
|
mx.log('Command line: ' + ' '.join(cmd))
|
||||||
mx.log('-----------------------------------------------------')
|
mx.log('-----------------------------------------------------')
|
||||||
|
|
||||||
mx.run(cmd, cwd=_jdkSourceRoot)
|
mx.run(cmd, cwd=_get_jdk_dir())
|
||||||
|
|
||||||
def _runmultimake(args):
|
def _runmultimake(args):
|
||||||
"""run the JDK make process for one or more configurations"""
|
"""run the JDK make process for one or more configurations"""
|
||||||
|
|
|
@ -825,24 +825,33 @@ CompLevel JVMCIRuntime::adjust_comp_level_inner(const methodHandle& method, bool
|
||||||
if (compiler != NULL && compiler->is_bootstrapping()) {
|
if (compiler != NULL && compiler->is_bootstrapping()) {
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
if (!is_HotSpotJVMCIRuntime_initialized() || !_comp_level_adjustment) {
|
if (!is_HotSpotJVMCIRuntime_initialized() || _comp_level_adjustment == JVMCIRuntime::none) {
|
||||||
// JVMCI cannot participate in compilation scheduling until
|
// JVMCI cannot participate in compilation scheduling until
|
||||||
// JVMCI is initialized and indicates it wants to participate.
|
// JVMCI is initialized and indicates it wants to participate.
|
||||||
return level;
|
return level;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define CHECK_RETURN THREAD); \
|
#define CHECK_RETURN THREAD); \
|
||||||
if (HAS_PENDING_EXCEPTION) { \
|
|
||||||
Handle exception(THREAD, PENDING_EXCEPTION); \
|
|
||||||
CLEAR_PENDING_EXCEPTION; \
|
|
||||||
\
|
|
||||||
java_lang_Throwable::java_printStackTrace(exception, THREAD); \
|
|
||||||
if (HAS_PENDING_EXCEPTION) { \
|
if (HAS_PENDING_EXCEPTION) { \
|
||||||
|
Handle exception(THREAD, PENDING_EXCEPTION); \
|
||||||
CLEAR_PENDING_EXCEPTION; \
|
CLEAR_PENDING_EXCEPTION; \
|
||||||
|
\
|
||||||
|
if (exception->is_a(SystemDictionary::ThreadDeath_klass())) { \
|
||||||
|
/* In the special case of ThreadDeath, we need to reset the */ \
|
||||||
|
/* pending async exception so that it is propagated. */ \
|
||||||
|
thread->set_pending_async_exception(exception()); \
|
||||||
|
return level; \
|
||||||
|
} \
|
||||||
|
tty->print("Uncaught exception while adjusting compilation level: "); \
|
||||||
|
java_lang_Throwable::print(exception(), tty); \
|
||||||
|
tty->cr(); \
|
||||||
|
java_lang_Throwable::print_stack_trace(exception, tty); \
|
||||||
|
if (HAS_PENDING_EXCEPTION) { \
|
||||||
|
CLEAR_PENDING_EXCEPTION; \
|
||||||
|
} \
|
||||||
|
return level; \
|
||||||
} \
|
} \
|
||||||
return level; \
|
(void)(0
|
||||||
} \
|
|
||||||
(void)(0
|
|
||||||
|
|
||||||
|
|
||||||
Thread* THREAD = thread;
|
Thread* THREAD = thread;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue