Skip to content

Commit 95877db

Browse files
committed
Merge branch 'master' of https://github.com/openjdk/jdk into docs/cf-constantpool
2 parents e3ac100 + 1866c0c commit 95877db

File tree

577 files changed

+6806
-8872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

577 files changed

+6806
-8872
lines changed

make/Global.gmk

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ help:
102102
$(info $(_) # method is 'auto', 'ignore' or 'fail' (default))
103103
$(info $(_) TEST="test1 ..." # Use the given test descriptor(s) for testing, e.g.)
104104
$(info $(_) # make test TEST="jdk_lang gtest:all")
105-
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk
105+
$(info $(_) TEST_DEPS="dependency1 ..." # Specify additional dependencies for running tests, e.g docs-jdk)
106106
$(info $(_) JTREG="OPT1=x;OPT2=y" # Control the JTREG test harness, use 'make test-only JTREG=help' to list)
107107
$(info $(_) GTEST="OPT1=x;OPT2=y" # Control the GTEST test harness, use 'make test-only GTEST=help' to list)
108108
$(info $(_) MICRO="OPT1=x;OPT2=y" # Control the MICRO test harness, use 'make test-only MICRO=help' to list)

make/langtools/src/classes/build/tools/symbolgenerator/CreateSymbols.java

+5
Original file line numberDiff line numberDiff line change
@@ -1896,6 +1896,11 @@ private void finishClassLoading(ClassList classes, Map<String, ModuleDescription
18961896
continue;
18971897
}
18981898

1899+
if (ed.packageName.equals("jdk/internal/javac")) {
1900+
//keep jdk/internal/javac untouched. It is used to determine participates in preview:
1901+
continue;
1902+
}
1903+
18991904
Set<String> usingModules = package2ModulesUsingIt.getOrDefault(ed.packageName(), Set.of());
19001905

19011906
ed.to.retainAll(usingModules);

src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.hpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,11 @@ friend class ArrayCopyStub;
7070
_call_stub_size = 11 * MacroAssembler::instruction_size +
7171
1 * MacroAssembler::instruction_size + wordSize,
7272
// See emit_exception_handler for detail
73-
// verify_not_null_oop + far_call + should_not_reach_here + invalidate_registers(DEBUG_ONLY)
74-
_exception_handler_size = DEBUG_ONLY(584) NOT_DEBUG(548), // or smaller
73+
_exception_handler_size = DEBUG_ONLY(256) NOT_DEBUG(32), // or smaller
7574
// See emit_deopt_handler for detail
76-
// auipc (1) + far_jump (6 or 2)
75+
// auipc (1) + far_jump (2)
7776
_deopt_handler_size = 1 * MacroAssembler::instruction_size +
78-
6 * MacroAssembler::instruction_size // or smaller
77+
2 * MacroAssembler::instruction_size
7978
};
8079

8180
void check_conflict(ciKlass* exact_klass, intptr_t current_klass, Register tmp,

src/hotspot/os/linux/cgroupV1Subsystem_linux.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ void CgroupV1MemoryController::print_version_specific_info(outputStream* st, jul
300300
jlong kmem_limit = kernel_memory_limit_in_bytes(phys_mem);
301301
jlong kmem_max_usage = kernel_memory_max_usage_in_bytes();
302302

303+
OSContainer::print_container_helper(st, kmem_limit, "kernel_memory_limit_in_bytes");
303304
OSContainer::print_container_helper(st, kmem_usage, "kernel_memory_usage_in_bytes");
304-
OSContainer::print_container_helper(st, kmem_limit, "kernel_memory_max_usage_in_bytes");
305-
OSContainer::print_container_helper(st, kmem_max_usage, "kernel_memory_limit_in_bytes");
305+
OSContainer::print_container_helper(st, kmem_max_usage, "kernel_memory_max_usage_in_bytes");
306306
}
307307

308308
char* CgroupV1Subsystem::cpu_cpuset_cpus() {

src/hotspot/os/posix/os_posix.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -931,10 +931,6 @@ void os::_exit(int num) {
931931
ALLOW_C_FUNCTION(::_exit, ::_exit(num);)
932932
}
933933

934-
bool os::dont_yield() {
935-
return DontYieldALot;
936-
}
937-
938934
void os::naked_yield() {
939935
sched_yield();
940936
}

src/hotspot/os/windows/os_windows.cpp

-6
Original file line numberDiff line numberDiff line change
@@ -4856,12 +4856,6 @@ int os::loadavg(double loadavg[], int nelem) {
48564856
return -1;
48574857
}
48584858

4859-
4860-
// DontYieldALot=false by default: dutifully perform all yields as requested by JVM_Yield()
4861-
bool os::dont_yield() {
4862-
return DontYieldALot;
4863-
}
4864-
48654859
int os::open(const char *path, int oflag, int mode) {
48664860
errno_t err;
48674861
wchar_t* wide_path = wide_abs_unc_path(path, err);

src/hotspot/os_cpu/aix_ppc/globals_aix_ppc.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -29,7 +29,6 @@
2929
// Sets the default values for platform dependent flags used by the runtime system.
3030
// (see globals.hpp)
3131

32-
define_pd_global(bool, DontYieldALot, false);
3332
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
3433
define_pd_global(intx, VMThreadStackSize, 2048);
3534

src/hotspot/os_cpu/bsd_aarch64/globals_bsd_aarch64.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
55
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,7 +31,6 @@
3131
// Sets the default values for platform dependent flags used by the runtime system.
3232
// (see globals.hpp)
3333

34-
define_pd_global(bool, DontYieldALot, false);
3534
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
3635
define_pd_global(intx, VMThreadStackSize, 2048);
3736

src/hotspot/os_cpu/bsd_x86/globals_bsd_x86.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
2929
// Sets the default values for platform dependent flags used by the runtime system.
3030
// (see globals.hpp)
3131
//
32-
define_pd_global(bool, DontYieldALot, false);
3332
#ifdef AMD64
3433
define_pd_global(intx, CompilerThreadStackSize, 1024);
3534
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default

src/hotspot/os_cpu/bsd_zero/globals_bsd_zero.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright 2007, 2008, 2010 Red Hat, Inc.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -31,7 +31,6 @@
3131
// runtime system. See globals.hpp for details of what they do.
3232
//
3333

34-
define_pd_global(bool, DontYieldALot, false);
3534
define_pd_global(intx, ThreadStackSize, 1536);
3635
#ifdef _LP64
3736
define_pd_global(intx, VMThreadStackSize, 1024);

src/hotspot/os_cpu/linux_aarch64/globals_linux_aarch64.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -29,8 +29,6 @@
2929
// Sets the default values for platform dependent flags used by the runtime system.
3030
// (see globals.hpp)
3131

32-
define_pd_global(bool, DontYieldALot, false);
33-
3432
// Set default stack sizes < 2MB so as to prevent stacks from getting
3533
// large-page aligned and backed by THPs on systems where 2MB is the
3634
// default huge page size. For non-JavaThreads, glibc may add an additional

src/hotspot/os_cpu/linux_arm/globals_linux_arm.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +29,6 @@
2929
// Sets the default values for platform dependent flags used by the runtime system.
3030
// (see globals.hpp)
3131
//
32-
define_pd_global(bool, DontYieldALot, false);
3332
define_pd_global(intx, CompilerThreadStackSize, 512);
3433
// System default ThreadStackSize appears to be 512 which is too big.
3534
define_pd_global(intx, ThreadStackSize, 320);

src/hotspot/os_cpu/linux_ppc/globals_linux_ppc.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2002, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2012, 2015 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -29,7 +29,6 @@
2929
// Sets the default values for platform dependent flags used by the runtime system.
3030
// (see globals.hpp)
3131

32-
define_pd_global(bool, DontYieldALot, false);
3332
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
3433
define_pd_global(intx, VMThreadStackSize, 2048);
3534

src/hotspot/os_cpu/linux_riscv/globals_linux_riscv.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -29,7 +29,6 @@
2929
// Sets the default values for platform dependent flags used by the runtime system.
3030
// (see globals.hpp)
3131

32-
define_pd_global(bool, DontYieldALot, false);
3332
define_pd_global(intx, ThreadStackSize, 2048); // 0 => use system default
3433
define_pd_global(intx, VMThreadStackSize, 2048);
3534

src/hotspot/os_cpu/linux_s390/globals_linux_s390.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2016 SAP SE. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -31,7 +31,6 @@
3131
// Sets the default values for platform dependent flags used by the
3232
// runtime system (see globals.hpp).
3333

34-
define_pd_global(bool, DontYieldALot, false);
3534
define_pd_global(intx, ThreadStackSize, 1024); // 0 => Use system default.
3635
define_pd_global(intx, VMThreadStackSize, 1024);
3736
// Some jck tests in lang/fp/fpl038 run out of compile thread stack.

src/hotspot/os_cpu/linux_x86/globals_linux_x86.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
2828
// Sets the default values for platform dependent flags used by the runtime system.
2929
// (see globals.hpp)
3030

31-
define_pd_global(bool, DontYieldALot, false);
3231
#ifdef AMD64
3332
define_pd_global(intx, CompilerThreadStackSize, 1024);
3433
define_pd_global(intx, ThreadStackSize, 1024); // 0 => use system default

src/hotspot/os_cpu/linux_zero/globals_linux_zero.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright 2007, 2008, 2010 Red Hat, Inc.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -31,7 +31,6 @@
3131
// runtime system. See globals.hpp for details of what they do.
3232
//
3333

34-
define_pd_global(bool, DontYieldALot, false);
3534
define_pd_global(intx, ThreadStackSize, 1536);
3635
#ifdef _LP64
3736
define_pd_global(intx, VMThreadStackSize, 1024);

src/hotspot/os_cpu/windows_aarch64/globals_windows_aarch64.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
// Sets the default values for platform dependent flags used by the runtime system.
2929
// (see globals.hpp)
3030

31-
define_pd_global(bool, DontYieldALot, false);
32-
3331
// Default stack size on Windows is determined by the executable (java.exe
3432
// has a default value of 320K/1MB [32bit/64bit]). Depending on Windows version, changing
3533
// ThreadStackSize to non-zero may have significant impact on memory usage.

src/hotspot/os_cpu/windows_x86/globals_windows_x86.hpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,8 +28,6 @@
2828
// Sets the default values for platform dependent flags used by the runtime system.
2929
// (see globals.hpp)
3030

31-
define_pd_global(bool, DontYieldALot, false);
32-
3331
// Default stack size on Windows is determined by the executable (java.exe
3432
// has a default value of 320K/1MB [32bit/64bit]). Depending on Windows version, changing
3533
// ThreadStackSize to non-zero may have significant impact on memory usage.

src/hotspot/share/cds/lambdaFormInvokers.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ void LambdaFormInvokers::regenerate_holder_classes(TRAPS) {
166166
// make a copy of class bytes so GC will not affect us.
167167
char *buf = NEW_RESOURCE_ARRAY(char, len);
168168
memcpy(buf, (char*)h_bytes->byte_at_addr(0), len);
169-
ClassFileStream st((u1*)buf, len, nullptr, ClassFileStream::verify);
169+
ClassFileStream st((u1*)buf, len, nullptr);
170170
regenerate_class(class_name, st, CHECK);
171171
}
172172
}

src/hotspot/share/cds/unregisteredClasses.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ InstanceKlass* UnregisteredClasses::load_class(Symbol* name, const char* path, T
5151
PerfClassTraceTime::CLASS_LOAD);
5252

5353
Symbol* path_symbol = SymbolTable::new_symbol(path);
54+
Symbol* findClass = SymbolTable::new_symbol("findClass");
5455
Handle url_classloader = get_url_classloader(path_symbol, CHECK_NULL);
5556
Handle ext_class_name = java_lang_String::externalize_classname(name, CHECK_NULL);
5657

5758
JavaValue result(T_OBJECT);
5859
JavaCallArguments args(2);
5960
args.set_receiver(url_classloader);
6061
args.push_oop(ext_class_name);
61-
args.push_int(JNI_FALSE);
6262
JavaCalls::call_virtual(&result,
6363
vmClasses::URLClassLoader_klass(),
64-
vmSymbols::loadClass_name(),
65-
vmSymbols::string_boolean_class_signature(),
64+
findClass,
65+
vmSymbols::string_class_signature(),
6666
&args,
6767
CHECK_NULL);
6868
assert(result.get_type() == T_OBJECT, "just checking");

src/hotspot/share/classfile/classFileParser.cpp

+6-32
Original file line numberDiff line numberDiff line change
@@ -4659,7 +4659,7 @@ const char* ClassFileParser::skip_over_field_signature(const char* signature,
46594659

46604660
// Checks if name is a legal class name.
46614661
void ClassFileParser::verify_legal_class_name(const Symbol* name, TRAPS) const {
4662-
if (!_need_verify || _relax_verify) { return; }
4662+
if (!_need_verify) { return; }
46634663

46644664
assert(name->refcount() > 0, "symbol must be kept alive");
46654665
char* bytes = (char*)name->bytes();
@@ -4699,7 +4699,7 @@ void ClassFileParser::verify_legal_class_name(const Symbol* name, TRAPS) const {
46994699

47004700
// Checks if name is a legal field name.
47014701
void ClassFileParser::verify_legal_field_name(const Symbol* name, TRAPS) const {
4702-
if (!_need_verify || _relax_verify) { return; }
4702+
if (!_need_verify) { return; }
47034703

47044704
char* bytes = (char*)name->bytes();
47054705
unsigned int length = name->utf8_length();
@@ -4732,7 +4732,7 @@ void ClassFileParser::verify_legal_field_name(const Symbol* name, TRAPS) const {
47324732

47334733
// Checks if name is a legal method name.
47344734
void ClassFileParser::verify_legal_method_name(const Symbol* name, TRAPS) const {
4735-
if (!_need_verify || _relax_verify) { return; }
4735+
if (!_need_verify) { return; }
47364736

47374737
assert(name != nullptr, "method name is null");
47384738
char* bytes = (char*)name->bytes();
@@ -5236,17 +5236,6 @@ void ClassFileParser::update_class_name(Symbol* new_class_name) {
52365236
_class_name->increment_refcount();
52375237
}
52385238

5239-
static bool relax_format_check_for(ClassLoaderData* loader_data) {
5240-
bool trusted = loader_data->is_boot_class_loader_data() ||
5241-
loader_data->is_platform_class_loader_data();
5242-
bool need_verify =
5243-
// verifyAll
5244-
(BytecodeVerificationLocal && BytecodeVerificationRemote) ||
5245-
// verifyRemote
5246-
(!BytecodeVerificationLocal && BytecodeVerificationRemote && !trusted);
5247-
return !need_verify;
5248-
}
5249-
52505239
ClassFileParser::ClassFileParser(ClassFileStream* stream,
52515240
Symbol* name,
52525241
ClassLoaderData* loader_data,
@@ -5303,7 +5292,6 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
53035292
_itfs_len(0),
53045293
_java_fields_count(0),
53055294
_need_verify(false),
5306-
_relax_verify(false),
53075295
_has_nonstatic_concrete_methods(false),
53085296
_declares_nonstatic_concrete_methods(false),
53095297
_has_localvariable_table(false),
@@ -5324,24 +5312,10 @@ ClassFileParser::ClassFileParser(ClassFileStream* stream,
53245312
assert(0 == _access_flags.as_int(), "invariant");
53255313

53265314
// Figure out whether we can skip format checking (matching classic VM behavior)
5327-
if (CDSConfig::is_dumping_static_archive()) {
5328-
// verify == true means it's a 'remote' class (i.e., non-boot class)
5329-
// Verification decision is based on BytecodeVerificationRemote flag
5330-
// for those classes.
5331-
_need_verify = (stream->need_verify()) ? BytecodeVerificationRemote :
5332-
BytecodeVerificationLocal;
5333-
}
5334-
else {
5335-
_need_verify = Verifier::should_verify_for(_loader_data->class_loader(),
5336-
stream->need_verify());
5337-
}
5338-
5339-
// synch back verification state to stream
5340-
stream->set_verify(_need_verify);
5315+
_need_verify = Verifier::should_verify_for(_loader_data->class_loader());
53415316

5342-
// Check if verification needs to be relaxed for this class file
5343-
// Do not restrict it to jdk1.0 or jdk1.1 to maintain backward compatibility (4982376)
5344-
_relax_verify = relax_format_check_for(_loader_data);
5317+
// synch back verification state to stream to check for truncation.
5318+
stream->set_need_verify(_need_verify);
53455319

53465320
parse_stream(stream, CHECK);
53475321

src/hotspot/share/classfile/classFileParser.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ class ClassFileParser {
185185
u2 _java_fields_count;
186186

187187
bool _need_verify;
188-
bool _relax_verify;
189188

190189
bool _has_nonstatic_concrete_methods;
191190
bool _declares_nonstatic_concrete_methods;

0 commit comments

Comments
 (0)