Skip to content

Commit

Permalink
Merge branch 'master' into HttpClient-SM-8344228
Browse files Browse the repository at this point in the history
  • Loading branch information
dfuch committed Nov 15, 2024
2 parents 61cfa49 + 3eece6e commit 30d6f8d
Show file tree
Hide file tree
Showing 67 changed files with 692 additions and 858 deletions.
2 changes: 1 addition & 1 deletion make/Global.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ help:
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
$(info $(_) # make test TEST="jdk_lang gtest:all")
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk)
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)
Expand Down
4 changes: 0 additions & 4 deletions src/hotspot/os/posix/os_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -931,10 +931,6 @@ void os::_exit(int num) {
ALLOW_C_FUNCTION(::_exit, ::_exit(num);)
}

bool os::dont_yield() {
return DontYieldALot;
}

void os::naked_yield() {
sched_yield();
}
Expand Down
6 changes: 0 additions & 6 deletions src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4856,12 +4856,6 @@ int os::loadavg(double loadavg[], int nelem) {
return -1;
}


// DontYieldALot=false by default: dutifully perform all yields as requested by JVM_Yield()
bool os::dont_yield() {
return DontYieldALot;
}

int os::open(const char *path, int oflag, int mode) {
errno_t err;
wchar_t* wide_path = wide_abs_unc_path(path, err);
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/aix_ppc/globals_aix_ppc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -29,7 +29,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
define_pd_global(intx, VMThreadStackSize, 2048);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/bsd_aarch64/globals_bsd_aarch64.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
Expand Down Expand Up @@ -31,7 +31,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
define_pd_global(intx, VMThreadStackSize, 2048);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/bsd_x86/globals_bsd_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,7 +29,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
//
define_pd_global(bool, DontYieldALot, false);
#ifdef AMD64
define_pd_global(intx, CompilerThreadStackSize, 1024);
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/bsd_zero/globals_bsd_zero.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -31,7 +31,6 @@
// runtime system. See globals.hpp for details of what they do.
//

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 1536);
#ifdef _LP64
define_pd_global(intx, VMThreadStackSize, 1024);
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/os_cpu/linux_aarch64/globals_linux_aarch64.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -29,8 +29,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);

// Set default stack sizes < 2MB so as to prevent stacks from getting
// large-page aligned and backed by THPs on systems where 2MB is the
// default huge page size. For non-JavaThreads, glibc may add an additional
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/linux_arm/globals_linux_arm.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -29,7 +29,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)
//
define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, CompilerThreadStackSize, 512);
// System default ThreadStackSize appears to be 512 which is too big.
define_pd_global(intx, ThreadStackSize, 320);
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/linux_ppc/globals_linux_ppc.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -29,7 +29,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
define_pd_global(intx, VMThreadStackSize, 2048);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/linux_riscv/globals_linux_riscv.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -29,7 +29,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
define_pd_global(intx, VMThreadStackSize, 2048);

Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/linux_s390/globals_linux_s390.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -31,7 +31,6 @@
// Sets the default values for platform dependent flags used by the
// runtime system (see globals.hpp).

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 1024); // 0 => Use system default.
define_pd_global(intx, VMThreadStackSize, 1024);
// Some jck tests in lang/fp/fpl038 run out of compile thread stack.
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -28,7 +28,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);
#ifdef AMD64
define_pd_global(intx, CompilerThreadStackSize, 1024);
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default
Expand Down
3 changes: 1 addition & 2 deletions src/hotspot/os_cpu/linux_zero/globals_linux_zero.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright 2007, 2008, 2010 Red Hat, Inc.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -31,7 +31,6 @@
// runtime system. See globals.hpp for details of what they do.
//

define_pd_global(bool, DontYieldALot, false);
define_pd_global(intx, ThreadStackSize, 1536);
#ifdef _LP64
define_pd_global(intx, VMThreadStackSize, 1024);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);

// Default stack size on Windows is determined by the executable (java.exe
// has a default value of 320K/1MB [32bit/64bit]). Depending on Windows version, changing
// ThreadStackSize to non-zero may have significant impact on memory usage.
Expand Down
4 changes: 1 addition & 3 deletions src/hotspot/os_cpu/windows_x86/globals_windows_x86.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -28,8 +28,6 @@
// Sets the default values for platform dependent flags used by the runtime system.
// (see globals.hpp)

define_pd_global(bool, DontYieldALot, false);

// Default stack size on Windows is determined by the executable (java.exe
// has a default value of 320K/1MB [32bit/64bit]). Depending on Windows version, changing
// ThreadStackSize to non-zero may have significant impact on memory usage.
Expand Down
1 change: 0 additions & 1 deletion src/hotspot/share/prims/jvm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2951,7 +2951,6 @@ JVM_END


