Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Automatic merge of jdk:master into master
  • Loading branch information
duke committed Feb 10, 2021
2 parents 64a3f88 + 4619f37 commit 79bb7559e555d768354add0b2c90986cbeaf29aa
Showing with 1,363 additions and 735 deletions.
  1. +4 −1 make/RunTestsPrebuilt.gmk
  2. +0 −26 make/data/cacerts/soneraclass2ca
  3. +3 −0 src/hotspot/cpu/ppc/c1_MacroAssembler_ppc.cpp
  4. +70 −0 src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp
  5. +3 −0 src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.hpp
  6. +95 −4 src/hotspot/cpu/ppc/gc/shared/barrierSetNMethod_ppc.cpp
  7. +1 −1 src/hotspot/cpu/ppc/macroAssembler_ppc.cpp
  8. +9 −0 src/hotspot/cpu/ppc/ppc.ad
  9. +9 −1 src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
  10. +57 −2 src/hotspot/cpu/ppc/stubGenerator_ppc.cpp
  11. +11 −1 src/hotspot/cpu/ppc/stubRoutines_ppc.hpp
  12. +6 −1 src/hotspot/cpu/ppc/stubRoutines_ppc_64.cpp
  13. +1 −7 src/hotspot/share/gc/g1/g1OopClosures.hpp
  14. +6 −5 src/hotspot/share/gc/g1/g1OopClosures.inline.hpp
  15. +6 −6 src/hotspot/share/gc/g1/g1RootClosures.cpp
  16. +5 −10 src/hotspot/share/gc/g1/g1SharedClosures.hpp
  17. +3 −5 src/hotspot/share/jfr/recorder/storage/jfrVirtualMemory.cpp
  18. +8 −4 src/java.base/share/classes/java/lang/Class.java
  19. +2 −2 src/java.base/share/classes/java/util/ServiceLoader.java
  20. +51 −36 src/java.base/share/classes/jdk/internal/jimage/BasicImageReader.java
  21. +99 −62 src/java.base/share/classes/jdk/internal/jimage/ImageLocation.java
  22. +7 −2 src/java.base/share/classes/jdk/internal/jimage/ImageReader.java
  23. +13 −3 src/java.base/share/classes/jdk/internal/jimage/ImageStrings.java
  24. +81 −19 src/java.base/share/classes/jdk/internal/jimage/ImageStringsReader.java
  25. +20 −4 src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java
  26. +1 −20 src/java.base/share/classes/jdk/internal/vm/VMSupport.java
  27. +10 −3 src/java.base/share/classes/sun/security/x509/BasicConstraintsExtension.java
  28. +3 −3 src/java.xml/share/classes/com/sun/org/apache/xml/internal/serializer/ToXMLStream.java
  29. +1 −3 src/java.xml/share/classes/module-info.java
  30. +219 −0 src/jdk.dynalink/share/classes/jdk/dynalink/BiClassValue.java
  31. +0 −157 src/jdk.dynalink/share/classes/jdk/dynalink/ClassMap.java
  32. +37 −77 src/jdk.dynalink/share/classes/jdk/dynalink/TypeConverterFactory.java
  33. +4 −5 ...vadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractExecutableMemberWriter.java
  34. +1 −1 ...are/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
  35. +2 −2 ...k.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
  36. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java
  37. +3 −4 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java
  38. +23 −70 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java
  39. +3 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java
  40. +2 −19 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java
  41. +29 −34 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkInfoImpl.java
  42. +3 −4 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
  43. +1 −2 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
  44. +3 −6 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java
  45. +1 −1 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java
  46. +17 −38 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java
  47. +11 −27 src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkInfo.java
  48. +1 −1 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageFileCreator.java
  49. +1 −2 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginStack.java
  50. +2 −3 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
  51. +1 −2 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Utils.java
  52. +1 −2 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/ExcludeVMPlugin.java
  53. +5 −5 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java
  54. +1 −2 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StringSharingPlugin.java
  55. +1 −1 src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/SystemModulesPlugin.java
  56. +1 −0 src/jdk.jpackage/linux/native/applauncher/LinuxPackage.c
  57. +3 −5 src/jdk.jpackage/windows/native/libjpackage/WindowsRegistry.cpp
  58. +1 −5 src/jdk.jpackage/windows/native/libjpackage/jpackage.cpp
  59. +2 −1 test/hotspot/jtreg/vmTestbase/nsk/share/IORedirector.java
  60. +6 −1 test/hotspot/jtreg/vmTestbase/nsk/share/Log.java
  61. +3 −1 test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Binder.java
  62. +3 −1 test/hotspot/jtreg/vmTestbase/nsk/share/jpda/DebugeeProcess.java
  63. +3 −1 test/hotspot/jtreg/vmTestbase/nsk/share/jpda/IOPipe.java
  64. +30 −12 test/jaxp/javax/xml/jaxp/unittest/common/prettyprint/PrettyPrintTest.java
  65. +102 −0 test/jdk/jdk/dynalink/TypeConverterFactoryMemoryLeakTest.java
  66. +194 −0 test/jdk/jdk/dynalink/TypeConverterFactoryRetentionTests.java
  67. +3 −7 test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
  68. +3 −2 test/jdk/sun/util/resources/cldr/TimeZoneNamesTest.java
  69. +51 −0 test/micro/org/openjdk/bench/java/lang/ClassGetResource.java
@@ -189,8 +189,10 @@ ifeq ($(OPENJDK_TARGET_CPU), x86_64)
endif

ifeq ($(OPENJDK_TARGET_OS), windows)
FIXPATH := $(BASH) $(TOPDIR)/make/scripts/fixpath.sh exec
FIXPATH_BASE := $(BASH) $(TOPDIR)/make/scripts/fixpath.sh
FIXPATH := $(FIXPATH_BASE) exec
else
FIXPATH_BASE :=
FIXPATH :=
endif

@@ -273,6 +275,7 @@ $(call CreateNewSpec, $(NEW_SPEC), \
MAKE := $(MAKE), \
BASH := $(BASH), \
JIB_JAR := $(JIB_JAR), \
FIXPATH_BASE := $(FIXPATH_BASE), \
FIXPATH := $(FIXPATH), \
OPENJDK_TARGET_OS := $(OPENJDK_TARGET_OS), \
OPENJDK_TARGET_OS_TYPE := $(OPENJDK_TARGET_OS_TYPE), \

This file was deleted.

@@ -81,6 +81,9 @@ void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_by

std(return_pc, _abi0(lr), R1_SP); // SP->lr = return_pc
push_frame(frame_size_in_bytes, R0); // SP -= frame_size_in_bytes

BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(this, R20);
}


@@ -23,12 +23,16 @@
*
*/

#include "nativeInst_ppc.hpp"
#include "precompiled.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "interpreter/interp_masm.hpp"
#include "oops/compressedOops.hpp"
#include "runtime/jniHandles.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"

#define __ masm->

@@ -125,3 +129,69 @@ void BarrierSetAssembler::try_resolve_jobject_in_native(MacroAssembler* masm, Re
__ clrrdi(dst, obj, JNIHandles::weak_tag_size);
__ ld(dst, 0, dst); // Resolve (untagged) jobject.
}

void BarrierSetAssembler::nmethod_entry_barrier(MacroAssembler* masm, Register tmp) {
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
if (bs_nm == nullptr) {
return;
}

assert_different_registers(tmp, R0);

// Load stub address using toc (fixed instruction size, unlike load_const_optimized)
__ calculate_address_from_global_toc(tmp, StubRoutines::ppc::nmethod_entry_barrier(),
true, true, false); // 2 instructions
__ mtctr(tmp);

// This is a compound instruction. Patching support is provided by NativeMovRegMem.
// Actual patching is done in (platform-specific part of) BarrierSetNMethod.
__ load_const32(tmp, 0 /* Value is patched */); // 2 instructions

__ lwz(R0, in_bytes(bs_nm->thread_disarmed_offset()), R16_thread);
__ cmpw(CCR0, R0, tmp);

__ bnectrl(CCR0);

// Oops may have been changed; exploiting isync semantics (used as acquire) to make those updates observable.
__ isync();
}

void BarrierSetAssembler::c2i_entry_barrier(MacroAssembler *masm, Register tmp1, Register tmp2, Register tmp3) {
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
if (bs_nm == nullptr) {
return;
}

assert_different_registers(tmp1, tmp2, tmp3);

Register tmp1_class_loader_data = tmp1;

Label bad_call, skip_barrier;

// Fast path: If no method is given, the call is definitely bad.
__ cmpdi(CCR0, R19_method, 0);
__ beq(CCR0, bad_call);

// Load class loader data to determine whether the method's holder is concurrently unloading.
__ load_method_holder(tmp1, R19_method);
__ ld(tmp1_class_loader_data, in_bytes(InstanceKlass::class_loader_data_offset()), tmp1);

// Fast path: If class loader is strong, the holder cannot be unloaded.
__ ld(tmp2, in_bytes(ClassLoaderData::keep_alive_offset()), tmp1_class_loader_data);
__ cmpdi(CCR0, tmp2, 0);
__ bne(CCR0, skip_barrier);

// Class loader is weak. Determine whether the holder is still alive.
__ ld(tmp2, in_bytes(ClassLoaderData::holder_offset()), tmp1_class_loader_data);
__ resolve_weak_handle(tmp2, tmp1, tmp3, MacroAssembler::PreservationLevel::PRESERVATION_FRAME_LR_GP_FP_REGS);
__ cmpdi(CCR0, tmp2, 0);
__ bne(CCR0, skip_barrier);

__ bind(bad_call);

__ calculate_address_from_global_toc(tmp1, SharedRuntime::get_handle_wrong_method_stub(), true, true, false);
__ mtctr(tmp1);
__ bctr();

__ bind(skip_barrier);
}
@@ -57,6 +57,9 @@ class BarrierSetAssembler: public CHeapObj<mtGC> {
Register obj, Register tmp, Label& slowpath);

virtual void barrier_stubs_init() {}

virtual void nmethod_entry_barrier(MacroAssembler* masm, Register tmp);
virtual void c2i_entry_barrier(MacroAssembler* masm, Register tmp1, Register tmp2, Register tmp3);
};

#endif // CPU_PPC_GC_SHARED_BARRIERSETASSEMBLER_PPC_HPP
@@ -23,18 +23,109 @@
*/

#include "precompiled.hpp"
#include "code/codeBlob.hpp"
#include "code/nmethod.hpp"
#include "code/nativeInst.hpp"
#include "gc/shared/barrierSetNMethod.hpp"
#include "utilities/debug.hpp"

class NativeNMethodBarrier: public NativeInstruction {

address get_barrier_start_address() const {
return NativeInstruction::addr_at(0);
}

NativeMovRegMem* get_patchable_instruction_handle() const {
// Endianness is handled by NativeMovRegMem
return reinterpret_cast<NativeMovRegMem*>(get_barrier_start_address() + 3 * 4);
}

public:
int get_guard_value() const {
// Retrieve the guard value (naming of 'offset' function is misleading).
return get_patchable_instruction_handle()->offset();
}

void release_set_guard_value(int value) {
// Patching is not atomic.
// Stale observations of the "armed" state is okay as invoking the barrier stub in that case has no
// unwanted side effects. Disarming is thus a non-critical operation.
// The visibility of the "armed" state must be ensured by safepoint/handshake.

OrderAccess::release(); // Release modified oops

// Set the guard value (naming of 'offset' function is misleading).
get_patchable_instruction_handle()->set_offset(value);
}

void verify() const {
// Although it's possible to just validate the to-be-patched instruction,
// all instructions are validated to ensure that the barrier is hit properly - especially since
// the pattern used in load_const32 is a quite common one.

uint* current_instruction = reinterpret_cast<uint*>(get_barrier_start_address());

// calculate_address_from_global_toc (compound instruction)
verify_op_code_manually(current_instruction, MacroAssembler::is_addis(*current_instruction));
verify_op_code_manually(current_instruction, MacroAssembler::is_addi(*current_instruction));

verify_op_code_manually(current_instruction, MacroAssembler::is_mtctr(*current_instruction));

get_patchable_instruction_handle()->verify();
current_instruction += 2;

verify_op_code(current_instruction, Assembler::LWZ_OPCODE);

// cmpw (mnemonic)
verify_op_code(current_instruction, Assembler::CMP_OPCODE);

// bnectrl (mnemonic) (weak check; not checking the exact type)
verify_op_code(current_instruction, Assembler::BCCTR_OPCODE);

verify_op_code(current_instruction, Assembler::ISYNC_OPCODE);
}

private:
static void verify_op_code_manually(uint*& current_instruction, bool result) {
assert(result, "illegal instruction sequence for nmethod entry barrier");
current_instruction++;
}
static void verify_op_code(uint*& current_instruction, uint expected,
unsigned int mask = 63u << Assembler::OPCODE_SHIFT) {
// Masking both, current instruction and opcode, as some opcodes in Assembler contain additional information
// to uniquely identify simplified mnemonics.
// As long as the caller doesn't provide a custom mask, that additional information is discarded.
verify_op_code_manually(current_instruction, (*current_instruction & mask) == (expected & mask));
}
};

static NativeNMethodBarrier* get_nmethod_barrier(nmethod* nm) {
address barrier_address = nm->code_begin() + nm->frame_complete_offset() + (-9 * 4);

auto barrier = reinterpret_cast<NativeNMethodBarrier*>(barrier_address);
debug_only(barrier->verify());
return barrier;
}

void BarrierSetNMethod::deoptimize(nmethod* nm, address* return_address_ptr) {
ShouldNotReachHere();
// As PPC64 always has a valid back chain (unlike other platforms), the stub can simply pop the frame.
// Thus, there's nothing to do here.
}

void BarrierSetNMethod::disarm(nmethod* nm) {
ShouldNotReachHere();
if (!supports_entry_barrier(nm)) {
return;
}

NativeNMethodBarrier* barrier = get_nmethod_barrier(nm);
barrier->release_set_guard_value(disarmed_value());
}

bool BarrierSetNMethod::is_armed(nmethod* nm) {
ShouldNotReachHere();
return false;
if (!supports_entry_barrier(nm)) {
return false;
}

NativeNMethodBarrier* barrier = get_nmethod_barrier(nm);
return barrier->get_guard_value() != disarmed_value();
}
@@ -3379,7 +3379,7 @@ int MacroAssembler::crc32_table_columns(Register table, Register tc0, Register t
assert(!VM_Version::has_vpmsumb(), "Vector version should be used instead!");

// Point to 4 byte folding tables (byte-reversed version for Big Endian)
// Layout: See StubRoutines::generate_crc_constants.
// Layout: See StubRoutines::ppc::generate_crc_constants.
#ifdef VM_LITTLE_ENDIAN
const int ix0 = 3 * CRC32_TABLE_SIZE;
const int ix1 = 2 * CRC32_TABLE_SIZE;
@@ -1376,6 +1376,10 @@ void MachPrologNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
st->print("save return pc\n\t");
st->print("push frame %ld\n\t", -framesize);
}

if (C->stub_function() == NULL) {
st->print("nmethod entry barrier\n\t");
}
}
#endif

@@ -1529,6 +1533,11 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {
__ std(return_pc, _abi0(lr), callers_sp);
}

if (C->stub_function() == NULL) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(&_masm, push_frame_temp);
}

C->output()->set_frame_complete(cbuf.insts_size());
}

@@ -1301,9 +1301,13 @@ AdapterHandlerEntry* SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm
c2i_no_clinit_check_entry = __ pc();
}

BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->c2i_entry_barrier(masm, /* tmp register*/ ic_klass, /* tmp register*/ receiver_klass, /* tmp register*/ code);

gen_c2i_adapter(masm, total_args_passed, comp_args_on_stack, sig_bt, regs, call_interpreter, ientry);

return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry, c2i_no_clinit_check_entry);
return AdapterHandlerLibrary::new_entry(fingerprint, i2c_entry, c2i_entry, c2i_unverified_entry,
c2i_no_clinit_check_entry);
}

// An oop arg. Must pass a handle not the oop itself.
@@ -1973,6 +1977,10 @@ nmethod *SharedRuntime::generate_native_wrapper(MacroAssembler *masm,
__ generate_stack_overflow_check(frame_size_in_bytes); // Check before creating frame.
__ mr(r_callers_sp, R1_SP); // Remember frame pointer.
__ push_frame(frame_size_in_bytes, r_temp_1); // Push the c2n adapter's frame.

BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(masm, r_temp_1);

frame_done_pc = (intptr_t)__ pc();

__ verify_thread();

0 comments on commit 79bb755

Please sign in to comment.