Skip to content

Commit 7465ba1

Browse files
author
Datadog Syncup Service
committed
Merge branch 'upstream-master'
2 parents 0578d77 + 964d8d2 commit 7465ba1

File tree

76 files changed

+543
-3103
lines changed

Some content is hidden

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

76 files changed

+543
-3103
lines changed

doc/testing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ <h4 id="failure_handler_timeout">FAILURE_HANDLER_TIMEOUT</h4>
434434
<p>Sets the argument <code>-timeoutHandlerTimeout</code> for JTReg. The
435435
default value is 0. This is only valid if the failure handler is
436436
built.</p>
437-
<h4 id="jtreg_test_thread_factory">JTREG_TEST_THREAD_FACTORY</h4>
437+
<h4 id="test_thread_factory">TEST_THREAD_FACTORY</h4>
438438
<p>Sets the <code>-testThreadFactory</code> for JTReg. It should be the
439439
fully qualified classname of a class which implements
440440
<code>java.util.concurrent.ThreadFactory</code>. One such implementation

doc/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ Defaults to 4.
380380
Sets the argument `-timeoutHandlerTimeout` for JTReg. The default value is 0.
381381
This is only valid if the failure handler is built.
382382

383-
#### JTREG_TEST_THREAD_FACTORY
383+
#### TEST_THREAD_FACTORY
384384

385385
Sets the `-testThreadFactory` for JTReg. It should be the fully qualified
386386
classname of a class which implements `java.util.concurrent.ThreadFactory`. One