JVM_LEAF(void, JVM_Yield(JNIEnv *env, jclass threadClass))
if (os::dont_yield()) return;
HOTSPOT_THREAD_YIELD();
os::naked_yield();
JVM_END
Expand Down
3 changes: 0 additions & 3 deletions src/hotspot/share/runtime/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,9 +697,6 @@ const int ObjectAlignmentInBytes = 8;
"Allow parallel defineClass requests for class loaders " \
"registering as parallel capable") \
\
product_pd(bool, DontYieldALot, \
"(Deprecated) Throw away obvious excess yield calls") \
\
product(bool, DisablePrimordialThreadGuardPages, false, EXPERIMENTAL, \
"Disable the use of stack guard pages if the JVM is loaded " \
"on the primordial process thread") \
Expand Down
2 changes: 0 additions & 2 deletions src/hotspot/share/runtime/os.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1042,8 +1042,6 @@ class os: AllStatic {
// debugging support (mostly used by debug.cpp but also fatal error handler)
static bool find(address pc, outputStream* st = tty); // OS specific function to make sense out of an address

static bool dont_yield(); // when true, JVM_Yield() is nop

// Thread priority helpers (implemented in OS-specific part)
static OSReturn set_native_priority(Thread* thread, int native_prio);
static OSReturn get_native_priority(const Thread* const thread, int* priority_ptr);
Expand Down
82 changes: 1 addition & 81 deletions src/java.base/share/classes/java/lang/ClassLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
import jdk.internal.reflect.CallerSensitiveAdapter;
import jdk.internal.reflect.Reflection;
import jdk.internal.util.StaticProperty;
import sun.security.util.SecurityConstants;

/**
* A class loader is an object that is responsible for loading classes. The
Expand Down Expand Up @@ -357,12 +356,6 @@ private static Void checkCreateClassLoader(String name) {
if (name != null && name.isEmpty()) {
throw new IllegalArgumentException("name must be non-empty or null");
}

@SuppressWarnings("removal")
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkCreateClassLoader();
}
return null;
}

Expand Down Expand Up @@ -1735,18 +1728,7 @@ public static InputStream getSystemResourceAsStream(String name) {
*
* @since 1.2
*/
@CallerSensitive
public final ClassLoader getParent() {
if (parent == null)
return null;
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
// Check access to the parent class loader
// If the caller's class loader is same as this class loader,
// permission check is performed.
checkClassLoaderPermission(parent, Reflection.getCallerClass());
}
return parent;
}

Expand Down Expand Up @@ -1774,15 +1756,8 @@ public final Module getUnnamedModule() {
*
* @since 9
*/
@CallerSensitive
public static ClassLoader getPlatformClassLoader() {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
ClassLoader loader = getBuiltinPlatformClassLoader();
if (sm != null) {
checkClassLoaderPermission(loader, Reflection.getCallerClass());
}
return loader;
return getBuiltinPlatformClassLoader();
}

/**
Expand Down Expand Up @@ -1853,7 +1828,6 @@ public static ClassLoader getPlatformClassLoader() {
* underlying cause of the error can be retrieved via the
* {@link Throwable#getCause()} method.
*/
@CallerSensitive
public static ClassLoader getSystemClassLoader() {
switch (VM.initLevel()) {
case 0:
Expand All @@ -1867,11 +1841,6 @@ public static ClassLoader getSystemClassLoader() {
default:
// system fully initialized
assert VM.isBooted() && scl != null;
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
checkClassLoaderPermission(scl, Reflection.getCallerClass());
}
return scl;
}
}
Expand Down Expand Up @@ -1902,8 +1871,6 @@ static synchronized ClassLoader initSystemClassLoader() {
}

ClassLoader builtinLoader = getBuiltinAppClassLoader();

// All are privileged frames. No need to call doPrivileged.
String cn = System.getProperty("java.system.class.loader");
if (cn != null) {
try {
Expand All @@ -1930,36 +1897,6 @@ static synchronized ClassLoader initSystemClassLoader() {
return scl;
}

// Returns true if the specified class loader can be found in this class
// loader's delegation chain.
boolean isAncestor(ClassLoader cl) {
ClassLoader acl = this;
do {
acl = acl.parent;
if (cl == acl) {
return true;
}
} while (acl != null);
return false;
}

// Tests if class loader access requires "getClassLoader" permission
// check. A class loader 'from' can access class loader 'to' if
// class loader 'from' is same as class loader 'to' or an ancestor
// of 'to'. The class loader in a system domain can access
// any class loader.
private static boolean needsClassLoaderPermissionCheck(ClassLoader from,
ClassLoader to)
{
if (from == to)
return false;

if (from == null)
return false;

return !to.isAncestor(from);
}

// Returns the class's class loader, or null if none.
static ClassLoader getClassLoader(Class<?> caller) {
// This can be null if the VM is requesting it
Expand All @@ -1970,23 +1907,6 @@ static ClassLoader getClassLoader(Class<?> caller) {
return caller.getClassLoader0();
}

/*
* Checks RuntimePermission("getClassLoader") permission
* if caller's class loader is not null and caller's class loader
* is not the same as or an ancestor of the given cl argument.
*/
static void checkClassLoaderPermission(ClassLoader cl, Class<?> caller) {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
// caller can be null if the VM is requesting it
ClassLoader ccl = getClassLoader(caller);
if (needsClassLoaderPermissionCheck(ccl, cl)) {
sm.checkPermission(SecurityConstants.GET_CLASSLOADER_PERMISSION);
}
}
}

// The system class loader
// @GuardedBy("ClassLoader.class")
private static volatile ClassLoader scl;
Expand Down
Loading

0 comments on commit 30d6f8d

Please sign in to comment.