8314284: Enhance Nashorn performance

Co-authored-by: Francisco Ferrari Bihurriet <fferrari@redhat.com>
Co-authored-by: Martin Balao Alonso <mbalao@redhat.com>
Reviewed-by: andrew
This commit is contained in:
Martin Balao 2023-12-04 22:09:47 -05:00 committed by Andrew John Hughes
parent 7f5db81118
commit 5e0e2bf0ba

View File

@ -1430,9 +1430,11 @@ public final class Global extends Scope {
if ("context".equals(nameStr)) {
return sctxt;
} else if ("engine".equals(nameStr)) {
// expose "engine" variable only when there is no security manager
// or when no class filter is set.
if (System.getSecurityManager() == null || global.getClassFilter() == null) {
// expose "engine" variable only when there is no security manager,
// or when no class filter is set and --no-java is not set
if (System.getSecurityManager() == null ||
(global.getClassFilter() == null &&
!global.getContext().getEnv()._no_java)) {
return global.engine;
}
}