src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,9 @@ class StubGenerator: public StubCodeGenerator {
13741374
// r15 is the byte adjustment needed to align s.
13751375
__ cbz(r15, aligned);
13761376
int shift = exact_log2(granularity);
1377-
if (shift) __ lsr(r15, r15, shift);
1377+
if (shift > 0) {
1378+
__ lsr(r15, r15, shift);
1379+
}
13781380
__ sub(count, count, r15);
13791381

13801382
#if 0
@@ -1402,9 +1404,15 @@ class StubGenerator: public StubCodeGenerator {
14021404

14031405
// s is now 2-word-aligned.
14041406

1405-
// We have a count of units and some trailing bytes. Adjust the
1406-
// count and do a bulk copy of words.
1407-
__ lsr(r15, count, exact_log2(wordSize/granularity));
1407+
// We have a count of units and some trailing bytes. Adjust the
1408+
// count and do a bulk copy of words. If the shift is zero
1409+
// perform a move instead to benefit from zero latency moves.
1410+
int shift = exact_log2(wordSize/granularity);
1411+
if (shift > 0) {
1412+
__ lsr(r15, count, shift);
1413+
} else {
1414+
__ mov(r15, count);
1415+
}
14081416
if (direction == copy_forwards) {
14091417
if (type != T_OBJECT) {
14101418
__ bl(copy_f);

src/hotspot/cpu/ppc/ppc.ad

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12268,7 +12268,7 @@ instruct string_equalsL(rarg1RegP str1, rarg2RegP str2, rarg3RegI cnt, iRegIdst
1226812268
%}
1226912269

1227012270
instruct array_equalsB(rarg1RegP ary1, rarg2RegP ary2, iRegIdst result,
12271-
iRegIdst tmp1, iRegIdst tmp2, regCTR ctr, flagsRegCR0 cr0, flagsRegCR0 cr1) %{
12271+
iRegIdst tmp1, iRegIdst tmp2, regCTR ctr, flagsRegCR0 cr0, flagsRegCR1 cr1) %{
1227212272
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::LL);
1227312273
match(Set result (AryEq ary1 ary2));
1227412274
effect(TEMP_DEF result, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, KILL ctr, KILL cr0, KILL cr1);
@@ -12283,7 +12283,7 @@ instruct array_equalsB(rarg1RegP ary1, rarg2RegP ary2, iRegIdst result,
1228312283
%}
1228412284

1228512285
instruct array_equalsC(rarg1RegP ary1, rarg2RegP ary2, iRegIdst result,
12286-
iRegIdst tmp1, iRegIdst tmp2, regCTR ctr, flagsRegCR0 cr0, flagsRegCR0 cr1) %{
12286+
iRegIdst tmp1, iRegIdst tmp2, regCTR ctr, flagsRegCR0 cr0, flagsRegCR1 cr1) %{
1228712287
predicate(((AryEqNode*)n)->encoding() == StrIntrinsicNode::UU);
1228812288
match(Set result (AryEq ary1 ary2));
1228912289
effect(TEMP_DEF result, USE_KILL ary1, USE_KILL ary2, TEMP tmp1, TEMP tmp2, KILL ctr, KILL cr0, KILL cr1);

src/hotspot/share/cds/heapShared.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,18 @@ class HeapShared: AllStatic {
143143
friend class VerifySharedOopClosure;
144144

145145
public:
146-
// Can this VM write a heap region into the CDS archive? Currently only {G1|Parallel|Serial}+compressed_cp
146+
// Can this VM write a heap region into the CDS archive?
147147
static bool can_write() {
148148
CDS_JAVA_HEAP_ONLY(
149149
if (_disable_writing) {
150150
return false;
151151
}
152-
return (UseG1GC || UseParallelGC || UseSerialGC) && UseCompressedClassPointers;
152+
// Need compressed class pointers for heap region dump.
153+
if (!UseCompressedClassPointers) {
154+
return false;
155+
}
156+
// Almost all GCs support heap region dump, except ZGC (so far).
157+
return !UseZGC;
153158
)
154159
NOT_CDS_JAVA_HEAP(return false;)
155160
}

src/hotspot/share/classfile/classFileParser.cpp

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4076,26 +4076,6 @@ void ClassFileParser::check_super_class_access(const InstanceKlass* this_klass,
40764076
return;
40774077
}
40784078

4079-
// If the loader is not the boot loader then throw an exception if its
4080-
// superclass is in package jdk.internal.reflect and its loader is not a
4081-
// special reflection class loader
4082-
if (!this_klass->class_loader_data()->is_the_null_class_loader_data()) {
4083-
PackageEntry* super_package = super->package();
4084-
if (super_package != nullptr &&
4085-
super_package->name()->fast_compare(vmSymbols::jdk_internal_reflect()) == 0 &&
4086-
!java_lang_ClassLoader::is_reflection_class_loader(this_klass->class_loader())) {
4087-
ResourceMark rm(THREAD);
4088-
Exceptions::fthrow(
4089-
THREAD_AND_LOCATION,
4090-
vmSymbols::java_lang_IllegalAccessError(),
4091-
"class %s loaded by %s cannot access jdk/internal/reflect superclass %s",
4092-
this_klass->external_name(),
4093-
this_klass->class_loader_data()->loader_name_and_id(),
4094-
super->external_name());
4095-
return;
4096-
}
4097-
}
4098-
40994079
Reflection::VerifyClassAccessResults vca_result =
41004080
Reflection::verify_class_access(this_klass, InstanceKlass::cast(super), false);
41014081
if (vca_result != Reflection::ACCESS_OK) {
@@ -5106,7 +5086,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik,
51065086

51075087
// Set PackageEntry for this_klass
51085088
oop cl = ik->class_loader();
5109-
Handle clh = Handle(THREAD, java_lang_ClassLoader::non_reflection_class_loader(cl));
5089+
Handle clh = Handle(THREAD, cl);
51105090
ClassLoaderData* cld = ClassLoaderData::class_loader_data_or_null(clh());
51115091
ik->set_package(cld, nullptr, CHECK);
51125092

src/hotspot/share/classfile/classLoaderData.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,8 +644,6 @@ Dictionary* ClassLoaderData::create_dictionary() {
644644
int size;
645645
if (_the_null_class_loader_data == nullptr) {
646646
size = _boot_loader_dictionary_size;
647-
} else if (class_loader()->is_a(vmClasses::reflect_DelegatingClassLoader_klass())) {
648-
size = 1; // there's only one class in relection class loader and no initiated classes
649647
} else if (is_system_class_loader_data()) {
650648
size = _boot_loader_dictionary_size;
651649
} else {
@@ -815,8 +813,6 @@ ClassLoaderMetaspace* ClassLoaderData::metaspace_non_null() {
815813
metaspace = new ClassLoaderMetaspace(_metaspace_lock, Metaspace::BootMetaspaceType);
816814
} else if (has_class_mirror_holder()) {
817815
metaspace = new ClassLoaderMetaspace(_metaspace_lock, Metaspace::ClassMirrorHolderMetaspaceType);
818-
} else if (class_loader()->is_a(vmClasses::reflect_DelegatingClassLoader_klass())) {
819-
metaspace = new ClassLoaderMetaspace(_metaspace_lock, Metaspace::ReflectionMetaspaceType);
820816
} else {
821817
metaspace = new ClassLoaderMetaspace(_metaspace_lock, Metaspace::StandardMetaspaceType);
822818
}

src/hotspot/share/classfile/javaClasses.cpp

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4763,9 +4763,6 @@ bool java_lang_ClassLoader::parallelCapable(oop class_loader) {
47634763
}
47644764

47654765
bool java_lang_ClassLoader::is_trusted_loader(oop loader) {
4766-
// Fix for 4474172; see evaluation for more details
4767-
loader = non_reflection_class_loader(loader);
4768-
47694766
oop cl = SystemDictionary::java_system_loader();
47704767
while(cl != nullptr) {
47714768
if (cl == loader) return true;
@@ -4774,29 +4771,6 @@ bool java_lang_ClassLoader::is_trusted_loader(oop loader) {
47744771
return false;
47754772
}
47764773

4777-
// Return true if this is one of the class loaders associated with
4778-
// the generated bytecodes for serialization constructor returned
4779-
// by sun.reflect.ReflectionFactory::newConstructorForSerialization
4780-
bool java_lang_ClassLoader::is_reflection_class_loader(oop loader) {
4781-
if (loader != nullptr) {
4782-
Klass* delegating_cl_class = vmClasses::reflect_DelegatingClassLoader_klass();
4783-
// This might be null in non-1.4 JDKs
4784-
return (delegating_cl_class != nullptr && loader->is_a(delegating_cl_class));
4785-
}
4786-
return false;
4787-
}
4788-
4789-
oop java_lang_ClassLoader::non_reflection_class_loader(oop loader) {
4790-
// See whether this is one of the class loaders associated with
4791-
// the generated bytecodes for reflection, and if so, "magically"
4792-
// delegate to its parent to prevent class loading from occurring
4793-
// in places where applications using reflection didn't expect it.
4794-
if (is_reflection_class_loader(loader)) {
4795-
return parent(loader);
4796-
}
4797-
return loader;
4798-
}
4799-
48004774
oop java_lang_ClassLoader::unnamedModule(oop loader) {
48014775
assert(is_instance(loader), "loader must be oop");
48024776
return loader->obj_field(_unnamedModule_offset);

src/hotspot/share/classfile/javaClasses.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1502,14 +1502,6 @@ class java_lang_ClassLoader : AllStatic {
15021502

15031503
static bool is_trusted_loader(oop loader);
15041504

1505-
// Return true if this is one of the class loaders associated with
1506-
// the generated bytecodes for serialization constructor returned
1507-
// by sun.reflect.ReflectionFactory::newConstructorForSerialization
1508-
static bool is_reflection_class_loader(oop loader);
1509-
1510-
// Fix for 4474172
1511-
static oop non_reflection_class_loader(oop loader);
1512-
15131505
// Testers
15141506
static bool is_subclass(Klass* klass) {
15151507
return klass->is_subclass_of(vmClasses::ClassLoader_klass());

src/hotspot/share/classfile/modules.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,6 @@ void Modules::define_module(Handle module, jboolean is_open, jstring version,
309309
}
310310

311311
oop loader = java_lang_Module::loader(module());
312-
// Make sure loader is not the jdk.internal.reflect.DelegatingClassLoader.
313-
if (loader != java_lang_ClassLoader::non_reflection_class_loader(loader)) {
314-
THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(),
315-
"Class loader is an invalid delegating class loader");
316-
}
317312
Handle h_loader = Handle(THREAD, loader);
318313
// define_module can be called during start-up, before the class loader's ClassLoaderData
319314
// has been created. SystemDictionary::register_loader ensures creation, if needed.

0 commit comments

Comments
 (0)