OpenJDK / amber / amber
changeset 59876:abf9b403ebe0 stats-before-this-super
Automatic merge with default
author | mcimadamore |
---|---|
date | Thu, 30 Jan 2020 22:06:12 +0000 |
parents | aad1a08c883b 560b2becbe87 |
children | 2568bcf17169 |
files | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script-dir/external/jquery/jquery.js src/jdk.javadoc/share/classes/jdk/javadoc/internal/tool/ToolOption.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java test/hotspot/jtreg/vmTestbase/jit/escape/LockCoarsening/run.sh test/hotspot/jtreg/vmTestbase/jit/tiered/TestDescription.java test/hotspot/jtreg/vmTestbase/jit/tiered/tieredTest.sh test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/TestDescription.java test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/run.sh test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/TestDescription.java test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/run.sh test/jdk/jdk/jfr/event/io/EvilInstrument.java test/jdk/jdk/jfr/event/sampling/libTestNative.c test/langtools/jdk/javadoc/doclet/testOptions/help.html |
diffstat | 259 files changed, 5023 insertions(+), 14696 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgtags Mon Jan 27 10:46:12 2020 +0000 +++ b/.hgtags Thu Jan 30 22:06:12 2020 +0000 @@ -614,3 +614,5 @@ ef7d53b4fccd4a0501b17d974e84f37aa99fa813 jdk-15+6 f728b6c7f4910d6bd6070cb4dde8393f4ba95113 jdk-14+33 e2bc57500c1b785837982f7ce8af6751387ed73b jdk-15+7 +a96bc204e3b31ddbf909b20088964112f052927e jdk-14+34 +c7d4f2849dbfb755fc5860b362a4044ea0c9e082 jdk-15+8
--- a/make/RunTests.gmk Mon Jan 27 10:46:12 2020 +0000 +++ b/make/RunTests.gmk Thu Jan 30 22:06:12 2020 +0000 @@ -1073,10 +1073,14 @@ $$(call LogWarn, Test report is stored in $$(strip \ $$(subst $$(TOPDIR)/, , $$($1_TEST_RESULTS_DIR)))) $$(call LogWarn, Warning: Special test results are not properly parsed!) - $$(eval $1_PASSED := 0) - $$(eval $1_FAILED := 0) + $$(eval $1_PASSED := $$(shell \ + if [ `$(CAT) $$($1_EXITCODE)` = "0" ]; then $(ECHO) 1; else $(ECHO) 0; fi \ + )) + $$(eval $1_FAILED := $$(shell \ + if [ `$(CAT) $$($1_EXITCODE)` = "0" ]; then $(ECHO) 0; else $(ECHO) 1; fi \ + )) $$(eval $1_ERROR := 0) - $$(eval $1_TOTAL := 0) + $$(eval $1_TOTAL := 1) $1: run-test-$1 parse-test-$1
--- a/make/common/MakeBase.gmk Mon Jan 27 10:46:12 2020 +0000 +++ b/make/common/MakeBase.gmk Thu Jan 30 22:06:12 2020 +0000 @@ -525,15 +525,16 @@ # Param 2 - (optional) name of file to store value in DependOnVariableHelper = \ $(strip \ - $(eval -include $(call DependOnVariableFileName, $1, $2)) \ + $(eval $1_filename := $(call DependOnVariableFileName, $1, $2)) \ + $(if $(wildcard $($1_filename)), $(eval include $($1_filename))) \ $(if $(call equals, $(strip $($1)), $(strip $($1_old))),,\ - $(call MakeDir, $(dir $(call DependOnVariableFileName, $1, $2))) \ + $(call MakeDir, $(dir $($1_filename))) \ $(if $(findstring $(LOG_LEVEL), trace), \ $(info NewVariable $1: >$(strip $($1))<) \ $(info OldVariable $1: >$(strip $($1_old))<)) \ $(call WriteFile, $1_old:=$(call DoubleDollar,$(call EscapeHash,$($1))), \ - $(call DependOnVariableFileName, $1, $2))) \ - $(call DependOnVariableFileName, $1, $2) \ + $($1_filename))) \ + $($1_filename) \ ) # Main macro
--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -138,18 +138,6 @@ } } -void LIR_Assembler::set_24bit_FPU() { Unimplemented(); } - -void LIR_Assembler::reset_FPU() { Unimplemented(); } - -void LIR_Assembler::fpop() { Unimplemented(); } - -void LIR_Assembler::fxch(int i) { Unimplemented(); } - -void LIR_Assembler::fld(int i) { Unimplemented(); } - -void LIR_Assembler::ffree(int i) { Unimplemented(); } - void LIR_Assembler::breakpoint() { Unimplemented(); } void LIR_Assembler::push(LIR_Opr opr) { Unimplemented(); }
--- a/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1127,7 +1127,6 @@ // arguments of lir_convert LIR_Opr conv_input = input; LIR_Opr conv_result = result; - ConversionStub* stub = NULL; __ convert(x->op(), conv_input, conv_result);
--- a/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/aarch64/globalDefinitions_aarch64.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -34,11 +34,10 @@ #define SUPPORTS_NATIVE_CX8 -// Aarch64 was not originally defined as multi-copy-atomic, but now is. -// See: "Simplifying ARM Concurrency: Multicopy-atomic Axiomatic and -// Operational Models for ARMv8" -// So we could #define CPU_MULTI_COPY_ATOMIC but historically we have -// not done so. +// Aarch64 was not originally defined to be multi-copy-atomic, but now +// is. See: "Simplifying ARM Concurrency: Multicopy-atomic Axiomatic +// and Operational Models for ARMv8" +#define CPU_MULTI_COPY_ATOMIC // According to the ARMv8 ARM, "Concurrent modification and execution // of instructions can lead to the resulting instruction performing
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2014, 2019, Red Hat Inc. All rights reserved. + * Copyright (c) 1997, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, Red Hat Inc. 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 @@ -4977,8 +4977,6 @@ sub(cnt2, zr, cnt2, LSL, str2_chr_shift); } else if (isLU) { ldrs(vtmp, Address(str1)); - cmp(str1, str2); - br(Assembler::EQ, DONE); ldr(tmp2, Address(str2)); cmp(cnt2, stub_threshold); br(GE, STUB); @@ -4993,8 +4991,6 @@ fmovd(tmp1, vtmp); } else { // UL case ldr(tmp1, Address(str1)); - cmp(str1, str2); - br(Assembler::EQ, DONE); ldrs(vtmp, Address(str2)); cmp(cnt2, stub_threshold); br(GE, STUB);
--- a/src/hotspot/cpu/arm/arm.ad Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/arm.ad Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ // -// Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2008, 2020, 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 @@ -351,10 +351,7 @@ // If this does safepoint polling, then do it here if (do_polling() && ra_->C->is_method_compilation()) { - // mov_slow here is usually one or two instruction - __ mov_address(Rtemp, (address)os::get_polling_page()); - __ relocate(relocInfo::poll_return_type); - __ ldr(Rtemp, Address(Rtemp)); + __ read_polling_page(Rtemp, relocInfo::poll_return_type); } }
--- a/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -86,30 +86,6 @@ //--------------fpu register translations----------------------- -void LIR_Assembler::set_24bit_FPU() { - ShouldNotReachHere(); -} - -void LIR_Assembler::reset_FPU() { - ShouldNotReachHere(); -} - -void LIR_Assembler::fpop() { - Unimplemented(); -} - -void LIR_Assembler::fxch(int i) { - Unimplemented(); -} - -void LIR_Assembler::fld(int i) { - Unimplemented(); -} - -void LIR_Assembler::ffree(int i) { - Unimplemented(); -} - void LIR_Assembler::breakpoint() { __ breakpoint(); } @@ -309,23 +285,16 @@ void LIR_Assembler::return_op(LIR_Opr result) { // Pop the frame before safepoint polling __ remove_frame(initial_frame_size_in_bytes()); - - // mov_slow here is usually one or two instruction - __ mov_address(Rtemp, os::get_polling_page()); - __ relocate(relocInfo::poll_return_type); - __ ldr(Rtemp, Address(Rtemp)); + __ read_polling_page(Rtemp, relocInfo::poll_return_type); __ ret(); } - int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) { - __ mov_address(Rtemp, os::get_polling_page()); if (info != NULL) { add_debug_info_for_branch(info); } int offset = __ offset(); - __ relocate(relocInfo::poll_type); - __ ldr(Rtemp, Address(Rtemp)); + __ read_polling_page(Rtemp, relocInfo::poll_type); return offset; }
--- a/src/hotspot/cpu/arm/globalDefinitions_arm.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/globalDefinitions_arm.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -62,4 +62,6 @@ #endif #endif +#define THREAD_LOCAL_POLL + #endif // CPU_ARM_GLOBALDEFINITIONS_ARM_HPP
--- a/src/hotspot/cpu/arm/interp_masm_arm.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/interp_masm_arm.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -42,6 +42,7 @@ #include "runtime/basicLock.hpp" #include "runtime/biasedLocking.hpp" #include "runtime/frame.inline.hpp" +#include "runtime/safepointMechanism.hpp" #include "runtime/sharedRuntime.hpp" //-------------------------------------------------------------------- @@ -556,7 +557,7 @@ void InterpreterMacroAssembler::dispatch_base(TosState state, DispatchTableMode table_mode, - bool verifyoop) { + bool verifyoop, bool generate_poll) { if (VerifyActivationFrameSize) { Label L; sub(Rtemp, FP, SP); @@ -571,6 +572,18 @@ interp_verify_oop(R0_tos, state, __FILE__, __LINE__); } + Label safepoint; + address* const safepoint_table = Interpreter::safept_table(state); + address* const table = Interpreter::dispatch_table(state); + bool needs_thread_local_poll = generate_poll && + SafepointMechanism::uses_thread_local_poll() && table != safepoint_table; + + if (needs_thread_local_poll) { + NOT_PRODUCT(block_comment("Thread-local Safepoint poll")); + ldr(Rtemp, Address(Rthread, Thread::polling_page_offset())); + tbnz(Rtemp, exact_log2(SafepointMechanism::poll_bit()), safepoint); + } + if((state == itos) || (state == btos) || (state == ztos) || (state == ctos) || (state == stos)) { zap_high_non_significant_bits(R0_tos); } @@ -600,12 +613,18 @@ indirect_jump(Address::indexed_ptr(Rtemp, R3_bytecode), Rtemp); } + if (needs_thread_local_poll) { + bind(safepoint); + lea(Rtemp, ExternalAddress((address)safepoint_table)); + indirect_jump(Address::indexed_ptr(Rtemp, R3_bytecode), Rtemp); + } + nop(); // to avoid filling CPU pipeline with invalid instructions nop(); } -void InterpreterMacroAssembler::dispatch_only(TosState state) { - dispatch_base(state, DispatchDefault); +void InterpreterMacroAssembler::dispatch_only(TosState state, bool generate_poll) { + dispatch_base(state, DispatchDefault, true, generate_poll); } @@ -617,10 +636,10 @@ dispatch_base(state, DispatchNormal, false); } -void InterpreterMacroAssembler::dispatch_next(TosState state, int step) { +void InterpreterMacroAssembler::dispatch_next(TosState state, int step, bool generate_poll) { // load next bytecode and advance Rbcp ldrb(R3_bytecode, Address(Rbcp, step, pre_indexed)); - dispatch_base(state, DispatchDefault); + dispatch_base(state, DispatchDefault, true, generate_poll); } void InterpreterMacroAssembler::narrow(Register result) {
--- a/src/hotspot/cpu/arm/interp_masm_arm.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/interp_masm_arm.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -54,7 +54,7 @@ // base routine for all dispatches typedef enum { DispatchDefault, DispatchNormal } DispatchTableMode; - void dispatch_base(TosState state, DispatchTableMode table_mode, bool verifyoop = true); + void dispatch_base(TosState state, DispatchTableMode table_mode, bool verifyoop = true, bool generate_poll = false); public: InterpreterMacroAssembler(CodeBuffer* code); @@ -160,10 +160,10 @@ // Dispatching void dispatch_prolog(TosState state, int step = 0); void dispatch_epilog(TosState state, int step = 0); - void dispatch_only(TosState state); // dispatch by R3_bytecode - void dispatch_only_normal(TosState state); // dispatch normal table by R3_bytecode + void dispatch_only(TosState state, bool generate_poll = false); // dispatch by R3_bytecode + void dispatch_only_normal(TosState state); // dispatch normal table by R3_bytecode void dispatch_only_noverify(TosState state); - void dispatch_next(TosState state, int step = 0); // load R3_bytecode from [Rbcp + step] and dispatch by R3_bytecode + void dispatch_next(TosState state, int step = 0, bool generate_poll = false); // load R3_bytecode from [Rbcp + step] and dispatch by R3_bytecode // jump to an invoked target void prepare_to_jump_from_interpreted();
--- a/src/hotspot/cpu/arm/macroAssembler_arm.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/macroAssembler_arm.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -2053,4 +2053,32 @@ bind(done); } + +void MacroAssembler::safepoint_poll(Register tmp1, Label& slow_path) { + if (SafepointMechanism::uses_thread_local_poll()) { + ldr_u32(tmp1, Address(Rthread, Thread::polling_page_offset())); + tst(tmp1, exact_log2(SafepointMechanism::poll_bit())); + b(slow_path, eq); + } else { + ldr_global_s32(tmp1, SafepointSynchronize::address_of_state()); + cmp(tmp1, SafepointSynchronize::_not_synchronized); + b(slow_path, ne); + } +} + +void MacroAssembler::get_polling_page(Register dest) { + if (SafepointMechanism::uses_thread_local_poll()) { + ldr(dest, Address(Rthread, Thread::polling_page_offset())); + } else { + mov_address(dest, os::get_polling_page()); + } +} + +void MacroAssembler::read_polling_page(Register dest, relocInfo::relocType rtype) { + get_polling_page(dest); + relocate(rtype); + ldr(dest, Address(dest)); +} + + #endif // COMPILER2
--- a/src/hotspot/cpu/arm/macroAssembler_arm.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/macroAssembler_arm.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -1074,7 +1074,9 @@ void fast_unlock(Register obj, Register box, Register scratch, Register scratch2); #endif - + void safepoint_poll(Register tmp1, Label& slow_path); + void get_polling_page(Register dest); + void read_polling_page(Register dest, relocInfo::relocType rtype); };
--- a/src/hotspot/cpu/arm/sharedRuntime_arm.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/sharedRuntime_arm.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -34,6 +34,7 @@ #include "oops/compiledICHolder.hpp" #include "oops/klass.inline.hpp" #include "runtime/sharedRuntime.hpp" +#include "runtime/safepointMechanism.hpp" #include "runtime/vframeArray.hpp" #include "utilities/align.hpp" #include "vmreg_arm.inline.hpp" @@ -1219,20 +1220,18 @@ } // Do a safepoint check while thread is in transition state - InlinedAddress safepoint_state(SafepointSynchronize::address_of_state()); Label call_safepoint_runtime, return_to_java; __ mov(Rtemp, _thread_in_native_trans); - __ ldr_literal(R2, safepoint_state); __ str_32(Rtemp, Address(Rthread, JavaThread::thread_state_offset())); // make sure the store is observed before reading the SafepointSynchronize state and further mem refs __ membar(MacroAssembler::Membar_mask_bits(MacroAssembler::StoreLoad | MacroAssembler::StoreStore), Rtemp); - __ ldr_s32(R2, Address(R2)); + __ safepoint_poll(R2, call_safepoint_runtime); __ ldr_u32(R3, Address(Rthread, JavaThread::suspend_flags_offset())); - __ cmp(R2, SafepointSynchronize::_not_synchronized); - __ cond_cmp(R3, 0, eq); + __ cmp(R3, 0); __ b(call_safepoint_runtime, ne); + __ bind(return_to_java); // Perform thread state transition and reguard stack yellow pages if needed @@ -1303,8 +1302,6 @@ pop_result_registers(masm, ret_type); __ b(return_to_java); - __ bind_literal(safepoint_state); - // Reguard stack pages. Save native results around a call to C runtime. __ bind(reguard); push_result_registers(masm, ret_type); @@ -1806,15 +1803,29 @@ oop_maps->add_gc_map(pc_offset, map); __ reset_last_Java_frame(Rtemp); // Rtemp free since scratched by far call - // Check for pending exception - __ ldr(Rtemp, Address(Rthread, Thread::pending_exception_offset())); - __ cmp(Rtemp, 0); + if (!cause_return) { + if (SafepointMechanism::uses_thread_local_poll()) { + // If our stashed return pc was modified by the runtime we avoid touching it + __ ldr(R3_tmp, Address(Rthread, JavaThread::saved_exception_pc_offset())); + __ ldr(R2_tmp, Address(SP, RegisterSaver::LR_offset * wordSize)); + __ cmp(R2_tmp, R3_tmp); + // Adjust return pc forward to step over the safepoint poll instruction + __ add(R2_tmp, R2_tmp, 4, eq); + __ str(R2_tmp, Address(SP, RegisterSaver::LR_offset * wordSize), eq); + } - if (!cause_return) { + // Check for pending exception + __ ldr(Rtemp, Address(Rthread, Thread::pending_exception_offset())); + __ cmp(Rtemp, 0); + RegisterSaver::restore_live_registers(masm, false); __ pop(PC, eq); __ pop(Rexception_pc); } else { + // Check for pending exception + __ ldr(Rtemp, Address(Rthread, Thread::pending_exception_offset())); + __ cmp(Rtemp, 0); + RegisterSaver::restore_live_registers(masm); __ bx(LR, eq); __ mov(Rexception_pc, LR);
--- a/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/templateInterpreterGenerator_arm.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -959,8 +959,6 @@ // Force this write out before the read below __ membar(MacroAssembler::StoreLoad, Rtemp); - __ ldr_global_s32(Rtemp, SafepointSynchronize::address_of_state()); - // Protect the return value in the interleaved code: save it to callee-save registers. __ mov(Rsaved_result_lo, R0); __ mov(Rsaved_result_hi, R1); @@ -973,12 +971,16 @@ #endif // __ABI_HARD__ { - __ ldr_u32(R3, Address(Rthread, JavaThread::suspend_flags_offset())); - __ cmp(Rtemp, SafepointSynchronize::_not_synchronized); - __ cond_cmp(R3, 0, eq); + Label call, skip_call; + __ safepoint_poll(Rtemp, call); + __ ldr_u32(R3, Address(Rthread, JavaThread::suspend_flags_offset())); + __ cmp(R3, 0); + __ b(skip_call, eq); + __ bind(call); + __ mov(R0, Rthread); + __ call(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans), relocInfo::none); + __ bind(skip_call); - __ mov(R0, Rthread, ne); - __ call(CAST_FROM_FN_PTR(address, JavaThread::check_special_condition_for_native_trans), relocInfo::none, ne); #if R9_IS_SCRATCHED __ restore_method(); #endif
--- a/src/hotspot/cpu/arm/templateTable_arm.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/arm/templateTable_arm.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2020, 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 @@ -2168,7 +2168,7 @@ } // continue with the bytecode @ target - __ dispatch_only(vtos); + __ dispatch_only(vtos, true); if (UseLoopCounter) { if (ProfileInterpreter) { @@ -2362,7 +2362,7 @@ // load the next bytecode to R3_bytecode and advance Rbcp __ ldrb(R3_bytecode, Address(Rbcp, Roffset, lsl, 0, pre_indexed)); - __ dispatch_only(vtos); + __ dispatch_only(vtos, true); } @@ -2439,7 +2439,7 @@ // load the next bytecode to R3_bytecode and advance Rbcp __ ldrb(R3_bytecode, Address(Rbcp, Roffset, lsl, 0, pre_indexed)); - __ dispatch_only(vtos); + __ dispatch_only(vtos, true); } @@ -2533,7 +2533,7 @@ __ profile_switch_case(R0, i, R1, i); __ byteswap_u32(offset, temp1, temp2); __ ldrb(R3_bytecode, Address(Rbcp, offset, lsl, 0, pre_indexed)); - __ dispatch_only(vtos); + __ dispatch_only(vtos, true); // default case __ bind(default_case); @@ -2541,7 +2541,7 @@ __ ldr_s32(offset, Address(array, -2*BytesPerInt)); __ byteswap_u32(offset, temp1, temp2); __ ldrb(R3_bytecode, Address(Rbcp, offset, lsl, 0, pre_indexed)); - __ dispatch_only(vtos); + __ dispatch_only(vtos, true); }
--- a/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/ppc/c1_LIRAssembler_ppc.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1726,12 +1726,6 @@ } -void LIR_Assembler::fpop() { - Unimplemented(); - // do nothing -} - - void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) { switch (code) { case lir_sqrt: { @@ -2691,16 +2685,6 @@ } } - -void LIR_Assembler::set_24bit_FPU() { - Unimplemented(); -} - -void LIR_Assembler::reset_FPU() { - Unimplemented(); -} - - void LIR_Assembler::breakpoint() { __ illtrap(); } @@ -2894,19 +2878,6 @@ } -void LIR_Assembler::fxch(int i) { - Unimplemented(); -} - -void LIR_Assembler::fld(int i) { - Unimplemented(); -} - -void LIR_Assembler::ffree(int i) { - Unimplemented(); -} - - void LIR_Assembler::rt_call(LIR_Opr result, address dest, const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) { // Stubs: Called via rt_call, but dest is a stub address (no function descriptor).
--- a/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1698,10 +1698,6 @@ } } -void LIR_Assembler::fpop() { - // do nothing -} - void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) { switch (code) { case lir_sqrt: { @@ -2739,14 +2735,6 @@ } } -void LIR_Assembler::set_24bit_FPU() { - ShouldNotCallThis(); // x86 only -} - -void LIR_Assembler::reset_FPU() { - ShouldNotCallThis(); // x86 only -} - void LIR_Assembler::breakpoint() { Unimplemented(); // __ breakpoint_trap(); @@ -2887,18 +2875,6 @@ } } -void LIR_Assembler::fxch(int i) { - ShouldNotCallThis(); // x86 only -} - -void LIR_Assembler::fld(int i) { - ShouldNotCallThis(); // x86 only -} - -void LIR_Assembler::ffree(int i) { - ShouldNotCallThis(); // x86 only -} - void LIR_Assembler::rt_call(LIR_Opr result, address dest, const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) { assert(!tmp->is_valid(), "don't need temporary");
--- a/src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/sparc/c1_LIRAssembler_sparc.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1732,12 +1732,6 @@ } } - -void LIR_Assembler::fpop() { - // do nothing -} - - void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr thread, LIR_Opr dest, LIR_Op* op) { switch (code) { case lir_tan: { @@ -2658,16 +2652,6 @@ } } -void LIR_Assembler::set_24bit_FPU() { - Unimplemented(); -} - - -void LIR_Assembler::reset_FPU() { - Unimplemented(); -} - - void LIR_Assembler::breakpoint() { __ breakpoint_trap(); } @@ -3057,19 +3041,6 @@ } } - -void LIR_Assembler::fxch(int i) { - Unimplemented(); -} - -void LIR_Assembler::fld(int i) { - Unimplemented(); -} - -void LIR_Assembler::ffree(int i) { - Unimplemented(); -} - void LIR_Assembler::rt_call(LIR_Opr result, address dest, const LIR_OprList* args, LIR_Opr tmp, CodeEmitInfo* info) {
--- a/src/hotspot/cpu/x86/assembler_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/assembler_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -7330,9 +7330,7 @@ emit_int8(0x48 | dst->encoding()); } -#endif // _LP64 - -// 64bit typically doesn't use the x87 but needs to for the trig funcs +// 64bit doesn't use the x87 void Assembler::fabs() { emit_int8((unsigned char)0xD9); @@ -7767,6 +7765,7 @@ emit_int8((unsigned char)0xD9); emit_int8((unsigned char)0xEA); } +#endif // !_LP64 // SSE SIMD prefix byte values corresponding to VexSimdPrefix encoding. static int simd_pre[4] = { 0, 0x66, 0xF3, 0xF2 }; @@ -8834,6 +8833,18 @@ emit_operand(dst, src); } +void Assembler::cvttsd2siq(Register dst, Address src) { + NOT_LP64(assert(VM_Version::supports_sse2(), "")); + // F2 REX.W 0F 2C /r + // CVTTSD2SI r64, xmm1/m64 + InstructionMark im(this); + emit_int8((unsigned char)0xF2); + prefix(REX_W); + emit_int8(0x0F); + emit_int8(0x2C); + emit_operand(dst, src); +} + void Assembler::cvttsd2siq(Register dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);
--- a/src/hotspot/cpu/x86/assembler_x86.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/assembler_x86.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1110,6 +1110,7 @@ // Convert with Truncation Scalar Double-Precision Floating-Point Value to Doubleword Integer void cvttsd2sil(Register dst, Address src); void cvttsd2sil(Register dst, XMMRegister src); + void cvttsd2siq(Register dst, Address src); void cvttsd2siq(Register dst, XMMRegister src); // Convert with Truncation Scalar Single-Precision Floating-Point Value to Doubleword Integer @@ -1137,6 +1138,7 @@ void emms(); +#ifndef _LP64 void fabs(); void fadd(int i); @@ -1270,16 +1272,17 @@ void fxch(int i = 1); - void fxrstor(Address src); - void xrstor(Address src); - - void fxsave(Address dst); - void xsave(Address dst); - void fyl2x(); void frndint(); void f2xm1(); void fldl2e(); +#endif // !_LP64 + + void fxrstor(Address src); + void xrstor(Address src); + + void fxsave(Address dst); + void xsave(Address dst); void hlt();
--- a/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_CodeStubs_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -37,6 +37,7 @@ #define __ ce->masm()-> +#ifndef _LP64 float ConversionStub::float_zero = 0.0; double ConversionStub::double_zero = 0.0; @@ -52,7 +53,6 @@ __ comisd(input()->as_xmm_double_reg(), ExternalAddress((address)&double_zero)); } else { - LP64_ONLY(ShouldNotReachHere()); __ push(rax); __ ftst(); __ fnstsw_ax(); @@ -76,6 +76,7 @@ __ bind(do_return); __ jmp(_continuation); } +#endif // !_LP64 void CounterOverflowStub::emit_code(LIR_Assembler* ce) { __ bind(_entry);
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -158,15 +158,7 @@ } } - -void LIR_Assembler::set_24bit_FPU() { - __ fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_24())); -} - -void LIR_Assembler::reset_FPU() { - __ fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); -} - +#ifndef _LP64 void LIR_Assembler::fpop() { __ fpop(); } @@ -182,6 +174,7 @@ void LIR_Assembler::ffree(int i) { __ ffree(i); } +#endif // !_LP64 void LIR_Assembler::breakpoint() { __ int3(); @@ -670,6 +663,7 @@ InternalAddress(float_constant(c->as_jfloat()))); } } else { +#ifndef _LP64 assert(dest->is_single_fpu(), "must be"); assert(dest->fpu_regnr() == 0, "dest must be TOS"); if (c->is_zero_float()) { @@ -679,6 +673,9 @@ } else { __ fld_s (InternalAddress(float_constant(c->as_jfloat()))); } +#else + ShouldNotReachHere(); +#endif // !_LP64 } break; } @@ -692,6 +689,7 @@ InternalAddress(double_constant(c->as_jdouble()))); } } else { +#ifndef _LP64 assert(dest->is_double_fpu(), "must be"); assert(dest->fpu_regnrLo() == 0, "dest must be TOS"); if (c->is_zero_double()) { @@ -701,6 +699,9 @@ } else { __ fld_d (InternalAddress(double_constant(c->as_jdouble()))); } +#else + ShouldNotReachHere(); +#endif // !_LP64 } break; } @@ -892,6 +893,7 @@ } #endif // LP64 +#ifndef _LP64 // special moves from fpu-register to xmm-register // necessary for method results } else if (src->is_single_xmm() && !dest->is_single_xmm()) { @@ -907,6 +909,12 @@ __ fstp_d(Address(rsp, 0)); __ movdbl(dest->as_xmm_double_reg(), Address(rsp, 0)); + // move between fpu-registers (no instruction necessary because of fpu-stack) + } else if (dest->is_single_fpu() || dest->is_double_fpu()) { + assert(src->is_single_fpu() || src->is_double_fpu(), "must match"); + assert(src->fpu() == dest->fpu(), "currently should be nothing to do"); +#endif // !_LP64 + // move between xmm-registers } else if (dest->is_single_xmm()) { assert(src->is_single_xmm(), "must match"); @@ -915,10 +923,6 @@ assert(src->is_double_xmm(), "must match"); __ movdbl(dest->as_xmm_double_reg(), src->as_xmm_double_reg()); - // move between fpu-registers (no instruction necessary because of fpu-stack) - } else if (dest->is_single_fpu() || dest->is_double_fpu()) { - assert(src->is_single_fpu() || src->is_double_fpu(), "must match"); - assert(src->fpu() == dest->fpu(), "currently should be nothing to do"); } else { ShouldNotReachHere(); } @@ -953,6 +957,7 @@ Address dst_addr = frame_map()->address_for_slot(dest->double_stack_ix()); __ movdbl(dst_addr, src->as_xmm_double_reg()); +#ifndef _LP64 } else if (src->is_single_fpu()) { assert(src->fpu_regnr() == 0, "argument must be on TOS"); Address dst_addr = frame_map()->address_for_slot(dest->single_stack_ix()); @@ -964,6 +969,7 @@ Address dst_addr = frame_map()->address_for_slot(dest->double_stack_ix()); if (pop_fpu_stack) __ fstp_d (dst_addr); else __ fst_d (dst_addr); +#endif // !_LP64 } else { ShouldNotReachHere(); @@ -998,6 +1004,10 @@ int null_check_here = code_offset(); switch (type) { case T_FLOAT: { +#ifdef _LP64 + assert(src->is_single_xmm(), "not a float"); + __ movflt(as_Address(to_addr), src->as_xmm_float_reg()); +#else if (src->is_single_xmm()) { __ movflt(as_Address(to_addr), src->as_xmm_float_reg()); } else { @@ -1006,10 +1016,15 @@ if (pop_fpu_stack) __ fstp_s(as_Address(to_addr)); else __ fst_s (as_Address(to_addr)); } +#endif // _LP64 break; } case T_DOUBLE: { +#ifdef _LP64 + assert(src->is_double_xmm(), "not a double"); + __ movdbl(as_Address(to_addr), src->as_xmm_double_reg()); +#else if (src->is_double_xmm()) { __ movdbl(as_Address(to_addr), src->as_xmm_double_reg()); } else { @@ -1018,6 +1033,7 @@ if (pop_fpu_stack) __ fstp_d(as_Address(to_addr)); else __ fst_d (as_Address(to_addr)); } +#endif // _LP64 break; } @@ -1134,6 +1150,7 @@ Address src_addr = frame_map()->address_for_slot(src->double_stack_ix()); __ movdbl(dest->as_xmm_double_reg(), src_addr); +#ifndef _LP64 } else if (dest->is_single_fpu()) { assert(dest->fpu_regnr() == 0, "dest must be TOS"); Address src_addr = frame_map()->address_for_slot(src->single_stack_ix()); @@ -1143,6 +1160,7 @@ assert(dest->fpu_regnrLo() == 0, "dest must be TOS"); Address src_addr = frame_map()->address_for_slot(src->double_stack_ix()); __ fld_d(src_addr); +#endif // _LP64 } else { ShouldNotReachHere(); @@ -1226,9 +1244,13 @@ if (dest->is_single_xmm()) { __ movflt(dest->as_xmm_float_reg(), from_addr); } else { +#ifndef _LP64 assert(dest->is_single_fpu(), "must be"); assert(dest->fpu_regnr() == 0, "dest must be TOS"); __ fld_s(from_addr); +#else + ShouldNotReachHere(); +#endif // !LP64 } break; } @@ -1237,9 +1259,13 @@ if (dest->is_double_xmm()) { __ movdbl(dest->as_xmm_double_reg(), from_addr); } else { +#ifndef _LP64 assert(dest->is_double_fpu(), "must be"); assert(dest->fpu_regnrLo() == 0, "dest must be TOS"); __ fld_d(from_addr); +#else + ShouldNotReachHere(); +#endif // !LP64 } break; } @@ -1495,6 +1521,47 @@ break; +#ifdef _LP64 + case Bytecodes::_f2d: + __ cvtss2sd(dest->as_xmm_double_reg(), src->as_xmm_float_reg()); + break; + + case Bytecodes::_d2f: + __ cvtsd2ss(dest->as_xmm_float_reg(), src->as_xmm_double_reg()); + break; + + case Bytecodes::_i2f: + __ cvtsi2ssl(dest->as_xmm_float_reg(), src->as_register()); + break; + + case Bytecodes::_i2d: + __ cvtsi2sdl(dest->as_xmm_double_reg(), src->as_register()); + break; + + case Bytecodes::_l2f: + __ cvtsi2ssq(dest->as_xmm_float_reg(), src->as_register_lo()); + break; + + case Bytecodes::_l2d: + __ cvtsi2sdq(dest->as_xmm_double_reg(), src->as_register_lo()); + break; + + case Bytecodes::_f2i: + __ convert_f2i(dest->as_register(), src->as_xmm_float_reg()); + break; + + case Bytecodes::_d2i: + __ convert_d2i(dest->as_register(), src->as_xmm_double_reg()); + break; + + case Bytecodes::_f2l: + __ convert_f2l(dest->as_register_lo(), src->as_xmm_float_reg()); + break; + + case Bytecodes::_d2l: + __ convert_d2l(dest->as_register_lo(), src->as_xmm_double_reg()); + break; +#else case Bytecodes::_f2d: case Bytecodes::_d2f: if (dest->is_single_xmm()) { @@ -1520,6 +1587,15 @@ } break; + case Bytecodes::_l2f: + case Bytecodes::_l2d: + assert(!dest->is_xmm_register(), "result in xmm register not supported (no SSE instruction present)"); + assert(dest->fpu() == 0, "result must be on TOS"); + __ movptr(Address(rsp, 0), src->as_register_lo()); + __ movl(Address(rsp, BytesPerWord), src->as_register_hi()); + __ fild_d(Address(rsp, 0)); + // float result is rounded later through spilling + case Bytecodes::_f2i: case Bytecodes::_d2i: if (src->is_single_xmm()) { @@ -1533,7 +1609,6 @@ __ movl(dest->as_register(), Address(rsp, 0)); __ fldcw(ExternalAddress(StubRoutines::addr_fpu_cntrl_wrd_std())); } - // IA32 conversion instructions do not match JLS for overflow, underflow and NaN -> fixup in stub assert(op->stub() != NULL, "stub required"); __ cmpl(dest->as_register(), 0x80000000); @@ -1541,17 +1616,6 @@ __ bind(*op->stub()->continuation()); break; - case Bytecodes::_l2f: - case Bytecodes::_l2d: - assert(!dest->is_xmm_register(), "result in xmm register not supported (no SSE instruction present)"); - assert(dest->fpu() == 0, "result must be on TOS"); - - __ movptr(Address(rsp, 0), src->as_register_lo()); - NOT_LP64(__ movl(Address(rsp, BytesPerWord), src->as_register_hi())); - __ fild_d(Address(rsp, 0)); - // float result is rounded later through spilling - break; - case Bytecodes::_f2l: case Bytecodes::_d2l: assert(!src->is_xmm_register(), "input in xmm register not supported (no SSE instruction present)"); @@ -1563,6 +1627,7 @@ __ call(RuntimeAddress(Runtime1::entry_for(Runtime1::fpu2long_stub_id))); } break; +#endif // _LP64 default: ShouldNotReachHere(); } @@ -2222,6 +2287,7 @@ } } +#ifndef _LP64 } else if (left->is_single_fpu()) { assert(dest->is_single_fpu(), "fpu stack allocation required"); @@ -2297,6 +2363,7 @@ __ fld_x(ExternalAddress(StubRoutines::addr_fpu_subnormal_bias2())); __ fmulp(dest->fpu_regnrLo() + 1); } +#endif // !_LP64 } else if (left->is_single_stack() || left->is_address()) { assert(left == dest, "left and dest must be equal"); @@ -2339,6 +2406,7 @@ } } +#ifndef _LP64 void LIR_Assembler::arith_fpu_implementation(LIR_Code code, int left_index, int right_index, int dest_index, bool pop_fpu_stack) { assert(pop_fpu_stack || (left_index == dest_index || right_index == dest_index), "invalid LIR"); assert(!pop_fpu_stack || (left_index - 1 == dest_index || right_index - 1 == dest_index), "invalid LIR"); @@ -2396,6 +2464,7 @@ ShouldNotReachHere(); } } +#endif // _LP64 void LIR_Assembler::intrinsic_op(LIR_Code code, LIR_Opr value, LIR_Opr tmp, LIR_Opr dest, LIR_Op* op) { @@ -2425,6 +2494,7 @@ default : ShouldNotReachHere(); } +#ifndef _LP64 } else if (value->is_double_fpu()) { assert(value->fpu_regnrLo() == 0 && dest->fpu_regnrLo() == 0, "both must be on TOS"); switch(code) { @@ -2432,6 +2502,7 @@ case lir_sqrt : __ fsqrt(); break; default : ShouldNotReachHere(); } +#endif // !_LP64 } else { Unimplemented(); } @@ -2740,10 +2811,12 @@ ShouldNotReachHere(); } +#ifndef _LP64 } else if(opr1->is_single_fpu() || opr1->is_double_fpu()) { assert(opr1->is_fpu_register() && opr1->fpu() == 0, "currently left-hand side must be on TOS (relax this restriction)"); assert(opr2->is_fpu_register(), "both must be registers"); __ fcmp(noreg, opr2->fpu(), op->fpu_pop_count() > 0, op->fpu_pop_count() > 1); +#endif // LP64 } else if (opr1->is_address() && opr2->is_constant()) { LIR_Const* c = opr2->as_constant_ptr(); @@ -2787,12 +2860,16 @@ __ cmpsd2int(left->as_xmm_double_reg(), right->as_xmm_double_reg(), dst->as_register(), code == lir_ucmp_fd2i); } else { +#ifdef _LP64 + ShouldNotReachHere(); +#else assert(left->is_single_fpu() || left->is_double_fpu(), "must be"); assert(right->is_single_fpu() || right->is_double_fpu(), "must match"); assert(left->fpu() == 0, "left must be on TOS"); __ fcmp2int(dst->as_register(), code == lir_ucmp_fd2i, right->fpu(), op->fpu_pop_count() > 0, op->fpu_pop_count() > 1); +#endif // LP64 } } else { assert(code == lir_cmp_l2i, "check"); @@ -3809,10 +3886,12 @@ __ xorpd(dest->as_xmm_double_reg(), ExternalAddress((address)double_signflip_pool)); } +#ifndef _LP64 } else if (left->is_single_fpu() || left->is_double_fpu()) { assert(left->fpu() == 0, "arg must be on TOS"); assert(dest->fpu() == 0, "dest must be TOS"); __ fchs(); +#endif // !_LP64 } else { ShouldNotReachHere(); @@ -3882,6 +3961,7 @@ ShouldNotReachHere(); } +#ifndef _LP64 } else if (src->is_double_fpu()) { assert(src->fpu_regnrLo() == 0, "must be TOS"); if (dest->is_double_stack()) { @@ -3901,6 +3981,8 @@ } else { ShouldNotReachHere(); } +#endif // !_LP64 + } else { ShouldNotReachHere(); }
--- a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_LIRAssembler_x86.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -29,8 +29,6 @@ Address::ScaleFactor array_element_size(BasicType type) const; - void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, int dest_index, bool pop_fpu_stack); - // helper functions which checks for overflow and sets bailout if it // occurs. Always returns a valid embeddable pointer but in the // bailout case the pointer won't be to unique storage. @@ -62,4 +60,13 @@ void store_parameter(jobject c, int offset_from_esp_in_words); void store_parameter(Metadata* c, int offset_from_esp_in_words); +#ifndef _LP64 + void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, int dest_index, bool pop_fpu_stack); + + void fpop(); + void fxch(int i); + void fld(int i); + void ffree(int i); +#endif // !_LP64 + #endif // CPU_X86_C1_LIRASSEMBLER_X86_HPP
--- a/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_LIRGenerator_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -386,6 +386,42 @@ tmp = new_register(T_DOUBLE); } +#ifdef _LP64 + if (x->op() == Bytecodes::_frem || x->op() == Bytecodes::_drem) { + // frem and drem are implemented as a direct call into the runtime. + LIRItem left(x->x(), this); + LIRItem right(x->y(), this); + + BasicType bt = as_BasicType(x->type()); + BasicTypeList signature(2); + signature.append(bt); + signature.append(bt); + CallingConvention* cc = frame_map()->c_calling_convention(&signature); + + const LIR_Opr result_reg = result_register_for(x->type()); + left.load_item_force(cc->at(0)); + right.load_item_force(cc->at(1)); + + address entry = NULL; + switch (x->op()) { + case Bytecodes::_frem: + entry = CAST_FROM_FN_PTR(address, SharedRuntime::frem); + break; + case Bytecodes::_drem: + entry = CAST_FROM_FN_PTR(address, SharedRuntime::drem); + break; + default: + ShouldNotReachHere(); + } + + LIR_Opr result = rlock_result(x); + __ call_runtime_leaf(entry, getThreadTemp(), result_reg, cc->args()); + __ move(result_reg, result); + } else { + arithmetic_op_fpu(x->op(), reg, left.result(), right.result(), x->is_strictfp(), tmp); + set_result(x, round_item(reg)); + } +#else if ((UseSSE >= 1 && x->op() == Bytecodes::_frem) || (UseSSE >= 2 && x->op() == Bytecodes::_drem)) { // special handling for frem and drem: no SSE instruction, so must use FPU with temporary fpu stack slots LIR_Opr fpu0, fpu1; @@ -404,8 +440,8 @@ } else { arithmetic_op_fpu(x->op(), reg, left.result(), right.result(), x->is_strictfp(), tmp); } - set_result(x, round_item(reg)); +#endif // _LP64 } @@ -444,9 +480,6 @@ case Bytecodes::_ldiv: entry = CAST_FROM_FN_PTR(address, SharedRuntime::ldiv); break; // check if dividend is 0 is done elsewhere - case Bytecodes::_lmul: - entry = CAST_FROM_FN_PTR(address, SharedRuntime::lmul); - break; default: ShouldNotReachHere(); } @@ -1145,6 +1178,15 @@ } void LIRGenerator::do_Convert(Convert* x) { +#ifdef _LP64 + LIRItem value(x->value(), this); + value.load_item(); + LIR_Opr input = value.result(); + LIR_Opr result = rlock(x); + __ convert(x->op(), input, result); + assert(result->is_virtual(), "result must be virtual register"); + set_result(x, result); +#else // flags that vary for the different operations and different SSE-settings bool fixed_input = false, fixed_result = false, round_result = false, needs_stub = false; @@ -1203,6 +1245,7 @@ assert(result->is_virtual(), "result must be virtual register"); set_result(x, result); +#endif // _LP64 }
--- a/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_LinearScan_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -28,6 +28,11 @@ #include "utilities/bitMap.inline.hpp" +#ifdef _LP64 +void LinearScan::allocate_fpu_stack() { + // No FPU stack used on x86-64 +} +#else //---------------------------------------------------------------------- // Allocation of FPU stack slots (Intel x86 only) //---------------------------------------------------------------------- @@ -815,12 +820,6 @@ #ifndef PRODUCT void FpuStackAllocator::check_invalid_lir_op(LIR_Op* op) { switch (op->code()) { - case lir_24bit_FPU: - case lir_reset_FPU: - case lir_ffree: - assert(false, "operations not allowed in lir. If one of these operations is needed, check if they have fpu operands"); - break; - case lir_fpop_raw: case lir_fxch: case lir_fld: @@ -1139,3 +1138,4 @@ return changed; } +#endif // _LP64
--- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -325,12 +325,12 @@ if (PreserveFramePointer) { mov(rbp, rsp); } -#ifdef TIERED - // c2 leaves fpu stack dirty. Clean it on entry +#if !defined(_LP64) && defined(TIERED) if (UseSSE < 2 ) { + // c2 leaves fpu stack dirty. Clean it on entry empty_FPU_stack(); } -#endif // TIERED +#endif // !_LP64 && TIERED decrement(rsp, frame_size_in_bytes); // does not emit code for frame_size == 0 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); @@ -357,7 +357,7 @@ } if (C1Breakpoint)int3(); // build frame - verify_FPU(0, "method_entry"); + IA32_ONLY( verify_FPU(0, "method_entry"); ) } void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
--- a/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -427,6 +427,7 @@ #endif if (save_fpu_registers) { +#ifndef _LP64 if (UseSSE < 2) { // save FPU stack __ fnsave(Address(rsp, fpu_state_off * VMRegImpl::stack_slot_size)); @@ -454,6 +455,7 @@ offset += 8; } } +#endif // !_LP64 if (UseSSE >= 2) { // save XMM registers @@ -473,6 +475,7 @@ __ movdbl(Address(rsp, xmm_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset), xmm_name); offset += 8; } +#ifndef _LP64 } else if (UseSSE == 1) { // save XMM registers as float because double not supported without SSE2(num MMX == num fpu) int offset = 0; @@ -481,26 +484,37 @@ __ movflt(Address(rsp, xmm_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset), xmm_name); offset += 8; } +#endif // !_LP64 } } // FPU stack must be empty now - __ verify_FPU(0, "save_live_registers"); + NOT_LP64( __ verify_FPU(0, "save_live_registers"); ) } #undef __ #define __ sasm-> static void restore_fpu(C1_MacroAssembler* sasm, bool restore_fpu_registers) { +#ifdef _LP64 + if (restore_fpu_registers) { + // restore XMM registers + int xmm_bypass_limit = FrameMap::nof_xmm_regs; + if (UseAVX < 3) { + xmm_bypass_limit = xmm_bypass_limit / 2; + } + int offset = 0; + for (int n = 0; n < xmm_bypass_limit; n++) { + XMMRegister xmm_name = as_XMMRegister(n); + __ movdbl(xmm_name, Address(rsp, xmm_regs_as_doubles_off * VMRegImpl::stack_slot_size + offset)); + offset += 8; + } + } +#else if (restore_fpu_registers) { if (UseSSE >= 2) { // restore XMM registers int xmm_bypass_limit = FrameMap::nof_xmm_regs; -#ifdef _LP64 - if (UseAVX < 3) { - xmm_bypass_limit = xmm_bypass_limit / 2; - } -#endif int offset = 0; for (int n = 0; n < xmm_bypass_limit; n++) { XMMRegister xmm_name = as_XMMRegister(n); @@ -523,11 +537,11 @@ // check that FPU stack is really empty __ verify_FPU(0, "restore_live_registers"); } - } else { // check that FPU stack is really empty __ verify_FPU(0, "restore_live_registers"); } +#endif // _LP64 #ifdef ASSERT { @@ -699,12 +713,12 @@ default: ShouldNotReachHere(); } -#ifdef TIERED - // C2 can leave the fpu stack dirty +#if !defined(_LP64) && defined(TIERED) if (UseSSE < 2) { + // C2 can leave the fpu stack dirty __ empty_FPU_stack(); } -#endif // TIERED +#endif // !_LP64 && TIERED // verify that only rax, and rdx is valid at this time __ invalidate_registers(false, true, true, false, true, true); @@ -806,7 +820,7 @@ #endif // clear the FPU stack in case any FPU results are left behind - __ empty_FPU_stack(); + NOT_LP64( __ empty_FPU_stack(); ) // save exception_oop in callee-saved register to preserve it during runtime calls __ verify_not_null_oop(exception_oop); @@ -1477,11 +1491,23 @@ case fpu2long_stub_id: { +#ifdef _LP64 + Label done; + __ cvttsd2siq(rax, Address(rsp, wordSize)); + __ cmp64(rax, ExternalAddress((address) StubRoutines::x86::double_sign_flip())); + __ jccb(Assembler::notEqual, done); + __ movq(rax, Address(rsp, wordSize)); + __ subptr(rsp, 8); + __ movq(Address(rsp, 0), rax); + __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::d2l_fixup()))); + __ pop(rax); + __ bind(done); + __ ret(0); +#else // rax, and rdx are destroyed, but should be free since the result is returned there // preserve rsi,ecx __ push(rsi); __ push(rcx); - LP64_ONLY(__ push(rdx);) // check for NaN Label return0, do_return, return_min_jlong, do_convert; @@ -1526,46 +1552,29 @@ __ fldz(); __ fcomp_d(value_low_word); __ fnstsw_ax(); -#ifdef _LP64 - __ testl(rax, 0x4100); // ZF & CF == 0 - __ jcc(Assembler::equal, return_min_jlong); -#else __ sahf(); __ jcc(Assembler::above, return_min_jlong); -#endif // _LP64 // return max_jlong -#ifndef _LP64 __ movl(rdx, 0x7fffffff); __ movl(rax, 0xffffffff); -#else - __ mov64(rax, CONST64(0x7fffffffffffffff)); -#endif // _LP64 __ jmp(do_return); __ bind(return_min_jlong); -#ifndef _LP64 __ movl(rdx, 0x80000000); __ xorl(rax, rax); -#else - __ mov64(rax, UCONST64(0x8000000000000000)); -#endif // _LP64 __ jmp(do_return); __ bind(return0); __ fpop(); -#ifndef _LP64 __ xorptr(rdx,rdx); __ xorptr(rax,rax); -#else - __ xorptr(rax, rax); -#endif // _LP64 __ bind(do_return); __ addptr(rsp, 32); - LP64_ONLY(__ pop(rdx);) __ pop(rcx); __ pop(rsi); __ ret(0); +#endif // _LP64 } break;
--- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -349,11 +349,6 @@ pop(rsi); } -void MacroAssembler::pop_fTOS() { - fld_d(Address(rsp, 0)); - addl(rsp, 2 * wordSize); -} - void MacroAssembler::push_callee_saved_registers() { push(rsi); push(rdi); @@ -361,12 +356,6 @@ push(rcx); } -void MacroAssembler::push_fTOS() { - subl(rsp, 2 * wordSize); - fstp_d(Address(rsp, 0)); -} - - void MacroAssembler::pushoop(jobject obj) { push_literal32((int32_t)obj, oop_Relocation::spec_for_immediate()); } @@ -2735,8 +2724,7 @@ } } -// !defined(COMPILER2) is because of stupid core builds -#if !defined(_LP64) || defined(COMPILER1) || !defined(COMPILER2) || INCLUDE_JVMCI +#ifndef _LP64 void MacroAssembler::empty_FPU_stack() { if (VM_Version::supports_mmx()) { emms(); @@ -2744,7 +2732,7 @@ for (int i = 8; i-- > 0; ) ffree(i); } } -#endif // !LP64 || C1 || !C2 || INCLUDE_JVMCI +#endif // !LP64 void MacroAssembler::enter() { @@ -2765,6 +2753,7 @@ } } +#if !defined(_LP64) void MacroAssembler::fcmp(Register tmp) { fcmp(tmp, 1, true, true); } @@ -2846,84 +2835,19 @@ Assembler::fldcw(as_Address(src)); } -void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src) { - if (reachable(src)) { - Assembler::mulpd(dst, as_Address(src)); - } else { - lea(rscratch1, src); - Assembler::mulpd(dst, Address(rscratch1, 0)); - } -} - -void MacroAssembler::increase_precision() { - subptr(rsp, BytesPerWord); - fnstcw(Address(rsp, 0)); - movl(rax, Address(rsp, 0)); - orl(rax, 0x300); - push(rax); - fldcw(Address(rsp, 0)); - pop(rax); -} - -void MacroAssembler::restore_precision() { - fldcw(Address(rsp, 0)); - addptr(rsp, BytesPerWord); -} - void MacroAssembler::fpop() { ffree(); fincstp(); } -void MacroAssembler::load_float(Address src) { - if (UseSSE >= 1) { - movflt(xmm0, src); - } else { - LP64_ONLY(ShouldNotReachHere()); - NOT_LP64(fld_s(src)); - } -} - -void MacroAssembler::store_float(Address dst) { - if (UseSSE >= 1) { - movflt(dst, xmm0); - } else { - LP64_ONLY(ShouldNotReachHere()); - NOT_LP64(fstp_s(dst)); - } -} - -void MacroAssembler::load_double(Address src) { - if (UseSSE >= 2) { - movdbl(xmm0, src); - } else { - LP64_ONLY(ShouldNotReachHere()); - NOT_LP64(fld_d(src)); - } -} - -void MacroAssembler::store_double(Address dst) { - if (UseSSE >= 2) { - movdbl(dst, xmm0); - } else { - LP64_ONLY(ShouldNotReachHere()); - NOT_LP64(fstp_d(dst)); - } -} - void MacroAssembler::fremr(Register tmp) { save_rax(tmp); { Label L; bind(L); fprem(); fwait(); fnstsw_ax(); -#ifdef _LP64 - testl(rax, 0x400); - jcc(Assembler::notEqual, L); -#else sahf(); jcc(Assembler::parity, L); -#endif // _LP64 } restore_rax(tmp); // Result is in ST0. @@ -2932,6 +2856,52 @@ fxch(1); fpop(); } +#endif // !LP64 + +void MacroAssembler::mulpd(XMMRegister dst, AddressLiteral src) { + if (reachable(src)) { + Assembler::mulpd(dst, as_Address(src)); + } else { + lea(rscratch1, src); + Assembler::mulpd(dst, Address(rscratch1, 0)); + } +} + +void MacroAssembler::load_float(Address src) { + if (UseSSE >= 1) { + movflt(xmm0, src); + } else { + LP64_ONLY(ShouldNotReachHere()); + NOT_LP64(fld_s(src)); + } +} + +void MacroAssembler::store_float(Address dst) { + if (UseSSE >= 1) { + movflt(dst, xmm0); + } else { + LP64_ONLY(ShouldNotReachHere()); + NOT_LP64(fstp_s(dst)); + } +} + +void MacroAssembler::load_double(Address src) { + if (UseSSE >= 2) { + movdbl(xmm0, src); + } else { + LP64_ONLY(ShouldNotReachHere()); + NOT_LP64(fld_d(src)); + } +} + +void MacroAssembler::store_double(Address dst) { + if (UseSSE >= 2) { + movdbl(dst, xmm0); + } else { + LP64_ONLY(ShouldNotReachHere()); + NOT_LP64(fstp_d(dst)); + } +} // dst = c = a * b + c void MacroAssembler::fmad(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c) { @@ -5098,6 +5068,7 @@ } +#ifndef _LP64 static bool _verify_FPU(int stack_depth, char* s, CPU_State* state) { static int counter = 0; FPU_State* fs = &state->_fpu_state; @@ -5154,7 +5125,6 @@ return true; } - void MacroAssembler::verify_FPU(int stack_depth, const char* s) { if (!VerifyFPU) return; push_CPU_state(); @@ -5174,6 +5144,7 @@ } pop_CPU_state(); } +#endif // _LP64 void MacroAssembler::restore_cpu_control_state_after_jni() { // Either restore the MXCSR register after returning from the JNI Call @@ -9888,6 +9859,56 @@ } #ifdef _LP64 +void MacroAssembler::convert_f2i(Register dst, XMMRegister src) { + Label done; + cvttss2sil(dst, src); + // Conversion instructions do not match JLS for overflow, underflow and NaN -> fixup in stub + cmpl(dst, 0x80000000); // float_sign_flip + jccb(Assembler::notEqual, done); + subptr(rsp, 8); + movflt(Address(rsp, 0), src); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::f2i_fixup()))); + pop(dst); + bind(done); +} + +void MacroAssembler::convert_d2i(Register dst, XMMRegister src) { + Label done; + cvttsd2sil(dst, src); + // Conversion instructions do not match JLS for overflow, underflow and NaN -> fixup in stub + cmpl(dst, 0x80000000); // float_sign_flip + jccb(Assembler::notEqual, done); + subptr(rsp, 8); + movdbl(Address(rsp, 0), src); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::d2i_fixup()))); + pop(dst); + bind(done); +} + +void MacroAssembler::convert_f2l(Register dst, XMMRegister src) { + Label done; + cvttss2siq(dst, src); + cmp64(dst, ExternalAddress((address) StubRoutines::x86::double_sign_flip())); + jccb(Assembler::notEqual, done); + subptr(rsp, 8); + movflt(Address(rsp, 0), src); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::f2l_fixup()))); + pop(dst); + bind(done); +} + +void MacroAssembler::convert_d2l(Register dst, XMMRegister src) { + Label done; + cvttsd2siq(dst, src); + cmp64(dst, ExternalAddress((address) StubRoutines::x86::double_sign_flip())); + jccb(Assembler::notEqual, done); + subptr(rsp, 8); + movdbl(Address(rsp, 0), src); + call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::d2l_fixup()))); + pop(dst); + bind(done); +} + void MacroAssembler::cache_wb(Address line) { // 64 bit cpus always support clflush @@ -10000,4 +10021,4 @@ } } -#endif +#endif // !WIN32 || _LP64
--- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -426,6 +426,7 @@ // Division by power of 2, rounding towards 0 void division_with_shift(Register reg, int shift_value); +#ifndef _LP64 // Compares the top-most stack entries on the FPU stack and sets the eflags as follows: // // CF (corresponds to C0) if x < y @@ -454,6 +455,10 @@ // tmp is a temporary register, if none is available use noreg void fremr(Register tmp); + // only if +VerifyFPU + void verify_FPU(int stack_depth, const char* s = "illegal FPU state"); +#endif // !LP64 + // dst = c = a * b + c void fmad(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c); void fmaf(XMMRegister dst, XMMRegister a, XMMRegister b, XMMRegister c); @@ -473,9 +478,6 @@ void jC2 (Register tmp, Label& L); void jnC2(Register tmp, Label& L); - // Pop ST (ffree & fincstp combined) - void fpop(); - // Load float value from 'address'. If UseSSE >= 1, the value is loaded into // register xmm0. Otherwise, the value is loaded onto the FPU stack. void load_float(Address src); @@ -492,13 +494,12 @@ // from register xmm0. Otherwise, the value is stored from the FPU stack. void store_double(Address dst); - // pushes double TOS element of FPU stack on CPU stack; pops from FPU stack - void push_fTOS(); - - // pops double TOS element from CPU stack and pushes on FPU stack - void pop_fTOS(); +#ifndef _LP64 + // Pop ST (ffree & fincstp combined) + void fpop(); void empty_FPU_stack(); +#endif // !_LP64 void push_IU_state(); void pop_IU_state(); @@ -609,9 +610,6 @@ #define verify_method_ptr(reg) _verify_method_ptr(reg, "broken method " #reg, __FILE__, __LINE__) #define verify_klass_ptr(reg) _verify_klass_ptr(reg, "broken klass " #reg, __FILE__, __LINE__) - // only if +VerifyFPU - void verify_FPU(int stack_depth, const char* s = "illegal FPU state"); - // Verify or restore cpu control state after JNI call void restore_cpu_control_state_after_jni(); @@ -902,6 +900,7 @@ void comisd(XMMRegister dst, Address src) { Assembler::comisd(dst, src); } void comisd(XMMRegister dst, AddressLiteral src); +#ifndef _LP64 void fadd_s(Address src) { Assembler::fadd_s(src); } void fadd_s(AddressLiteral src) { Assembler::fadd_s(as_Address(src)); } @@ -920,6 +919,7 @@ void fmul_s(Address src) { Assembler::fmul_s(src); } void fmul_s(AddressLiteral src) { Assembler::fmul_s(as_Address(src)); } +#endif // _LP64 void ldmxcsr(Address src) { Assembler::ldmxcsr(src); } void ldmxcsr(AddressLiteral src); @@ -1082,9 +1082,6 @@ Register rax, Register rcx, Register rdx, Register tmp); #endif - void increase_precision(); - void restore_precision(); - private: // these are private because users should be doing movflt/movdbl @@ -1813,6 +1810,11 @@ XMMRegister tmp1, Register tmp2); #ifdef _LP64 + void convert_f2i(Register dst, XMMRegister src); + void convert_d2i(Register dst, XMMRegister src); + void convert_f2l(Register dst, XMMRegister src); + void convert_d2l(Register dst, XMMRegister src); + void cache_wb(Address line); void cache_wbsync(bool is_pre); #endif // _LP64
--- a/src/hotspot/cpu/x86/methodHandles_x86.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/methodHandles_x86.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -604,7 +604,10 @@ // robust stack walking implemented in trace_method_handle_stub. // save FP result, valid at some call sites (adapter_opt_return_float, ...) - __ increment(rsp, -2 * wordSize); + __ decrement(rsp, 2 * wordSize); +#ifdef _LP64 + __ movdbl(Address(rsp, 0), xmm0); +#else if (UseSSE >= 2) { __ movdbl(Address(rsp, 0), xmm0); } else if (UseSSE == 1) { @@ -612,6 +615,7 @@ } else { __ fst_d(Address(rsp, 0)); } +#endif // LP64 // Incoming state: // rcx: method handle @@ -626,6 +630,9 @@ __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, trace_method_handle_stub_wrapper), rsp); __ increment(rsp, sizeof(MethodHandleStubArguments)); +#ifdef _LP64 + __ movdbl(xmm0, Address(rsp, 0)); +#else if (UseSSE >= 2) { __ movdbl(xmm0, Address(rsp, 0)); } else if (UseSSE == 1) { @@ -633,6 +640,7 @@ } else { __ fld_d(Address(rsp, 0)); } +#endif // LP64 __ increment(rsp, 2 * wordSize); __ popa();
--- a/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -6341,6 +6341,16 @@ StubRoutines::x86::_verify_mxcsr_entry = generate_verify_mxcsr(); + StubRoutines::x86::_f2i_fixup = generate_f2i_fixup(); + StubRoutines::x86::_f2l_fixup = generate_f2l_fixup(); + StubRoutines::x86::_d2i_fixup = generate_d2i_fixup(); + StubRoutines::x86::_d2l_fixup = generate_d2l_fixup(); + + StubRoutines::x86::_float_sign_mask = generate_fp_mask("float_sign_mask", 0x7FFFFFFF7FFFFFFF); + StubRoutines::x86::_float_sign_flip = generate_fp_mask("float_sign_flip", 0x8000000080000000); + StubRoutines::x86::_double_sign_mask = generate_fp_mask("double_sign_mask", 0x7FFFFFFFFFFFFFFF); + StubRoutines::x86::_double_sign_flip = generate_fp_mask("double_sign_flip", 0x8000000000000000); + // Build this early so it's available for the interpreter. StubRoutines::_throw_StackOverflowError_entry = generate_throw_exception("StackOverflowError throw_exception", @@ -6364,7 +6374,7 @@ StubRoutines::_crc32c_table_addr = (address)StubRoutines::x86::_crc32c_table; StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(supports_clmul); } - if (VM_Version::supports_sse2() && UseLibmIntrinsic && InlineIntrinsics) { + if (UseLibmIntrinsic && InlineIntrinsics) { if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dsin) || vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dcos) || vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dtan)) { @@ -6432,15 +6442,6 @@ throw_NullPointerException_at_call)); // entry points that are platform specific - StubRoutines::x86::_f2i_fixup = generate_f2i_fixup(); - StubRoutines::x86::_f2l_fixup = generate_f2l_fixup(); - StubRoutines::x86::_d2i_fixup = generate_d2i_fixup(); - StubRoutines::x86::_d2l_fixup = generate_d2l_fixup(); - - StubRoutines::x86::_float_sign_mask = generate_fp_mask("float_sign_mask", 0x7FFFFFFF7FFFFFFF); - StubRoutines::x86::_float_sign_flip = generate_fp_mask("float_sign_flip", 0x8000000080000000); - StubRoutines::x86::_double_sign_mask = generate_fp_mask("double_sign_mask", 0x7FFFFFFFFFFFFFFF); - StubRoutines::x86::_double_sign_flip = generate_fp_mask("double_sign_flip", 0x8000000000000000); StubRoutines::x86::_vector_float_sign_mask = generate_vector_mask("vector_float_sign_mask", 0x7FFFFFFF7FFFFFFF); StubRoutines::x86::_vector_float_sign_flip = generate_vector_mask("vector_float_sign_flip", 0x8000000080000000); StubRoutines::x86::_vector_double_sign_mask = generate_vector_mask("vector_double_sign_mask", 0x7FFFFFFFFFFFFFFF);
--- a/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/templateInterpreterGenerator_x86_64.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -432,25 +432,14 @@ } else { __ call_VM_leaf0(CAST_FROM_FN_PTR(address, SharedRuntime::dtan)); } + } else if (kind == Interpreter::java_lang_math_abs) { + assert(StubRoutines::x86::double_sign_mask() != NULL, "not initialized"); + __ movdbl(xmm0, Address(rsp, wordSize)); + __ andpd(xmm0, ExternalAddress(StubRoutines::x86::double_sign_mask())); } else { - __ fld_d(Address(rsp, wordSize)); - switch (kind) { - case Interpreter::java_lang_math_abs: - __ fabs(); - break; - default: - ShouldNotReachHere(); - } - - // return double result in xmm0 for interpreter and compilers. - __ subptr(rsp, 2*wordSize); - // Round to 64bit precision - __ fstp_d(Address(rsp, 0)); - __ movdbl(xmm0, Address(rsp, 0)); - __ addptr(rsp, 2*wordSize); + ShouldNotReachHere(); } - __ pop(rax); __ mov(rsp, r13); __ jmp(rax);
--- a/src/hotspot/cpu/x86/x86_64.ad Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/cpu/x86/x86_64.ad Thu Jan 30 22:06:12 2020 +0000 @@ -10588,25 +10588,9 @@ %{ match(Set dst (ConvF2I src)); effect(KILL cr); - - format %{ "cvttss2sil $dst, $src\t# f2i\n\t" - "cmpl $dst, #0x80000000\n\t" - "jne,s done\n\t" - "subq rsp, #8\n\t" - "movss [rsp], $src\n\t" - "call f2i_fixup\n\t" - "popq $dst\n" - "done: "%} - ins_encode %{ - Label done; - __ cvttss2sil($dst$$Register, $src$$XMMRegister); - __ cmpl($dst$$Register, 0x80000000); - __ jccb(Assembler::notEqual, done); - __ subptr(rsp, 8); - __ movflt(Address(rsp, 0), $src$$XMMRegister); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::f2i_fixup()))); - __ pop($dst$$Register); - __ bind(done); + format %{ "convert_f2i $dst,$src" %} + ins_encode %{ + __ convert_f2i($dst$$Register, $src$$XMMRegister); %} ins_pipe(pipe_slow); %} @@ -10615,26 +10599,9 @@ %{ match(Set dst (ConvF2L src)); effect(KILL cr); - - format %{ "cvttss2siq $dst, $src\t# f2l\n\t" - "cmpq $dst, [0x8000000000000000]\n\t" - "jne,s done\n\t" - "subq rsp, #8\n\t" - "movss [rsp], $src\n\t" - "call f2l_fixup\n\t" - "popq $dst\n" - "done: "%} - ins_encode %{ - Label done; - __ cvttss2siq($dst$$Register, $src$$XMMRegister); - __ cmp64($dst$$Register, - ExternalAddress((address) StubRoutines::x86::double_sign_flip())); - __ jccb(Assembler::notEqual, done); - __ subptr(rsp, 8); - __ movflt(Address(rsp, 0), $src$$XMMRegister); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::f2l_fixup()))); - __ pop($dst$$Register); - __ bind(done); + format %{ "convert_f2l $dst,$src"%} + ins_encode %{ + __ convert_f2l($dst$$Register, $src$$XMMRegister); %} ins_pipe(pipe_slow); %} @@ -10643,25 +10610,9 @@ %{ match(Set dst (ConvD2I src)); effect(KILL cr); - - format %{ "cvttsd2sil $dst, $src\t# d2i\n\t" - "cmpl $dst, #0x80000000\n\t" - "jne,s done\n\t" - "subq rsp, #8\n\t" - "movsd [rsp], $src\n\t" - "call d2i_fixup\n\t" - "popq $dst\n" - "done: "%} - ins_encode %{ - Label done; - __ cvttsd2sil($dst$$Register, $src$$XMMRegister); - __ cmpl($dst$$Register, 0x80000000); - __ jccb(Assembler::notEqual, done); - __ subptr(rsp, 8); - __ movdbl(Address(rsp, 0), $src$$XMMRegister); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::d2i_fixup()))); - __ pop($dst$$Register); - __ bind(done); + format %{ "convert_d2i $dst,$src"%} + ins_encode %{ + __ convert_d2i($dst$$Register, $src$$XMMRegister); %} ins_pipe(pipe_slow); %} @@ -10670,26 +10621,9 @@ %{ match(Set dst (ConvD2L src)); effect(KILL cr); - - format %{ "cvttsd2siq $dst, $src\t# d2l\n\t" - "cmpq $dst, [0x8000000000000000]\n\t" - "jne,s done\n\t" - "subq rsp, #8\n\t" - "movsd [rsp], $src\n\t" - "call d2l_fixup\n\t" - "popq $dst\n" - "done: "%} - ins_encode %{ - Label done; - __ cvttsd2siq($dst$$Register, $src$$XMMRegister); - __ cmp64($dst$$Register, - ExternalAddress((address) StubRoutines::x86::double_sign_flip())); - __ jccb(Assembler::notEqual, done); - __ subptr(rsp, 8); - __ movdbl(Address(rsp, 0), $src$$XMMRegister); - __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, StubRoutines::x86::d2l_fixup()))); - __ pop($dst$$Register); - __ bind(done); + format %{ "convert_d2l $dst,$src"%} + ins_encode %{ + __ convert_d2l($dst$$Register, $src$$XMMRegister); %} ins_pipe(pipe_slow); %}
--- a/src/hotspot/os/aix/perfMemory_aix.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/aix/perfMemory_aix.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, 2018 SAP SE. All rights reserved. + * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020 SAP SE. 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 @@ -98,8 +98,8 @@ int result; - RESTARTABLE(::open(destfile, O_CREAT|O_WRONLY|O_TRUNC, S_IREAD|S_IWRITE), - result);; + RESTARTABLE(os::open(destfile, O_CREAT|O_WRONLY|O_TRUNC, S_IREAD|S_IWRITE), + result); if (result == OS_ERR) { if (PrintMiscellaneous && Verbose) { warning("Could not create Perfdata save file: %s: %s\n", @@ -248,7 +248,6 @@ return is_statbuf_secure(&statbuf); } -// (Taken over from Solaris to support the O_NOFOLLOW case on AIX.) // Check if the given directory file descriptor is considered a secure // directory for the backing store files. Returns true if the directory // exists and is considered a secure location. Returns false if the path @@ -290,89 +289,6 @@ } } -// Helper functions for open without O_NOFOLLOW which is not present on AIX 5.3/6.1. -// We use the jdk6 implementation here. -#ifndef O_NOFOLLOW -// The O_NOFOLLOW oflag doesn't exist before solaris 5.10, this is to simulate that behaviour -// was done in jdk 5/6 hotspot by Oracle this way -static int open_o_nofollow_impl(const char* path, int oflag, mode_t mode, bool use_mode) { - struct stat orig_st; - struct stat new_st; - bool create; - int error; - int fd; - int result; - - create = false; - - RESTARTABLE(::lstat(path, &orig_st), result); - - if (result == OS_ERR) { - if (errno == ENOENT && (oflag & O_CREAT) != 0) { - // File doesn't exist, but_we want to create it, add O_EXCL flag - // to make sure no-one creates it (or a symlink) before us - // This works as we expect with symlinks, from posix man page: - // 'If O_EXCL and O_CREAT are set, and path names a symbolic - // link, open() shall fail and set errno to [EEXIST]'. - oflag |= O_EXCL; - create = true; - } else { - // File doesn't exist, and we are not creating it. - return OS_ERR; - } - } else { - // lstat success, check if existing file is a link. - if ((orig_st.st_mode & S_IFMT) == S_IFLNK) { - // File is a symlink. - errno = ELOOP; - return OS_ERR; - } - } - - if (use_mode == true) { - RESTARTABLE(::open(path, oflag, mode), fd); - } else { - RESTARTABLE(::open(path, oflag), fd); - } - - if (fd == OS_ERR) { - return fd; - } - - // Can't do inode checks on before/after if we created the file. - if (create == false) { - RESTARTABLE(::fstat(fd, &new_st), result); - if (result == OS_ERR) { - // Keep errno from fstat, in case close also fails. - error = errno; - ::close(fd); - errno = error; - return OS_ERR; - } - - if (orig_st.st_dev != new_st.st_dev || orig_st.st_ino != new_st.st_ino) { - // File was tampered with during race window. - ::close(fd); - errno = EEXIST; - if (PrintMiscellaneous && Verbose) { - warning("possible file tampering attempt detected when opening %s", path); - } - return OS_ERR; - } - } - - return fd; -} - -static int open_o_nofollow(const char* path, int oflag, mode_t mode) { - return open_o_nofollow_impl(path, oflag, mode, true); -} - -static int open_o_nofollow(const char* path, int oflag) { - return open_o_nofollow_impl(path, oflag, 0, false); -} -#endif - // Open the directory of the given path and validate it. // Return a DIR * of the open directory. static DIR *open_directory_secure(const char* dirname) { @@ -383,15 +299,7 @@ // calling opendir() and is_directory_secure() does. int result; DIR *dirp = NULL; - - // No O_NOFOLLOW defined at buildtime, and it is not documented for open; - // so provide a workaround in this case. -#ifdef O_NOFOLLOW RESTARTABLE(::open(dirname, O_RDONLY|O_NOFOLLOW), result); -#else - // workaround (jdk6 coding) - result = open_o_nofollow(dirname, O_RDONLY); -#endif if (result == OS_ERR) { // Directory doesn't exist or is a symlink, so there is nothing to cleanup. @@ -879,15 +787,7 @@ // Cannot use O_TRUNC here; truncation of an existing file has to happen // after the is_file_secure() check below. int result; - - // No O_NOFOLLOW defined at buildtime, and it is not documented for open; - // so provide a workaround in this case. -#ifdef O_NOFOLLOW - RESTARTABLE(::open(filename, O_RDWR|O_CREAT|O_NOFOLLOW, S_IREAD|S_IWRITE), result); -#else - // workaround function (jdk6 code) - result = open_o_nofollow(filename, O_RDWR|O_CREAT, S_IREAD|S_IWRITE); -#endif + RESTARTABLE(os::open(filename, O_RDWR|O_CREAT|O_NOFOLLOW, S_IREAD|S_IWRITE), result); if (result == OS_ERR) { if (PrintMiscellaneous && Verbose) { @@ -944,12 +844,8 @@ // open the file int result; - // provide a workaround in case no O_NOFOLLOW is defined at buildtime -#ifdef O_NOFOLLOW - RESTARTABLE(::open(filename, oflags), result); -#else - result = open_o_nofollow(filename, oflags); -#endif + RESTARTABLE(os::open(filename, oflags, 0), result); + if (result == OS_ERR) { if (errno == ENOENT) { THROW_MSG_(vmSymbols::java_lang_IllegalArgumentException(), @@ -1137,12 +1033,7 @@ // constructs for the file and the shared memory mapping. if (mode == PerfMemory::PERF_MODE_RO) { mmap_prot = PROT_READ; - // No O_NOFOLLOW defined at buildtime, and it is not documented for open. -#ifdef O_NOFOLLOW file_flags = O_RDONLY | O_NOFOLLOW; -#else - file_flags = O_RDONLY; -#endif } else if (mode == PerfMemory::PERF_MODE_RW) { #ifdef LATER
--- a/src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/gc/z/zMountPoint_linux.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -25,6 +25,7 @@ #include "gc/z/zArray.inline.hpp" #include "gc/z/zErrno.hpp" #include "gc/z/zMountPoint_linux.hpp" +#include "runtime/globals.hpp" #include "logging/log.hpp" #include <stdio.h> @@ -34,9 +35,9 @@ #define PROC_SELF_MOUNTINFO "/proc/self/mountinfo" ZMountPoint::ZMountPoint(const char* filesystem, const char** preferred_mountpoints) { - if (ZPath != NULL) { + if (AllocateHeapAt != NULL) { // Use specified path - _path = strdup(ZPath); + _path = strdup(AllocateHeapAt); } else { // Find suitable path _path = find_mountpoint(filesystem, preferred_mountpoints);
--- a/src/hotspot/os/linux/gc/z/zNUMA_linux.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/gc/z/zNUMA_linux.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -21,28 +21,14 @@ * questions. */ +#include "gc/z/zCPU.inline.hpp" #include "gc/z/zErrno.hpp" -#include "gc/z/zCPU.inline.hpp" #include "gc/z/zNUMA.hpp" +#include "gc/z/zSyscall_linux.hpp" #include "runtime/globals.hpp" #include "runtime/os.hpp" #include "utilities/debug.hpp" -#include <unistd.h> -#include <sys/syscall.h> - -#ifndef MPOL_F_NODE -#define MPOL_F_NODE (1<<0) // Return next IL mode instead of node mask -#endif - -#ifndef MPOL_F_ADDR -#define MPOL_F_ADDR (1<<1) // Look up VMA using address -#endif - -static int z_get_mempolicy(uint32_t* mode, const unsigned long *nmask, unsigned long maxnode, uintptr_t addr, int flags) { - return syscall(SYS_get_mempolicy, mode, nmask, maxnode, addr, flags); -} - void ZNUMA::initialize_platform() { _enabled = UseNUMA; } @@ -73,7 +59,7 @@ uint32_t id = (uint32_t)-1; - if (z_get_mempolicy(&id, NULL, 0, addr, MPOL_F_NODE | MPOL_F_ADDR) == -1) { + if (ZSyscall::get_mempolicy((int*)&id, NULL, 0, (void*)addr, MPOL_F_NODE | MPOL_F_ADDR) == -1) { ZErrno err; fatal("Failed to get NUMA id for memory at " PTR_FORMAT " (%s)", addr, err.to_string()); }
--- a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -27,6 +27,7 @@ #include "gc/z/zGlobals.hpp" #include "gc/z/zLargePages.inline.hpp" #include "gc/z/zMountPoint_linux.hpp" +#include "gc/z/zNUMA.inline.hpp" #include "gc/z/zPhysicalMemoryBacking_linux.hpp" #include "gc/z/zSyscall_linux.hpp" #include "logging/log.hpp" @@ -34,6 +35,7 @@ #include "runtime/os.hpp" #include "utilities/align.hpp" #include "utilities/debug.hpp" +#include "utilities/growableArray.hpp" #include <fcntl.h> #include <stdio.h> @@ -209,7 +211,7 @@ // Find mountpoint ZMountPoint mountpoint(filesystem, preferred_mountpoints); if (mountpoint.get() == NULL) { - log_error(gc)("Use -XX:ZPath to specify the path to a %s filesystem", filesystem); + log_error(gc)("Use -XX:AllocateHeapAt to specify the path to a %s filesystem", filesystem); return -1; } @@ -261,7 +263,7 @@ } int ZPhysicalMemoryBacking::create_fd(const char* name) const { - if (ZPath == NULL) { + if (AllocateHeapAt == NULL) { // If the path is not explicitly specified, then we first try to create a memfd file // instead of looking for a tmpfd/hugetlbfs mount point. Note that memfd_create() might // not be supported at all (requires kernel >= 3.17), or it might not support large @@ -596,7 +598,38 @@ return true; } -size_t ZPhysicalMemoryBacking::commit(size_t offset, size_t length) { +static int offset_to_node(size_t offset) { + const GrowableArray<int>* mapping = os::Linux::numa_nindex_to_node(); + const size_t nindex = (offset >> ZGranuleSizeShift) % mapping->length(); + return mapping->at((int)nindex); +} + +size_t ZPhysicalMemoryBacking::commit_numa_interleaved(size_t offset, size_t length) { + size_t committed = 0; + + // Commit one granule at a time, so that each granule + // can be allocated from a different preferred node. + while (committed < length) { + const size_t granule_offset = offset + committed; + + // Setup NUMA policy to allocate memory from a preferred node + os::Linux::numa_set_preferred(offset_to_node(granule_offset)); + + if (!commit_inner(granule_offset, ZGranuleSize)) { + // Failed + break; + } + + committed += ZGranuleSize; + } + + // Restore NUMA policy + os::Linux::numa_set_preferred(-1); + + return committed; +} + +size_t ZPhysicalMemoryBacking::commit_default(size_t offset, size_t length) { // Try to commit the whole region if (commit_inner(offset, length)) { // Success @@ -624,6 +657,16 @@ } } +size_t ZPhysicalMemoryBacking::commit(size_t offset, size_t length) { + if (ZNUMA::is_enabled() && !ZLargePages::is_explicit()) { + // To get granule-level NUMA interleaving when using non-large pages, + // we must explicitly interleave the memory at commit/fallocate time. + return commit_numa_interleaved(offset, length); + } + + return commit_default(offset, length); +} + size_t ZPhysicalMemoryBacking::uncommit(size_t offset, size_t length) { log_trace(gc, heap)("Uncommitting memory: " SIZE_FORMAT "M-" SIZE_FORMAT "M (" SIZE_FORMAT "M)", offset / M, (offset + length) / M, length / M);
--- a/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/gc/z/zPhysicalMemoryBacking_linux.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -57,6 +57,8 @@ ZErrno fallocate(bool punch_hole, size_t offset, size_t length); bool commit_inner(size_t offset, size_t length); + size_t commit_numa_interleaved(size_t offset, size_t length); + size_t commit_default(size_t offset, size_t length); public: ZPhysicalMemoryBacking();
--- a/src/hotspot/os/linux/gc/z/zSyscall_linux.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/gc/z/zSyscall_linux.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -34,3 +34,7 @@ int ZSyscall::fallocate(int fd, int mode, size_t offset, size_t length) { return syscall(SYS_fallocate, fd, mode, offset, length); } + +long ZSyscall::get_mempolicy(int* mode, unsigned long* nodemask, unsigned long maxnode, void* addr, unsigned long flags) { + return syscall(SYS_get_mempolicy, mode, nodemask, maxnode, addr, flags); +}
--- a/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/gc/z/zSyscall_linux.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -26,10 +26,19 @@ #include "memory/allocation.hpp" +// Flags for get_mempolicy() +#ifndef MPOL_F_NODE +#define MPOL_F_NODE (1<<0) +#endif +#ifndef MPOL_F_ADDR +#define MPOL_F_ADDR (1<<1) +#endif + class ZSyscall : public AllStatic { public: - static int memfd_create(const char *name, unsigned int flags); + static int memfd_create(const char* name, unsigned int flags); static int fallocate(int fd, int mode, size_t offset, size_t length); + static long get_mempolicy(int* mode, unsigned long* nodemask, unsigned long maxnode, void* addr, unsigned long flags); }; #endif // OS_LINUX_GC_Z_ZSYSCALL_LINUX_HPP
--- a/src/hotspot/os/linux/os_linux.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/os_linux.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -3163,6 +3163,8 @@ libnuma_v2_dlsym(handle, "numa_get_interleave_mask"))); set_numa_move_pages(CAST_TO_FN_PTR(numa_move_pages_func_t, libnuma_dlsym(handle, "numa_move_pages"))); + set_numa_set_preferred(CAST_TO_FN_PTR(numa_set_preferred_func_t, + libnuma_dlsym(handle, "numa_set_preferred"))); if (numa_available() != -1) { set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes")); @@ -3298,6 +3300,7 @@ os::Linux::numa_get_membind_func_t os::Linux::_numa_get_membind; os::Linux::numa_get_interleave_mask_func_t os::Linux::_numa_get_interleave_mask; os::Linux::numa_move_pages_func_t os::Linux::_numa_move_pages; +os::Linux::numa_set_preferred_func_t os::Linux::_numa_set_preferred; os::Linux::NumaAllocationPolicy os::Linux::_current_numa_policy; unsigned long* os::Linux::_numa_all_nodes; struct bitmask* os::Linux::_numa_all_nodes_ptr;
--- a/src/hotspot/os/linux/os_linux.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/os/linux/os_linux.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -219,7 +219,7 @@ typedef struct bitmask* (*numa_get_membind_func_t)(void); typedef struct bitmask* (*numa_get_interleave_mask_func_t)(void); typedef long (*numa_move_pages_func_t)(int pid, unsigned long count, void **pages, const int *nodes, int *status, int flags); - + typedef void (*numa_set_preferred_func_t)(int node); typedef void (*numa_set_bind_policy_func_t)(int policy); typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); typedef int (*numa_distance_func_t)(int node1, int node2); @@ -238,6 +238,7 @@ static numa_get_membind_func_t _numa_get_membind; static numa_get_interleave_mask_func_t _numa_get_interleave_mask; static numa_move_pages_func_t _numa_move_pages; + static numa_set_preferred_func_t _numa_set_preferred; static unsigned long* _numa_all_nodes; static struct bitmask* _numa_all_nodes_ptr; static struct bitmask* _numa_nodes_ptr; @@ -258,6 +259,7 @@ static void set_numa_get_membind(numa_get_membind_func_t func) { _numa_get_membind = func; } static void set_numa_get_interleave_mask(numa_get_interleave_mask_func_t func) { _numa_get_interleave_mask = func; } static void set_numa_move_pages(numa_move_pages_func_t func) { _numa_move_pages = func; } + static void set_numa_set_preferred(numa_set_preferred_func_t func) { _numa_set_preferred = func; } static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; } static void set_numa_all_nodes_ptr(struct bitmask **ptr) { _numa_all_nodes_ptr = (ptr == NULL ? NULL : *ptr); } static void set_numa_nodes_ptr(struct bitmask **ptr) { _numa_nodes_ptr = (ptr == NULL ? NULL : *ptr); } @@ -315,6 +317,11 @@ _numa_interleave_memory(start, size, _numa_all_nodes); } } + static void numa_set_preferred(int node) { + if (_numa_set_preferred != NULL) { + _numa_set_preferred(node); + } + } static void numa_set_bind_policy(int policy) { if (_numa_set_bind_policy != NULL) { _numa_set_bind_policy(policy); @@ -392,6 +399,10 @@ return false; } } + + static const GrowableArray<int>* numa_nindex_to_node() { + return _nindex_to_node; + } }; #endif // OS_LINUX_OS_LINUX_HPP
--- a/src/hotspot/share/c1/c1_CodeStubs.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_CodeStubs.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -123,6 +123,7 @@ public: ConversionStub(Bytecodes::Code bytecode, LIR_Opr input, LIR_Opr result) : _bytecode(bytecode), _input(input), _result(result) { + NOT_IA32( ShouldNotReachHere(); ) // used only on x86-32 } Bytecodes::Code bytecode() { return _bytecode; }
--- a/src/hotspot/share/c1/c1_LIR.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_LIR.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -424,8 +424,6 @@ case lir_backwardbranch_target: // result and info always invalid case lir_build_frame: // result and info always invalid case lir_fpop_raw: // result and info always invalid - case lir_24bit_FPU: // result and info always invalid - case lir_reset_FPU: // result and info always invalid case lir_breakpoint: // result and info always invalid case lir_membar: // result and info always invalid case lir_membar_acquire: // result and info always invalid @@ -467,7 +465,6 @@ // LIR_Op1 case lir_fxch: // input always valid, result and info always invalid case lir_fld: // input always valid, result and info always invalid - case lir_ffree: // input always valid, result and info always invalid case lir_push: // input always valid, result and info always invalid case lir_pop: // input always valid, result and info always invalid case lir_return: // input always valid, result and info always invalid @@ -1649,14 +1646,11 @@ case lir_osr_entry: s = "osr_entry"; break; case lir_build_frame: s = "build_frm"; break; case lir_fpop_raw: s = "fpop_raw"; break; - case lir_24bit_FPU: s = "24bit_FPU"; break; - case lir_reset_FPU: s = "reset_FPU"; break; case lir_breakpoint: s = "breakpoint"; break; case lir_get_thread: s = "get_thread"; break; // LIR_Op1 case lir_fxch: s = "fxch"; break; case lir_fld: s = "fld"; break; - case lir_ffree: s = "ffree"; break; case lir_push: s = "push"; break; case lir_pop: s = "pop"; break; case lir_null_check: s = "null_check"; break;
--- a/src/hotspot/share/c1/c1_LIR.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_LIR.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -888,8 +888,6 @@ , lir_osr_entry , lir_build_frame , lir_fpop_raw - , lir_24bit_FPU - , lir_reset_FPU , lir_breakpoint , lir_rtcall , lir_membar @@ -905,7 +903,6 @@ , begin_op1 , lir_fxch , lir_fld - , lir_ffree , lir_push , lir_pop , lir_null_check @@ -2232,8 +2229,6 @@ void unlock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub); void lock_object(LIR_Opr hdr, LIR_Opr obj, LIR_Opr lock, LIR_Opr scratch, CodeStub* stub, CodeEmitInfo* info); - void set_24bit_fpu() { append(new LIR_Op0(lir_24bit_FPU )); } - void restore_fpu() { append(new LIR_Op0(lir_reset_FPU )); } void breakpoint() { append(new LIR_Op0(lir_breakpoint)); } void arraycopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length, LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info) { append(new LIR_OpArrayCopy(src, src_pos, dst, dst_pos, length, tmp, expected_type, flags, info)); }
--- a/src/hotspot/share/c1/c1_LIRAssembler.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_LIRAssembler.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -481,7 +481,7 @@ compilation()->set_has_method_handle_invokes(true); } -#if defined(X86) && defined(TIERED) +#if defined(IA32) && defined(TIERED) // C2 leave fpu stack dirty clean it if (UseSSE < 2) { int i; @@ -532,6 +532,7 @@ safepoint_poll(op->in_opr(), op->info()); break; +#ifdef IA32 case lir_fxch: fxch(op->in_opr()->as_jint()); break; @@ -539,10 +540,7 @@ case lir_fld: fld(op->in_opr()->as_jint()); break; - - case lir_ffree: - ffree(op->in_opr()->as_jint()); - break; +#endif // IA32 case lir_branch: break; @@ -636,22 +634,16 @@ osr_entry(); break; - case lir_24bit_FPU: - set_24bit_FPU(); +#ifdef IA32 + case lir_fpop_raw: + fpop(); break; - - case lir_reset_FPU: - reset_FPU(); - break; +#endif // IA32 case lir_breakpoint: breakpoint(); break; - case lir_fpop_raw: - fpop(); - break; - case lir_membar: membar(); break;
--- a/src/hotspot/share/c1/c1_LIRAssembler.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_LIRAssembler.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -105,13 +105,6 @@ ImplicitNullCheckStub* add_debug_info_for_null_check(int pc_offset, CodeEmitInfo* cinfo); ImplicitNullCheckStub* add_debug_info_for_null_check_here(CodeEmitInfo* info); - void set_24bit_FPU(); - void reset_FPU(); - void fpop(); - void fxch(int i); - void fld(int i); - void ffree(int i); - void breakpoint(); void push(LIR_Opr opr); void pop(LIR_Opr opr);
--- a/src/hotspot/share/c1/c1_LinearScan.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_LinearScan.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -90,7 +90,7 @@ , _has_call(0) , _interval_in_loop(0) // initialized later with correct length , _scope_value_cache(0) // initialized later with correct length -#ifdef X86 +#ifdef IA32 , _fpu_stack_allocator(NULL) #endif { @@ -2653,13 +2653,15 @@ #endif } else if (opr->is_single_fpu()) { -#ifdef X86 +#ifdef IA32 // the exact location of fpu stack values is only known // during fpu stack allocation, so the stack allocator object // must be present assert(use_fpu_stack_allocation(), "should not have float stack values without fpu stack allocation (all floats must be SSE2)"); assert(_fpu_stack_allocator != NULL, "must be present"); opr = _fpu_stack_allocator->to_fpu_stack(opr); +#elif defined(AMD64) + assert(false, "FPU not used on x86-64"); #endif Location::Type loc_type = float_saved_as_double ? Location::float_in_dbl : Location::normal; @@ -2764,7 +2766,7 @@ // name for the other half. *first and *second must represent the // least and most significant words, respectively. -#ifdef X86 +#ifdef IA32 // the exact location of fpu stack values is only known // during fpu stack allocation, so the stack allocator object // must be present @@ -2774,6 +2776,9 @@ assert(opr->fpu_regnrLo() == opr->fpu_regnrHi(), "assumed in calculation (only fpu_regnrLo is used)"); #endif +#ifdef AMD64 + assert(false, "FPU not used on x86-64"); +#endif #ifdef SPARC assert(opr->fpu_regnrLo() == opr->fpu_regnrHi() + 1, "assumed in calculation (only fpu_regnrHi is used)"); #endif
--- a/src/hotspot/share/c1/c1_LinearScan.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/c1/c1_LinearScan.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -177,7 +177,7 @@ bool is_interval_in_loop(int interval, int loop) const { return _interval_in_loop.at(interval, loop); } // handling of fpu stack allocation (platform dependent, needed for debug information generation) -#ifdef X86 +#ifdef IA32 FpuStackAllocator* _fpu_stack_allocator; bool use_fpu_stack_allocation() const { return UseSSE < 2 && has_fpu_registers(); } #else
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -2987,6 +2987,19 @@ return false; } + do_collection_pause_at_safepoint_helper(target_pause_time_ms); + if (should_upgrade_to_full_gc(gc_cause())) { + log_info(gc, ergo)("Attempting maximally compacting collection"); + bool result = do_full_collection(false /* explicit gc */, + true /* clear_all_soft_refs */); + // do_full_collection only fails if blocked by GC locker, but + // we've already checked for that above. + assert(result, "invariant"); + } + return true; +} + +void G1CollectedHeap::do_collection_pause_at_safepoint_helper(double target_pause_time_ms) { GCIdMark gc_id_mark; SvcGCMarker sgcm(SvcGCMarker::MINOR); @@ -3174,8 +3187,6 @@ // itself is released in SuspendibleThreadSet::desynchronize(). do_concurrent_mark(); } - - return true; } void G1CollectedHeap::remove_self_forwarding_pointers(G1RedirtyCardsQueueSet* rdcqs) {
--- a/src/hotspot/share/gc/g1/g1CollectedHeap.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/g1/g1CollectedHeap.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2020, 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 @@ -757,11 +757,18 @@ void wait_for_root_region_scanning(); - // The guts of the incremental collection pause, executed by the vm - // thread. It returns false if it is unable to do the collection due - // to the GC locker being active, true otherwise + // Perform an incremental collection at a safepoint, possibly + // followed by a by-policy upgrade to a full collection. Returns + // false if unable to do the collection due to the GC locker being + // active, true otherwise. + // precondition: at safepoint on VM thread + // precondition: !is_gc_active() bool do_collection_pause_at_safepoint(double target_pause_time_ms); + // Helper for do_collection_pause_at_safepoint, containing the guts + // of the incremental collection pause, executed by the vm thread. + void do_collection_pause_at_safepoint_helper(double target_pause_time_ms); + G1HeapVerifier::G1VerifyType young_collection_verify_type() const; void verify_before_young_collection(G1HeapVerifier::G1VerifyType type); void verify_after_young_collection(G1HeapVerifier::G1VerifyType type);
--- a/src/hotspot/share/gc/g1/g1VMOperations.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/g1/g1VMOperations.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -82,20 +82,14 @@ // there is already a concurrent marking cycle in progress. Set flag // to notify the caller and return immediately. _cycle_already_in_progress = true; - } else if (!g1h->do_collection_pause_at_safepoint(_target_pause_time_ms)) { + } else if (g1h->do_collection_pause_at_safepoint(_target_pause_time_ms)) { + _gc_succeeded = true; + } else { // Failure to perform the collection at all occurs because GCLocker is // active, and we have the bad luck to be the collection request that // makes a later _gc_locker collection needed. (Else we would have hit // the GCLocker check in the prologue.) _transient_failure = true; - } else if (g1h->should_upgrade_to_full_gc(_gc_cause)) { - // GC ran, but we're still in trouble and need a full GC. - log_info(gc, ergo)("Attempting maximally compacting collection"); - _gc_succeeded = g1h->do_full_collection(false, /* explicit gc */ - true /* clear_all_soft_refs */); - guarantee(_gc_succeeded, "Elevated collections during the safepoint must always succeed"); - } else { - _gc_succeeded = true; } } @@ -132,20 +126,10 @@ // Try a partial collection of some kind. _gc_succeeded = g1h->do_collection_pause_at_safepoint(_target_pause_time_ms); - if (_gc_succeeded) { - if (_word_size > 0) { - // An allocation had been requested. Do it, eventually trying a stronger - // kind of GC. - _result = g1h->satisfy_failed_allocation(_word_size, &_gc_succeeded); - } else if (g1h->should_upgrade_to_full_gc(_gc_cause)) { - // There has been a request to perform a GC to free some space. We have no - // information on how much memory has been asked for. In case there are - // absolutely no regions left to allocate into, do a maximally compacting full GC. - log_info(gc, ergo)("Attempting maximally compacting collection"); - _gc_succeeded = g1h->do_full_collection(false, /* explicit gc */ - true /* clear_all_soft_refs */); - } - guarantee(_gc_succeeded, "Elevated collections during the safepoint must always succeed."); + if (_gc_succeeded && (_word_size > 0)) { + // An allocation had been requested. Do it, eventually trying a stronger + // kind of GC. + _result = g1h->satisfy_failed_allocation(_word_size, &_gc_succeeded); } }
--- a/src/hotspot/share/gc/g1/g1VMOperations.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/g1/g1VMOperations.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -29,10 +29,6 @@ #include "gc/shared/gcVMOperations.hpp" // VM_operations for the G1 collector. -// VM_GC_Operation: -// - VM_G1Concurrent -// - VM_G1CollectForAllocation -// - VM_G1CollectFull class VM_G1CollectFull : public VM_GC_Operation { bool _gc_succeeded;
--- a/src/hotspot/share/gc/parallel/psCompactionManager.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/parallel/psCompactionManager.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -52,8 +52,7 @@ GrowableArray<size_t >* ParCompactionManager::_shadow_region_array = NULL; Monitor* ParCompactionManager::_shadow_region_monitor = NULL; -ParCompactionManager::ParCompactionManager() : - _action(CopyAndUpdate) { +ParCompactionManager::ParCompactionManager() { ParallelScavengeHeap* heap = ParallelScavengeHeap::heap(); @@ -115,19 +114,6 @@ } } -bool ParCompactionManager::should_update() { - assert(action() != NotValid, "Action is not set"); - return (action() == ParCompactionManager::Update) || - (action() == ParCompactionManager::CopyAndUpdate) || - (action() == ParCompactionManager::UpdateAndCopy); -} - -bool ParCompactionManager::should_copy() { - assert(action() != NotValid, "Action is not set"); - return (action() == ParCompactionManager::Copy) || - (action() == ParCompactionManager::CopyAndUpdate) || - (action() == ParCompactionManager::UpdateAndCopy); -} ParCompactionManager* ParCompactionManager::gc_thread_compaction_manager(uint index) { @@ -199,4 +185,4 @@ void ParCompactionManager::remove_all_shadow_regions() { _shadow_region_array->clear(); -} \ No newline at end of file +}
--- a/src/hotspot/share/gc/parallel/psCompactionManager.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/parallel/psCompactionManager.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -50,16 +50,6 @@ public: -// ------------------------ Don't putback if not needed - // Actions that the compaction manager should take. - enum Action { - Update, - Copy, - UpdateAndCopy, - CopyAndUpdate, - NotValid - }; -// ------------------------ End don't putback if not needed private: // 32-bit: 4K * 8 = 32KiB; 64-bit: 8K * 16 = 128KiB @@ -95,8 +85,6 @@ // See pop/push_shadow_region_mt_safe() below static Monitor* _shadow_region_monitor; - Action _action; - HeapWord* _last_query_beg; oop _last_query_obj; size_t _last_query_ret; @@ -138,9 +126,6 @@ _last_query_ret = 0; } - Action action() { return _action; } - void set_action(Action v) { _action = v; } - // Bitmap query support, cache last query and result HeapWord* last_query_begin() { return _last_query_beg; } oop last_query_object() { return _last_query_obj; }
--- a/src/hotspot/share/gc/shared/taskqueue.inline.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/shared/taskqueue.inline.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -204,11 +204,25 @@ template<class E, MEMFLAGS F, unsigned int N> bool GenericTaskQueue<E, F, N>::pop_global(volatile E& t) { Age oldAge = _age.get(); - // Architectures with weak memory model require a barrier here - // to guarantee that bottom is not older than age, +#ifndef CPU_MULTI_COPY_ATOMIC + // Architectures with non-multi-copy-atomic memory model require a + // full fence here to guarantee that bottom is not older than age, // which is crucial for the correctness of the algorithm. -#ifndef CPU_MULTI_COPY_ATOMIC + // + // We need a full fence here for this case: + // + // Thread1: set bottom (push) + // Thread2: read age, read bottom, set age (pop_global) + // Thread3: read age, read bottom (pop_global) + // + // The requirement is that Thread3 must never read an older bottom + // value than Thread2 after Thread3 has seen the age value from + // Thread2. OrderAccess::fence(); +#else + // Everyone else can make do with a LoadLoad barrier to keep reads + // from _age and _bottom in order. + OrderAccess::loadload(); #endif uint localBot = Atomic::load_acquire(&_bottom); uint n_elems = size(localBot, oldAge.top());
--- a/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/shenandoah/c2/shenandoahSupport.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1799,6 +1799,7 @@ case Op_ConN: case Op_ConP: case Op_Parm: + case Op_CreateEx: return phase->igvn().zerocon(T_OBJECT); default: #ifdef ASSERT
--- a/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/shenandoah/shenandoahBarrierSet.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -260,7 +260,12 @@ ShenandoahMarkingContext* const marking_context = _heap->marking_context(); if (_heap->is_concurrent_root_in_progress() && !marking_context->is_marked(obj)) { - return NULL; + Thread* thr = Thread::current(); + if (thr->is_Java_thread()) { + return NULL; + } else { + return obj; + } } oop fwd = load_reference_barrier_not_null(obj); @@ -277,3 +282,4 @@ clone_barrier(src); } } +
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Red Hat, Inc. All rights reserved. + * Copyright (c) 2015, 2020, Red Hat, Inc. 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 @@ -152,9 +152,9 @@ ShenandoahConcurrentStringDedupRoots::ShenandoahConcurrentStringDedupRoots() { if (ShenandoahStringDedup::is_enabled()) { - StringDedup::gc_prologue(true); StringDedupTable_lock->lock_without_safepoint_check(); StringDedupQueue_lock->lock_without_safepoint_check(); + StringDedup::gc_prologue(true); } }
--- a/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/shenandoah/shenandoahRootProcessor.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -266,7 +266,7 @@ _cld_roots; ShenandoahSerialWeakRoots _serial_weak_roots; ShenandoahWeakRoots<false /*concurrent*/> _weak_roots; - ShenandoahStringDedupRoots _dedup_roots; + ShenandoahConcurrentStringDedupRoots _dedup_roots; ShenandoahCodeCacheRoots<ShenandoahAllCodeRootsIterator> _code_roots; public:
--- a/src/hotspot/share/gc/z/zHeuristics.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/z/zHeuristics.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -28,6 +28,7 @@ #include "logging/log.hpp" #include "runtime/globals.hpp" #include "runtime/os.hpp" +#include "utilities/globalDefinitions.hpp" #include "utilities/powerOfTwo.hpp" void ZHeuristics::set_medium_page_size() { @@ -38,7 +39,7 @@ const size_t min = ZGranuleSize; const size_t max = ZGranuleSize * 16; const size_t unclamped = MaxHeapSize * 0.03125; - const size_t clamped = MIN2(MAX2(min, unclamped), max); + const size_t clamped = clamp(unclamped, min, max); const size_t size = round_down_power_of_2(clamped); if (size > ZPageSizeSmall) {
--- a/src/hotspot/share/gc/z/zNUMA.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/z/zNUMA.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -24,7 +24,6 @@ #include "precompiled.hpp" #include "gc/z/zNUMA.hpp" #include "logging/log.hpp" -#include "runtime/os.hpp" bool ZNUMA::_enabled;
--- a/src/hotspot/share/gc/z/zPage.inline.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/z/zPage.inline.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -136,7 +136,7 @@ inline uint8_t ZPage::numa_id() { if (_numa_id == (uint8_t)-1) { - _numa_id = (uint8_t)ZNUMA::memory_id(ZAddress::good(start())); + _numa_id = ZNUMA::memory_id(ZAddress::good(start())); } return _numa_id;
--- a/src/hotspot/share/gc/z/zPhysicalMemory.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/z/zPhysicalMemory.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -277,8 +277,11 @@ size += segment.size(); } - // Setup NUMA interleaving - if (ZNUMA::is_enabled()) { + // Setup NUMA interleaving for large pages + if (ZNUMA::is_enabled() && ZLargePages::is_explicit()) { + // To get granule-level NUMA interleaving when using large pages, + // we simply let the kernel interleave the memory for us at page + // fault time. os::numa_make_global((char*)addr, size); }
--- a/src/hotspot/share/gc/z/zUtils.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/z/zUtils.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -31,10 +31,6 @@ // Allocation static uintptr_t alloc_aligned(size_t alignment, size_t size); - // Power of two - static size_t round_up_power_of_2(size_t value); - static size_t round_down_power_of_2(size_t value); - // Size conversion static size_t bytes_to_words(size_t size_in_words); static size_t words_to_bytes(size_t size_in_words);
--- a/src/hotspot/share/gc/z/z_globals.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/gc/z/z_globals.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -38,10 +38,6 @@ range, \ constraint) \ \ - experimental(ccstr, ZPath, NULL, \ - "Filesystem path for Java heap backing storage " \ - "(must be a tmpfs or a hugetlbfs filesystem)") \ - \ experimental(double, ZAllocationSpikeTolerance, 2.0, \ "Allocation spike tolerance factor") \ \
--- a/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/jni/jfrJavaSupport.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -46,6 +46,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadSMR.hpp" #include "utilities/growableArray.hpp" +#include "classfile/vmSymbols.hpp" #ifdef ASSERT void JfrJavaSupport::check_java_thread_in_vm(Thread* t) { @@ -763,6 +764,74 @@ return native_thread != NULL ? native_thread->jfr_thread_local()->is_excluded() : is_thread_excluded(thread); } +jobject JfrJavaSupport::get_handler(jobject clazz, TRAPS) { + DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD)); + const oop klass_oop = JNIHandles::resolve(clazz); + assert(klass_oop != NULL, "invariant"); + Klass* klass = java_lang_Class::as_Klass(klass_oop); + HandleMark hm(THREAD); + Handle h_klass_oop(Handle(THREAD, klass->java_mirror())); + InstanceKlass* const instance_klass = static_cast<InstanceKlass*>(klass); + klass->initialize(CHECK_NULL); + + fieldDescriptor event_handler_field; + Klass* f = instance_klass->find_field( + vmSymbols::eventHandler_name(), + vmSymbols::jdk_jfr_internal_handlers_EventHandler_signature(), + true, &event_handler_field); + if (f != NULL) { + oop ret = h_klass_oop->obj_field(event_handler_field.offset()); + return ret != NULL ? JfrJavaSupport::local_jni_handle(ret, THREAD) : NULL; + } + + fieldDescriptor object_field; + Klass* g = instance_klass->find_field( + vmSymbols::eventHandler_name(), + vmSymbols::object_signature(), + true, &object_field); + if (g != NULL) { + oop ret = h_klass_oop->obj_field(object_field.offset()); + return ret != NULL ? JfrJavaSupport::local_jni_handle(ret, THREAD) : NULL; + } + assert(f == NULL && g == NULL, "no handler field for class"); + return NULL; +} + +bool JfrJavaSupport::set_handler(jobject clazz, jobject handler, TRAPS) { + DEBUG_ONLY(JfrJavaSupport::check_java_thread_in_vm(THREAD)); + const oop klass_oop = JNIHandles::resolve(clazz); + assert(klass_oop != NULL, "invariant"); + const oop handler_oop = JNIHandles::resolve(handler); + assert(handler_oop != NULL, "invariant"); + Klass* klass = java_lang_Class::as_Klass(klass_oop); + HandleMark hm(THREAD); + Handle h_klass_oop(Handle(THREAD, klass->java_mirror())); + InstanceKlass* const instance_klass = static_cast<InstanceKlass*>(klass); + klass->initialize(CHECK_false); + + fieldDescriptor event_handler_field; + Klass* f = instance_klass->find_field( + vmSymbols::eventHandler_name(), + vmSymbols::jdk_jfr_internal_handlers_EventHandler_signature(), + true, &event_handler_field); + if (f != NULL) { + h_klass_oop->obj_field_put(event_handler_field.offset(), handler_oop); + return true; + } + + fieldDescriptor object_handler_field; + Klass* g = instance_klass->find_field( + vmSymbols::eventHandler_name(), + vmSymbols::object_signature(), + true, &object_handler_field); + if (g != NULL) { + h_klass_oop->obj_field_put(object_handler_field.offset(), handler_oop); + return true; + } + assert(f == NULL && g == NULL, "no handler field for class"); + return false; +} + void JfrJavaSupport::on_thread_start(Thread* t) { assert(t != NULL, "invariant"); assert(Thread::current() == t, "invariant");
--- a/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/jni/jfrJavaSupport.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -95,6 +95,9 @@ static bool is_excluded(jobject thread); static void on_thread_start(Thread* t); + static jobject get_handler(jobject clazz, TRAPS); + static bool set_handler(jobject clazz, jobject handler, TRAPS); + // critical static void abort(jstring errorMsg, TRAPS); static void uncaught_exception(jthrowable throwable, Thread* t);
--- a/src/hotspot/share/jfr/jni/jfrJniMethod.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/jni/jfrJniMethod.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -341,3 +341,12 @@ return JfrRepository::current_chunk_start_nanos(); JVM_END +JVM_ENTRY_NO_ENV(jobject, jfr_get_handler(JNIEnv * env, jobject jvm, jobject clazz)) + return JfrJavaSupport::get_handler(clazz, thread); +JVM_END + +JVM_ENTRY_NO_ENV(jboolean, jfr_set_handler(JNIEnv * env, jobject jvm, jobject clazz, jobject handler)) + return JfrJavaSupport::set_handler(clazz, handler, thread); +JVM_END + +
--- a/src/hotspot/share/jfr/jni/jfrJniMethod.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/jni/jfrJniMethod.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2020, 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 @@ -144,6 +144,11 @@ jlong JNICALL jfr_chunk_start_nanos(JNIEnv* env, jobject jvm); +jobject JNICALL jfr_get_handler(JNIEnv* env, jobject jvm, jobject clazz); + +jboolean JNICALL jfr_set_handler(JNIEnv* env, jobject jvm, jobject clazz, jobject handler); + + #ifdef __cplusplus } #endif
--- a/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/jni/jfrJniMethodRegistration.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2020, 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 @@ -86,7 +86,9 @@ (char*)"exclude", (char*)"(Ljava/lang/Thread;)V", (void*)jfr_exclude_thread, (char*)"include", (char*)"(Ljava/lang/Thread;)V", (void*)jfr_include_thread, (char*)"isExcluded", (char*)"(Ljava/lang/Thread;)Z", (void*)jfr_is_thread_excluded, - (char*)"getChunkStartNanos", (char*)"()J", (void*)jfr_chunk_start_nanos + (char*)"getChunkStartNanos", (char*)"()J", (void*)jfr_chunk_start_nanos, + (char*)"getHandler", (char*)"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)jfr_get_handler, + (char*)"setHandler", (char*)"(Ljava/lang/Class;Ljdk/jfr/internal/handlers/EventHandler;)Z", (void*)jfr_set_handler }; const size_t method_array_length = sizeof(method) / sizeof(JNINativeMethod);
--- a/src/hotspot/share/jfr/metadata/metadata.xml Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/metadata/metadata.xml Thu Jan 30 22:06:12 2020 +0000 @@ -1023,6 +1023,13 @@ <Field type="ulong" contentType="bytes" name="size" label="Size Written" /> </Event> + <Event name="HeapDump" category="Java Virtual Machine, Diagnostics" label="Heap Dump" stackTrace="true" thread="true"> + <Field type="string" name="destination" label="Destination" /> + <Field type="long" name="size" label="Size" /> + <Field type="boolean" name="gcBeforeDump" label="GC Before Dump" /> + <Field type="boolean" name="onOutOfMemoryError" label="On Out of Memory Error" /> + </Event> + <Type name="DeoptimizationReason" label="Deoptimization Reason"> <Field type="string" name="reason" label="Reason" /> </Type>
--- a/src/hotspot/share/jfr/support/jfrIntrinsics.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/jfr/support/jfrIntrinsics.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -34,7 +34,9 @@ #include "jfr/recorder/checkpoint/types/traceid/jfrTraceIdMacros.hpp" #define JFR_TEMPLATES(template) \ - template(jdk_jfr_internal_JVM, "jdk/jfr/internal/JVM") + template(jdk_jfr_internal_JVM, "jdk/jfr/internal/JVM") \ + template(jdk_jfr_internal_handlers_EventHandler_signature, "Ljdk/jfr/internal/handlers/EventHandler;") \ + template(eventHandler_name, "eventHandler") \ #define JFR_INTRINSICS(do_intrinsic, do_class, do_name, do_signature, do_alias) \ do_intrinsic(_counterTime, jdk_jfr_internal_JVM, counterTime_name, void_long_signature, F_SN) \
--- a/src/hotspot/share/logging/logConfiguration.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/logging/logConfiguration.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, 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 @@ -102,7 +102,6 @@ void LogConfiguration::initialize(jlong vm_start_time) { LogFileOutput::set_file_name_parameters(vm_start_time); - LogDecorations::initialize(vm_start_time); assert(_outputs == NULL, "Should not initialize _outputs before this function, initialize called twice?"); _outputs = NEW_C_HEAP_ARRAY(LogOutput*, 2, mtLogging); _outputs[0] = &StdoutLog;
--- a/src/hotspot/share/logging/logDecorations.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/logging/logDecorations.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -30,7 +30,6 @@ #include "runtime/thread.inline.hpp" #include "services/management.hpp" -jlong LogDecorations::_vm_start_time_millis = 0; const char* volatile LogDecorations::_host_name = NULL; LogDecorations::LogDecorations(LogLevelType level, const LogTagSet &tagset, const LogDecorators &decorators) @@ -38,10 +37,6 @@ create_decorations(decorators); } -void LogDecorations::initialize(jlong vm_start_time) { - _vm_start_time_millis = vm_start_time; -} - const char* LogDecorations::host_name() { const char* host_name = Atomic::load_acquire(&_host_name); if (host_name == NULL) { @@ -97,9 +92,14 @@ ASSERT_AND_RETURN(written, pos) } +// Small helper for uptime conversion +static jlong elapsed_time(int unit_multiplier) { + return (jlong)(os::elapsedTime() * unit_multiplier); +} + char * LogDecorations::create_uptimemillis_decoration(char* pos) { int written = jio_snprintf(pos, DecorationsBufferSize - (pos - _decorations_buffer), - INT64_FORMAT "ms", nanos_to_millis(os::elapsed_counter())); + INT64_FORMAT "ms", elapsed_time(MILLIUNITS)); ASSERT_AND_RETURN(written, pos) } @@ -109,7 +109,7 @@ } char * LogDecorations::create_uptimenanos_decoration(char* pos) { - int written = jio_snprintf(pos, DecorationsBufferSize - (pos - _decorations_buffer), INT64_FORMAT "ns", os::elapsed_counter()); + int written = jio_snprintf(pos, DecorationsBufferSize - (pos - _decorations_buffer), INT64_FORMAT "ns", elapsed_time(NANOUNITS)); ASSERT_AND_RETURN(written, pos) }
--- a/src/hotspot/share/logging/logDecorations.hpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/logging/logDecorations.hpp Thu Jan 30 22:06:12 2020 +0000 @@ -36,7 +36,6 @@ char* _decoration_offset[LogDecorators::Count]; LogLevelType _level; const LogTagSet& _tagset; - static jlong _vm_start_time_millis; static const char* volatile _host_name; const char* host_name(); @@ -47,8 +46,6 @@ #undef DECORATOR public: - static void initialize(jlong vm_start_time); - LogDecorations(LogLevelType level, const LogTagSet& tagset, const LogDecorators& decorators); void set_level(LogLevelType level) {
--- a/src/hotspot/share/prims/unsafe.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/prims/unsafe.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, 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 @@ -360,7 +360,8 @@ UNSAFE_ENTRY(jlong, Unsafe_AllocateMemory0(JNIEnv *env, jobject unsafe, jlong size)) { size_t sz = (size_t)size; - sz = align_up(sz, HeapWordSize); + assert(is_aligned(sz, HeapWordSize), "sz not aligned"); + void* x = os::malloc(sz, mtOther); return addr_to_java(x); @@ -369,7 +370,8 @@ UNSAFE_ENTRY(jlong, Unsafe_ReallocateMemory0(JNIEnv *env, jobject unsafe, jlong addr, jlong size)) { void* p = addr_from_java(addr); size_t sz = (size_t)size; - sz = align_up(sz, HeapWordSize); + + assert(is_aligned(sz, HeapWordSize), "sz not aligned"); void* x = os::realloc(p, sz, mtOther);
--- a/src/hotspot/share/runtime/arguments.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/runtime/arguments.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -2113,12 +2113,6 @@ } #endif - if (!FLAG_IS_DEFAULT(AllocateHeapAt)) { - if ((UseNUMAInterleaving && !FLAG_IS_DEFAULT(UseNUMAInterleaving)) || (UseNUMA && !FLAG_IS_DEFAULT(UseNUMA))) { - log_warning(arguments) ("NUMA support for Heap depends on the file system when AllocateHeapAt option is used.\n"); - } - } - status = status && GCArguments::check_args_consistency(); return status; @@ -4159,9 +4153,7 @@ jint Arguments::adjust_after_os() { if (UseNUMA) { - if (!FLAG_IS_DEFAULT(AllocateHeapAt)) { - FLAG_SET_ERGO(UseNUMA, false); - } else if (UseParallelGC) { + if (UseParallelGC) { if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) { FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M); }
--- a/src/hotspot/share/runtime/mutexLocker.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/runtime/mutexLocker.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2020, 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 @@ -329,7 +329,7 @@ def(NMethodSweeperStats_lock , PaddedMutex , special, true, _safepoint_check_never); def(ThreadsSMRDelete_lock , PaddedMonitor, special, true, _safepoint_check_never); def(ThreadIdTableCreate_lock , PaddedMutex , leaf, false, _safepoint_check_always); - def(SharedDecoder_lock , PaddedMutex , native, false, _safepoint_check_never); + def(SharedDecoder_lock , PaddedMutex , native, true, _safepoint_check_never); def(DCmdFactory_lock , PaddedMutex , leaf, true, _safepoint_check_never); #if INCLUDE_NMT def(NMTQuery_lock , PaddedMutex , max_nonleaf, false, _safepoint_check_always);
--- a/src/hotspot/share/services/heapDumper.cpp Mon Jan 27 10:46:12 2020 +0000 +++ b/src/hotspot/share/services/heapDumper.cpp Thu Jan 30 22:06:12 2020 +0000 @@ -32,6 +32,7 @@ #include "classfile/vmSymbols.hpp" #include "gc/shared/gcLocker.hpp" #include "gc/shared/gcVMOperations.hpp" +#include "jfr/jfrEvents.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" @@ -1952,6 +1953,9 @@ timer()->start(); } + // create JFR event + EventHeapDump event; + // create the dump writer. If the file can be opened then bail DumpWriter writer(path); if (writer.error() != NULL) { @@ -1976,6 +1980,15 @@ writer.close(); set_error(writer.error()); + // emit JFR event + if (error() == NULL) { + event.set_destination(path); + event.set_gcBeforeDump(_gc_before_heap_dump); + event.set_size(writer.bytes_written()); + event.set_onOutOfMemoryError(_oome); + event.commit(); + } + // print message in interactive case if (out != NULL) { timer()->stop();
--- a/src/java.base/share/classes/java/io/ObjectInputFilter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.base/share/classes/java/io/ObjectInputFilter.java Thu Jan 30 22:06:12 2020 +0000 @@ -206,11 +206,10 @@ * <p> * The filter is configured during the initialization of the {@code ObjectInputFilter.Config} * class. For example, by calling {@link #getSerialFilter() Config.getSerialFilter}. - * If the system property {@systemProperty jdk.serialFilter} is defined on the command line, - * it is used to configure the filter. - * If the system property is not defined on the command line, and the - * {@link java.security.Security} property {@code jdk.serialFilter} is defined - * then it is used to configure the filter. + * If the Java virtual machine is started with the system property + * {@systemProperty jdk.serialFilter}, its value is used to configure the filter. + * If the system property is not defined, and the {@link java.security.Security} property + * {@code jdk.serialFilter} is defined then it is used to configure the filter. * Otherwise, the filter is not configured during initialization and * can be set with {@link #setSerialFilter(ObjectInputFilter) Config.setSerialFilter}. * Setting the {@code jdk.serialFilter} with {@link System#setProperty(String, String)
--- a/src/java.base/share/classes/java/net/MulticastSocket.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.base/share/classes/java/net/MulticastSocket.java Thu Jan 30 22:06:12 2020 +0000 @@ -26,6 +26,8 @@ package java.net; import java.io.IOException; +import java.nio.channels.DatagramChannel; +import java.nio.channels.MulticastChannel; import java.util.Collections; import java.util.Enumeration; import java.util.Set; @@ -121,6 +123,13 @@ * </blockquote> * Additional (implementation specific) options may also be supported. * + * @apiNote {@link DatagramChannel} implements the {@link MulticastChannel} interface + * and provides an alternative API for sending and receiving multicast datagrams. + * The {@link MulticastChannel} API supports both {@linkplain + * MulticastChannel#join(InetAddress, NetworkInterface) any-source} and + * {@linkplain MulticastChannel#join(InetAddress, NetworkInterface, InetAddress) + * source-specific} multicast. + * * @author Pavani Diwanji * @since 1.1 */ @@ -438,6 +447,7 @@ * @throws IllegalArgumentException if mcastaddr is {@code null} or is a * SocketAddress subclass not supported by this socket * @see SecurityManager#checkMulticast(InetAddress) + * @see DatagramChannel#join(InetAddress, NetworkInterface) * @since 1.4 */ public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
--- a/src/java.base/share/classes/java/util/stream/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.base/share/classes/java/util/stream/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, 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 @@ -176,7 +176,7 @@ * do: * * <pre>{@code - * int sumOfWeights = widgets.}<code><b>parallelStream()</b></code>{@code + * int sumOfWeights = widgets.<b>parallelStream()</b> * .filter(b -> b.getColor() == RED) * .mapToInt(b -> b.getWeight()) * .sum();
--- a/src/java.base/share/classes/jdk/internal/misc/Unsafe.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.base/share/classes/jdk/internal/misc/Unsafe.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, 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 @@ -584,6 +584,17 @@ /// wrappers for malloc, realloc, free: /** + * Round up allocation size to a multiple of HeapWordSize. + */ + private long alignToHeapWordSize(long bytes) { + if (bytes >= 0) { + return (bytes + ADDRESS_SIZE - 1) & ~(ADDRESS_SIZE - 1); + } else { + throw invalidInput(); + } + } + + /** * Allocates a new block of native memory, of the given size in bytes. The * contents of the memory are uninitialized; they will generally be * garbage. The resulting native pointer will never be zero, and will be @@ -608,6 +619,8 @@ * @see #putByte(long, byte) */ public long allocateMemory(long bytes) { + bytes = alignToHeapWordSize(bytes); + allocateMemoryChecks(bytes); if (bytes == 0) { @@ -661,6 +674,8 @@ * @see #allocateMemory */ public long reallocateMemory(long address, long bytes) { + bytes = alignToHeapWordSize(bytes); + reallocateMemoryChecks(address, bytes); if (bytes == 0) {
--- a/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.smartcardio/share/classes/javax/smartcardio/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2020, 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 @@ -36,7 +36,7 @@ * * <p> * The API is defined by classes in the package - * <code>javax.smartcardio</code>. They can be classified as follows: + * {@code javax.smartcardio}. They can be classified as follows: * * <dl> * <dt>Classes describing the corresponding Smart Card structures
--- a/src/java.sql.rowset/share/classes/com/sun/rowset/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql.rowset/share/classes/com/sun/rowset/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -24,48 +24,48 @@ */ /** - * Provides five standard implementations of the standard JDBC <code>RowSet</code> implementation + * Provides five standard implementations of the standard JDBC {@code RowSet} implementation * interface definitions. These reference implementations are included with the J2SE version - * 1.5 platform and represent the benchmark standard <code>RowSet</code> implementations as verified + * 1.5 platform and represent the benchmark standard {@code RowSet} implementations as verified * by the Test Compatibility Kit (TCK) as mandated by the Java Community Process. * <br> * * <h2>1.0 Available JDBC RowSet Reference Implementations </h2> * The following implementations are provided:<br> * - * <blockquote><code><b>JdbcRowSetImpl</b></code> - The <code>javax.sql.rowset.JdbcRowSet</code> + * <blockquote><b>{@code JdbcRowSetImpl}</b> - The {@code javax.sql.rowset.JdbcRowSet} * interface reference implementation. <br> * <br> - * <code><b>CachedRowSetImpl</b></code> - The <code>javax.sql.rowset.CachedRowSet</code> interface + * <b>{@code CachedRowSetImpl}</b> - The {@code javax.sql.rowset.CachedRowSet} interface * reference implementation.<br> * <br> - * <code><b>WebRowSetImpl</b></code> - The <code>javax.sql.rowset.WebRowSet</code> interface + * <b>{@code WebRowSetImpl}</b> - The {@code javax.sql.rowset.WebRowSet} interface * reference implementation.<br> * <br> - * <code><b>FilteredRowSetImpl</b></code> - The <code>javax.sql.rowset.FilteredRowSet</code> + * <b>{@code FilteredRowSetImpl}</b> - The {@code javax.sql.rowset.FilteredRowSet} * interface reference implementation.<br> * <br> - * <code><b>JoinRowSetImpl</b></code> - The <code>javax.sql.rowset.JoinRowSet</code> interface + * <b>{@code JoinRowSetImpl}</b> - The {@code javax.sql.rowset.JoinRowSet} interface * reference implementation.<br> * </blockquote> * - * All details on their expected behavior, including their interactions with the <code>SyncProvider</code> - * SPI and helper classes are provided in the interface definitions in the <code>javax.sql.rowset</code> + * All details on their expected behavior, including their interactions with the {@code SyncProvider} + * SPI and helper classes are provided in the interface definitions in the {@code javax.sql.rowset} * package specification.<br> * * <h2>2.0 Usage</h2> * The reference implementations represent robust implementations of the standard - * <code>RowSet</code> interfaces defined in the <code>javax.sql.rowset</code> package. - * All disconnected <code>RowSet</code> implementations, such as the <code>CachedRowSetImpl</code> - * and <code>WebRowSetImpl</code>, are flexible enough to use the <code>SyncFactory</code> SPIs to - * leverage non-reference implementation <code>SyncProvider</code> implementations to obtain + * {@code RowSet} interfaces defined in the {@code javax.sql.rowset} package. + * All disconnected {@code RowSet} implementations, such as the {@code CachedRowSetImpl} + * and {@code WebRowSetImpl}, are flexible enough to use the {@code SyncFactory} SPIs to + * leverage non-reference implementation {@code SyncProvider} implementations to obtain * differing synchronization semantics. Furthermore, developers and vendors alike are free * to use these implementations and integrate them into their products just as they * can with to other components of the Java platform.<br> * * <h2>3.0 Extending the JDBC RowSet Implementations</h2> * - * The JDBC <code>RowSet</code> reference implementations are provided as non-final + * The JDBC {@code RowSet} reference implementations are provided as non-final * classes so that any developer can extend them to provide additional features * while maintaining the core required standard functionality and compatibility. It * is anticipated that many vendors and developers will extend the standard feature
--- a/src/java.sql.rowset/share/classes/com/sun/rowset/providers/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql.rowset/share/classes/com/sun/rowset/providers/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -25,39 +25,39 @@ /** * - * Repository for the <code>RowSet</code> reference implementations of the - * <code>SyncProvider</code> abstract class. These implementations provide a - * disconnected <code>RowSet</code> + * Repository for the {@code RowSet} reference implementations of the + * {@code SyncProvider} abstract class. These implementations provide a + * disconnected {@code RowSet} * object with the ability to synchronize the data in the underlying data * source with its data. These implementations are provided as - * the default <code>SyncProvider</code> implementations and are accessible via the - * <code>SyncProvider</code> SPI managed by the <code>SyncFactory</code>. + * the default {@code SyncProvider} implementations and are accessible via the + * {@code SyncProvider} SPI managed by the {@code SyncFactory}. * - * <h2>1.0 <code>SyncProvider</code> Reference Implementations</h2> - * The main job of a <code>SyncProvider</code> implementation is to manage + * <h2>1.0 {@code SyncProvider} Reference Implementations</h2> + * The main job of a {@code SyncProvider} implementation is to manage * the reader and writer mechanisms. - * The <code>SyncProvider</code> SPI, as specified in the <code>javax.sql.rowset.spi</code> - * package, provides a pluggable mechanism by which <code>javax.sql.RowSetReader</code> - * and <code>javax.sql.RowSetWriter</code> implementations can be supplied to a disconnected - * <code>RowSet</code> object. + * The {@code SyncProvider} SPI, as specified in the {@code javax.sql.rowset.spi} + * package, provides a pluggable mechanism by which {@code javax.sql.RowSetReader} + * and {@code javax.sql.RowSetWriter} implementations can be supplied to a disconnected + * {@code RowSet} object. * <P> - * A reader, a <code>javax.sql.RowSetReader</code> - * object, does the work necessary to populate a <code>RowSet</code> object with data. - * A writer, a <code>javax.sql.RowSetWriter</code> object, does the work necessary for - * synchronizing a <code>RowSet</code> object's data with the data in the originating - * source of data. Put another way, a writer writes a <code>RowSet</code> + * A reader, a {@code javax.sql.RowSetReader} + * object, does the work necessary to populate a {@code RowSet} object with data. + * A writer, a {@code javax.sql.RowSetWriter} object, does the work necessary for + * synchronizing a {@code RowSet} object's data with the data in the originating + * source of data. Put another way, a writer writes a {@code RowSet} * object's data back to the data source. * <P> * Generally speaking, the course of events is this. The reader makes a connection to - * the data source and reads the data from a <code>ResultSet</code> object into its - * <code>RowSet</code> object. Then it closes the connection. While - * the <code>RowSet</code> object is disconnected, an application makes some modifications - * to the data and calls the method <code>acceptChanges</code>. At this point, the + * the data source and reads the data from a {@code ResultSet} object into its + * {@code RowSet} object. Then it closes the connection. While + * the {@code RowSet} object is disconnected, an application makes some modifications + * to the data and calls the method {@code acceptChanges}. At this point, the * writer is called to write the changes back to the database table or view * from which the original data came. This is called <i>synchronization</i>. * <P> * If the data in the originating data source has not changed, there is no problem - * with just writing the <code>RowSet</code> object's new data to the data source. + * with just writing the {@code RowSet} object's new data to the data source. * If it has changed, however, there is a conflict that needs to be resolved. One * way to solve the problem is not to let the data in the data source be changed in * the first place, which can be done by setting locks on a row, a table, or the @@ -65,44 +65,44 @@ * very expensive. Another approach, which is at the other end of the spectrum, * is simply to assume that no conflicts will occur and thus do nothing to avoid * conflicts. - * Different <code>SyncProvider</code> implementations may handle synchronization in + * Different {@code SyncProvider} implementations may handle synchronization in * any of these ways, varying from doing no checking for * conflicts, to doing various levels of checking, to guaranteeing that there are no * conflicts. * <P> - * The <code>SyncProvider</code> class offers methods to help a <code>RowSet</code> + * The {@code SyncProvider} class offers methods to help a {@code RowSet} * object discover and manage how a provider handles synchronization. - * The method <code>getProviderGrade</code> returns the + * The method {@code getProviderGrade} returns the * grade of synchronization a provider offers. An application can * direct the provider to use a particular level of locking by calling - * the method <code>setDataSourceLock</code> and specifying the level of locking desired. - * If a <code>RowSet</code> object's data came from an SQL <code>VIEW</code>, an - * application may call the method <code>supportsUpdatableView</code> to - * find out whether the <code>VIEW</code> can be updated. + * the method {@code setDataSourceLock} and specifying the level of locking desired. + * If a {@code RowSet} object's data came from an SQL {@code VIEW}, an + * application may call the method {@code supportsUpdatableView} to + * find out whether the {@code VIEW} can be updated. * <P> * Synchronization is done completely behind the scenes, so it is third party vendors of * synchronization provider implementations who have to take care of this complex task. * Application programmers can decide which provider to use and the level of locking to * be done, but they are free from having to worry about the implementation details. * <P> - * The JDBC <code>RowSet</code> Implementations reference implementation provides two - * implementations of the <code>SyncProvider</code> class: + * The JDBC {@code RowSet} Implementations reference implementation provides two + * implementations of the {@code SyncProvider} class: * * <UL> * <LI> - * <b><code>RIOptimisticProvider</code></b> - provides the <code>javax.sql.RowSetReader</code> - * and <code>javax.sql.RowSetWriter</code> interface implementations and provides + * <b>{@code RIOptimisticProvider}</b> - provides the {@code javax.sql.RowSetReader} + * and {@code javax.sql.RowSetWriter} interface implementations and provides * an optimistic concurrency model for synchronization. This model assumes that there * will be few conflicts and therefore uses a relatively low grade of synchronization. * If no other provider is available, this is the default provider that the - * <code>SyncFactory</code> will supply to a <code>RowSet</code> object. + * {@code SyncFactory} will supply to a {@code RowSet} object. * <br> * <LI> - * <b><code>RIXMLProvider</code></b> - provides the <code>XmlReader</code> (an extension - * of the <code>javax.sql.RowSetReader</code> interface) and the <code>XmlWriter</code> - * (an extension of the <code>javax.sql.RowSetWriter</code> interface) to enable - * <code>WebRowSet</code> objects to write their state to a - * well formed XML document according to the <code>WebRowSet</code> XML schema + * <b>{@code RIXMLProvider}</b> - provides the {@code XmlReader} (an extension + * of the {@code javax.sql.RowSetReader} interface) and the {@code XmlWriter} + * (an extension of the {@code javax.sql.RowSetWriter} interface) to enable + * {@code WebRowSet} objects to write their state to a + * well formed XML document according to the {@code WebRowSet} XML schema * definition.<br> * </UL> * @@ -117,12 +117,12 @@ * properties. The general rule is that a RowSet is required to set only the * properties that it uses.<br> * <br> - * The <code>command</code> property contains the query that determines what - * data a <code>RowSet</code> will contain. Rowsets have methods for setting a query's + * The {@code command} property contains the query that determines what + * data a {@code RowSet} will contain. Rowsets have methods for setting a query's * parameter(s), which means that a query can be executed multiple times with * different parameters to produce different result sets. Or the query can be * changed to something completely new to get a new result set. - * <p>Once a rowset contains the rows from a <code>ResultSet</code> object or some + * <p>Once a rowset contains the rows from a {@code ResultSet} object or some * other data source, its column values can be updated, and its rows can be * inserted or deleted. Any method that causes a change in the rowset's values * or cursor position also notifies any object that has been registered as @@ -134,13 +134,13 @@ * source to keep the rowset and its data source synchronized. Although this * involves many operations behind the scenes, it is completely transparent * to the application programmer and remains the concern of the RowSet provider - * developer. All an application has to do is invoke the method <code>acceptChanges</code>, + * developer. All an application has to do is invoke the method {@code acceptChanges}, * and the data source backing the rowset will be updated to match the current * values in the rowset. </p> * - * <p>A disconnected rowset, such as a <code>CachedRowSet</code> or <code>WebRowSet</code> + * <p>A disconnected rowset, such as a {@code CachedRowSet} or {@code WebRowSet} * object, establishes a connection to populate itself with data from a database - * and then closes the connection. The <code>RowSet</code> object will remain + * and then closes the connection. The {@code RowSet} object will remain * disconnected until it wants to propagate changes back to its database table, * which is optional. To write its changes back to the database (synchronize with * the database), the rowset establishes a connection, write the changes, and then @@ -148,9 +148,9 @@ * </p> * * <h2> 3.0 Other Possible Implementations</h2> - * There are many other possible implementations of the <code>SyncProvider</code> abstract + * There are many other possible implementations of the {@code SyncProvider} abstract * class. One possibility is to employ a more robust synchronization model, which - * would give a <code>RowSet</code> object increased trust in the provider's + * would give a {@code RowSet} object increased trust in the provider's * ability to get any updates back to the original data source. Another possibility * is a more formal synchronization mechanism such as SyncML * (<a href="http://www.syncml.org/">http://www.syncml.org/</a>) <br>
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2020, 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 @@ -24,9 +24,9 @@ */ /** - * Standard interfaces and base classes for JDBC <code>RowSet</code> + * Standard interfaces and base classes for JDBC {@code RowSet} * implementations. This package contains interfaces and classes - * that a standard <code>RowSet</code> implementation either implements or extends. + * that a standard {@code RowSet} implementation either implements or extends. * * <h2>Table of Contents</h2> * <ul> @@ -38,133 +38,133 @@ * </ul> * * <h3><a id="pkgspec">1.0 Package Specification</a></h3> - * This package specifies five standard JDBC <code>RowSet</code> interfaces. + * This package specifies five standard JDBC {@code RowSet} interfaces. * All five extend the * <a href="{@docRoot}/java.sql/javax/sql/RowSet.html">RowSet</a> interface described in the JDBC 3.0 * specification. It is anticipated that additional definitions - * of more specialized JDBC <code>RowSet</code> types will emerge as this technology + * of more specialized JDBC {@code RowSet} types will emerge as this technology * matures. Future definitions <i>should</i> be specified as subinterfaces using * inheritance similar to the way it is used in this specification. * <p> * <i>Note:</i> The interface definitions provided in this package form the basis for - * all compliant JDBC <code>RowSet</code> implementations. Vendors and more advanced - * developers who intend to provide their own compliant <code>RowSet</code> implementations + * all compliant JDBC {@code RowSet} implementations. Vendors and more advanced + * developers who intend to provide their own compliant {@code RowSet} implementations * should pay particular attention to the assertions detailed in specification * interfaces. * * <h3><a id="stdrowset">2.0 Standard RowSet Definitions</a></h3> * <ul> - * <li><a href="JdbcRowSet.html"><b><code>JdbcRowSet</code></b></a> - A wrapper around - * a <code>ResultSet</code> object that makes it possible to use the result set as a + * <li><a href="JdbcRowSet.html"><b>{@code JdbcRowSet}</b></a> - A wrapper around + * a {@code ResultSet} object that makes it possible to use the result set as a * JavaBeans™ component. Thus, - * a <code>JdbcRowSet</code> object can be a Bean that any tool + * a {@code JdbcRowSet} object can be a Bean that any tool * makes available for assembling an application as part of a component based - * architecture. A <code>JdbcRowSet</code> object is a connected <code>RowSet</code> + * architecture. A {@code JdbcRowSet} object is a connected {@code RowSet} * object, that is, it * <b>must</b> continually maintain its connection to its data source using a JDBC - * technology-enabled driver ("JDBC driver"). In addition, a <code>JdbcRowSet</code> + * technology-enabled driver ("JDBC driver"). In addition, a {@code JdbcRowSet} * object provides a fully updatable and scrollable tabular * data structure as defined in the JDBC 3.0 specification. * * <li><a href="CachedRowSet.html"> - * <b><code>CachedRowSet</code>™</b></a> - * - A <code>CachedRowSet</code> object is a JavaBeans™ + * <b>{@code CachedRowSet}™</b></a> + * - A {@code CachedRowSet} object is a JavaBeans™ * component that is scrollable, updatable, serializable, and generally disconnected from - * the source of its data. A <code>CachedRowSet</code> object + * the source of its data. A {@code CachedRowSet} object * typically contains rows from a result set, but it can also contain rows from any - * file with a tabular format, such as a spreadsheet. <code>CachedRowSet</code> implementations - * <b>must</b> use the <code>SyncFactory</code> to manage and obtain pluggable - * <code>SyncProvider</code> objects to provide synchronization between the - * disconnected <code>RowSet</code> object and the originating data source. - * Typically a <code>SyncProvider</code> implementation relies upon a JDBC + * file with a tabular format, such as a spreadsheet. {@code CachedRowSet} implementations + * <b>must</b> use the {@code SyncFactory} to manage and obtain pluggable + * {@code SyncProvider} objects to provide synchronization between the + * disconnected {@code RowSet} object and the originating data source. + * Typically a {@code SyncProvider} implementation relies upon a JDBC * driver to obtain connectivity to a particular data source. * Further details on this mechanism are discussed in the <a - * href="spi/package-summary.html"><code>javax.sql.rowset.spi</code></a> package + * href="spi/package-summary.html">{@code javax.sql.rowset.spi}</a> package * specification. * - * <li><a href="WebRowSet.html"><b><code>WebRowSet</code></b></a> - A - * <code>WebRowSet</code> object is an extension of <code>CachedRowSet</code> - * that can read and write a <code>RowSet</code> object in a well formed XML format. - * This class calls an <a href="spi/XmlReader.html"><code>XmlReader</code></a> object - * (an extension of the <a href="{@docRoot}/java.sql/javax/sql/RowSetReader.html"><code>RowSetReader</code></a> + * <li><a href="WebRowSet.html"><b>{@code WebRowSet}</b></a> - A + * {@code WebRowSet} object is an extension of {@code CachedRowSet} + * that can read and write a {@code RowSet} object in a well formed XML format. + * This class calls an <a href="spi/XmlReader.html">{@code XmlReader}</a> object + * (an extension of the <a href="{@docRoot}/java.sql/javax/sql/RowSetReader.html">{@code RowSetReader}</a> * interface) to read a rowset in XML format. It calls an - * <a href="spi/XmlWriter.html"><code>XmlWriter</code></a> object (an extension of the - * <a href="{@docRoot}/java.sql/javax/sql/RowSetWriter.html"><code>RowSetWriter</code></a> interface) + * <a href="spi/XmlWriter.html">{@code XmlWriter}</a> object (an extension of the + * <a href="{@docRoot}/java.sql/javax/sql/RowSetWriter.html">{@code RowSetWriter}</a> interface) * to write a rowset in XML format. The reader and writer required by - * <code>WebRowSet</code> objects are provided by the - * <code>SyncFactory</code> in the form of <code>SyncProvider</code> + * {@code WebRowSet} objects are provided by the + * {@code SyncFactory} in the form of {@code SyncProvider} * implementations. In order to ensure well formed XML usage, a standard generic XML * Schema is defined and published at * <a href="http://xmlns.jcp.org/xml/ns//jdbc/webrowset.xsd"> - * <code>http://xmlns.jcp.org/xml/ns//jdbc/webrowset.xsd</code></a>. + * {@code http://xmlns.jcp.org/xml/ns//jdbc/webrowset.xsd}</a>. * - * <li><a href="FilteredRowSet.html"><b><code>FilteredRowSet</code></b></a> - A - * <code>FilteredRowSet</code> object provides filtering functionality in a programmatic - * and extensible way. There are many instances when a <code>RowSet</code> <code>object</code> + * <li><a href="FilteredRowSet.html"><b>{@code FilteredRowSet}</b></a> - A + * {@code FilteredRowSet} object provides filtering functionality in a programmatic + * and extensible way. There are many instances when a {@code RowSet} {@code object} * has a need to provide filtering in its contents without sacrificing the disconnected * environment, thus saving the expense of having to create a connection to the data source. * Solutions to this need vary from providing heavyweight full scale * SQL query abilities, to portable components, to more lightweight - * approaches. A <code>FilteredRowSet</code> object consumes - * an implementation of the <a href="Predicate.html"><code>Predicate</code></a> + * approaches. A {@code FilteredRowSet} object consumes + * an implementation of the <a href="Predicate.html">{@code Predicate}</a> * interface, which <b>may</b> define a filter at run time. In turn, a - * <code>FilteredRowSet</code> object is tasked with enforcing the set filter for both + * {@code FilteredRowSet} object is tasked with enforcing the set filter for both * inbound and outbound read and write operations. That is, all filters can be * considered as bi-directional. No standard filters are defined; * however, sufficient mechanics are specified to permit any required filter to be * implemented. * - * <li><a href="JoinRowSet.html"><b><code>JoinRowSet</code></b></a> - The <code>JoinRowSet</code> + * <li><a href="JoinRowSet.html"><b>{@code JoinRowSet}</b></a> - The {@code JoinRowSet} * interface describes a mechanism by which relationships can be established between - * two or more standard <code>RowSet</code> implementations. Any number of <code>RowSet</code> - * objects can be added to a <code>JoinRowSet</code> object provided the <code>RowSet</code>objects - * can be related in a SQL <code>JOIN</code> like fashion. By definition, the SQL <code>JOIN</code> + * two or more standard {@code RowSet} implementations. Any number of {@code RowSet} + * objects can be added to a {@code JoinRowSet} object provided the {@code RowSet}objects + * can be related in a SQL {@code JOIN} like fashion. By definition, the SQL {@code JOIN} * statement is used to combine the data contained in two (<i>or more</i>) relational * database tables based upon a common attribute. By establishing and then enforcing - * column matches, a <code>JoinRowSet</code> object establishes relationships between - * <code>RowSet</code> instances without the need to touch the originating data source. + * column matches, a {@code JoinRowSet} object establishes relationships between + * {@code RowSet} instances without the need to touch the originating data source. * </ul> * * <h3><a id="impl">3.0 Implementer's Guide</a></h3> - * Compliant implementations of JDBC <code>RowSet</code> Implementations + * Compliant implementations of JDBC {@code RowSet} Implementations * <b>must</b> follow the assertions described in this specification. In accordance * with the terms of the <a href="http://www.jcp.org">Java Community Process</a>, a * Test Compatibility Kit (TCK) can be licensed to ensure compatibility with the * specification. The following paragraphs outline a number of starting points for - * implementers of the standard JDBC <code>RowSet</code> definitions. Implementers + * implementers of the standard JDBC {@code RowSet} definitions. Implementers * should also consult the <i>Implementer's Guide</i> in the <a * href="spi/package-summary.html">javax.sql.rowset.spi</a> package for guidelines - * on <a href="spi/SyncProvider.html"><code>SyncProvider</code></a> implementations. + * on <a href="spi/SyncProvider.html">{@code SyncProvider}</a> implementations. * * <ul> * <li><b>3.1 Constructor</b> * <p> - * All <code>RowSet</code> implementations <strong>must</strong> provide a + * All {@code RowSet} implementations <strong>must</strong> provide a * no-argument constructor. * </li> - * <li><b>3.2 Role of the <code>BaseRowSet</code> Class</b> + * <li><b>3.2 Role of the {@code BaseRowSet} Class</b> * <p> - * A compliant JDBC <code>RowSet</code> implementation <b>must</b> implement one or more + * A compliant JDBC {@code RowSet} implementation <b>must</b> implement one or more * standard interfaces specified in this package and <b>may</b> extend the - * <a href="BaseRowSet.html"><code>BaseRowSet</code></a> abstract class. For example, a - * <code>CachedRowSet</code> implementation must implement the <code>CachedRowSet</code> - * interface and extend the <code>BaseRowSet</code> abstract class. The - * <code>BaseRowSet</code> class provides the standard architecture on which all - * <code>RowSet</code> implementations should be built, regardless of whether the - * <code>RowSet</code> objects exist in a connected or disconnected environment. - * The <code>BaseRowSet</code> abstract class provides any <code>RowSet</code> implementation + * <a href="BaseRowSet.html">{@code BaseRowSet}</a> abstract class. For example, a + * {@code CachedRowSet} implementation must implement the {@code CachedRowSet} + * interface and extend the {@code BaseRowSet} abstract class. The + * {@code BaseRowSet} class provides the standard architecture on which all + * {@code RowSet} implementations should be built, regardless of whether the + * {@code RowSet} objects exist in a connected or disconnected environment. + * The {@code BaseRowSet} abstract class provides any {@code RowSet} implementation * with its base functionality, including property manipulation and event notification * that is fully compliant with * <a href="https://www.oracle.com/technetwork/java/javase/documentation/spec-136004.html">JavaBeans</a> * component requirements. As an example, all implementations provided in the - * reference implementations (contained in the <code>com.sun.rowset</code> package) use - * the <code>BaseRowSet</code> class as a basis for their implementations. + * reference implementations (contained in the {@code com.sun.rowset} package) use + * the {@code BaseRowSet} class as a basis for their implementations. * <P> - * The following table illustrates the features that the <code>BaseRowSet</code> + * The following table illustrates the features that the {@code BaseRowSet} * abstract class provides. * <blockquote> * <table class="striped" style="vertical-align:top; width:75%"> - * <caption>Features in <code>BaseRowSet</code></caption> + * <caption>Features in {@code BaseRowSet}</caption> * <thead> * <tr> * <th scope="col">Feature</th> @@ -175,15 +175,15 @@ * <tr> * <th scope="row">Properties</th> * <td>Provides standard JavaBeans property manipulation - * mechanisms to allow applications to get and set <code>RowSet</code> command and - * property values. Refer to the documentation of the <code>javax.sql.RowSet</code> + * mechanisms to allow applications to get and set {@code RowSet} command and + * property values. Refer to the documentation of the {@code javax.sql.RowSet} * interface (available in the JDBC 3.0 specification) for more details on - * the standard <code>RowSet</code> properties.</td> + * the standard {@code RowSet} properties.</td> * </tr> * <tr> * <th scope="row">Event notification</th> * <td>Provides standard JavaBeans event notifications - * to registered event listeners. Refer to the documentation of <code>javax.sql.RowSetEvent</code> + * to registered event listeners. Refer to the documentation of {@code javax.sql.RowSetEvent} * interface (available in the JDBC 3.0 specification) for * more details on how to register and handle standard RowSet events generated * by compliant implementations.</td> @@ -204,70 +204,70 @@ * * <li><b>3.3 Connected RowSet Requirements</b> * <p> - * The <code>JdbcRowSet</code> describes a <code>RowSet</code> object that <b>must</b> always - * be connected to the originating data source. Implementations of the <code>JdbcRowSet</code> + * The {@code JdbcRowSet} describes a {@code RowSet} object that <b>must</b> always + * be connected to the originating data source. Implementations of the {@code JdbcRowSet} * should ensure that this connection is provided solely by a JDBC driver. - * Furthermore, <code>RowSet</code> objects that are implementations of the - * <code>JdbcRowSet</code> interface and are therefore operating in a connected environment - * do not use the <code>SyncFactory</code> to obtain a <code>RowSetReader</code> object - * or a <code>RowSetWriter</code> object. They can safely rely on the JDBC driver to + * Furthermore, {@code RowSet} objects that are implementations of the + * {@code JdbcRowSet} interface and are therefore operating in a connected environment + * do not use the {@code SyncFactory} to obtain a {@code RowSetReader} object + * or a {@code RowSetWriter} object. They can safely rely on the JDBC driver to * supply their needs by virtue of the presence of an underlying updatable and scrollable - * <code>ResultSet</code> implementation. + * {@code ResultSet} implementation. * * <li> * <b>3.4 Disconnected RowSet Requirements</b> * <p> - * A disconnected <code>RowSet</code> object, such as a <code>CachedRowSet</code> object, + * A disconnected {@code RowSet} object, such as a {@code CachedRowSet} object, * <b>should</b> delegate - * connection management to a <code>SyncProvider</code> object provided by the - * <code>SyncFactory</code>. To ensure fully disconnected semantics, all - * disconnected <code>RowSet</code> objects <b>must</b> ensure - * that the original connection made to the data source to populate the <code>RowSet</code> + * connection management to a {@code SyncProvider} object provided by the + * {@code SyncFactory}. To ensure fully disconnected semantics, all + * disconnected {@code RowSet} objects <b>must</b> ensure + * that the original connection made to the data source to populate the {@code RowSet} * object is closed to permit the garbage collector to recover and release resources. The - * <code>SyncProvider</code> object ensures that the critical JDBC properties are + * {@code SyncProvider} object ensures that the critical JDBC properties are * maintained in order to re-establish a connection to the data source when a - * synchronization is required. A disconnected <code>RowSet</code> object should + * synchronization is required. A disconnected {@code RowSet} object should * therefore ensure that no - * extraneous references remain on the <code>Connection</code> object. + * extraneous references remain on the {@code Connection} object. * * <li><b>3.5 Role of RowSetMetaDataImpl</b> * <p> - * The <code>RowsetMetaDataImpl</code> class is a utility class that provides an implementation of the + * The {@code RowsetMetaDataImpl} class is a utility class that provides an implementation of the * <a href="{@docRoot}/java.sql/javax/sql/RowSetMetaData.html">RowSetMetaData</a> interface, supplying standard setter * method implementations for metadata for both connected and disconnected - * <code>RowSet</code> objects. All implementations are free to use this standard + * {@code RowSet} objects. All implementations are free to use this standard * implementation but are not required to do so. * * <li><b>3.6 RowSetWarning Class</b> * <p> - * The <code>RowSetWarning</code> class provides warnings that can be set - * on <code>RowSet</code> implementations. + * The {@code RowSetWarning} class provides warnings that can be set + * on {@code RowSet} implementations. * Similar to <a href="{@docRoot}/java.sql/java/sql/SQLWarning.html">SQLWarning</a> objects, - * <code>RowSetWarning</code> objects are silently chained to the object whose method - * caused the warning to be thrown. All <code>RowSet</code> implementations <b>should</b> + * {@code RowSetWarning} objects are silently chained to the object whose method + * caused the warning to be thrown. All {@code RowSet} implementations <b>should</b> * ensure that this chaining occurs if a warning is generated and also ensure that the - * warnings are available via the <code>getRowSetWarnings</code> method defined in either - * the <code>JdbcRowSet</code> interface or the <code>CachedRowSet</code> interface. + * warnings are available via the {@code getRowSetWarnings} method defined in either + * the {@code JdbcRowSet} interface or the {@code CachedRowSet} interface. * After a warning has been retrieved with one of the - * <code>getRowSetWarnings</code> methods, the <code>RowSetWarning</code> method - * <code>getNextWarning</code> can be called on it to retrieve any warnings that might - * be chained on it. If a warning is returned, <code>getNextWarning</code> can be called + * {@code getRowSetWarnings} methods, the {@code RowSetWarning} method + * {@code getNextWarning} can be called on it to retrieve any warnings that might + * be chained on it. If a warning is returned, {@code getNextWarning} can be called * on it, and so on until there are no more warnings. * * <li><b>3.7 The Joinable Interface</b> * <P> - * The <code>Joinable</code> interface provides both connected and disconnected - * <code>RowSet</code> objects with the capability to be added to a - * <code>JoinRowSet</code> object in an SQL <code>JOIN</code> operation. - * A <code>RowSet</code> object that has implemented the <code>Joinable</code> + * The {@code Joinable} interface provides both connected and disconnected + * {@code RowSet} objects with the capability to be added to a + * {@code JoinRowSet} object in an SQL {@code JOIN} operation. + * A {@code RowSet} object that has implemented the {@code Joinable} * interface can set a match column, retrieve a match column, or unset a match column. - * A <code>JoinRowSet</code> object can then use the <code>RowSet</code> object's - * match column as a basis for adding the <code>RowSet</code> object. + * A {@code JoinRowSet} object can then use the {@code RowSet} object's + * match column as a basis for adding the {@code RowSet} object. * </li> * * <li><b>3.8 The RowSetFactory Interface</b> * <p> - * A <code>RowSetFactory</code> implementation <strong>must</strong> + * A {@code RowSetFactory} implementation <strong>must</strong> * be provided. * </li> * </ul>
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/serial/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -26,11 +26,11 @@ /** * Provides utility classes to allow serializable mappings between SQL types * and data types in the Java programming language. - * <p> Standard JDBC <code>RowSet</code> implementations may use these utility + * <p> Standard JDBC {@code RowSet} implementations may use these utility * classes to - * assist in the serialization of disconnected <code>RowSet</code> objects. + * assist in the serialization of disconnected {@code RowSet} objects. * This is useful - * when transmitting a disconnected <code>RowSet</code> object over the wire to + * when transmitting a disconnected {@code RowSet} object over the wire to * a different VM or across layers within an application.<br> * </p> * @@ -38,40 +38,40 @@ * A serializable mapping in the Java programming language of an SQL ARRAY * value. <br> * <br> - * The <code>SerialArray</code> class provides a constructor for creating a <code>SerialArray</code> + * The {@code SerialArray} class provides a constructor for creating a {@code SerialArray} * instance from an Array object, methods for getting the base type and * the SQL name for the base type, and methods for copying all or part of a - * <code>SerialArray</code> object. <br> + * {@code SerialArray} object. <br> * * <h2>2.0 SerialBlob</h2> * A serializable mapping in the Java programming language of an SQL BLOB * value. <br> * <br> - * The <code>SerialBlob</code>class provides a constructor for creating an instance + * The {@code SerialBlob} class provides a constructor for creating an instance * from a Blob object. Note that the Blob object should have brought the SQL - * BLOB value's data over to the client before a <code>SerialBlob</code>object + * BLOB value's data over to the client before a {@code SerialBlob} object * is constructed from it. The data of an SQL BLOB value can be materialized - * on the client as an array of bytes (using the method <code>Blob.getBytes</code>) - * or as a stream of uninterpreted bytes (using the method <code>Blob.getBinaryStream</code>). + * on the client as an array of bytes (using the method {@code Blob.getBytes}) + * or as a stream of uninterpreted bytes (using the method {@code Blob.getBinaryStream}). * <br> * <br> - * <code>SerialBlob</code> methods make it possible to make a copy of a <code>SerialBlob</code> + * {@code SerialBlob} methods make it possible to make a copy of a {@code SerialBlob} * object as an array of bytes or as a stream. They also make it possible - * to locate a given pattern of bytes or a <code>Blob</code> object within a <code>SerialBlob</code> + * to locate a given pattern of bytes or a {@code Blob} object within a {@code SerialBlob} * object. <br> * * <h2>3.0 SerialClob</h2> * A serializable mapping in the Java programming language of an SQL CLOB * value. <br> * <br> - * The <code>SerialClob</code> class provides a constructor for creating an instance - * from a <code>Clob</code> object. Note that the <code>Clob</code> object should have - * brought the SQL CLOB value's data over to the client before a <code>SerialClob</code> + * The {@code SerialClob} class provides a constructor for creating an instance + * from a {@code Clob} object. Note that the {@code Clob} object should have + * brought the SQL CLOB value's data over to the client before a {@code SerialClob} * object is constructed from it. The data of an SQL CLOB value can be * materialized on the client as a stream of Unicode characters. <br> * <br> - * <code>SerialClob</code> methods make it possible to get a substring from a - * <code>SerialClob</code> object or to locate the start of a pattern of characters. + * {@code SerialClob} methods make it possible to get a substring from a + * {@code SerialClob} object or to locate the start of a pattern of characters. * <br> * * <h2>5.0 SerialDatalink</h2> @@ -79,11 +79,12 @@ * value. A DATALINK value references a file outside of the underlying data source * that the originating data source manages. <br> * <br> - * <code>RowSet</code> implementations can use the method <code>RowSet.getURL()</code> to retrieve - * a <code>java.net.URL</code> object, which can be used to manipulate the external data. + * {@code RowSet} implementations can use the method {@code RowSet.getURL()} to retrieve + * a {@code java.net.URL} object, which can be used to manipulate the external data. * <br> - * <br> - * <code> java.net.URL url = rowset.getURL(1);</code><br> + * <PRE> + * java.net.URL url = rowset.getURL(1); + * </PRE> * * <h2>6.0 SerialJavaObject</h2> * A serializable mapping in the Java programming language of an SQL JAVA_OBJECT @@ -94,15 +95,15 @@ * object is not immediately serializable, this class will attempt to serialize * all non static members to permit the object instance state to be serialized. * Static or transient fields cannot be serialized and attempting to do so - * will result in a <code>SerialException</code> being thrown. <br> + * will result in a {@code SerialException} being thrown. <br> * * <h2>7.0 SerialRef</h2> * A serializable mapping between the SQL REF type and the Java programming * language. <br> * <br> - * The <code>SerialRef</code> class provides a constructor for creating a <code>SerialRef</code> - * instance from a <code>Ref</code> type and provides methods for getting - * and setting the <code>Ref</code> object type. <br> + * The {@code SerialRef} class provides a constructor for creating a {@code SerialRef} + * instance from a {@code Ref} type and provides methods for getting + * and setting the {@code Ref} object type. <br> * * <h2>8.0 SerialStruct</h2> * A serializable mapping in the Java programming language of an SQL structured @@ -110,36 +111,36 @@ * form, and if an attribute is itself a structured type, each of its attributes * that is not already serializable is mapped to a serializable form. <br> * <br> - * In addition, if a <code>Map</code> object is passed to one of the constructors or - * to the method <code>getAttributes</code>, the structured type is custom mapped - * according to the mapping specified in the <code>Map</code> object. + * In addition, if a {@code Map} object is passed to one of the constructors or + * to the method {@code getAttributes}, the structured type is custom mapped + * according to the mapping specified in the {@code Map} object. * <br> - * The <code>SerialStruct</code> class provides a constructor for creating an - * instance from a <code>Struct</code> object, a method for retrieving the SQL + * The {@code SerialStruct} class provides a constructor for creating an + * instance from a {@code Struct} object, a method for retrieving the SQL * type name of the SQL structured type in the database, and methods for retrieving * its attribute values. <br> * * <h2>9.0 SQLInputImpl</h2> * An input stream used for custom mapping user-defined types (UDTs). An - * <code>SQLInputImpl</code> object is an input stream that contains a stream of + * {@code SQLInputImpl} object is an input stream that contains a stream of * values that are * the attributes of a UDT. This class is used by the driver behind the scenes - * when the method <code>getObject</code> is called on an SQL structured or distinct - * type that has a custom mapping; a programmer never invokes <code>SQLInputImpl</code> + * when the method {@code getObject} is called on an SQL structured or distinct + * type that has a custom mapping; a programmer never invokes {@code SQLInputImpl} * methods directly. <br> * <br> - * The <code>SQLInputImpl</code> class provides a set of reader methods - * analogous to the <code>ResultSet</code> getter methods. These methods make it - * possible to read the values in an <code>SQLInputImpl</code> object. The method - * <code>wasNull</code> is used to determine whether the last value read was SQL NULL. + * The {@code SQLInputImpl} class provides a set of reader methods + * analogous to the {@code ResultSet} getter methods. These methods make it + * possible to read the values in an {@code SQLInputImpl} object. The method + * {@code wasNull} is used to determine whether the last value read was SQL NULL. * <br> * <br> - * When a constructor or getter method that takes a <code>Map</code> object is called, + * When a constructor or getter method that takes a {@code Map} object is called, * the JDBC driver calls the method - * <code>SQLData.getSQLType</code> to determine the SQL type of the UDT being custom - * mapped. The driver creates an instance of <code>SQLInputImpl</code>, populating it with + * {@code SQLData.getSQLType} to determine the SQL type of the UDT being custom + * mapped. The driver creates an instance of {@code SQLInputImpl}, populating it with * the attributes of the UDT. The driver then passes the input stream to the - * method <code>SQLData.readSQL</code>, which in turn calls the <code>SQLInputImpl</code> + * method {@code SQLData.readSQL}, which in turn calls the {@code SQLInputImpl} * methods to read the attributes from the input stream. <br> * * <h2>10.0 SQLOutputImpl</h2> @@ -148,16 +149,16 @@ * and its methods are never directly invoked by an application programmer. * <br> * <br> - * When an application calls the method <code>PreparedStatement.setObject</code>, the + * When an application calls the method {@code PreparedStatement.setObject}, the * driver checks to see whether the value to be written is a UDT with a custom * mapping. If it is, there will be an entry in a type map containing the Class - * object for the class that implements <code>SQLData</code> for this UDT. If the - * value to be written is an instance of <code>SQLData</code>, the driver will - * create an instance of <code>SQLOutputImpl</code> and pass it to the method - * <code>SQLData.writeSQL</code>. - * The method <code>writeSQL</code> in turn calls the appropriate <code>SQLOutputImpl</code> - * writer methods to write data from the <code>SQLData</code> object to the - * <code>SQLOutputImpl</code> + * object for the class that implements {@code SQLData} for this UDT. If the + * value to be written is an instance of {@code SQLData}, the driver will + * create an instance of {@code SQLOutputImpl} and pass it to the method + * {@code SQLData.writeSQL}. + * The method {@code writeSQL} in turn calls the appropriate {@code SQLOutputImpl} + * writer methods to write data from the {@code SQLData} object to the + * {@code SQLOutputImpl} * output stream as the representation of an SQL user-defined type. * * <h2>Custom Mapping</h2> @@ -167,12 +168,12 @@ * (A DISTINCT type can thought of as having one attribute.) However, there are * many other possibilities, and there may be any number of different mappings. * <P> - * A programmer defines the mapping by implementing the interface <code>SQLData</code>. + * A programmer defines the mapping by implementing the interface {@code SQLData}. * For example, if an SQL structured type named AUTHORS has the attributes NAME, * TITLE, and PUBLISHER, it could be mapped to a Java class named Authors. The * Authors class could have the fields name, title, and publisher, to which the * attributes of AUTHORS are mapped. In such a case, the implementation of - * <code>SQLData</code> could look like the following: + * {@code SQLData} could look like the following: * <PRE> * public class Authors implements SQLData { * public String name; @@ -200,27 +201,27 @@ * } * </PRE> * - * A <code>java.util.Map</code> object is used to associate the SQL structured - * type with its mapping to the class <code>Authors</code>. The following code fragment shows - * how a <code>Map</code> object might be created and given an entry associating - * <code>AUTHORS</code> and <code>Authors</code>. + * A {@code java.util.Map} object is used to associate the SQL structured + * type with its mapping to the class {@code Authors}. The following code fragment shows + * how a {@code Map} object might be created and given an entry associating + * {@code AUTHORS} and {@code Authors}. * <PRE> * java.util.Map map = new java.util.HashMap(); * map.put("SCHEMA_NAME.AUTHORS", Class.forName("Authors"); * </PRE> * - * The <code>Map</code> object <i>map</i> now contains an entry with the - * fully qualified name of the SQL structured type and the <code>Class</code> - * object for the class <code>Authors</code>. It can be passed to a method - * to tell the driver how to map <code>AUTHORS</code> to <code>Authors</code>. + * The {@code Map} object <i>map</i> now contains an entry with the + * fully qualified name of the SQL structured type and the {@code Class} + * object for the class {@code Authors}. It can be passed to a method + * to tell the driver how to map {@code AUTHORS} to {@code Authors}. * <P> - * For a disconnected <code>RowSet</code> object, custom mapping can be done - * only when a <code>Map</code> object is passed to the method or constructor + * For a disconnected {@code RowSet} object, custom mapping can be done + * only when a {@code Map} object is passed to the method or constructor * that will be doing the custom mapping. The situation is different for - * connected <code>RowSet</code> objects because they maintain a connection + * connected {@code RowSet} objects because they maintain a connection * with the data source. A method that does custom mapping and is called by - * a disconnected <code>RowSet</code> object may use the <code>Map</code> - * object that is associated with the <code>Connection</code> object being + * a disconnected {@code RowSet} object may use the {@code Map} + * object that is associated with the {@code Connection} object being * used. So, in other words, if no map is specified, the connection's type * map can be used by default. */
--- a/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql.rowset/share/classes/javax/sql/rowset/spi/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2020, 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 @@ -27,9 +27,9 @@ * The standard classes and interfaces that a third party vendor has to * use in its implementation of a synchronization provider. These classes and * interfaces are referred to as the Service Provider Interface (SPI). To make it possible - * for a <code>RowSet</code> object to use an implementation, the vendor must register - * it with the <code>SyncFactory</code> singleton. (See the class comment for - * <code>SyncProvider</code> for a full explanation of the registration process and + * for a {@code RowSet} object to use an implementation, the vendor must register + * it with the {@code SyncFactory} singleton. (See the class comment for + * {@code SyncProvider} for a full explanation of the registration process and * the naming convention to be used.) * * <h2>Table of Contents</h2> @@ -44,46 +44,46 @@ * * <h3><a id="pkgspec">1.0 Package Specification</a></h3> * <P> - * The following classes and interfaces make up the <code>javax.sql.rowset.spi</code> + * The following classes and interfaces make up the {@code javax.sql.rowset.spi} * package: * <UL> - * <LI><code>SyncFactory</code> - * <LI><code>SyncProvider</code> - * <LI><code>SyncFactoryException</code> - * <LI><code>SyncProviderException</code> - * <LI><code>SyncResolver</code> - * <LI><code>XmlReader</code> - * <LI><code>XmlWriter</code> - * <LI><code>TransactionalWriter</code> + * <LI>{@code SyncFactory} + * <LI>{@code SyncProvider} + * <LI>{@code SyncFactoryException} + * <LI>{@code SyncProviderException} + * <LI>{@code SyncResolver} + * <LI>{@code XmlReader} + * <LI>{@code XmlWriter} + * <LI>{@code TransactionalWriter} * </UL> - * The following interfaces, in the <code>javax.sql</code> package, are also part of the SPI: + * The following interfaces, in the {@code javax.sql} package, are also part of the SPI: * <UL> - * <LI><code>RowSetReader</code> - * <LI><code>RowSetWriter</code> + * <LI>{@code RowSetReader} + * <LI>{@code RowSetWriter} * </UL> * <P> - * A <code>SyncProvider</code> implementation provides a disconnected <code>RowSet</code> + * A {@code SyncProvider} implementation provides a disconnected {@code RowSet} * object with the mechanisms for reading data into it and for writing data that has been * modified in it - * back to the underlying data source. A <i>reader</i>, a <code>RowSetReader</code> or - * <code>XMLReader</code> object, reads data into a <code>RowSet</code> object when the - * <code>CachedRowSet</code> methods <code>execute</code> or <code>populate</code> - * are called. A <i>writer</i>, a <code>RowSetWriter</code> or <code>XMLWriter</code> + * back to the underlying data source. A <i>reader</i>, a {@code RowSetReader} or + * {@code XMLReader} object, reads data into a {@code RowSet} object when the + * {@code CachedRowSet} methods {@code execute} or {@code populate} + * are called. A <i>writer</i>, a {@code RowSetWriter} or {@code XMLWriter} * object, writes changes back to the underlying data source when the - * <code>CachedRowSet</code> method <code>acceptChanges</code> is called. + * {@code CachedRowSet} method {@code acceptChanges} is called. * <P> - * The process of writing changes in a <code>RowSet</code> object to its data source - * is known as <i>synchronization</i>. The <code>SyncProvider</code> implementation that a - * <code>RowSet</code> object is using determines the level of synchronization that the - * <code>RowSet</code> object's writer uses. The various levels of synchronization are + * The process of writing changes in a {@code RowSet} object to its data source + * is known as <i>synchronization</i>. The {@code SyncProvider} implementation that a + * {@code RowSet} object is using determines the level of synchronization that the + * {@code RowSet} object's writer uses. The various levels of synchronization are * referred to as <i>grades</i>. * <P> * The lower grades of synchronization are * known as <i>optimistic</i> concurrency levels because they optimistically * assume that there will be no conflicts or very few conflicts. A conflict exists when - * the same data modified in the <code>RowSet</code> object has also been modified + * the same data modified in the {@code RowSet} object has also been modified * in the data source. Using the optimistic concurrency model means that if there - * is a conflict, modifications to either the data source or the <code>RowSet</code> + * is a conflict, modifications to either the data source or the {@code RowSet} * object will be lost. * <P> * Higher grades of synchronization are called <i>pessimistic</i> because they assume @@ -92,114 +92,114 @@ * occur. * <P> * The lowest level of synchronization is simply writing any changes made to the - * <code>RowSet</code> object to its underlying data source. The writer does + * {@code RowSet} object to its underlying data source. The writer does * nothing to check for conflicts. * If there is a conflict and the data * source values are overwritten, the changes other parties have made by to the data * source are lost. * <P> - * The <code>RIXMLProvider</code> implementation uses the lowest level - * of synchronization and just writes <code>RowSet</code> changes to the data source. + * The {@code RIXMLProvider} implementation uses the lowest level + * of synchronization and just writes {@code RowSet} changes to the data source. * * <P> * For the next level up, the * writer checks to see if there are any conflicts, and if there are, * it does not write anything to the data source. The problem with this concurrency * level is that if another party has modified the corresponding data in the data source - * since the <code>RowSet</code> object got its data, - * the changes made to the <code>RowSet</code> object are lost. The - * <code>RIOptimisticProvider</code> implementation uses this level of synchronization. + * since the {@code RowSet} object got its data, + * the changes made to the {@code RowSet} object are lost. The + * {@code RIOptimisticProvider} implementation uses this level of synchronization. * <P> * At higher levels of synchronization, referred to as pessimistic concurrency, * the writer take steps to avoid conflicts by setting locks. Setting locks * can vary from setting a lock on a single row to setting a lock on a table * or the entire data source. The level of synchronization is therefore a tradeoff * between the ability of users to access the data source concurrently and the ability - * of the writer to keep the data in the <code>RowSet</code> object and its data source + * of the writer to keep the data in the {@code RowSet} object and its data source * synchronized. * <P> - * It is a requirement that all disconnected <code>RowSet</code> objects - * (<code>CachedRowSet</code>, <code>FilteredRowSet</code>, <code>JoinRowSet</code>, - * and <code>WebRowSet</code> objects) obtain their <code>SyncProvider</code> objects - * from the <code>SyncFactory</code> mechanism. + * It is a requirement that all disconnected {@code RowSet} objects + * ({@code CachedRowSet}, {@code FilteredRowSet}, {@code JoinRowSet}, + * and {@code WebRowSet} objects) obtain their {@code SyncProvider} objects + * from the {@code SyncFactory} mechanism. * <P> * The reference implementation (RI) provides two synchronization providers. * <UL> - * <LI><b><code>RIOptimisticProvider</code></b> <br> - * The default provider that the <code>SyncFactory</code> instance will - * supply to a disconnected <code>RowSet</code> object when no provider + * <LI><b>{@code RIOptimisticProvider}</b> <br> + * The default provider that the {@code SyncFactory} instance will + * supply to a disconnected {@code RowSet} object when no provider * implementation is specified.<BR> * This synchronization provider uses an optimistic concurrency model, * assuming that there will be few conflicts among users * who are accessing the same data in a database. It avoids * using locks; rather, it checks to see if there is a conflict - * before trying to synchronize the <code>RowSet</code> object and the + * before trying to synchronize the {@code RowSet} object and the * data source. If there is a conflict, it does nothing, meaning that - * changes to the <code>RowSet</code> object are not persisted to the data + * changes to the {@code RowSet} object are not persisted to the data * source. - * <LI><B><code>RIXMLProvider</code></B> <BR> + * <LI><B>{@code RIXMLProvider}</B> <BR> * A synchronization provider that can be used with a - * <code>WebRowSet</code> object, which is a rowset that can be written + * {@code WebRowSet} object, which is a rowset that can be written * in XML format or read from XML format. The - * <code>RIXMLProvider</code> implementation does no checking at all for + * {@code RIXMLProvider} implementation does no checking at all for * conflicts and simply writes any updated data in the - * <code>WebRowSet</code> object to the underlying data source. - * <code>WebRowSet</code> objects use this provider when they are + * {@code WebRowSet} object to the underlying data source. + * {@code WebRowSet} objects use this provider when they are * dealing with XML data. * </UL> * - * These <code>SyncProvider</code> implementations + * These {@code SyncProvider} implementations * are bundled with the reference implementation, which makes them always available to - * <code>RowSet</code> implementations. - * <code>SyncProvider</code> implementations make themselves available by being - * registered with the <code>SyncFactory</code> singleton. When a <code>RowSet</code> + * {@code RowSet} implementations. + * {@code SyncProvider} implementations make themselves available by being + * registered with the {@code SyncFactory} singleton. When a {@code RowSet} * object requests a provider, by specifying it in the constructor or as an argument to the - * <code>CachedRowSet</code> method <code>setSyncProvider</code>, - * the <code>SyncFactory</code> singleton + * {@code CachedRowSet} method {@code setSyncProvider}, + * the {@code SyncFactory} singleton * checks to see if the requested provider has been registered with it. - * If it has, the <code>SyncFactory</code> creates an instance of it and passes it to the - * requesting <code>RowSet</code> object. - * If the <code>SyncProvider</code> implementation that is specified has not been registered, - * the <code>SyncFactory</code> singleton causes a <code>SyncFactoryException</code> object + * If it has, the {@code SyncFactory} creates an instance of it and passes it to the + * requesting {@code RowSet} object. + * If the {@code SyncProvider} implementation that is specified has not been registered, + * the {@code SyncFactory} singleton causes a {@code SyncFactoryException} object * to be thrown. If no provider is specified, - * the <code>SyncFactory</code> singleton will create an instance of the default - * provider implementation, <code>RIOptimisticProvider</code>, - * and pass it to the requesting <code>RowSet</code> object. + * the {@code SyncFactory} singleton will create an instance of the default + * provider implementation, {@code RIOptimisticProvider}, + * and pass it to the requesting {@code RowSet} object. * * <P> - * If a <code>WebRowSet</code> object does not specify a provider in its constructor, the - * <code>SyncFactory</code> will give it an instance of <code>RIOptimisticProvider</code>. - * However, the constructor for <code>WebRowSet</code> is implemented to set the provider - * to the <code>RIXMLProvider</code>, which reads and writes a <code>RowSet</code> object + * If a {@code WebRowSet} object does not specify a provider in its constructor, the + * {@code SyncFactory} will give it an instance of {@code RIOptimisticProvider}. + * However, the constructor for {@code WebRowSet} is implemented to set the provider + * to the {@code RIXMLProvider}, which reads and writes a {@code RowSet} object * in XML format. * <P> * See the <a href="SyncProvider.html">SyncProvider</a> class * specification for further details. * <p> - * Vendors may develop a <code>SyncProvider</code> implementation with any one of the possible - * levels of synchronization, thus giving <code>RowSet</code> objects a choice of + * Vendors may develop a {@code SyncProvider} implementation with any one of the possible + * levels of synchronization, thus giving {@code RowSet} objects a choice of * synchronization mechanisms. * * <h3><a id="arch">2.0 Service Provider Interface Architecture</a></h3> * <b>2.1 Overview</b> * <p> * The Service Provider Interface provides a pluggable mechanism by which - * <code>SyncProvider</code> implementations can be registered and then generated when - * required. The lazy reference mechanism employed by the <code>SyncFactory</code> limits + * {@code SyncProvider} implementations can be registered and then generated when + * required. The lazy reference mechanism employed by the {@code SyncFactory} limits * unnecessary resource consumption by not creating an instance until it is * required by a disconnected - * <code>RowSet</code> object. The <code>SyncFactory</code> class also provides + * {@code RowSet} object. The {@code SyncFactory} class also provides * a standard API to configure logging options and streams that <b>may</b> be provided - * by a particular <code>SyncProvider</code> implementation. + * by a particular {@code SyncProvider} implementation. * <p> - * <b>2.2 Registering with the <code>SyncFactory</code></b> + * <b>2.2 Registering with the {@code SyncFactory}</b> * <p> - * A third party <code>SyncProvider</code> implementation must be registered with the - * <code>SyncFactory</code> in order for a disconnected <code>RowSet</code> object - * to obtain it and thereby use its <code>javax.sql.RowSetReader</code> and - * <code>javax.sql.RowSetWriter</code> + * A third party {@code SyncProvider} implementation must be registered with the + * {@code SyncFactory} in order for a disconnected {@code RowSet} object + * to obtain it and thereby use its {@code javax.sql.RowSetReader} and + * {@code javax.sql.RowSetWriter} * implementations. The following registration mechanisms are available to all - * <code>SyncProvider</code> implementations: + * {@code SyncProvider} implementations: * <ul> * <li><b>System properties</b> - Properties set at the command line. These * properties are set at run time and apply system-wide per invocation of the Java @@ -210,159 +210,159 @@ * This can be specified using a System Property or by modifying a standard * property file located in the platform run-time. The * reference implementation of this technology includes a standard property - * file than can be edited to add additional <code>SyncProvider</code> objects. + * file than can be edited to add additional {@code SyncProvider} objects. * * <li><b>JNDI Context</b> - Available providers can be registered on a JNDI - * context. The <code>SyncFactory</code> will attempt to load <code>SyncProvider</code> + * context. The {@code SyncFactory} will attempt to load {@code SyncProvider} * objects bound to the context and register them with the factory. This - * context must be supplied to the <code>SyncFactory</code> for the mechanism to + * context must be supplied to the {@code SyncFactory} for the mechanism to * function correctly. * </ul> * <p> * Details on how to specify the system properties or properties in a property file * and how to configure the JNDI Context are explained in detail in the - * <a href="SyncFactory.html"><code>SyncFactory</code></a> class description. + * <a href="SyncFactory.html">{@code SyncFactory}</a> class description. * <p> * <b>2.3 SyncFactory Provider Instance Generation Policies</b> * <p> - * The <code>SyncFactory</code> generates a requested <code>SyncProvider</code> + * The {@code SyncFactory} generates a requested {@code SyncProvider} * object if the provider has been correctly registered. The - * following policies are adhered to when either a disconnected <code>RowSet</code> object - * is instantiated with a specified <code>SyncProvider</code> implementation or is - * reconfigured at runtime with an alternative <code>SyncProvider</code> object. + * following policies are adhered to when either a disconnected {@code RowSet} object + * is instantiated with a specified {@code SyncProvider} implementation or is + * reconfigured at runtime with an alternative {@code SyncProvider} object. * <ul> - * <li> If a <code>SyncProvider</code> object is specified and the <code>SyncFactory</code> - * contains <i>no</i> reference to the provider, a <code>SyncFactoryException</code> is + * <li> If a {@code SyncProvider} object is specified and the {@code SyncFactory} + * contains <i>no</i> reference to the provider, a {@code SyncFactoryException} is * thrown. * - * <li> If a <code>SyncProvider</code> object is specified and the <code>SyncFactory</code> + * <li> If a {@code SyncProvider} object is specified and the {@code SyncFactory} * contains a reference to the provider, the requested provider is supplied. * - * <li> If no <code>SyncProvider</code> object is specified, the reference - * implementation provider <code>RIOptimisticProvider</code> is supplied. + * <li> If no {@code SyncProvider} object is specified, the reference + * implementation provider {@code RIOptimisticProvider} is supplied. * </ul> * <p> * These policies are explored in more detail in the <a href="SyncFactory.html"> - * <code>SyncFactory</code></a> class. + * {@code SyncFactory}</a> class. * * <h3><a id="impl">3.0 SyncProvider Implementer's Guide</a></h3> * * <b>3.1 Requirements</b> * <p> - * A compliant <code>SyncProvider</code> implementation that is fully pluggable - * into the <code>SyncFactory</code> <b>must</b> extend and implement all - * abstract methods in the <a href="SyncProvider.html"><code>SyncProvider</code></a> + * A compliant {@code SyncProvider} implementation that is fully pluggable + * into the {@code SyncFactory} <b>must</b> extend and implement all + * abstract methods in the <a href="SyncProvider.html">{@code SyncProvider}</a> * class. In addition, an implementation <b>must</b> determine the * grade, locking and updatable view capabilities defined in the - * <code>SyncProvider</code> class definition. One or more of the - * <code>SyncProvider</code> description criteria <b>must</b> be supported. It + * {@code SyncProvider} class definition. One or more of the + * {@code SyncProvider} description criteria <b>must</b> be supported. It * is expected that vendor implementations will offer a range of grade, locking, and * updatable view capabilities. * <p> - * Furthermore, the <code>SyncProvider</code> naming convention <b>must</b> be followed as - * detailed in the <a href="SyncProvider.html"><code>SyncProvider</code></a> class + * Furthermore, the {@code SyncProvider} naming convention <b>must</b> be followed as + * detailed in the <a href="SyncProvider.html">{@code SyncProvider}</a> class * description. * <p> * <b>3.2 Grades</b> * <p> * JSR 114 defines a set of grades to describe the quality of synchronization - * a <code>SyncProvider</code> object can offer a disconnected <code>RowSet</code> + * a {@code SyncProvider} object can offer a disconnected {@code RowSet} * object. These grades are listed from the lowest quality of service to the highest. * <ul> * <li><b>GRADE_NONE</b> - No synchronization with the originating data source is - * provided. A <code>SyncProvider</code> implementation returning this grade will simply - * attempt to write any data that has changed in the <code>RowSet</code> object to the + * provided. A {@code SyncProvider} implementation returning this grade will simply + * attempt to write any data that has changed in the {@code RowSet} object to the *underlying data source, overwriting whatever is there. No attempt is made to compare * original values with current values to see if there is a conflict. The - * <code>RIXMLProvider</code> is implemented with this grade. + * {@code RIXMLProvider} is implemented with this grade. * * <li><b>GRADE_CHECK_MODIFIED_AT_COMMIT</b> - A low grade of optimistic synchronization. - * A <code>SyncProvider</code> implementation returning this grade + * A {@code SyncProvider} implementation returning this grade * will check for conflicts in rows that have changed between the last synchronization * and the current synchronization under way. Any changes in the originating data source - * that have been modified will not be reflected in the disconnected <code>RowSet</code> - * object. If there are no conflicts, changes in the <code>RowSet</code> object will be + * that have been modified will not be reflected in the disconnected {@code RowSet} + * object. If there are no conflicts, changes in the {@code RowSet} object will be * written to the data source. If there are conflicts, no changes are written. - * The <code>RIOptimisticProvider</code> implementation uses this grade. + * The {@code RIOptimisticProvider} implementation uses this grade. * * <li><b>GRADE_CHECK_ALL_AT_COMMIT</b> - A high grade of optimistic synchronization. - * A <code>SyncProvider</code> implementation returning this grade + * A {@code SyncProvider} implementation returning this grade * will check all rows, including rows that have not changed in the disconnected - * <code>RowSet</code> object. In this way, any changes to rows in the underlying - * data source will be reflected in the disconnected <code>RowSet</code> object + * {@code RowSet} object. In this way, any changes to rows in the underlying + * data source will be reflected in the disconnected {@code RowSet} object * when the synchronization finishes successfully. * * <li><b>GRADE_LOCK_WHEN_MODIFIED</b> - A pessimistic grade of synchronization. - * <code>SyncProvider</code> implementations returning this grade will lock + * {@code SyncProvider} implementations returning this grade will lock * the row in the originating data source that corresponds to the row being changed - * in the <code>RowSet</code> object to reduce the possibility of other + * in the {@code RowSet} object to reduce the possibility of other * processes modifying the same data in the data source. * * <li><b>GRADE_LOCK_WHEN_LOADED</b> - A higher pessimistic synchronization grade. - * A <code>SyncProvider</code> implementation returning this grade will lock + * A {@code SyncProvider} implementation returning this grade will lock * the entire view and/or table affected by the original query used to - * populate a <code>RowSet</code> object. + * populate a {@code RowSet} object. * </ul> * <p> * <b>3.3 Locks</b> * <p> * JSR 114 defines a set of constants that specify whether any locks have been - * placed on a <code>RowSet</code> object's underlying data source and, if so, + * placed on a {@code RowSet} object's underlying data source and, if so, * on which constructs the locks are placed. These locks will remain on the data - * source while the <code>RowSet</code> object is disconnected from the data source. + * source while the {@code RowSet} object is disconnected from the data source. * <P> * These constants <b>should</b> be considered complementary to the * grade constants. The default setting for the majority of grade settings requires - * that no data source locks remain when a <code>RowSet</code> object is disconnected + * that no data source locks remain when a {@code RowSet} object is disconnected * from its data source. - * The grades <code>GRADE_LOCK_WHEN_MODIFIED</code> and - * <code>GRADE_LOCK_WHEN_LOADED</code> allow a disconnected <code>RowSet</code> object + * The grades {@code GRADE_LOCK_WHEN_MODIFIED} and + * {@code GRADE_LOCK_WHEN_LOADED} allow a disconnected {@code RowSet} object * to have a fine-grained control over the degree of locking. * <ul> * <li><b>DATASOURCE_NO_LOCK</b> - No locks remain on the originating data source. - * This is the default lock setting for all <code>SyncProvider</code> implementations - * unless otherwise directed by a <code>RowSet</code> object. + * This is the default lock setting for all {@code SyncProvider} implementations + * unless otherwise directed by a {@code RowSet} object. * * <li><b>DATASOURCE_ROW_LOCK</b> - A lock is placed on the rows that are touched by - * the original SQL query used to populate the <code>RowSet</code> object. + * the original SQL query used to populate the {@code RowSet} object. * * <li><b>DATASOURCE_TABLE_LOCK</b> - A lock is placed on all tables that are touched - * by the query that was used to populate the <code>RowSet</code> object. + * by the query that was used to populate the {@code RowSet} object. * * <li><b>DATASOURCE_DB_LOCK</b> - * A lock is placed on the entire data source that is used by the <code>RowSet</code> + * A lock is placed on the entire data source that is used by the {@code RowSet} * object. * </ul> * <p> * <b>3.4 Updatable Views</b> * <p> - * A <code>RowSet</code> object may be populated with data from an SQL <code>VIEW</code>. - * The following constants indicate whether a <code>SyncProvider</code> object can - * update data in the table or tables from which the <code>VIEW</code> was derived. + * A {@code RowSet} object may be populated with data from an SQL {@code VIEW}. + * The following constants indicate whether a {@code SyncProvider} object can + * update data in the table or tables from which the {@code VIEW} was derived. * <ul> * <li><b>UPDATABLE_VIEW_SYNC</b> - * Indicates that a <code>SyncProvider</code> implementation supports synchronization - * to the table or tables from which the SQL <code>VIEW</code> used to populate - * a <code>RowSet</code> object is derived. + * Indicates that a {@code SyncProvider} implementation supports synchronization + * to the table or tables from which the SQL {@code VIEW} used to populate + * a {@code RowSet} object is derived. * * <li><b>NONUPDATABLE_VIEW_SYNC</b> - * Indicates that a <code>SyncProvider</code> implementation does <b>not</b> support - * synchronization to the table or tables from which the SQL <code>VIEW</code> - * used to populate a <code>RowSet</code> object is derived. + * Indicates that a {@code SyncProvider} implementation does <b>not</b> support + * synchronization to the table or tables from which the SQL {@code VIEW} + * used to populate a {@code RowSet} object is derived. * </ul> * <p> - * <b>3.5 Usage of <code>SyncProvider</code> Grading and Locking</b> + * <b>3.5 Usage of {@code SyncProvider} Grading and Locking</b> * <p> - * In the example below, the reference <code>CachedRowSetImpl</code> implementation - * reconfigures its current <code>SyncProvider</code> object by calling the - * <code>setSyncProvider</code> method.<br> + * In the example below, the reference {@code CachedRowSetImpl} implementation + * reconfigures its current {@code SyncProvider} object by calling the + * {@code setSyncProvider} method.<br> * * <PRE> * CachedRowSetImpl crs = new CachedRowSetImpl(); * crs.setSyncProvider("com.foo.bar.HASyncProvider"); * </PRE> - * An application can retrieve the <code>SyncProvider</code> object currently in use - * by a disconnected <code>RowSet</code> object. It can also retrieve the + * An application can retrieve the {@code SyncProvider} object currently in use + * by a disconnected {@code RowSet} object. It can also retrieve the * grade of synchronization with which the provider was implemented and the degree of * locking currently in use. In addition, an application has the flexibility to set * the degree of locking to be used, which can increase the possibilities for successful @@ -388,10 +388,10 @@ * break; * } * - * switch (sync.getDataSourcLock() { + * switch (sync.getDataSourceLock() { * case: SyncProvider.DATASOURCE_DB_LOCK * // A lock is placed on the entire datasource that is used by the - * // <code>RowSet</code> object + * // {@code RowSet} object * break; * * case: SyncProvider.DATASOURCE_NO_LOCK @@ -412,8 +412,8 @@ * * </PRE> * It is also possible using the static utility method in the - * <code>SyncFactory</code> class to determine the list of <code>SyncProvider</code> - * implementations currently registered with the <code>SyncFactory</code>. + * {@code SyncFactory} class to determine the list of {@code SyncProvider} + * implementations currently registered with the {@code SyncFactory}. * * <pre> * Enumeration e = SyncFactory.getRegisteredProviders(); @@ -422,48 +422,48 @@ * * <h3><a id="resolving">4.0 Resolving Synchronization Conflicts</a></h3> * - * The interface <code>SyncResolver</code> provides a way for an application to - * decide manually what to do when a conflict occurs. When the <code>CachedRowSet</code> - * method <code>acceptChanges</code> finishes and has detected one or more conflicts, - * it throws a <code>SyncProviderException</code> object. An application can + * The interface {@code SyncResolver} provides a way for an application to + * decide manually what to do when a conflict occurs. When the {@code CachedRowSet} + * method {@code acceptChanges} finishes and has detected one or more conflicts, + * it throws a {@code SyncProviderException} object. An application can * catch the exception and - * have it retrieve a <code>SyncResolver</code> object by calling the method - * <code>SyncProviderException.getSyncResolver()</code>. + * have it retrieve a {@code SyncResolver} object by calling the method + * {@code SyncProviderException.getSyncResolver()}. * <P> - * A <code>SyncResolver</code> object, which is a special kind of - * <code>CachedRowSet</code> object or - * a <code>JdbcRowSet</code> object that has implemented the <code>SyncResolver</code> + * A {@code SyncResolver} object, which is a special kind of + * {@code CachedRowSet} object or + * a {@code JdbcRowSet} object that has implemented the {@code SyncResolver} * interface, examines the conflicts row by row. It is a duplicate of the - * <code>RowSet</code> object being synchronized except that it contains only the data + * {@code RowSet} object being synchronized except that it contains only the data * from the data source this is causing a conflict. All of the other column values are - * set to <code>null</code>. To navigate from one conflict value to another, a - * <code>SyncResolver</code> object provides the methods <code>nextConflict</code> and - * <code>previousConflict</code>. + * set to {@code null}. To navigate from one conflict value to another, a + * {@code SyncResolver} object provides the methods {@code nextConflict} and + * {@code previousConflict}. * <P> - * The <code>SyncResolver</code> interface also + * The {@code SyncResolver} interface also * provides methods for doing the following: * <UL> * <LI>finding out whether the conflict involved an update, a delete, or an insert * <LI>getting the value in the data source that caused the conflict * <LI>setting the value that should be in the data source if it needs to be changed - * or setting the value that should be in the <code>RowSet</code> object if it needs + * or setting the value that should be in the {@code RowSet} object if it needs * to be changed * </UL> * <P> - * When the <code>CachedRowSet</code> method <code>acceptChanges</code> is called, it - * delegates to the <code>RowSet</code> object's <code>SyncProvider</code> object. - * How the writer provided by that <code>SyncProvider</code> object is implemented + * When the {@code CachedRowSet} method {@code acceptChanges} is called, it + * delegates to the {@code RowSet} object's {@code SyncProvider} object. + * How the writer provided by that {@code SyncProvider} object is implemented * determines what level (grade) of checking for conflicts will be done. After all * checking for conflicts is completed and one or more conflicts has been found, the method - * <code>acceptChanges</code> throws a <code>SyncProviderException</code> object. The - * application can catch the exception and use it to obtain a <code>SyncResolver</code> object. + * {@code acceptChanges} throws a {@code SyncProviderException} object. The + * application can catch the exception and use it to obtain a {@code SyncResolver} object. * <P> - * The application can then use <code>SyncResolver</code> methods to get information + * The application can then use {@code SyncResolver} methods to get information * about each conflict and decide what to do. If the application logic or the user - * decides that a value in the <code>RowSet</code> object should be the one to + * decides that a value in the {@code RowSet} object should be the one to * persist, the application or user can overwrite the data source value with it. * <P> - * The comment for the <code>SyncResolver</code> interface has more detail. + * The comment for the {@code SyncResolver} interface has more detail. * * <h3><a id="relspec">5.0 Related Specifications</a></h3> * <ul>
--- a/src/java.sql/share/classes/java/sql/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql/share/classes/java/sql/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2020, 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 @@ -34,17 +34,17 @@ * to passing SQL statements to a database, it provides for reading and * writing data from any data source with a tabular format. * The reader/writer facility, available through the - * <code>javax.sql.RowSet</code> group of interfaces, can be customized to + * {@code javax.sql.RowSet} group of interfaces, can be customized to * use and update data from a spread sheet, flat file, or any other tabular * data source. * * <h2>What the JDBC™ 4.3 API Includes</h2> * The JDBC™ 4.3 API includes both - * the <code>java.sql</code> package, referred to as the JDBC core API, - * and the <code>javax.sql</code> package, referred to as the JDBC Optional + * the {@code java.sql} package, referred to as the JDBC core API, + * and the {@code javax.sql} package, referred to as the JDBC Optional * Package API. This complete JDBC API * is included in the Java™ Standard Edition (Java SE™), version 7. - * The <code>javax.sql</code> package extends the functionality of the JDBC API + * The {@code javax.sql} package extends the functionality of the JDBC API * from a client-side API to a server-side API, and it is an essential part * of the Java™ Enterprise Edition * (Java EE™) technology. @@ -91,141 +91,141 @@ * check your driver's documentation to see whether it supports a feature before * you try to use it. * <P> - * <b>NOTE:</b> The class <code>SQLPermission</code> was added in the + * <b>NOTE:</b> The class {@code SQLPermission} was added in the * Java™ 2 SDK, Standard Edition, * version 1.3 release. This class is used to prevent unauthorized - * access to the logging stream associated with the <code>DriverManager</code>, + * access to the logging stream associated with the {@code DriverManager}, * which may contain information such as table names, column data, and so on. * - * <h2>What the <code>java.sql</code> Package Contains</h2> - * The <code>java.sql</code> package contains API for the following: + * <h2>What the {@code java.sql} Package Contains</h2> + * The {@code java.sql} package contains API for the following: * <UL> - * <LI>Making a connection with a database via the <code>DriverManager</code> facility + * <LI>Making a connection with a database via the {@code DriverManager} facility * <UL> - * <LI><code>DriverManager</code> class -- makes a connection with a driver - * <LI><code>SQLPermission</code> class -- provides permission when code + * <LI>{@code DriverManager} class -- makes a connection with a driver + * <LI>{@code SQLPermission} class -- provides permission when code * running within a Security Manager, such as an applet, * attempts to set up a logging stream through the - * <code>DriverManager</code> - * <LI><code>Driver</code> interface -- provides the API for registering + * {@code DriverManager} + * <LI>{@code Driver} interface -- provides the API for registering * and connecting drivers based on JDBC technology ("JDBC drivers"); - * generally used only by the <code>DriverManager</code> class - * <LI><code>DriverPropertyInfo</code> class -- provides properties for a + * generally used only by the {@code DriverManager} class + * <LI>{@code DriverPropertyInfo} class -- provides properties for a * JDBC driver; not used by the general user * </UL> * <LI>Sending SQL statements to a database * <UL> - * <LI><code>Statement</code> -- used to send basic SQL statements - * <LI><code>PreparedStatement</code> -- used to send prepared statements or - * basic SQL statements (derived from <code>Statement</code>) - * <LI><code>CallableStatement</code> -- used to call database stored - * procedures (derived from <code>PreparedStatement</code>) - * <LI><code>Connection</code> interface -- provides methods for creating + * <LI>{@code Statement} -- used to send basic SQL statements + * <LI>{@code PreparedStatement} -- used to send prepared statements or + * basic SQL statements (derived from {@code Statement}) + * <LI>{@code CallableStatement} -- used to call database stored + * procedures (derived from {@code PreparedStatement}) + * <LI>{@code Connection} interface -- provides methods for creating * statements and managing connections and their properties - * <LI><code>Savepoint</code> -- provides savepoints in a transaction + * <LI>{@code Savepoint} -- provides savepoints in a transaction * * </UL> * <LI>Retrieving and updating the results of a query * <UL> - * <LI><code>ResultSet</code> interface + * <LI>{@code ResultSet} interface * </UL> * <LI>Standard mappings for SQL types to classes and interfaces in the * Java programming language * <UL> - * <LI><code>Array</code> interface -- mapping for SQL <code>ARRAY</code> - * <LI><code>Blob</code> interface -- mapping for SQL <code>BLOB</code> - * <LI><code>Clob</code> interface -- mapping for SQL <code>CLOB</code> - * <LI><code>Date</code> class -- mapping for SQL <code>DATE</code> - * <LI><code>NClob</code> interface -- mapping for SQL <code>NCLOB</code> - * <LI><code>Ref</code> interface -- mapping for SQL <code>REF</code> - * <LI><code>RowId</code> interface -- mapping for SQL <code>ROWID</code> - * <LI><code>Struct</code> interface -- mapping for SQL <code>STRUCT</code> - * <LI><code>SQLXML</code> interface -- mapping for SQL <code>XML</code> - * <LI><code>Time</code> class -- mapping for SQL <code>TIME</code> - * <LI><code>Timestamp</code> class -- mapping for SQL <code>TIMESTAMP</code> - * <LI><code>Types</code> class -- provides constants for SQL types + * <LI>{@code Array} interface -- mapping for SQL {@code ARRAY} + * <LI>{@code Blob} interface -- mapping for SQL {@code BLOB} + * <LI>{@code Clob} interface -- mapping for SQL {@code CLOB} + * <LI>{@code Date} class -- mapping for SQL {@code DATE} + * <LI>{@code NClob} interface -- mapping for SQL {@code NCLOB} + * <LI>{@code Ref} interface -- mapping for SQL {@code REF} + * <LI>{@code RowId} interface -- mapping for SQL {@code ROWID} + * <LI>{@code Struct} interface -- mapping for SQL {@code STRUCT} + * <LI>{@code SQLXML} interface -- mapping for SQL {@code XML} + * <LI>{@code Time} class -- mapping for SQL {@code TIME} + * <LI>{@code Timestamp} class -- mapping for SQL {@code TIMESTAMP} + * <LI>{@code Types} class -- provides constants for SQL types * </UL> * <LI>Custom mapping an SQL user-defined type (UDT) to a class in the * Java programming language * <UL> - * <LI><code>SQLData</code> interface -- specifies the mapping of + * <LI>{@code SQLData} interface -- specifies the mapping of * a UDT to an instance of this class - * <LI><code>SQLInput</code> interface -- provides methods for reading + * <LI>{@code SQLInput} interface -- provides methods for reading * UDT attributes from a stream - * <LI><code>SQLOutput</code> interface -- provides methods for writing + * <LI>{@code SQLOutput} interface -- provides methods for writing * UDT attributes back to a stream * </UL> * <LI>Metadata * <UL> - * <LI><code>DatabaseMetaData</code> interface -- provides information + * <LI>{@code DatabaseMetaData} interface -- provides information * about the database - * <LI><code>ResultSetMetaData</code> interface -- provides information - * about the columns of a <code>ResultSet</code> object - * <LI><code>ParameterMetaData</code> interface -- provides information - * about the parameters to <code>PreparedStatement</code> commands + * <LI>{@code ResultSetMetaData} interface -- provides information + * about the columns of a {@code ResultSet} object + * <LI>{@code ParameterMetaData} interface -- provides information + * about the parameters to {@code PreparedStatement} commands * </UL> * <LI>Exceptions * <UL> - * <LI><code>SQLException</code> -- thrown by most methods when there + * <LI>{@code SQLException} -- thrown by most methods when there * is a problem accessing data and by some methods for other reasons - * <LI><code>SQLWarning</code> -- thrown to indicate a warning - * <LI><code>DataTruncation</code> -- thrown to indicate that data may have + * <LI>{@code SQLWarning} -- thrown to indicate a warning + * <LI>{@code DataTruncation} -- thrown to indicate that data may have * been truncated - * <LI><code>BatchUpdateException</code> -- thrown to indicate that not all + * <LI>{@code BatchUpdateException} -- thrown to indicate that not all * commands in a batch update executed successfully * </UL> * </UL> * - * <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.3 API</h3> + * <h3>{@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.3 API</h3> * <UL> - * <LI>Added <code>Sharding</code> support</LI> - * <LI>Enhanced <code>Connection</code> to be able to provide hints + * <LI>Added {@code Sharding} support</LI> + * <LI>Enhanced {@code Connection} to be able to provide hints * to the driver that a request, an independent unit of work, * is beginning or ending</LI> - * <LI>Enhanced <code>DatabaseMetaData</code> to determine if Sharding is + * <LI>Enhanced {@code DatabaseMetaData} to determine if Sharding is * supported</LI> - * <LI>Added the method <code>drivers</code> to <code>DriverManager</code> + * <LI>Added the method {@code drivers} to {@code DriverManager} * to return a Stream of the currently loaded and * available JDBC drivers</LI> - * <LI>Added support to <code>Statement</code> for enquoting literals + * <LI>Added support to {@code Statement} for enquoting literals * and simple identifiers</LI> * <LI>Clarified the Java SE version that methods were deprecated</LI> * </UL> * - * <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.2 API</h3> + * <h3>{@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.2 API</h3> * <UL> - * <LI>Added <code>JDBCType</code> enum and <code>SQLType</code> interface</li> - * <LI>Support for <code>REF CURSORS</code> in <code>CallableStatement</code> + * <LI>Added {@code JDBCType} enum and {@code SQLType} interface</li> + * <LI>Support for {@code REF CURSORS} in {@code CallableStatement} * </LI> - * <LI><code>DatabaseMetaData</code> methods to return maximum Logical LOB size + * <LI>{@code DatabaseMetaData} methods to return maximum Logical LOB size * and if Ref Cursors are supported</LI> * <LI>Added support for large update counts</LI> * * </UL> * - * <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.1 API</h3> + * <h3>{@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.1 API</h3> * <UL> - * <LI>Allow <code>Connection</code>, - * <code>ResultSet</code> and <code>Statement</code> objects to be + * <LI>Allow {@code Connection}, + * {@code ResultSet} and {@code Statement} objects to be * used with the try-with-resources statement</LI> - * <LI>Support added to <code>CallableStatement</code> and - * <code>ResultSet</code> to specify the Java type to convert to via the - * <code>getObject</code> method</LI> - * <LI><code>DatabaseMetaData</code> methods to return PseudoColumns and if a + * <LI>Support added to {@code CallableStatement} and + * {@code ResultSet} to specify the Java type to convert to via the + * {@code getObject} method</LI> + * <LI>{@code DatabaseMetaData} methods to return PseudoColumns and if a * generated key is always returned</LI> - * <LI>Added support to <code>Connection</code> to specify a database schema, + * <LI>Added support to {@code Connection} to specify a database schema, * abort and timeout a physical connection.</LI> - * <LI>Added support to close a <code>Statement</code> object when its dependent + * <LI>Added support to close a {@code Statement} object when its dependent * objects have been closed</LI> - * <LI>Support for obtaining the parent logger for a <code>Driver</code>, - * <code>DataSource</code>, <code>ConnectionPoolDataSource</code> and - * <code>XADataSource</code></LI> + * <LI>Support for obtaining the parent logger for a {@code Driver}, + * {@code DataSource}, {@code ConnectionPoolDataSource} and + * {@code XADataSource}</LI> * * </UL> - * <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 4.0 API</h3> + * <h3>{@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 4.0 API</h3> * <UL> * <LI>auto java.sql.Driver discovery -- no longer need to load a - * <code>java.sql.Driver</code> class via <code>Class.forName</code> + * {@code java.sql.Driver} class via {@code Class.forName} * <LI>National Character Set support added * <li>Support added for the SQL:2003 XML data type * <lI>SQLException enhancements -- Added support for cause chaining; New SQLExceptions @@ -236,92 +236,92 @@ * <li>Support added to allow a JDBC application to access an instance of a JDBC resource * that has been wrapped by a vendor, usually in an application server or connection * pooling environment. - * <li>Availability to be notified when a <code>PreparedStatement</code> that is associated - * with a <code>PooledConnection</code> has been closed or the driver determines is invalid + * <li>Availability to be notified when a {@code PreparedStatement} that is associated + * with a {@code PooledConnection} has been closed or the driver determines is invalid * * * </UL> * * - * <h3><code>java.sql</code> and <code>javax.sql</code> Features Introduced in the JDBC 3.0 API</h3> + * <h3>{@code java.sql} and {@code javax.sql} Features Introduced in the JDBC 3.0 API</h3> * <UL> * <LI>Pooled statements -- reuse of statements associated with a pooled * connection * <LI>Savepoints -- allow a transaction to be rolled back to a designated * savepoint - * <LI>Properties defined for <code>ConnectionPoolDataSource</code> -- specify + * <LI>Properties defined for {@code ConnectionPoolDataSource} -- specify * how connections are to be pooled - * <LI>Metadata for parameters of a <code>PreparedStatement</code> object + * <LI>Metadata for parameters of a {@code PreparedStatement} object * <LI>Ability to retrieve values from automatically generated columns - * <LI>Ability to have multiple <code>ResultSet</code> objects - * returned from <code>CallableStatement</code> objects open at the + * <LI>Ability to have multiple {@code ResultSet} objects + * returned from {@code CallableStatement} objects open at the * same time - * <LI>Ability to identify parameters to <code>CallableStatement</code> + * <LI>Ability to identify parameters to {@code CallableStatement} * objects by name as well as by index - * <LI><code>ResultSet</code> holdability -- ability to specify whether cursors + * <LI>{@code ResultSet} holdability -- ability to specify whether cursors * should be held open or closed at the end of a transaction * <LI>Ability to retrieve and update the SQL structured type instance that a - * <code>Ref</code> object references - * <LI>Ability to programmatically update <code>BLOB</code>, - * <code>CLOB</code>, <code>ARRAY</code>, and <code>REF</code> values. - * <LI>Addition of the <code>java.sql.Types.DATALINK</code> data type -- + * {@code Ref} object references + * <LI>Ability to programmatically update {@code BLOB}, + * {@code CLOB}, {@code ARRAY}, and {@code REF} values. + * <LI>Addition of the {@code java.sql.Types.DATALINK} data type -- * allows JDBC drivers access to objects stored outside a data source * <LI>Addition of metadata for retrieving SQL type hierarchies * </UL> * - * <h3><code>java.sql</code> Features Introduced in the JDBC 2.1 Core API</h3> + * <h3>{@code java.sql} Features Introduced in the JDBC 2.1 Core API</h3> * <UL> - * <LI>Scrollable result sets--using new methods in the <code>ResultSet</code> + * <LI>Scrollable result sets--using new methods in the {@code ResultSet} * interface that allow the cursor to be moved to a particular row or to a * position relative to its current position * <LI>Batch updates - * <LI>Programmatic updates--using <code>ResultSet</code> updater methods + * <LI>Programmatic updates--using {@code ResultSet} updater methods * <LI>New data types--interfaces mapping the SQL3 data types * <LI>Custom mapping of user-defined types (UDTs) * <LI>Miscellaneous features, including performance hints, the use of character - * streams, full precision for <code>java.math.BigDecimal</code> values, + * streams, full precision for {@code java.math.BigDecimal} values, * additional security, and * support for time zones in date, time, and timestamp values. * </UL> * - * <h3><code>javax.sql</code> Features Introduced in the JDBC 2.0 Optional + * <h3>{@code javax.sql} Features Introduced in the JDBC 2.0 Optional * Package API</h3> * <UL> - * <LI>The <code>DataSource</code> interface as a means of making a connection. The + * <LI>The {@code DataSource} interface as a means of making a connection. The * Java Naming and Directory Interface™ - * (JNDI) is used for registering a <code>DataSource</code> object with a + * (JNDI) is used for registering a {@code DataSource} object with a * naming service and also for retrieving it. * <LI>Pooled connections -- allowing connections to be used and reused * <LI>Distributed transactions -- allowing a transaction to span diverse * DBMS servers - * <LI><code>RowSet</code> technology -- providing a convenient means of + * <LI>{@code RowSet} technology -- providing a convenient means of * handling and passing data * </UL> * * * <h3>Custom Mapping of UDTs</h3> * A user-defined type (UDT) defined in SQL can be mapped to a class in the Java - * programming language. An SQL structured type or an SQL <code>DISTINCT</code> + * programming language. An SQL structured type or an SQL {@code DISTINCT} * type are the UDTs that may be custom mapped. The following three * steps set up a custom mapping: * <ol> - * <li>Defining the SQL structured type or <code>DISTINCT</code> type in SQL + * <li>Defining the SQL structured type or {@code DISTINCT} type in SQL * <li>Defining the class in the Java programming language to which the * SQL UDT will be mapped. This class must implement the - * <code>SQLData</code> interface. - * <li>Making an entry in a <code>Connection</code> object's type map + * {@code SQLData} interface. + * <li>Making an entry in a {@code Connection} object's type map * that contains two things: * <ul> * <li>the fully-qualified SQL name of the UDT - * <li>the <code>Class</code> object for the class that implements the - * <code>SQLData</code> interface + * <li>the {@code Class} object for the class that implements the + * {@code SQLData} interface * </ul> * </ol> * <p> * When these are in place for a UDT, calling the methods - * <code>ResultSet.getObject</code> or <code>CallableStatement.getObject</code> + * {@code ResultSet.getObject} or {@code CallableStatement.getObject} * on that UDT will automatically retrieve the custom mapping for it. Also, the - * <code>PreparedStatement.setObject</code> method will automatically map the + * {@code PreparedStatement.setObject} method will automatically map the * object back to its SQL type to store it in the data source. * * <h2>Package Specification</h2>
--- a/src/java.sql/share/classes/javax/sql/package-info.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/java.sql/share/classes/javax/sql/package-info.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /** - * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2020, 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 @@ -26,36 +26,36 @@ /** * Provides the API for server side data source access and processing from * the Java™ programming language. - * This package supplements the <code>java.sql</code> + * This package supplements the {@code java.sql} * package and, as of the version 1.4 release, is included in the * Java Platform, Standard Edition (Java SE™). * It remains an essential part of the Java Platform, Enterprise Edition * (Java EE™). * <p> - * The <code>javax.sql</code> package provides for the following: + * The {@code javax.sql} package provides for the following: * <OL> - * <LI>The <code>DataSource</code> interface as an alternative to the - * <code>DriverManager</code> for establishing a + * <LI>The {@code DataSource} interface as an alternative to the + * {@code DriverManager} for establishing a * connection with a data source * <LI>Connection pooling and Statement pooling * <LI>Distributed transactions * <LI>Rowsets * </OL> * <p> - * Applications use the <code>DataSource</code> and <code>RowSet</code> + * Applications use the {@code DataSource} and {@code RowSet} * APIs directly, but the connection pooling and distributed transaction * APIs are used internally by the middle-tier infrastructure. * - * <H2>Using a <code>DataSource</code> Object to Make a Connection</H2> + * <H2>Using a {@code DataSource} Object to Make a Connection</H2> * <p> - * The <code>javax.sql</code> package provides the preferred - * way to make a connection with a data source. The <code>DriverManager</code> + * The {@code javax.sql} package provides the preferred + * way to make a connection with a data source. The {@code DriverManager} * class, the original mechanism, is still valid, and code using it will - * continue to run. However, the newer <code>DataSource</code> mechanism + * continue to run. However, the newer {@code DataSource} mechanism * is preferred because it offers many advantages over the - * <code>DriverManager</code> mechanism. + * {@code DriverManager} mechanism. * <p> - * These are the main advantages of using a <code>DataSource</code> object to + * These are the main advantages of using a {@code DataSource} object to * make a connection: * <UL> * @@ -63,39 +63,39 @@ * that it is not necessary to make changes in application code when * something about the data source or driver changes. * <LI>Connection and Statement pooling and distributed transactions are available - * through a <code>DataSource</code> object that is + * through a {@code DataSource} object that is * implemented to work with the middle-tier infrastructure. - * Connections made through the <code>DriverManager</code> + * Connections made through the {@code DriverManager} * do not have connection and statement pooling or distributed transaction * capabilities. * </UL> * <p> - * Driver vendors provide <code>DataSource</code> implementations. A - * particular <code>DataSource</code> object represents a particular - * physical data source, and each connection the <code>DataSource</code> object + * Driver vendors provide {@code DataSource} implementations. A + * particular {@code DataSource} object represents a particular + * physical data source, and each connection the {@code DataSource} object * creates is a connection to that physical data source. * <p> * A logical name for the data source is registered with a naming service that * uses the Java Naming and Directory Interface™ * (JNDI) API, usually by a system administrator or someone performing the * duties of a system administrator. An application can retrieve the - * <code>DataSource</code> object it wants by doing a lookup on the logical + * {@code DataSource} object it wants by doing a lookup on the logical * name that has been registered for it. The application can then use the - * <code>DataSource</code> object to create a connection to the physical data + * {@code DataSource} object to create a connection to the physical data * source it represents. * <p> - * A <code>DataSource</code> object can be implemented to work with the + * A {@code DataSource} object can be implemented to work with the * middle tier infrastructure so that the connections it produces will be - * pooled for reuse. An application that uses such a <code>DataSource</code> + * pooled for reuse. An application that uses such a {@code DataSource} * implementation will automatically get a connection that participates in * connection pooling. - * A <code>DataSource</code> object can also be implemented to work with the + * A {@code DataSource} object can also be implemented to work with the * middle tier infrastructure so that the connections it produces can be * used for distributed transactions without any special coding. * * <H2>Connection Pooling and Statement Pooling</H2> * <p> - * Connections made via a <code>DataSource</code> + * Connections made via a {@code DataSource} * object that is implemented to work with a middle tier connection pool manager * will participate in connection pooling. This can improve performance * dramatically because creating new connections is very expensive. @@ -106,40 +106,40 @@ * Connection pooling is totally transparent. It is done automatically * in the middle tier of a Java EE configuration, so from an application's * viewpoint, no change in code is required. An application simply uses - * the <code>DataSource.getConnection</code> method to get the pooled - * connection and uses it the same way it uses any <code>Connection</code> + * the {@code DataSource.getConnection} method to get the pooled + * connection and uses it the same way it uses any {@code Connection} * object. * <p> * The classes and interfaces used for connection pooling are: * <UL> - * <LI><code>ConnectionPoolDataSource</code> - * <LI><code>PooledConnection</code> - * <LI><code>ConnectionEvent</code> - * <LI><code>ConnectionEventListener</code> - * <LI><code>StatementEvent</code> - * <LI><code>StatementEventListener</code> + * <LI>{@code ConnectionPoolDataSource} + * <LI>{@code PooledConnection} + * <LI>{@code ConnectionEvent} + * <LI>{@code ConnectionEventListener} + * <LI>{@code StatementEvent} + * <LI>{@code StatementEventListener} * </UL> * The connection pool manager, a facility in the middle tier of * a three-tier architecture, uses these classes and interfaces - * behind the scenes. When a <code>ConnectionPoolDataSource</code> object - * is called on to create a <code>PooledConnection</code> object, the - * connection pool manager will register as a <code>ConnectionEventListener</code> - * object with the new <code>PooledConnection</code> object. When the connection + * behind the scenes. When a {@code ConnectionPoolDataSource} object + * is called on to create a {@code PooledConnection} object, the + * connection pool manager will register as a {@code ConnectionEventListener} + * object with the new {@code PooledConnection} object. When the connection * is closed or there is an error, the connection pool manager (being a listener) - * gets a notification that includes a <code>ConnectionEvent</code> object. + * gets a notification that includes a {@code ConnectionEvent} object. * <p> - * If the connection pool manager supports <code>Statement</code> pooling, for - * <code>PreparedStatements</code>, which can be determined by invoking the method - * <code>DatabaseMetaData.supportsStatementPooling</code>, the - * connection pool manager will register as a <code>StatementEventListener</code> - * object with the new <code>PooledConnection</code> object. When the - * <code>PreparedStatement</code> is closed or there is an error, the connection + * If the connection pool manager supports {@code Statement} pooling, for + * {@code PreparedStatements}, which can be determined by invoking the method + * {@code DatabaseMetaData.supportsStatementPooling}, the + * connection pool manager will register as a {@code StatementEventListener} + * object with the new {@code PooledConnection} object. When the + * {@code PreparedStatement} is closed or there is an error, the connection * pool manager (being a listener) - * gets a notification that includes a <code>StatementEvent</code> object. + * gets a notification that includes a {@code StatementEvent} object. * * <H2>Distributed Transactions</H2> * <p> - * As with pooled connections, connections made via a <code>DataSource</code> + * As with pooled connections, connections made via a {@code DataSource} * object that is implemented to work with the middle tier infrastructure * may participate in distributed transactions. This gives an application * the ability to involve data sources on multiple servers in a single @@ -147,112 +147,112 @@ * <p> * The classes and interfaces used for distributed transactions are: * <UL> - * <LI><code>XADataSource</code> - * <LI><code>XAConnection</code> + * <LI>{@code XADataSource} + * <LI>{@code XAConnection} * </UL> * These interfaces are used by the transaction manager; an application does * not use them directly. * <p> - * The <code>XAConnection</code> interface is derived from the - * <code>PooledConnection</code> interface, so what applies to a pooled connection + * The {@code XAConnection} interface is derived from the + * {@code PooledConnection} interface, so what applies to a pooled connection * also applies to a connection that is part of a distributed transaction. * A transaction manager in the middle tier handles everything transparently. * The only change in application code is that an application cannot do anything * that would interfere with the transaction manager's handling of the transaction. - * Specifically, an application cannot call the methods <code>Connection.commit</code> - * or <code>Connection.rollback</code>, and it cannot set the connection to be in + * Specifically, an application cannot call the methods {@code Connection.commit} + * or {@code Connection.rollback}, and it cannot set the connection to be in * auto-commit mode (that is, it cannot call - * <code>Connection.setAutoCommit(true)</code>). + * {@code Connection.setAutoCommit(true)}). * <p> * An application does not need to do anything special to participate in a * distributed transaction. * It simply creates connections to the data sources it wants to use via - * the <code>DataSource.getConnection</code> method, just as it normally does. + * the {@code DataSource.getConnection} method, just as it normally does. * The transaction manager manages the transaction behind the scenes. The - * <code>XADataSource</code> interface creates <code>XAConnection</code> objects, and - * each <code>XAConnection</code> object creates an <code>XAResource</code> object + * {@code XADataSource} interface creates {@code XAConnection} objects, and + * each {@code XAConnection} object creates an {@code XAResource} object * that the transaction manager uses to manage the connection. * * * <H2>Rowsets</H2> - * The <code>RowSet</code> interface works with various other classes and + * The {@code RowSet} interface works with various other classes and * interfaces behind the scenes. These can be grouped into three categories. * <OL> * <LI>Event Notification * <UL> - * <LI><code>RowSetListener</code><br> - * A <code>RowSet</code> object is a JavaBeans™ + * <LI>{@code RowSetListener}<br> + * A {@code RowSet} object is a JavaBeans™ * component because it has properties and participates in the JavaBeans - * event notification mechanism. The <code>RowSetListener</code> interface + * event notification mechanism. The {@code RowSetListener} interface * is implemented by a component that wants to be notified about events that - * occur to a particular <code>RowSet</code> object. Such a component registers - * itself as a listener with a rowset via the <code>RowSet.addRowSetListener</code> + * occur to a particular {@code RowSet} object. Such a component registers + * itself as a listener with a rowset via the {@code RowSet.addRowSetListener} * method. * <p> - * When the <code>RowSet</code> object changes one of its rows, changes all of + * When the {@code RowSet} object changes one of its rows, changes all of * it rows, or moves its cursor, it also notifies each listener that is registered * with it. The listener reacts by carrying out its implementation of the * notification method called on it. - * <LI><code>RowSetEvent</code><br> - * As part of its internal notification process, a <code>RowSet</code> object - * creates an instance of <code>RowSetEvent</code> and passes it to the listener. - * The listener can use this <code>RowSetEvent</code> object to find out which rowset + * <LI>{@code RowSetEvent}<br> + * As part of its internal notification process, a {@code RowSet} object + * creates an instance of {@code RowSetEvent} and passes it to the listener. + * The listener can use this {@code RowSetEvent} object to find out which rowset * had the event. * </UL> * <LI>Metadata * <UL> - * <LI><code>RowSetMetaData</code><br> + * <LI>{@code RowSetMetaData}<br> * This interface, derived from the - * <code>ResultSetMetaData</code> interface, provides information about - * the columns in a <code>RowSet</code> object. An application can use - * <code>RowSetMetaData</code> methods to find out how many columns the + * {@code ResultSetMetaData} interface, provides information about + * the columns in a {@code RowSet} object. An application can use + * {@code RowSetMetaData} methods to find out how many columns the * rowset contains and what kind of data each column can contain. * <p> - * The <code>RowSetMetaData</code> interface provides methods for + * The {@code RowSetMetaData} interface provides methods for * setting the information about columns, but an application would not - * normally use these methods. When an application calls the <code>RowSet</code> - * method <code>execute</code>, the <code>RowSet</code> object will contain - * a new set of rows, and its <code>RowSetMetaData</code> object will have been + * normally use these methods. When an application calls the {@code RowSet} + * method {@code execute}, the {@code RowSet} object will contain + * a new set of rows, and its {@code RowSetMetaData} object will have been * internally updated to contain information about the new columns. * </UL> * <LI>The Reader/Writer Facility<br> - * A <code>RowSet</code> object that implements the <code>RowSetInternal</code> - * interface can call on the <code>RowSetReader</code> object associated with it - * to populate itself with data. It can also call on the <code>RowSetWriter</code> + * A {@code RowSet} object that implements the {@code RowSetInternal} + * interface can call on the {@code RowSetReader} object associated with it + * to populate itself with data. It can also call on the {@code RowSetWriter} * object associated with it to write any changes to its rows back to the * data source from which it originally got the rows. * A rowset that remains connected to its data source does not need to use a * reader and writer because it can simply operate on the data source directly. * * <UL> - * <LI><code>RowSetInternal</code><br> - * By implementing the <code>RowSetInternal</code> interface, a - * <code>RowSet</code> object gets access to + * <LI>{@code RowSetInternal}<br> + * By implementing the {@code RowSetInternal} interface, a + * {@code RowSet} object gets access to * its internal state and is able to call on its reader and writer. A rowset * keeps track of the values in its current rows and of the values that immediately * preceded the current ones, referred to as the <i>original</i> values. A rowset * also keeps track of (1) the parameters that have been set for its command and * (2) the connection that was passed to it, if any. A rowset uses the - * <code>RowSetInternal</code> methods behind the scenes to get access to + * {@code RowSetInternal} methods behind the scenes to get access to * this information. An application does not normally invoke these methods directly. * - * <LI><code>RowSetReader</code><br> - * A disconnected <code>RowSet</code> object that has implemented the - * <code>RowSetInternal</code> interface can call on its reader (the - * <code>RowSetReader</code> object associated with it) to populate it with - * data. When an application calls the <code>RowSet.execute</code> method, + * <LI>{@code RowSetReader}<br> + * A disconnected {@code RowSet} object that has implemented the + * {@code RowSetInternal} interface can call on its reader (the + * {@code RowSetReader} object associated with it) to populate it with + * data. When an application calls the {@code RowSet.execute} method, * that method calls on the rowset's reader to do much of the work. Implementations * can vary widely, but generally a reader makes a connection to the data source, * reads data from the data source and populates the rowset with it, and closes - * the connection. A reader may also update the <code>RowSetMetaData</code> object + * the connection. A reader may also update the {@code RowSetMetaData} object * for its rowset. The rowset's internal state is also updated, either by the - * reader or directly by the method <code>RowSet.execute</code>. + * reader or directly by the method {@code RowSet.execute}. * * - * <LI><code>RowSetWriter</code><br> - * A disconnected <code>RowSet</code> object that has implemented the - * <code>RowSetInternal</code> interface can call on its writer (the - * <code>RowSetWriter</code> object associated with it) to write changes + * <LI>{@code RowSetWriter}<br> + * A disconnected {@code RowSet} object that has implemented the + * {@code RowSetInternal} interface can call on its writer (the + * {@code RowSetWriter} object associated with it) to write changes * back to the underlying data source. Implementations may vary widely, but * generally, a writer will do the following: * @@ -269,7 +269,7 @@ * </UL> * </OL> * <p> - * The <code>RowSet</code> interface may be implemented in any number of + * The {@code RowSet} interface may be implemented in any number of * ways, and anyone may write an implementation. Developers are encouraged * to use their imaginations in coming up with new ways to use rowsets. * @@ -283,7 +283,7 @@ * <h2>Related Documentation</h2> * <p> * The Java Series book published by Addison-Wesley Longman provides detailed - * information about the classes and interfaces in the <code>javax.sql</code> + * information about the classes and interfaces in the {@code javax.sql} * package: * * <ul>
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java Thu Jan 30 22:06:12 2020 +0000 @@ -170,8 +170,11 @@ if (bindingVar != null) { //TODO: cannot be null here? JCAssign fakeInit = (JCAssign)make.at(tree.pos).Assign( make.Ident(bindingVar), convert(make.Ident(temp), castTargetType)).setType(bindingVar.erasure(types)); - result = makeBinary(Tag.AND, (JCExpression)result, - makeBinary(Tag.EQ, fakeInit, convert(make.Ident(temp), castTargetType))); + LetExpr nestedLE = make.LetExpr(List.of(make.Exec(fakeInit)), + make.Literal(true)); + nestedLE.needsCond = true; + nestedLE.setType(syms.booleanType); + result = makeBinary(Tag.AND, (JCExpression)result, nestedLE); } result = make.at(tree.pos).LetExpr(make.VarDef(temp, translatedExpr), (JCExpression)result).setType(syms.booleanType); ((LetExpr) result).needsCond = true;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java Thu Jan 30 22:06:12 2020 +0000 @@ -4023,7 +4023,7 @@ int pos = token.pos; JCModifiers mods = modifiersOpt(); if (token.kind == CLASS || - isRecordStart() || + allowRecords && isRecordStart() || token.kind == INTERFACE || token.kind == ENUM) { return List.of(classOrRecordOrInterfaceOrEnumDeclaration(mods, dc));
--- a/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.incubator.foreign/share/classes/jdk/internal/foreign/Utils.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2019, 2020, 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 @@ -49,8 +49,9 @@ private static Unsafe unsafe = Unsafe.getUnsafe(); - // The maximum alignment supported by malloc - typically 16 on 64-bit platforms. - private final static long MAX_ALIGN = 16; + // The maximum alignment supported by malloc - typically 16 on + // 64-bit platforms and 8 on 32-bit platforms. + private final static long MAX_ALIGN = Unsafe.ADDRESS_SIZE == 4 ? 8 : 16; private static final JavaNioAccess javaNioAccess = SharedSecrets.getJavaNioAccess();
--- a/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.incubator.jpackage/windows/classes/jdk/incubator/jpackage/internal/resources/WinLauncher.template Thu Jan 30 22:06:12 2020 +0000 @@ -1,29 +1,3 @@ -# -# Copyright (c) 2017, 2019, 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 -# under the terms of the GNU General Public License version 2 only, as -# published by the Free Software Foundation. Oracle designates this -# particular file as subject to the "Classpath" exception as provided -# by Oracle in the LICENSE file that accompanied this code. -# -# This code is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# version 2 for more details (a copy is included in the LICENSE file that -# accompanied this code). -# -# You should have received a copy of the GNU General Public License version -# 2 along with this work; if not, write to the Free Software Foundation, -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -# or visit www.oracle.com if you need additional information or have any -# questions. -# -# - CompanyName=COMPANY_NAME FileDescription=FILE_DESCRIPTION FileVersion=FILE_VERSION
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTool.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/api/JavadocTool.java Thu Jan 30 22:06:12 2020 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2020, 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 @@ -50,7 +50,7 @@ import com.sun.tools.javac.util.ClientCodeException; import com.sun.tools.javac.util.Context; import com.sun.tools.javac.util.Log; -import jdk.javadoc.internal.tool.ToolOption; +import jdk.javadoc.internal.tool.ToolOptions; /** * Provides access to functionality specific to the JDK documentation tool, @@ -170,13 +170,7 @@ public int isSupportedOption(String option) { if (option == null) throw new NullPointerException(); - for (ToolOption o : ToolOption.values()) { - for (String name : o.names) { - if (name.equals(option)) - return o.hasArg ? 1 : 0; - } - } - return -1; + return ToolOptions.isSupportedOption(option); } }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -378,7 +378,7 @@ } protected void serialWarning(Element e, String key, String a1, String a2) { - if (options.serialWarn) { + if (options.serialWarn()) { configuration.messages.warning(e, key, a1, a2); } } @@ -596,7 +596,7 @@ // Name HtmlTree nameSpan = new HtmlTree(HtmlTag.SPAN); nameSpan.setStyle(HtmlStyle.memberName); - if (options.linkSource) { + if (options.linkSource()) { Content name = new StringContent(name(element)); writer.addSrcLink(element, name, nameSpan); } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractOverviewIndexWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -141,7 +141,7 @@ .setFooter(footer) .toContent()); printHtmlDocument( - configuration.metakeywords.getOverviewMetaKeywords(title, configuration.getOptions().docTitle), + configuration.metakeywords.getOverviewMetaKeywords(title, configuration.getOptions().docTitle()), description, body); } @@ -158,7 +158,7 @@ * @param body the document tree to which the title will be added */ protected void addConfigurationTitle(Content body) { - String doctitle = configuration.getOptions().docTitle; + String doctitle = configuration.getOptions().docTitle(); if (!doctitle.isEmpty()) { Content title = new RawHtml(doctitle); Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -113,7 +113,7 @@ .setHeader(new TableHeader(contents.packageLabel, contents.descriptionLabel)) .setColumnStyles(HtmlStyle.colFirst, HtmlStyle.colLast); for (PackageElement pkg : configuration.packages) { - if (!(configuration.getOptions().noDeprecated && utils.isDeprecated(pkg))) { + if (!(options.noDeprecated() && utils.isDeprecated(pkg))) { Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg)); Content summaryContent = new ContentBuilder(); addSummaryComment(pkg, summaryContent);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -187,7 +187,7 @@ LinkInfoImpl.Kind.CLASS_SIGNATURE, annotationType); Content annotationName = new StringContent(utils.getSimpleName(annotationType)); Content parameterLinks = getTypeParameterLinks(linkInfo); - if (configuration.getOptions().linkSource) { + if (options.linkSource()) { addSrcLink(annotationType, annotationName, pre); pre.add(parameterLinks); } else { @@ -203,7 +203,7 @@ */ @Override public void addAnnotationTypeDescription(Content annotationInfoTree) { - if (!configuration.getOptions().noComment) { + if (!options.noComment()) { if (!utils.getFullBody(annotationType).isEmpty()) { addInlineComment(annotationType, annotationInfoTree); } @@ -215,7 +215,7 @@ */ @Override public void addAnnotationTypeTagInfo(Content annotationInfoTree) { - if (!configuration.getOptions().noComment) { + if (!options.noComment()) { addTagsInfo(annotationType, annotationInfoTree); } }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -159,7 +159,7 @@ */ public static void generate(HtmlConfiguration configuration, ClassTree classtree) throws DocFileIOException { ClassUseMapper mapper = new ClassUseMapper(configuration, classtree); - boolean nodeprecated = configuration.getOptions().noDeprecated; + boolean nodeprecated = configuration.getOptions().noDeprecated(); Utils utils = configuration.utils; for (TypeElement aClass : configuration.getIncludedTypeElements()) { // If -nodeprecated option is set and the containing package is marked
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -228,7 +228,7 @@ linkInfo.linkToSelf = false; Content className = new StringContent(utils.getSimpleName(typeElement)); Content parameterLinks = getTypeParameterLinks(linkInfo); - if (configuration.getOptions().linkSource) { + if (options.linkSource()) { addSrcLink(typeElement, className, pre); pre.add(parameterLinks); } else { @@ -299,7 +299,7 @@ */ @Override public void addClassDescription(Content classInfoTree) { - if(!configuration.getOptions().noComment) { + if (!options.noComment()) { // generate documentation for the class. if (!utils.getFullBody(typeElement).isEmpty()) { addInlineComment(typeElement, classInfoTree); @@ -312,7 +312,7 @@ */ @Override public void addClassTagInfo(Content classInfoTree) { - if(!configuration.getOptions().noComment) { + if (!options.noComment()) { // Print Information about all the tags here addTagsInfo(typeElement, classInfoTree); }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/DocFilesHandlerImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -162,7 +162,7 @@ } } } else if (srcfile.isDirectory()) { - if (options.copyDocfileSubdirs + if (options.copyDocfileSubdirs() && !configuration.shouldExcludeDocFileDir(srcfile.getName())) { DocPath dirDocPath = dstDocPath.resolve(srcfile.getName()); copyDirectory(srcfile, dirDocPath, first);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -201,7 +201,7 @@ Content classLink = writer.getPreQualifiedClassLink( LinkInfoImpl.Kind.MEMBER, typeElement, false); Content label; - if (options.summarizeOverriddenMethods) { + if (options.summarizeOverriddenMethods()) { label = new StringContent(utils.isClass(typeElement) ? resources.getText("doclet.Fields_Declared_In_Class") : resources.getText("doclet.Fields_Declared_In_Interface"));
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -132,7 +132,7 @@ ul.setStyle(HtmlStyle.blockList); // Overview - if (options.createOverview) { + if (options.createOverview()) { Content overviewHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.overviewLabel); htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, overviewHeading); @@ -246,7 +246,7 @@ ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); // Class Use - if (options.classUse) { + if (options.classUse()) { Content useHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.getContent("doclet.help.use.head")); htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, useHead); @@ -257,7 +257,7 @@ } // Tree - if (options.createTree) { + if (options.createTree()) { Content treeHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.getContent("doclet.help.tree.head")); htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, treeHead); @@ -275,7 +275,7 @@ } // Deprecated - if (!(options.noDeprecatedList || options.noDeprecated)) { + if (!(options.noDeprecatedList() || options.noDeprecated())) { Content dHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.deprecatedAPI); htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, dHead); @@ -288,9 +288,9 @@ } // Index - if (options.createIndex) { + if (options.createIndex()) { Content indexlink; - if (options.splitIndex) { + if (options.splitIndex()) { indexlink = links.createLink(DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)), resources.getText("doclet.Index")); } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java Thu Jan 30 22:06:12 2020 +0000 @@ -188,7 +188,7 @@ docPaths = new DocPaths(utils); setCreateOverview(); setTopFile(docEnv); - workArounds.initDocLint(options.doclintOpts.values(), tagletManager.getAllTagletNames()); + workArounds.initDocLint(options.doclintOpts(), tagletManager.getAllTagletNames()); return true; } @@ -206,7 +206,7 @@ if (!checkForDeprecation(docEnv)) { return; } - if (options.createOverview) { + if (options.createOverview()) { topFile = DocPaths.INDEX; } else { if (showModules) { @@ -224,7 +224,7 @@ } protected TypeElement getValidClass(List<TypeElement> classes) { - if (!options.noDeprecated) { + if (!options.noDeprecated()) { return classes.get(0); } for (TypeElement te : classes) { @@ -246,14 +246,14 @@ /** * Generate "overview.html" page if option "-overview" is used or number of - * packages is more than one. Sets {@link HtmlOptions#createOverview} field to true. + * packages is more than one. Sets {@code HtmlOptions.createOverview} field to true. */ protected void setCreateOverview() { - if (!options.noOverview) { - if (options.overviewPath != null + if (!options.noOverview()) { + if (options.overviewPath() != null || modules.size() > 1 || (modules.isEmpty() && packages.size() > 1)) { - options.createOverview = true; + options.setCreateOverview(true); } } } @@ -283,7 +283,7 @@ */ @Override public JavaFileObject getOverviewPath() { - String overviewpath = options.overviewPath; + String overviewpath = options.overviewPath(); if (overviewpath != null && getFileManager() instanceof StandardJavaFileManager) { StandardJavaFileManager fm = (StandardJavaFileManager) getFileManager(); return fm.getJavaFileObjects(overviewpath).iterator().next(); @@ -292,7 +292,7 @@ } public DocPath getMainStylesheet() { - String stylesheetfile = options.stylesheetFile; + String stylesheetfile = options.stylesheetFile(); if(!stylesheetfile.isEmpty()){ DocFile docFile = DocFile.createFileForInput(this, stylesheetfile); return DocPath.create(docFile.getName()); @@ -301,7 +301,7 @@ } public List<DocPath> getAdditionalStylesheets() { - return options.additionalStylesheets.stream() + return options.additionalStylesheets().stream() .map(ssf -> DocFile.createFileForInput(this, ssf)).map(file -> DocPath.create(file.getName())) .collect(Collectors.toList()); } @@ -342,16 +342,18 @@ @Override protected boolean finishOptionSettings0() throws DocletException { - if (options.docEncoding == null) { - if (options.charset == null) { - options.docEncoding = options.charset = (options.encoding == null) ? HTML_DEFAULT_CHARSET : options.encoding; + if (options.docEncoding() == null) { + if (options.charset() == null) { + String charset = (options.encoding() == null) ? HTML_DEFAULT_CHARSET : options.encoding(); + options.setCharset(charset); + options.setDocEncoding((options.charset())); } else { - options.docEncoding = options.charset; + options.setDocEncoding(options.charset()); } } else { - if (options.charset == null) { - options.charset = options.docEncoding; - } else if (!options.charset.equals(options.docEncoding)) { + if (options.charset() == null) { + options.setCharset(options.docEncoding()); + } else if (!options.charset().equals(options.docEncoding())) { reporter.print(ERROR, resources.getText("doclet.Option_conflict", "-charset", "-docencoding")); return false; }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDoclet.java Thu Jan 30 22:06:12 2020 +0000 @@ -109,7 +109,7 @@ throws DocletException { super.generateOtherFiles(docEnv, classtree); HtmlOptions options = configuration.getOptions(); - if (options.linkSource) { + if (options.linkSource()) { SourceToHTMLConverter.convertRoot(configuration, docEnv, DocPaths.SOURCE_OUTPUT); } @@ -120,27 +120,27 @@ messages.error("doclet.No_Non_Deprecated_Classes_To_Document"); return; } - boolean nodeprecated = options.noDeprecated; - performCopy(options.helpFile); - performCopy(options.stylesheetFile); - for (String stylesheet : options.additionalStylesheets) { + boolean nodeprecated = options.noDeprecated(); + performCopy(options.helpFile()); + performCopy(options.stylesheetFile()); + for (String stylesheet : options.additionalStylesheets()) { performCopy(stylesheet); } // do early to reduce memory footprint - if (options.classUse) { + if (options.classUse()) { ClassUseWriter.generate(configuration, classtree); } IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated); - if (options.createTree) { + if (options.createTree()) { TreeWriter.generate(configuration, classtree); } - if (!(options.noDeprecatedList || nodeprecated)) { + if (!(options.noDeprecatedList() || nodeprecated)) { DeprecatedListWriter.generate(configuration); } - if (options.createOverview) { + if (options.createOverview()) { if (configuration.showModules) { ModuleIndexWriter.generate(configuration); } else { @@ -148,9 +148,9 @@ } } - if (options.createIndex) { + if (options.createIndex()) { configuration.buildSearchTagIndex(); - if (options.splitIndex) { + if (options.splitIndex()) { SplitIndexWriter.generate(configuration, indexbuilder); } else { SingleIndexWriter.generate(configuration, indexbuilder); @@ -163,25 +163,25 @@ SystemPropertiesWriter.generate(configuration); } - if (options.createOverview) { + if (options.createOverview()) { IndexRedirectWriter.generate(configuration, DocPaths.OVERVIEW_SUMMARY, DocPaths.INDEX); } else { IndexRedirectWriter.generate(configuration); } - if (options.helpFile.isEmpty() && !options.noHelp) { + if (options.helpFile().isEmpty() && !options.noHelp()) { HelpWriter.generate(configuration); } // If a stylesheet file is not specified, copy the default stylesheet // and replace newline with platform-specific newline. DocFile f; - if (options.stylesheetFile.length() == 0) { + if (options.stylesheetFile().length() == 0) { f = DocFile.createFileForOutput(configuration, DocPaths.STYLESHEET); f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.STYLESHEET), true, true); } f = DocFile.createFileForOutput(configuration, DocPaths.JAVASCRIPT); f.copyResource(DocPaths.RESOURCES.resolve(DocPaths.JAVASCRIPT), true, true); - if (options.createIndex) { + if (options.createIndex()) { f = DocFile.createFileForOutput(configuration, DocPaths.SEARCH_JS); f.copyResource(DOCLET_RESOURCES.resolve(DocPaths.SEARCH_JS), true, true); @@ -203,7 +203,6 @@ "jquery-ui.min.css", "jquery-ui.structure.min.css", "jquery-ui.structure.css", - "external/jquery/jquery.js", "jszip/dist/jszip.js", "jszip/dist/jszip.min.js", "jszip-utils/dist/jszip-utils.js", @@ -280,12 +279,12 @@ // if -nodeprecated option is set and the package is marked as // deprecated, do not generate the package-summary.html, package-frame.html // and package-tree.html pages for that package. - if (!(options.noDeprecated && utils.isDeprecated(pkg))) { + if (!(options.noDeprecated() && utils.isDeprecated(pkg))) { AbstractBuilder packageSummaryBuilder = configuration.getBuilderFactory().getPackageSummaryBuilder(pkg); packageSummaryBuilder.build(); - if (options.createTree) { - PackageTreeWriter.generate(configuration, pkg, options.noDeprecated); + if (options.createTree()) { + PackageTreeWriter.generate(configuration, pkg, options.noDeprecated()); } } }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -262,9 +262,9 @@ // append htmlstr up to start of next {@docroot} buf.append(htmlstr.substring(prevEnd, match)); prevEnd = docrootMatcher.end(); - if (options.docrootParent.length() > 0 && htmlstr.startsWith("/..", prevEnd)) { + if (options.docrootParent().length() > 0 && htmlstr.startsWith("/..", prevEnd)) { // Insert the absolute link if {@docRoot} is followed by "/..". - buf.append(options.docrootParent); + buf.append(options.docrootParent()); prevEnd += 3; } else { // Insert relative path where {@docRoot} was located @@ -342,7 +342,7 @@ * @param htmltree the documentation tree to which the tags will be added */ protected void addTagsInfo(Element e, Content htmltree) { - if (options.noComment) { + if (options.noComment()) { return; } Content dl = new HtmlTree(HtmlTag.DL); @@ -451,14 +451,14 @@ List<DocPath> additionalStylesheets = configuration.getAdditionalStylesheets(); additionalStylesheets.addAll(localStylesheets); Head head = new Head(path, configuration.docletVersion, configuration.startTime) - .setTimestamp(!options.noTimestamp) + .setTimestamp(!options.noTimestamp()) .setDescription(description) .setGenerator(getGenerator(getClass())) .setTitle(winTitle) - .setCharset(options.charset) + .setCharset(options.charset()) .addKeywords(metakeywords) .setStylesheets(configuration.getMainStylesheet(), additionalStylesheets) - .setIndex(options.createIndex, mainBodyScript) + .setIndex(options.createIndex(), mainBodyScript) .addContent(extraHeadContent); Content htmlTree = HtmlTree.HTML(configuration.getLocale().getLanguage(), head.toContent(), body); @@ -473,8 +473,8 @@ * @return the window title string */ public String getWindowTitle(String title) { - if (options.windowTitle.length() > 0) { - title += " (" + options.windowTitle + ")"; + if (options.windowTitle().length() > 0) { + title += " (" + options.windowTitle() + ")"; } return title; } @@ -488,12 +488,12 @@ public Content getUserHeaderFooter(boolean header) { String content; if (header) { - content = replaceDocRootDir(options.header); + content = replaceDocRootDir(options.header()); } else { - if (options.footer.length() != 0) { - content = replaceDocRootDir(options.footer); + if (options.footer().length() != 0) { + content = replaceDocRootDir(options.footer()); } else { - content = replaceDocRootDir(options.header); + content = replaceDocRootDir(options.header()); } } Content rawContent = new RawHtml(content); @@ -506,7 +506,7 @@ * @param htmlTree the content tree to which user specified top will be added */ public void addTop(Content htmlTree) { - Content top = new RawHtml(replaceDocRootDir(options.top)); + Content top = new RawHtml(replaceDocRootDir(options.top())); htmlTree.add(top); } @@ -516,7 +516,7 @@ * @param htmlTree the content tree to which user specified bottom will be added */ public void addBottom(Content htmlTree) { - Content bottom = new RawHtml(replaceDocRootDir(options.bottom)); + Content bottom = new RawHtml(replaceDocRootDir(options.bottom())); Content small = HtmlTree.SMALL(bottom); Content p = HtmlTree.P(HtmlStyle.legalCopy, small); htmlTree.add(p); @@ -1262,7 +1262,7 @@ */ private void addCommentTags(Element element, DocTree holderTag, List<? extends DocTree> tags, boolean depr, boolean first, boolean inSummary, Content htmltree) { - if (options.noComment){ + if (options.noComment()){ return; } Content div; @@ -1423,8 +1423,8 @@ for (DocTree dt : node.getValue()) { if (utils.isText(dt) && isHRef) { String text = ((TextTree) dt).getBody(); - if (text.startsWith("/..") && !options.docrootParent.isEmpty()) { - result.add(options.docrootParent); + if (text.startsWith("/..") && !options.docrootParent().isEmpty()) { + result.add(options.docrootParent()); docRootContent = new ContentBuilder(); result.add(textCleanup(text.substring(3), isLastNode)); } else {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlOptions.java Thu Jan 30 22:06:12 2020 +0000 @@ -28,14 +28,11 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.ArrayList; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.TreeSet; import com.sun.tools.doclint.DocLint; -import jdk.javadoc.doclet.Doclet; import jdk.javadoc.doclet.Reporter; import jdk.javadoc.internal.doclets.toolkit.BaseOptions; import jdk.javadoc.internal.doclets.toolkit.Resources; @@ -51,140 +48,146 @@ * including the format-independent options handled * by {@link BaseOptions}. * + * <p>Some of the methods used to access the values of options + * have names that begin with a verb, such as {@link #createOverview} + * or {@link #splitIndex}. Unless otherwise stated, + * these methods should all be taken as just accessing the value + * of the associated option. + * */ public class HtmlOptions extends BaseOptions { //<editor-fold desc="Option values"> /** * Argument for command-line option {@code --add-stylesheet}. */ - public List<String> additionalStylesheets = new ArrayList<>(); + private List<String> additionalStylesheets = new ArrayList<>(); /** * Argument for command-line option {@code -bottom}. */ - public String bottom = ""; + private String bottom = ""; /** * Argument for command-line option {@code -charset}. * The META charset tag used for cross-platform viewing. */ - public String charset = null; + private String charset = null; /** * Argument for command-line option {@code -use}. * True if command-line option "-use" is used. Default value is false. */ - public boolean classUse = false; + private boolean classUse = false; /** * Argument for command-line option {@code -noindex}. * False if command-line option "-noindex" is used. Default value is true. */ - public boolean createIndex = true; + private boolean createIndex = true; /** * Argument for command-line option {@code -overview}. * This is true if option "-overview" is used or option "-overview" is not * used and number of packages is more than one. */ - public boolean createOverview = false; + private boolean createOverview = false; /** * Argument for command-line option {@code -notree}. * False if command-line option "-notree" is used. Default value is true. */ - public boolean createTree = true; + private boolean createTree = true; /** * Arguments for command-line option {@code -Xdoclint} and friends. * Collected set of doclint options. */ - public Map<Doclet.Option, String> doclintOpts = new LinkedHashMap<>(); + private List<String> doclintOpts = new ArrayList<>(); /** * Argument for command-line option {@code -Xdocrootparent}. */ - public String docrootParent = ""; + private String docrootParent = ""; /** * Argument for command-line option {@code -doctitle}. */ - public String docTitle = ""; + private String docTitle = ""; /** * Argument for command-line option {@code -footer}. */ - public String footer = ""; + private String footer = ""; /** * Argument for command-line option {@code -header}. */ - public String header = ""; + private String header = ""; /** * Argument for command-line option {@code -helpfile}. */ - public String helpFile = ""; + private String helpFile = ""; /** * Argument for command-line option {@code -nodeprecated}. * True if command-line option "-nodeprecated" is used. Default value is * false. */ - public boolean noDeprecatedList = false; + private boolean noDeprecatedList = false; /** * Argument for command-line option {@code -nohelp}. * True if command-line option "-nohelp" is used. Default value is false. */ - public boolean noHelp = false; + private boolean noHelp = false; /** * Argument for command-line option {@code -nonavbar}. * True if command-line option "-nonavbar" is used. Default value is false. */ - public boolean noNavbar = false; + private boolean noNavbar = false; /** * Argument for command-line option {@code -nooverview}. * True if command-line option "-nooverview" is used. Default value is * false */ - boolean noOverview = false; + private boolean noOverview = false; /** * Argument for command-line option {@code -overview}. * The overview path specified with "-overview" flag. */ - public String overviewPath = null; + private String overviewPath = null; /** * Argument for command-line option {@code -packagesheader}. */ - public String packagesHeader = ""; + private String packagesHeader = ""; /** * Argument for command-line option {@code -splitindex}. * True if command-line option "-splitindex" is used. Default value is * false. */ - public boolean splitIndex = false; + private boolean splitIndex = false; /** * Argument for command-line option {@code -stylesheetfile}. */ - public String stylesheetFile = ""; + private String stylesheetFile = ""; /** * Argument for command-line option {@code -top}. */ - public String top = ""; + private String top = ""; /** * Argument for command-line option {@code -windowtitle}. */ - public String windowTitle = ""; + private String windowTitle = ""; //</editor-fold> private HtmlConfiguration config; @@ -405,7 +408,37 @@ new XOption(resources, "-Xdoclint") { @Override public boolean process(String opt, List<String> args) { - doclintOpts.put(this, DocLint.XMSGS_OPTION); + doclintOpts.add(DocLint.XMSGS_OPTION); + return true; + } + }, + + new XOption(resources, "doclet.usage.xdoclint-extended", "-Xdoclint:", 0) { + @Override + public boolean process(String opt, List<String> args) { + String dopt = opt.replace("-Xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX); + if (dopt.contains("/")) { + reporter.print(ERROR, resources.getText("doclet.Option_doclint_no_qualifiers")); + return false; + } + if (!DocLint.isValidOption(dopt)) { + reporter.print(ERROR, resources.getText("doclet.Option_doclint_invalid_arg")); + return false; + } + doclintOpts.add(dopt); + return true; + } + }, + + new XOption(resources, "doclet.usage.xdoclint-package", "-Xdoclint/package:", 0) { + @Override + public boolean process(String opt, List<String> args) { + String dopt = opt.replace("-Xdoclint/package:", DocLint.XCHECK_PACKAGE); + if (!DocLint.isValidOption(dopt)) { + reporter.print(ERROR, resources.getText("doclet.Option_doclint_package_invalid_arg")); + return false; + } + doclintOpts.add(dopt); return true; } }, @@ -424,36 +457,6 @@ } }, - new XOption(resources, "doclet.usage.xdoclint-extended", "-Xdoclint:", 0) { - @Override - public boolean process(String opt, List<String> args) { - String dopt = opt.replace("-Xdoclint:", DocLint.XMSGS_CUSTOM_PREFIX); - doclintOpts.put(this, dopt); - if (dopt.contains("/")) { - reporter.print(ERROR, resources.getText("doclet.Option_doclint_no_qualifiers")); - return false; - } - if (!DocLint.isValidOption(dopt)) { - reporter.print(ERROR, resources.getText("doclet.Option_doclint_invalid_arg")); - return false; - } - return true; - } - }, - - new XOption(resources, "doclet.usage.xdoclint-package", "-Xdoclint/package:", 0) { - @Override - public boolean process(String opt, List<String> args) { - String dopt = opt.replace("-Xdoclint/package:", DocLint.XCHECK_PACKAGE); - doclintOpts.put(this, dopt); - if (!DocLint.isValidOption(dopt)) { - reporter.print(ERROR, resources.getText("doclet.Option_doclint_package_invalid_arg")); - return false; - } - return true; - } - }, - new XOption(resources, "--no-frames") { @Override public boolean process(String opt, List<String> args) { @@ -516,4 +519,188 @@ return true; } + /** + * Argument for command-line option {@code --add-stylesheet}. + */ + List<String> additionalStylesheets() { + return additionalStylesheets; + } + + /** + * Argument for command-line option {@code -bottom}. + */ + String bottom() { + return bottom; + } + + /** + * Argument for command-line option {@code -charset}. + * The META charset tag used for cross-platform viewing. + */ + String charset() { + return charset; + } + + void setCharset(String charset) { + this.charset = charset; + } + + /** + * Argument for command-line option {@code -use}. + * True if command-line option "-use" is used. Default value is false. + */ + public boolean classUse() { + return classUse; + } + + /** + * Argument for command-line option {@code -noindex}. + * False if command-line option "-noindex" is used. Default value is true. + */ + public boolean createIndex() { + return createIndex; + } + + /** + * Argument for command-line option {@code -overview}. + * This is true if option "-overview" is used or option "-overview" is not + * used and number of packages is more than one. + */ + public boolean createOverview() { + return createOverview; + } + + public void setCreateOverview(boolean createOverview) { + this.createOverview = createOverview; + } + + /** + * Argument for command-line option {@code -notree}. + * False if command-line option "-notree" is used. Default value is true. + */ + public boolean createTree() { + return createTree; + } + + /** + * Arguments for command-line option {@code -Xdoclint} and friends. + * Collected set of doclint options. + */ + List<String> doclintOpts() { + return doclintOpts; + } + + /** + * Argument for command-line option {@code -Xdocrootparent}. + */ + String docrootParent() { + return docrootParent; + } + + /** + * Argument for command-line option {@code -doctitle}. + */ + String docTitle() { + return docTitle; + } + + /** + * Argument for command-line option {@code -footer}. + */ + String footer() { + return footer; + } + + /** + * Argument for command-line option {@code -header}. + */ + String header() { + return header; + } + + /** + * Argument for command-line option {@code -helpfile}. + */ + public String helpFile() { + return helpFile; + } + + /** + * Argument for command-line option {@code -nodeprecated}. + * True if command-line option "-nodeprecated" is used. Default value is + * false. + */ + public boolean noDeprecatedList() { + return noDeprecatedList; + } + + /** + * Argument for command-line option {@code -nohelp}. + * True if command-line option "-nohelp" is used. Default value is false. + */ + public boolean noHelp() { + return noHelp; + } + + /** + * Argument for command-line option {@code -nonavbar}. + * True if command-line option "-nonavbar" is used. Default value is false. + */ + public boolean noNavbar() { + return noNavbar; + } + + /** + * Argument for command-line option {@code -nooverview}. + * True if command-line option "-nooverview" is used. Default value is + * false + */ + boolean noOverview() { + return noOverview; + } + + /** + * Argument for command-line option {@code -overview}. + * The overview path specified with "-overview" flag. + */ + String overviewPath() { + return overviewPath; + } + + /** + * Argument for command-line option {@code -packagesheader}. + */ + String packagesHeader() { + return packagesHeader; + } + + /** + * Argument for command-line option {@code -splitindex}. + * True if command-line option "-splitindex" is used. Default value is + * false. + */ + public boolean splitIndex() { + return splitIndex; + } + + /** + * Argument for command-line option {@code -stylesheetfile}. + */ + String stylesheetFile() { + return stylesheetFile; + } + + /** + * Argument for command-line option {@code -top}. + */ + String top() { + return top; + } + + /** + * Argument for command-line option {@code -windowtitle}. + */ + String windowTitle() { + return windowTitle; + } }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -207,7 +207,7 @@ * @return true if overview details need to be printed */ public boolean shouldPrintOverview(VariableElement field) { - if (!options.noComment) { + if (!options.noComment()) { if(!utils.getFullBody(field).isEmpty() || writer.hasSerializationOverviewTags(field)) return true;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexRedirectWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -75,18 +75,18 @@ private void generateIndexFile() throws DocFileIOException { Content htmlComment = contents.newPage; Head head = new Head(path, configuration.docletVersion, configuration.startTime) - .setTimestamp(!options.noTimestamp) + .setTimestamp(!options.noTimestamp()) .setDescription("index redirect") .setGenerator(getGenerator(getClass())) .setStylesheets(configuration.getMainStylesheet(), Collections.emptyList()) // avoid reference to default stylesheet .addDefaultScript(false); - String title = (options.windowTitle.length() > 0) - ? options.windowTitle + String title = (options.windowTitle().length() > 0) + ? options.windowTitle() : resources.getText("doclet.Generated_Docs_Untitled"); head.setTitle(title) - .setCharset(options.charset) + .setCharset(options.charset()) .setCanonicalLink(target); String targetPath = target.getPath();
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -253,7 +253,7 @@ Content classLink = writer.getPreQualifiedClassLink( LinkInfoImpl.Kind.MEMBER, typeElement, false); Content label; - if (options.summarizeOverriddenMethods) { + if (options.summarizeOverriddenMethods()) { label = new StringContent(utils.isClass(typeElement) ? resources.getText("doclet.Methods_Declared_In_Class") : resources.getText("doclet.Methods_Declared_In_Interface")); @@ -285,7 +285,7 @@ */ protected static void addOverridden(HtmlDocletWriter writer, TypeMirror overriddenType, ExecutableElement method, Content dl) { - if (writer.options.noComment) { + if (writer.options.noComment()) { return; } Utils utils = writer.utils; @@ -336,7 +336,7 @@ protected static void addImplementsInfo(HtmlDocletWriter writer, ExecutableElement method, Content dl) { Utils utils = writer.utils; - if (utils.isStatic(method) || writer.options.noComment) { + if (utils.isStatic(method) || writer.options.noComment()) { return; } Contents contents = writer.contents;
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleIndexWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -108,7 +108,7 @@ for (ModuleElement mdle : modules) { if (!mdle.isUnnamed()) { - if (!(options.noDeprecated && utils.isDeprecated(mdle))) { + if (!(options.noDeprecated() && utils.isDeprecated(mdle))) { Content moduleLinkContent = getModuleLink(mdle, new StringContent(mdle.getQualifiedName().toString())); Content summaryContent = new ContentBuilder(); addSummaryComment(mdle, summaryContent);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -188,7 +188,7 @@ HtmlTree bodyTree = getBody(getWindowTitle(mdle.getQualifiedName().toString())); Content headerContent = new ContentBuilder(); addTop(headerContent); - navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !options.noComment); + navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !options.noComment()); navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules)); navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages) || display(indirectOpenPackages));
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -122,7 +122,7 @@ Content classLink = writer.getPreQualifiedClassLink( LinkInfoImpl.Kind.MEMBER, typeElement, false); Content label; - if (options.summarizeOverriddenMethods) { + if (options.summarizeOverriddenMethods()) { label = new StringContent(utils.isInterface(typeElement) ? resources.getText("doclet.Nested_Classes_Interfaces_Declared_In_Interface") : resources.getText("doclet.Nested_Classes_Interfaces_Declared_In_Class"));
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageIndexWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -109,7 +109,7 @@ for (PackageElement pkg : configuration.packages) { if (!pkg.isUnnamed()) { - if (!(options.noDeprecated && utils.isDeprecated(pkg))) { + if (!(options.noDeprecated() && utils.isDeprecated(pkg))) { Content packageLinkContent = getPackageLink(pkg, getPackageName(pkg)); Content summaryContent = new ContentBuilder(); addSummaryComment(pkg, summaryContent);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -213,7 +213,7 @@ Content classLink = writer.getPreQualifiedClassLink( LinkInfoImpl.Kind.MEMBER, typeElement, false); Content label; - if (options.summarizeOverriddenMethods) { + if (options.summarizeOverriddenMethods()) { label = new StringContent(utils.isClass(typeElement) ? resources.getText("doclet.Properties_Declared_In_Class") : resources.getText("doclet.Properties_Declared_In_Interface"));
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java Thu Jan 30 22:06:12 2020 +0000 @@ -124,20 +124,20 @@ for (ModuleElement mdl : configuration.getSpecifiedModuleElements()) { // If -nodeprecated option is set and the module is marked as deprecated, // do not convert the module files to HTML. - if (!(options.noDeprecated && utils.isDeprecated(mdl))) + if (!(options.noDeprecated() && utils.isDeprecated(mdl))) convertModule(mdl, outputdir); } for (PackageElement pkg : configuration.getSpecifiedPackageElements()) { // If -nodeprecated option is set and the package is marked as deprecated, // do not convert the package files to HTML. - if (!(options.noDeprecated && utils.isDeprecated(pkg))) + if (!(options.noDeprecated() && utils.isDeprecated(pkg))) convertPackage(pkg, outputdir); } for (TypeElement te : configuration.getSpecifiedTypeElements()) { // If -nodeprecated option is set and the class is marked as deprecated // or the containing package is deprecated, do not convert the // package files to HTML. - if (!(options.noDeprecated && + if (!(options.noDeprecated() && (utils.isDeprecated(te) || utils.isDeprecated(utils.containingPackage(te))))) convertClass(te, outputdir); } @@ -161,7 +161,7 @@ // do not convert the package files to HTML. We do not check for // containing package deprecation since it is already check in // the calling method above. - if (!(options.noDeprecated && utils.isDeprecated(te))) + if (!(options.noDeprecated() && utils.isDeprecated(te))) convertClass((TypeElement)te, outputdir); } } @@ -181,7 +181,7 @@ } for (Element elem : mdl.getEnclosedElements()) { if (elem instanceof PackageElement && configuration.docEnv.isIncluded(elem) - && !(options.noDeprecated && utils.isDeprecated(elem))) { + && !(options.noDeprecated() && utils.isDeprecated(elem))) { convertPackage((PackageElement) elem, outputdir); } } @@ -258,7 +258,7 @@ * @param head an HtmlTree to which the stylesheet links will be added */ public void addStyleSheetProperties(Content head) { - String filename = options.stylesheetFile; + String filename = options.stylesheetFile(); DocPath stylesheet; if (filename.length() > 0) { DocFile file = DocFile.createFileForInput(configuration, filename); @@ -273,7 +273,7 @@ } protected void addStylesheets(Content tree) { - List<String> stylesheets = options.additionalStylesheets; + List<String> stylesheets = options.additionalStylesheets(); if (!stylesheets.isEmpty()) { stylesheets.forEach((ssheet) -> { DocFile file = DocFile.createFileForInput(configuration, ssheet);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TagletWriterImpl.java Thu Jan 30 22:06:12 2020 +0000 @@ -440,7 +440,7 @@ anchorName += "-" + count; } result = HtmlTree.SPAN(anchorName, HtmlStyle.searchTagResult, new StringContent(tagText)); - if (options.createIndex && !tagText.isEmpty()) { + if (options.createIndex() && !tagText.isEmpty()) { SearchIndexItem si = new SearchIndexItem(); si.setSystemProperty(isSystemProperty); si.setLabel(tagText);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TreeWriter.java Thu Jan 30 22:06:12 2020 +0000 @@ -155,7 +155,7 @@ // is set and the package is marked as deprecated, do not include // the page in the list of package hierarchies. if (pkg.isUnnamed() || - (options.noDeprecated && utils.isDeprecated(pkg))) { + (options.noDeprecated() && utils.isDeprecated(pkg))) { i++; continue; }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java Mon Jan 27 10:46:12 2020 +0000 +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java Thu Jan 30 22:06:12 2020 +0000 @@ -203,11 +203,11 @@ private void addMainNavLinks(Content tree) { switch (documentedPage) { case OVERVIEW: - addActivePageLink(tree, contents.overviewLabel, options.createOverview); + addActivePageLink(tree, contents.overviewLabel, options.createOverview()); addModuleLink(tree); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, options.classUse); + addPageLabel(tree, contents.useLabel, options.classUse()); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -218,7 +218,7 @@ addActivePageLink(tree, contents.moduleLabel, configuration.showModules); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, options.classUse); + addPageLabel(tree, contents.useLabel, options.classUse()); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -229,11 +229,11 @@ addModuleOfElementLink(tree); addActivePageLink(tree, contents.packageLabel, true); addPageLabel(tree, contents.classLabel, true); - if (options.classUse) { + if (options.classUse()) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_USE, contents.useLabel, "", "")); } - if (options.createTree) { + if (options.createTree()) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel, "", "")); } @@ -246,11 +246,11 @@ addModuleOfElementLink(tree); addPackageSummaryLink(tree); addActivePageLink(tree, contents.classLabel, true); - if (options.classUse) { + if (options.classUse()) { addContentToTree(tree, links.createLink(DocPaths.CLASS_USE.resolve(path.basename()), contents.useLabel)); } - if (options.createTree) { + if (options.createTree()) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel, "", "")); } @@ -268,7 +268,7 @@ addPackageOfElementLink(tree); addContentToTree(tree, navLinkClass); } - addActivePageLink(tree, contents.useLabel, options.classUse); + addActivePageLink(tree, contents.useLabel, options.classUse()); if (element instanceof PackageElement) { addContentToTree(tree, links.createLink(DocPaths.PACKAGE_TREE, contents.treeLabel)); } else { @@ -290,8 +290,8 @@ addPackageSummaryLink(tree); } addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, options.classUse); - addActivePageLink(tree, contents.treeLabel, options.createTree); + addPageLabel(tree, contents.useLabel, options.classUse()); + addActivePageLink(tree, contents.treeLabel, options.createTree()); addDeprecatedLink(tree); addIndexLink(tree); addHelpLink(tree); @@ -303,21 +303,21 @@ addModuleLink(tree); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, options.classUse); + addPageLabel(tree, contents.useLabel, options.classUse()); addTreeLink(tree); if (documentedPage == PageMode.DEPRECATED) { - addActivePageLink(tree, contents.deprecatedLabel, !(options.noDeprecated - || options.noDeprecatedList)); + addActivePageLink(tree, contents.deprecatedLabel, !(options.noDeprecated() + || options.noDeprecatedList())); } else { addDeprecatedLink(tree); } if (documentedPage == PageMode.INDEX) { - addActivePageLink(tree, contents.indexLabel, options.createIndex); + addActivePageLink(tree, contents.indexLabel, options.createIndex()); } else { addIndexLink(tree); } if (documentedPage == PageMode.HELP) { - addActivePageLink(tree, contents.helpLabel, !options.noHelp); + addActivePageLink(tree, contents.helpLabel, !options.noHelp()); } else { addHelpLink(tree); } @@ -331,7 +331,7 @@ addModuleLink(tree); addPackageLink(tree); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, options.classUse); + addPageLabel(tree, contents.useLabel, options.classUse()); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -342,7 +342,7 @@ addModuleOfElementLink(tree); addContentToTree(tree, navLinkPackage); addPageLabel(tree, contents.classLabel, true); - addPageLabel(tree, contents.useLabel, options.classUse); + addPageLabel(tree, contents.useLabel, options.classUse()); addTreeLink(tree); addDeprecatedLink(tree); addIndexLink(tree); @@ -785,7 +785,7 @@ } private void addOverviewLink(Content tree) { - if (options.createOverview) { + if (options.createOverview()) { tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.INDEX), contents.overviewLabel, "", ""))); } @@ -851,7 +851,7 @@ } private void addTreeLink(Content tree) { - if (options.createTree) { + if (options.createTree()) { List<PackageElement> packages = new ArrayList<>(configuration.getSpecifiedPackageElements()); DocPath docPath = packages.size() == 1 && configuration.getSpecifiedTypeElements().isEmpty() ? pathToRoot.resolve(configuration.docPaths.forPackage(packages.get(0)).resolve(DocPaths.PACKAGE_TREE)) @@ -861,16 +861,16 @@ } private void addDeprecatedLink(Content tree) { - if (!(options.noDeprecated || options.noDeprecatedList)) { + if (!(options.noDeprecated() || options.noDeprecatedList())) { tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve(DocPaths.DEPRECATED_LIST), contents.deprecatedLabel, "", ""))); } } private void addIndexLink(Content tree) { - if (options.createIndex) { + if (options.createIndex()) { tree.add(HtmlTree.LI(links.createLink(pathToRoot.resolve( - (options.splitIndex + (options.splitIndex() ? DocPaths.INDEX_FILES.resolve(DocPaths.indexN(1)) : DocPaths.INDEX_ALL)), contents.indexLabel, "", ""))); @@ -878,8 +878,8 @@ } private void addHelpLink(Content tree) { - if (!options.noHelp) { - String helpfile = options.helpFile; + if (!options.noHelp()) { + String helpfile = options.helpFile(); DocPath helpfilenm; if (helpfile.isEmpty()) { helpfilenm = DocPaths.HELP_DOC; @@ -910,7 +910,7 @@ * @return the navigation contents */ public Content getContent(boolean top) { - if (options.noNavbar) { + if (options.noNavbar()) { return new ContentBuilder(); } Content tree = HtmlTree.NAV(); @@ -955,7 +955,7 @@ addDetailLinks(ulNavDetail); div.add(ulNavDetail); subDiv.add(div); - if (top && options.createIndex) { + if (top && options.createIndex()) { addSearch(subDiv); } tree.add(subDiv);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/script-dir/external/jquery/jquery.js Mon Jan 27 10:46:12 2020 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10598 +0,0 @@ -/*! - * jQuery JavaScript Library v3.4.1 - * https://jquery.com/ - * - * Includes Sizzle.js - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://jquery.org/license - * - * Date: 2019-05-01T21:04Z - */ -( function( global, factory ) { - - "use strict"; - - if ( typeof module === "object" && typeof module.exports === "object" ) { - - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 -// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode -// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common -// enough that all such attempts are guarded in a try block. -"use strict"; - -var arr = []; - -var document = window.document; - -var getProto = Object.getPrototypeOf; - -var slice = arr.slice; - -var concat = arr.concat; - -var push = arr.push; - -var indexOf = arr.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var fnToString = hasOwn.toString; - -var ObjectFunctionString = fnToString.call( Object ); - -var support = {}; - -var isFunction = function isFunction( obj ) { - - // Support: Chrome <=57, Firefox <=52 - // In some browsers, typeof returns "function" for HTML <object> elements - // (i.e., `typeof document.createElement( "object" ) === "function"`). - // We don't want to classify *any* DOM node as a function. - return typeof obj === "function" && typeof obj.nodeType !== "number"; - }; - - -var isWindow = function isWindow( obj ) { - return obj != null && obj === obj.window; - }; - - - - - var preservedScriptAttributes = { - type: true, - src: true, - nonce: true, - noModule: true - }; - - function DOMEval( code, node, doc ) { - doc = doc || document; - - var i, val, - script = doc.createElement( "script" ); - - script.text = code; - if ( node ) { - for ( i in preservedScriptAttributes ) { - - // Support: Firefox 64+, Edge 18+ - // Some browsers don't support the "nonce" property on scripts. - // On the other hand, just using `getAttribute` is not enough as - // the `nonce` attribute is reset to an empty string whenever it - // becomes browsing-context connected. - // See https://github.com/whatwg/html/issues/2369 - // See https://html.spec.whatwg.org/#nonce-attributes - // The `node.getAttribute` check was added for the sake of - // `jQuery.globalEval` so that it can fake a nonce-containing node - // via an object. - val = node[ i ] || node.getAttribute && node.getAttribute( i ); - if ( val ) { - script.setAttribute( i, val ); - } - } - } - doc.head.appendChild( script ).parentNode.removeChild( script ); - } - - -function toType( obj ) { - if ( obj == null ) { - return obj + ""; - } - - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; -} -/* global Symbol */ -// Defining this global in .eslintrc.json would create a danger of using the global -// unguarded in another place, it seems safer to define global only for this module - - - -var - version = "3.4.1", - - // Define a local copy of jQuery - jQuery = function( selector, context ) { - - // The jQuery object is actually just the init constructor 'enhanced' - // Need init if jQuery is called (just allow error to be thrown if not included) - return new jQuery.fn.init( selector, context ); - }, - - // Support: Android <=4.0 only - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; - -jQuery.fn = jQuery.prototype = { - - // The current version of jQuery being used - jquery: version, - - constructor: jQuery, - - // The default length of a jQuery object is 0 - length: 0, - - toArray: function() { - return slice.call( this ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - - // Return all the elements in a clean array - if ( num == null ) { - return slice.call( this ); - } - - // Return just the one element from the set - return num < 0 ? this[ num + this.length ] : this[ num ]; - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: arr.sort, - splice: arr.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // Skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !isFunction( target ) ) { - target = {}; - } - - // Extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - copy = options[ name ]; - - // Prevent Object.prototype pollution - // Prevent never-ending loop - if ( name === "__proto__" || target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject( copy ) || - ( copyIsArray = Array.isArray( copy ) ) ) ) { - src = target[ name ]; - - // Ensure proper type for the source value - if ( copyIsArray && !Array.isArray( src ) ) { - clone = []; - } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { - clone = {}; - } else { - clone = src; - } - copyIsArray = false; - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - isPlainObject: function( obj ) { - var proto, Ctor; - - // Detect obvious negatives - // Use toString instead of jQuery.type to catch host objects - if ( !obj || toString.call( obj ) !== "[object Object]" ) { - return false; - } - - proto = getProto( obj ); - - // Objects with no prototype (e.g., `Object.create( null )`) are plain - if ( !proto ) { - return true; - } - - // Objects with prototype are plain iff they were constructed by a global Object function - Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; - return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; - }, - - isEmptyObject: function( obj ) { - var name; - - for ( name in obj ) { - return false; - } - return true; - }, - - // Evaluates a script in a global context - globalEval: function( code, options ) { - DOMEval( code, { nonce: options && options.nonce } ); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android <=4.0 only - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - return arr == null ? -1 : indexOf.call( arr, elem, i ); - }, - - // Support: Android <=4.0 only, PhantomJS 1 only - // push.apply(_, arraylike) throws on ancient WebKit - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - for ( ; j < len; j++ ) { - first[ i++ ] = second[ j ]; - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; -} - -// Populate the class2type map -jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), -function( i, name ) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -} ); - -function isArrayLike( obj ) { - - // Support: real iOS 8.2 only (not reproducible in simulator) - // `in` check used to prevent JIT error (gh-2145) - // hasOwn isn't used here due to false negatives - // regarding Nodelist length in IE - var length = !!obj && "length" in obj && obj.length, - type = toType( obj ); - - if ( isFunction( obj ) || isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.3.4 - * https://sizzlejs.com/ - * - * Copyright JS Foundation and other contributors - * Released under the MIT license - * https://js.foundation/ - * - * Date: 2019-04-08 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - nonnativeSelectorCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - return 0; - }, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // https://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\0-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - - pseudos = ":(" + identifier + ")(?:\\((" + - // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: - // 1. quoted (capture 3; capture 4 or capture 5) - "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + - // 2. simple (capture 6) - "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + - // 3. anything else (capture 2) - ".*" + - ")\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - rdescend = new RegExp( whitespace + "|>" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + identifier + ")" ), - "CLASS": new RegExp( "^\\.(" + identifier + ")" ), - "TAG": new RegExp( "^(" + identifier + "|[*])" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rhtml = /HTML$/i, - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rnative = /^[^{]+\{\s*\[native \w/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, - - rsibling = /[+~]/, - - // CSS escapes - // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }, - - // CSS string/identifier serialization - // https://drafts.csswg.org/cssom/#common-serializing-idioms - rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, - fcssescape = function( ch, asCodePoint ) { - if ( asCodePoint ) { - - // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER - if ( ch === "\0" ) { - return "\uFFFD"; - } - - // Control characters and (dependent upon position) numbers get escaped as code points - return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; - } - - // Other potentially-special ASCII characters get backslash-escaped - return "\\" + ch; - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }, - - inDisabledFieldset = addCombinator( - function( elem ) { - return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; - }, - { dir: "parentNode", next: "legend" } - ); - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - if ( documentIsHTML ) { - - // If the selector is sufficiently simple, try using a "get*By*" DOM method - // (excepting DocumentFragment context, where the methods don't exist) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - - // ID selector - if ( (m = match[1]) ) { - - // Document context - if ( nodeType === 9 ) { - if ( (elem = context.getElementById( m )) ) { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !nonnativeSelectorCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) && - - // Support: IE 8 only - // Exclude object elements - (nodeType !== 1 || context.nodeName.toLowerCase() !== "object") ) { - - newSelector = selector; - newContext = context; - - // qSA considers elements outside a scoping root when evaluating child or - // descendant combinators, which is not what we want. - // In such cases, we work around the behavior by prefixing every selector in the - // list with an ID selector referencing the scope context. - // Thanks to Andrew Dupont for this technique. - if ( nodeType === 1 && rdescend.test( selector ) ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rcssescape, fcssescape ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - while ( i-- ) { - groups[i] = "#" + nid + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - nonnativeSelectorCache( selector, true ); - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Create key-value caches of limited size - * @returns {function(string, object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created element and returns a boolean result - */ -function assert( fn ) { - var el = document.createElement("fieldset"); - - try { - return !!fn( el ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( el.parentNode ) { - el.parentNode.removeChild( el ); - } - // release memory in IE - el = null; - } -} - -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = arr.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - a.sourceIndex - b.sourceIndex; - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -/** - * Returns a function to use in pseudos for input types - * @param {String} type - */ -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for :enabled/:disabled - * @param {Boolean} disabled true for :disabled; false for :enabled - */ -function createDisabledPseudo( disabled ) { - - // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable - return function( elem ) { - - // Only certain elements can match :enabled or :disabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled - // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled - if ( "form" in elem ) { - - // Check for inherited disabledness on relevant non-disabled elements: - // * listed form-associated elements in a disabled fieldset - // https://html.spec.whatwg.org/multipage/forms.html#category-listed - // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled - // * option elements in a disabled optgroup - // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled - // All such elements have a "form" property. - if ( elem.parentNode && elem.disabled === false ) { - - // Option elements defer to a parent optgroup if present - if ( "label" in elem ) { - if ( "label" in elem.parentNode ) { - return elem.parentNode.disabled === disabled; - } else { - return elem.disabled === disabled; - } - } - - // Support: IE 6 - 11 - // Use the isDisabled shortcut property to check for disabled fieldset ancestors - return elem.isDisabled === disabled || - - // Where there is no isDisabled, check manually - /* jshint -W018 */ - elem.isDisabled !== !disabled && - inDisabledFieldset( elem ) === disabled; - } - - return elem.disabled === disabled; - - // Try to winnow out elements that can't be disabled before trusting the disabled property. - // Some victims get caught in our net (label, legend, menu, track), but it shouldn't - // even exist on them, let alone have a boolean value. - } else if ( "label" in elem ) { - return elem.disabled === disabled; - } - - // Remaining elements are neither :enabled nor :disabled - return false; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -function testContext( context ) { - return context && typeof context.getElementsByTagName !== "undefined" && context; -} - -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - var namespace = elem.namespaceURI, - docElem = (elem.ownerDocument || elem).documentElement; - - // Support: IE <=8 - // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes - // https://bugs.jquery.com/ticket/4833 - return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, subWindow, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9-11, Edge - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( preferredDoc !== document && - (subWindow = document.defaultView) && subWindow.top !== subWindow ) { - - // Support: IE 11, Edge - if ( subWindow.addEventListener ) { - subWindow.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( subWindow.attachEvent ) { - subWindow.attachEvent( "onunload", unloadHandler ); - } - } - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( el ) { - el.className = "i"; - return !el.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( el ) { - el.appendChild( document.createComment("") ); - return !el.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programmatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( el ) { - docElem.appendChild( el ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID filter and find - if ( support.getById ) { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var elem = context.getElementById( id ); - return elem ? [ elem ] : []; - } - }; - } else { - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - - // Support: IE 6 - 7 only - // getElementById is not reliable as a find shortcut - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var node, i, elems, - elem = context.getElementById( id ); - - if ( elem ) { - - // Verify the id attribute - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - - // Fall back on getElementsByName - elems = context.getElementsByName( id ); - i = 0; - while ( (elem = elems[i++]) ) { - node = elem.getAttributeNode("id"); - if ( node && node.value === id ) { - return [ elem ]; - } - } - } - - return []; - } - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); - - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See https://bugs.jquery.com/ticket/13378 - rbuggyQSA = []; - - if ( (support.qsa = rnative.test( document.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( el ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // https://bugs.jquery.com/ticket/12359 - docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + - "<select id='" + expando + "-\r\\' msallowcapture=''>" + - "<option selected=''></option></select>"; - - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( el.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !el.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !el.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibling-combinator selector` fails - if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); - - assert(function( el ) { - el.innerHTML = "<a href='' disabled='disabled'></a>" + - "<select disabled='disabled'><option/></select>"; - - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - el.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( el.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( el.querySelectorAll(":enabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Support: IE9-11+ - // IE's :disabled selector does not pick up the children of disabled fieldsets - docElem.appendChild( el ).disabled = true; - if ( el.querySelectorAll(":disabled").length !== 2 ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - el.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( el ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( el, "*" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( el, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully self-exclusive - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === document ? -1 : - b === document ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - if ( support.matchesSelector && documentIsHTML && - !nonnativeSelectorCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { - - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch (e) { - nonnativeSelectorCache( expr, true ); - } - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) - val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? - fn( elem, name, !documentIsHTML ) : - undefined; - - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; -}; - -Sizzle.escape = function( sel ) { - return (sel + "").replace( rcssescape, fcssescape ); -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - return results; -}; - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {