Skip to content

Commit f2c9e42

Browse files
authored
Merge pull request #101 from SAP/pr-jdk-10.0.1+10
Merge to tag jdk-10.0.1+10
2 parents c7ff860 + 45a9161 commit f2c9e42

File tree

97 files changed

+2733
-1416
lines changed

Some content is hidden

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

97 files changed

+2733
-1416
lines changed

.hgtags

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,3 +470,13 @@ e569e83139fdfbecfeb3cd9014d560917787f158 jdk-10+38
470470
107413b070b92c88bde6230ceb4a19b579781068 jdk-10+43
471471
663f20fc51091bd7f95d18448850ba091207b7bd jdk-10+44
472472
4f96cf952e71cb8a127334494faf28880c26181b jdk-10+45
473+
6fa770f9f8ab296e1ce255ec17ccf6d4e1051886 jdk-10+46
474+
1c6ce8043f6eb0418a2951ab9afe2f00e1ab1940 jdk-10.0.1+1
475+
c889b905103da600c8ba90c0cabd0359aab26f29 jdk-10.0.1+2
476+
8252e3cbbb7050a3fe0f631eed66de020764ede6 jdk-10.0.1+3
477+
342919957cf16a198f554864c334762c8f3932bb jdk-10.0.1+4
478+
27a4cb8a28ee6edbd905a7a1fad2baa0683367d6 jdk-10.0.1+5
479+
959a0dfc93002e9b7fe661b161309568f7440211 jdk-10.0.1+6
480+
2da830b962d013490456f59a64426deb112e1cf8 jdk-10.0.1+7
481+
4fe8424f43e140ddd48b413181ede0a29e0ade70 jdk-10.0.1+8
482+
f33ce6eff26e86d2fdbb21d58a60a78696b1536f jdk-10.0.1+9

make/autoconf/version-numbers

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2018, 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
@@ -27,9 +27,9 @@
2727

2828
DEFAULT_VERSION_FEATURE=10
2929
DEFAULT_VERSION_INTERIM=0
30-
DEFAULT_VERSION_UPDATE=0
30+
DEFAULT_VERSION_UPDATE=1
3131
DEFAULT_VERSION_PATCH=0
32-
DEFAULT_VERSION_DATE=2018-03-20
32+
DEFAULT_VERSION_DATE=2018-04-17
3333

3434
LAUNCHER_NAME=openjdk
3535
PRODUCT_NAME=OpenJDK

src/hotspot/share/classfile/javaClasses.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, 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
@@ -3101,6 +3101,34 @@ void java_lang_ref_SoftReference::set_clock(jlong value) {
31013101
*offset = value;
31023102
}
31033103

3104+
// Support for java_lang_ref_ReferenceQueue
3105+
3106+
oop java_lang_ref_ReferenceQueue::NULL_queue() {
3107+
InstanceKlass* ik = SystemDictionary::ReferenceQueue_klass();
3108+
oop mirror = ik->java_mirror();
3109+
return mirror->obj_field(static_NULL_queue_offset);
3110+
}
3111+
3112+
oop java_lang_ref_ReferenceQueue::ENQUEUED_queue() {
3113+
InstanceKlass* ik = SystemDictionary::ReferenceQueue_klass();
3114+
oop mirror = ik->java_mirror();
3115+
return mirror->obj_field(static_ENQUEUED_queue_offset);
3116+
}
3117+
3118+
void java_lang_ref_ReferenceQueue::compute_offsets() {
3119+
InstanceKlass* k = SystemDictionary::ReferenceQueue_klass();
3120+
compute_offset(static_NULL_queue_offset,
3121+
k,
3122+
vmSymbols::referencequeue_null_name(),
3123+
vmSymbols::referencequeue_signature(),
3124+
true /* is_static */);
3125+
compute_offset(static_ENQUEUED_queue_offset,
3126+
k,
3127+
vmSymbols::referencequeue_enqueued_name(),
3128+
vmSymbols::referencequeue_signature(),
3129+
true /* is_static */);
3130+
}
3131+
31043132
// Support for java_lang_invoke_DirectMethodHandle
31053133

31063134
int java_lang_invoke_DirectMethodHandle::_member_offset;
@@ -3683,6 +3711,8 @@ int java_lang_ref_Reference::queue_offset;
36833711
int java_lang_ref_Reference::next_offset;
36843712
int java_lang_ref_Reference::discovered_offset;
36853713
int java_lang_ref_Reference::number_of_fake_oop_fields;
3714+
int java_lang_ref_ReferenceQueue::static_NULL_queue_offset;
3715+
int java_lang_ref_ReferenceQueue::static_ENQUEUED_queue_offset;
36863716
int java_lang_ref_SoftReference::timestamp_offset;
36873717
int java_lang_ref_SoftReference::static_clock_offset;
36883718
int java_lang_ClassLoader::parent_offset;
@@ -3912,6 +3942,7 @@ void JavaClasses::compute_offsets() {
39123942
java_lang_Module::compute_offsets();
39133943
java_lang_StackFrameInfo::compute_offsets();
39143944
java_lang_LiveStackFrameInfo::compute_offsets();
3945+
java_lang_ref_ReferenceQueue::compute_offsets();
39153946

39163947
// generated interpreter code wants to know about the offsets we just computed:
39173948
AbstractAssembler::update_delayed_values();

src/hotspot/share/classfile/javaClasses.hpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, 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
@@ -893,6 +893,8 @@ class java_lang_ref_Reference: AllStatic {
893893
static inline void set_discovered(oop ref, oop value);
894894
static inline void set_discovered_raw(oop ref, oop value);
895895
static inline HeapWord* discovered_addr(oop ref);
896+
static inline oop queue(oop ref);
897+
static inline void set_queue(oop ref, oop value);
896898
static bool is_referent_field(oop obj, ptrdiff_t offset);
897899
static inline bool is_phantom(oop ref);
898900
};
@@ -921,6 +923,20 @@ class java_lang_ref_SoftReference: public java_lang_ref_Reference {
921923
static void set_clock(jlong value);
922924
};
923925

926+
// Interface to java.lang.ref.ReferenceQueue objects
927+
928+
class java_lang_ref_ReferenceQueue: public AllStatic {
929+
public:
930+
static int static_NULL_queue_offset;
931+
static int static_ENQUEUED_queue_offset;
932+
933+
// Accessors
934+
static oop NULL_queue();
935+
static oop ENQUEUED_queue();
936+
937+
static void compute_offsets();
938+
};
939+
924940
// Interface to java.lang.invoke.MethodHandle objects
925941

926942
class MethodHandleEntry;

src/hotspot/share/classfile/javaClasses.inline.hpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2018, 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
@@ -121,6 +121,12 @@ void java_lang_ref_Reference::set_discovered_raw(oop ref, oop value) {
121121
HeapWord* java_lang_ref_Reference::discovered_addr(oop ref) {
122122
return ref->obj_field_addr<HeapWord>(discovered_offset);
123123
}
124+
oop java_lang_ref_Reference::queue(oop ref) {
125+
return ref->obj_field(queue_offset);
126+
}
127+
void java_lang_ref_Reference::set_queue(oop ref, oop value) {
128+
return ref->obj_field_put(queue_offset, value);
129+
}
124130
bool java_lang_ref_Reference::is_phantom(oop ref) {
125131
return InstanceKlass::cast(ref->klass())->reference_type() == REF_PHANTOM;
126132
}

src/hotspot/share/classfile/systemDictionary.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, 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
@@ -2156,6 +2156,8 @@ void SystemDictionary::initialize_preloaded_classes(TRAPS) {
21562156
InstanceKlass::cast(WK_KLASS(FinalReference_klass))->set_reference_type(REF_FINAL);
21572157
InstanceKlass::cast(WK_KLASS(PhantomReference_klass))->set_reference_type(REF_PHANTOM);
21582158

2159+
initialize_wk_klasses_through(WK_KLASS_ENUM_NAME(ReferenceQueue_klass), scan, CHECK);
2160+
21592161
// JSR 292 classes
21602162
WKID jsr292_group_start = WK_KLASS_ENUM_NAME(MethodHandle_klass);
21612163
WKID jsr292_group_end = WK_KLASS_ENUM_NAME(VolatileCallSite_klass);

src/hotspot/share/classfile/systemDictionary.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, 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
@@ -135,6 +135,7 @@ class GCTimer;
135135
do_klass(FinalReference_klass, java_lang_ref_FinalReference, Pre ) \
136136
do_klass(PhantomReference_klass, java_lang_ref_PhantomReference, Pre ) \
137137
do_klass(Finalizer_klass, java_lang_ref_Finalizer, Pre ) \
138+
do_klass(ReferenceQueue_klass, java_lang_ref_ReferenceQueue, Pre ) \
138139
\
139140
do_klass(Thread_klass, java_lang_Thread, Pre ) \
140141
do_klass(ThreadGroup_klass, java_lang_ThreadGroup, Pre ) \

src/hotspot/share/classfile/verificationType.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ bool VerificationType::resolve_and_check_assignability(InstanceKlass* klass, Sym
4848
Klass* this_class = SystemDictionary::resolve_or_fail(
4949
name, Handle(THREAD, klass->class_loader()),
5050
Handle(THREAD, klass->protection_domain()), true, CHECK_false);
51+
klass->class_loader_data()->record_dependency(this_class, CHECK_false);
5152
if (log_is_enabled(Debug, class, resolve)) {
5253
Verifier::trace_class_resolution(this_class, klass);
5354
}
@@ -65,6 +66,7 @@ bool VerificationType::resolve_and_check_assignability(InstanceKlass* klass, Sym
6566
Klass* from_class = SystemDictionary::resolve_or_fail(
6667
from_name, Handle(THREAD, klass->class_loader()),
6768
Handle(THREAD, klass->protection_domain()), true, CHECK_false);
69+
klass->class_loader_data()->record_dependency(from_class, CHECK_false);
6870
if (log_is_enabled(Debug, class, resolve)) {
6971
Verifier::trace_class_resolution(from_class, klass);
7072
}

src/hotspot/share/classfile/verifier.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,9 +2010,12 @@ Klass* ClassVerifier::load_class(Symbol* name, TRAPS) {
20102010
name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
20112011
true, THREAD);
20122012

2013-
if (log_is_enabled(Debug, class, resolve)) {
2014-
InstanceKlass* cur_class = InstanceKlass::cast(current_class());
2015-
Verifier::trace_class_resolution(kls, cur_class);
2013+
if (kls != NULL) {
2014+
current_class()->class_loader_data()->record_dependency(kls, CHECK_NULL);
2015+
if (log_is_enabled(Debug, class, resolve)) {
2016+
InstanceKlass* cur_class = InstanceKlass::cast(current_class());
2017+
Verifier::trace_class_resolution(kls, cur_class);
2018+
}
20162019
}
20172020
return kls;
20182021
}

src/hotspot/share/classfile/vmSymbols.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, 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
@@ -86,6 +86,7 @@
8686
template(java_lang_ref_FinalReference, "java/lang/ref/FinalReference") \
8787
template(java_lang_ref_PhantomReference, "java/lang/ref/PhantomReference") \
8888
template(java_lang_ref_Finalizer, "java/lang/ref/Finalizer") \
89+
template(java_lang_ref_ReferenceQueue, "java/lang/ref/ReferenceQueue") \
8990
template(java_lang_reflect_AccessibleObject, "java/lang/reflect/AccessibleObject") \
9091
template(java_lang_reflect_Method, "java/lang/reflect/Method") \
9192
template(java_lang_reflect_Constructor, "java/lang/reflect/Constructor") \
@@ -463,6 +464,8 @@
463464
template(module_entry_name, "module_entry") \
464465
template(resolved_references_name, "<resolved_references>") \
465466
template(init_lock_name, "<init_lock>") \
467+
template(referencequeue_null_name, "NULL") \
468+
template(referencequeue_enqueued_name, "ENQUEUED") \
466469
\
467470
/* name symbols needed by intrinsics */ \
468471
VM_INTRINSICS_DO(VM_INTRINSIC_IGNORE, VM_SYMBOL_IGNORE, template, VM_SYMBOL_IGNORE, VM_ALIAS_IGNORE) \
@@ -554,6 +557,7 @@
554557
template(class_signature, "Ljava/lang/Class;") \
555558
template(string_signature, "Ljava/lang/String;") \
556559
template(reference_signature, "Ljava/lang/ref/Reference;") \
560+
template(referencequeue_signature, "Ljava/lang/ref/ReferenceQueue;") \
557561
template(sun_misc_Cleaner_signature, "Lsun/misc/Cleaner;") \
558562
template(executable_signature, "Ljava/lang/reflect/Executable;") \
559563
template(module_signature, "Ljava/lang/Module;") \

src/hotspot/share/code/dependencies.cpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,14 @@ class ClassHierarchyWalker {
11161116
_signature = NULL;
11171117
initialize(participant);
11181118
}
1119+
ClassHierarchyWalker(Klass* participants[], int num_participants) {
1120+
_name = NULL;
1121+
_signature = NULL;
1122+
initialize(NULL);
1123+
for (int i = 0; i < num_participants; ++i) {
1124+
add_participant(participants[i]);
1125+
}
1126+
}
11191127

11201128
// This is common code for two searches: One for concrete subtypes,
11211129
// the other for concrete method implementations and overrides.
@@ -1221,6 +1229,24 @@ class ClassHierarchyWalker {
12211229
// Search class hierarchy first.
12221230
Method* m = InstanceKlass::cast(k)->find_instance_method(_name, _signature);
12231231
if (!Dependencies::is_concrete_method(m, k)) {
1232+
// Check for re-abstraction of method
1233+
if (!k->is_interface() && m != NULL && m->is_abstract()) {
1234+
// Found a matching abstract method 'm' in the class hierarchy.
1235+
// This is fine iff 'k' is an abstract class and all concrete subtypes
1236+
// of 'k' override 'm' and are participates of the current search.
1237+
ClassHierarchyWalker wf(_participants, _num_participants);
1238+
Klass* w = wf.find_witness_subtype(k);
1239+
if (w != NULL) {
1240+
Method* wm = InstanceKlass::cast(w)->find_instance_method(_name, _signature);
1241+
if (!Dependencies::is_concrete_method(wm, w)) {
1242+
// Found a concrete subtype 'w' which does not override abstract method 'm'.
1243+
// Bail out because 'm' could be called with 'w' as receiver (leading to an
1244+
// AbstractMethodError) and thus the method we are looking for is not unique.
1245+
_found_methods[_num_participants] = m;
1246+
return true;
1247+
}
1248+
}
1249+
}
12241250
// Check interface defaults also, if any exist.
12251251
Array<Method*>* default_methods = InstanceKlass::cast(k)->default_methods();
12261252
if (default_methods == NULL)

src/hotspot/share/oops/cpCache.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -244,14 +244,13 @@ void ConstantPoolCacheEntry::set_direct_or_vtable_call(Bytecodes::Code invoke_co
244244
// virtual method in java.lang.Object. This is a corner case in the spec
245245
// but is presumably legal. javac does not generate this code.
246246
//
247-
// We set bytecode_1() to _invokeinterface, because that is the
248-
// bytecode # used by the interpreter to see if it is resolved.
247+
// We do not set bytecode_1() to _invokeinterface, because that is the
248+
// bytecode # used by the interpreter to see if it is resolved. In this
249+
// case, the method gets reresolved with caller for each interface call
250+
// because the actual selected method may not be public.
251+
//
249252
// We set bytecode_2() to _invokevirtual.
250253
// See also interpreterRuntime.cpp. (8/25/2000)
251-
// Only set resolved for the invokeinterface case if method is public.
252-
// Otherwise, the method needs to be reresolved with caller for each
253-
// interface call.
254-
if (method->is_public()) set_bytecode_1(invoke_code);
255254
} else {
256255
assert(invoke_code == Bytecodes::_invokevirtual, "");
257256
}

src/hotspot/share/oops/klass.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2018, 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
@@ -60,11 +60,13 @@ bool Klass::is_cloneable() const {
6060
}
6161

6262
void Klass::set_is_cloneable() {
63-
if (name() != vmSymbols::java_lang_invoke_MemberName()) {
64-
_access_flags.set_is_cloneable_fast();
65-
} else {
63+
if (name() == vmSymbols::java_lang_invoke_MemberName()) {
6664
assert(is_final(), "no subclasses allowed");
6765
// MemberName cloning should not be intrinsified and always happen in JVM_Clone.
66+
} else if (is_instance_klass() && InstanceKlass::cast(this)->reference_type() != REF_NONE) {
67+
// Reference cloning should not be intrinsified and always happen in JVM_Clone.
68+
} else {
69+
_access_flags.set_is_cloneable_fast();
6870
}
6971
}
7072

0 commit comments

Comments
 (0)