From 0bc1701ea015d34507572de3296294832fd9045e Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 31 Jan 2014 09:55:59 +0100 Subject: [PATCH 01/35] 8032771: The flag VerifySilently misses a test case Add test case for the VerifySilently flag. Reviewed-by: brutisso --- hotspot/test/gc/TestVerifySilently.java | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 hotspot/test/gc/TestVerifySilently.java diff --git a/hotspot/test/gc/TestVerifySilently.java b/hotspot/test/gc/TestVerifySilently.java new file mode 100644 index 00000000000..deefd4863e4 --- /dev/null +++ b/hotspot/test/gc/TestVerifySilently.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2014, 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. + * + * 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. + */ + +/* @test TestVerifySilently.java + * @key gc + * @bug 8032771 + * @summary Test silent verification. + * @library /testlibrary + */ + +import com.oracle.java.testlibrary.OutputAnalyzer; +import com.oracle.java.testlibrary.ProcessTools; +import java.util.ArrayList; +import java.util.Collections; + +class RunSystemGC { + public static void main(String args[]) throws Exception { + System.gc(); + } +} + + +public class TestVerifySilently { + private static String[] getTestJavaOpts() { + String testVmOptsStr = System.getProperty("test.java.opts"); + if (!testVmOptsStr.isEmpty()) { + return testVmOptsStr.split(" "); + } else { + return new String[] {}; + } + } + + private static OutputAnalyzer runTest(boolean verifySilently) throws Exception { + ArrayList vmOpts = new ArrayList(); + + Collections.addAll(vmOpts, getTestJavaOpts()); + Collections.addAll(vmOpts, new String[] {"-XX:+UnlockDiagnosticVMOptions", + "-XX:+VerifyDuringStartup", + "-XX:+VerifyBeforeGC", + "-XX:+VerifyAfterGC", + "-XX:" + (verifySilently ? "+":"-") + "VerifySilently", + RunSystemGC.class.getName()}); + ProcessBuilder pb = + ProcessTools.createJavaProcessBuilder(vmOpts.toArray(new String[vmOpts.size()])); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + System.out.println("Output:\n" + output.getOutput()); + return output; + } + + + public static void main(String args[]) throws Exception { + + OutputAnalyzer output; + + output = runTest(false); + output.shouldContain("[Verifying"); + output.shouldHaveExitValue(0); + + output = runTest(true); + output.shouldNotContain("[Verifying"); + output.shouldHaveExitValue(0); + } +} From 90c553c06f5185ba97d8a7c79f26e32ded11b360 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 31 Jan 2014 09:57:50 +0100 Subject: [PATCH 02/35] 6991197: G1: specialize deal_with_reference() for narrowOop* Clean up and slightly optimize reference handling from the GC reference task queue. Since we never push partial array chunks as narrowOop* we can manually specialize the code so that some code can be optimized away. Reviewed-by: tonyp, brutisso, stefank --- .../vm/gc_implementation/g1/g1OopClosures.hpp | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp index 414b82f95bc..bda11dc6b98 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1OopClosures.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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,13 +86,26 @@ public: #define G1_PARTIAL_ARRAY_MASK 0x2 -template inline bool has_partial_array_mask(T* ref) { +inline bool has_partial_array_mask(oop* ref) { return ((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) == G1_PARTIAL_ARRAY_MASK; } -template inline T* set_partial_array_mask(T obj) { +// We never encode partial array oops as narrowOop*, so return false immediately. +// This allows the compiler to create optimized code when popping references from +// the work queue. +inline bool has_partial_array_mask(narrowOop* ref) { + assert(((uintptr_t)ref & G1_PARTIAL_ARRAY_MASK) != G1_PARTIAL_ARRAY_MASK, "Partial array oop reference encoded as narrowOop*"); + return false; +} + +// Only implement set_partial_array_mask() for regular oops, not for narrowOops. +// We always encode partial arrays as regular oop, to allow the +// specialization for has_partial_array_mask() for narrowOops above. +// This means that unintentional use of this method with narrowOops are caught +// by the compiler. +inline oop* set_partial_array_mask(oop obj) { assert(((uintptr_t)(void *)obj & G1_PARTIAL_ARRAY_MASK) == 0, "Information loss!"); - return (T*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK); + return (oop*) ((uintptr_t)(void *)obj | G1_PARTIAL_ARRAY_MASK); } template inline oop clear_partial_array_mask(T* ref) { From 58f7d4c7e56503c97b6cf9fd751aea07c508286a Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Fri, 31 Jan 2014 09:58:06 +0100 Subject: [PATCH 03/35] 8033106: Wrong predicate for checking whether the correct amount of symbol table entries have been processed in G1 The change fixes the predicate check. Reviewed-by: jmasa, tonyp, stefank --- hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index ba1fab4ffcd..4f638f447c3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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 @@ -5222,7 +5222,7 @@ public: guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size, err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT, StringTable::parallel_claimed_index(), _initial_string_table_size)); - guarantee(!_process_strings || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, + guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT, SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); } From c50ff2e023b65e4fee3d3349a0ef98ba5e6cbab1 Mon Sep 17 00:00:00 2001 From: Shrinivas Joshi Date: Thu, 16 Jan 2014 13:25:25 -0800 Subject: [PATCH 04/35] 8024366: Make UseNUMA enable UseNUMAInterleaving Reviewed-by: brutisso, tschatzl --- hotspot/src/share/vm/runtime/arguments.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index b0289b9d588..ca52c8d4a7b 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -3823,18 +3823,24 @@ jint Arguments::apply_ergo() { } jint Arguments::adjust_after_os() { -#if INCLUDE_ALL_GCS - if (UseParallelGC || UseParallelOldGC) { - if (UseNUMA) { + if (UseNUMA) { + if (UseParallelGC || UseParallelOldGC) { if (FLAG_IS_DEFAULT(MinHeapDeltaBytes)) { - FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M); + FLAG_SET_DEFAULT(MinHeapDeltaBytes, 64*M); } - // For those collectors or operating systems (eg, Windows) that do - // not support full UseNUMA, we will map to UseNUMAInterleaving for now - UseNUMAInterleaving = true; + } + // UseNUMAInterleaving is set to ON for all collectors and + // platforms when UseNUMA is set to ON. NUMA-aware collectors + // such as the parallel collector for Linux and Solaris will + // interleave old gen and survivor spaces on top of NUMA + // allocation policy for the eden space. + // Non NUMA-aware collectors such as CMS, G1 and Serial-GC on + // all platforms and ParallelGC on Windows will interleave all + // of the heap spaces across NUMA nodes. + if (FLAG_IS_DEFAULT(UseNUMAInterleaving)) { + FLAG_SET_ERGO(bool, UseNUMAInterleaving, true); } } -#endif // INCLUDE_ALL_GCS return JNI_OK; } From 814dad45e077b59b58f03e0d512c5774839b22f3 Mon Sep 17 00:00:00 2001 From: Erik Helin Date: Wed, 5 Feb 2014 10:09:54 +0100 Subject: [PATCH 05/35] 8028254: gc/arguments/TestMinInitialErgonomics.java failed with unexpected initial heap size Reviewed-by: brutisso, tschatzl, sjohanss --- hotspot/src/share/vm/prims/whitebox.cpp | 2 +- .../test/gc/arguments/TestMaxHeapSizeTools.java | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/prims/whitebox.cpp b/hotspot/src/share/vm/prims/whitebox.cpp index 1cb799b3ea9..56919990889 100644 --- a/hotspot/src/share/vm/prims/whitebox.cpp +++ b/hotspot/src/share/vm/prims/whitebox.cpp @@ -105,7 +105,7 @@ WB_END WB_ENTRY(void, WB_PrintHeapSizes(JNIEnv* env, jobject o)) { CollectorPolicy * p = Universe::heap()->collector_policy(); gclog_or_tty->print_cr("Minimum heap "SIZE_FORMAT" Initial heap " - SIZE_FORMAT" Maximum heap "SIZE_FORMAT" Min alignment "SIZE_FORMAT" Max alignment "SIZE_FORMAT, + SIZE_FORMAT" Maximum heap "SIZE_FORMAT" Space alignment "SIZE_FORMAT" Heap alignment "SIZE_FORMAT, p->min_heap_byte_size(), p->initial_heap_byte_size(), p->max_heap_byte_size(), p->space_alignment(), p->heap_alignment()); } diff --git a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java index 0e07f794194..b5859b5cf49 100644 --- a/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java +++ b/hotspot/test/gc/arguments/TestMaxHeapSizeTools.java @@ -41,8 +41,8 @@ final class MinInitialMaxValues { public long initialHeapSize; public long maxHeapSize; - public long minAlignment; - public long maxAlignment; + public long spaceAlignment; + public long heapAlignment; } class TestMaxHeapSizeTools { @@ -192,7 +192,7 @@ class TestMaxHeapSizeTools { // Unfortunately there is no other way to retrieve the minimum heap size and // the alignments. - Matcher m = Pattern.compile("Minimum heap \\d+ Initial heap \\d+ Maximum heap \\d+ Min alignment \\d+ Max alignment \\d+"). + Matcher m = Pattern.compile("Minimum heap \\d+ Initial heap \\d+ Maximum heap \\d+ Space alignment \\d+ Heap alignment \\d+"). matcher(output.getStdout()); if (!m.find()) { throw new RuntimeException("Could not find heap size string."); @@ -204,8 +204,8 @@ class TestMaxHeapSizeTools { val.minHeapSize = valueAfter(match, "Minimum heap "); val.initialHeapSize = valueAfter(match, "Initial heap "); val.maxHeapSize = valueAfter(match, "Maximum heap "); - val.minAlignment = valueAfter(match, "Min alignment "); - val.maxAlignment = valueAfter(match, "Max alignment "); + val.spaceAlignment = valueAfter(match, "Space alignment "); + val.heapAlignment = valueAfter(match, "Heap alignment "); } /** @@ -218,12 +218,12 @@ class TestMaxHeapSizeTools { MinInitialMaxValues v = new MinInitialMaxValues(); getMinInitialMaxHeap(args, v); - if ((expectedMin != -1) && (align_up(expectedMin, v.minAlignment) != v.minHeapSize)) { + if ((expectedMin != -1) && (align_up(expectedMin, v.heapAlignment) != v.minHeapSize)) { throw new RuntimeException("Actual minimum heap size of " + v.minHeapSize + " differs from expected minimum heap size of " + expectedMin); } - if ((expectedInitial != -1) && (align_up(expectedInitial, v.minAlignment) != v.initialHeapSize)) { + if ((expectedInitial != -1) && (align_up(expectedInitial, v.heapAlignment) != v.initialHeapSize)) { throw new RuntimeException("Actual initial heap size of " + v.initialHeapSize + " differs from expected initial heap size of " + expectedInitial); } @@ -247,7 +247,7 @@ class TestMaxHeapSizeTools { MinInitialMaxValues v = new MinInitialMaxValues(); getMinInitialMaxHeap(new String[] { gcflag, "-XX:MaxHeapSize=" + maxHeapsize + "M" }, v); - long expectedHeapSize = align_up(maxHeapsize * K * K, v.maxAlignment); + long expectedHeapSize = align_up(maxHeapsize * K * K, v.heapAlignment); long actualHeapSize = v.maxHeapSize; if (actualHeapSize > expectedHeapSize) { From 170566f471ad6091d79242e6aa974825fffc1524 Mon Sep 17 00:00:00 2001 From: Antonios Printezis Date: Wed, 5 Feb 2014 12:47:48 +0100 Subject: [PATCH 06/35] 8033601: G1: Make array chunking use the same length field as the other young GCs Use the old copy length instead of the length of the forwarded object for chunked arrays. Reviewed-by: brutisso, tschatzl --- .../gc_implementation/g1/g1CollectedHeap.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 4f638f447c3..7c70480183f 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -4764,9 +4764,9 @@ oop G1ParCopyClosure if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) { // We keep track of the next start index in the length field of - // the to-space object. The actual length can be found in the - // length field of the from-space object. - arrayOop(obj)->set_length(0); + // the from-space object. The actual length can be found in the + // length field of the to-space object. + arrayOop(old)->set_length(0); oop* old_p = set_partial_array_mask(old); _par_scan_state->push_on_queue(old_p); } else { @@ -4840,16 +4840,16 @@ template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(Universe::heap()->is_in_reserved(from_obj), "must be in heap."); assert(from_obj->is_objArray(), "must be obj array"); objArrayOop from_obj_array = objArrayOop(from_obj); - // The from-space object contains the real length. - int length = from_obj_array->length(); + // We keep track of the next start index in the length field of the + // from-space object. + int next_index = from_obj_array->length(); assert(from_obj->is_forwarded(), "must be forwarded"); oop to_obj = from_obj->forwardee(); assert(from_obj != to_obj, "should not be chunking self-forwarded objects"); objArrayOop to_obj_array = objArrayOop(to_obj); - // We keep track of the next start index in the length field of the - // to-space object. - int next_index = to_obj_array->length(); + // The to-space object contains the real length. + int length = to_obj_array->length(); assert(0 <= next_index && next_index < length, err_msg("invariant, next index: %d, length: %d", next_index, length)); @@ -4859,7 +4859,7 @@ template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { // We'll try not to push a range that's smaller than ParGCArrayScanChunk. if (remainder > 2 * ParGCArrayScanChunk) { end = start + ParGCArrayScanChunk; - to_obj_array->set_length(end); + from_obj_array->set_length(end); // Push the remainder before we process the range in case another // worker has run out of things to do and can steal it. oop* from_obj_p = set_partial_array_mask(from_obj); @@ -4868,7 +4868,7 @@ template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(length == end, "sanity"); // We'll process the final range for this object. Restore the length // so that the heap remains parsable in case of evacuation failure. - to_obj_array->set_length(end); + from_obj_array->set_length(end); } _scanner.set_region(_g1->heap_region_containing_raw(to_obj)); // Process indexes [start,end). It will also process the header From a81e7a52fc997c7bfdb8cf98faa4f779749cf682 Mon Sep 17 00:00:00 2001 From: Thomas Schatzl Date: Wed, 5 Feb 2014 14:29:34 +0100 Subject: [PATCH 07/35] 8033443: Test8000311 fails after latest changes to parallelize string and symbol table unlink When string and symbol table unlink are not performed in parallel, the claim index we check is not updated, and so a guarantee fails. Take this into account when checking the guarantee. Reviewed-by: brutisso, jwilhelm --- .../share/vm/gc_implementation/g1/g1CollectedHeap.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 7c70480183f..ec2813244ec 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -5202,9 +5202,12 @@ private: bool _process_symbols; int _symbols_processed; int _symbols_removed; + + bool _do_in_parallel; public: G1StringSymbolTableUnlinkTask(BoolObjectClosure* is_alive, bool process_strings, bool process_symbols) : AbstractGangTask("Par String/Symbol table unlink"), _is_alive(is_alive), + _do_in_parallel(G1CollectedHeap::use_parallel_gc_threads()), _process_strings(process_strings), _strings_processed(0), _strings_removed(0), _process_symbols(process_symbols), _symbols_processed(0), _symbols_removed(0) { @@ -5219,16 +5222,16 @@ public: } ~G1StringSymbolTableUnlinkTask() { - guarantee(!_process_strings || StringTable::parallel_claimed_index() >= _initial_string_table_size, + guarantee(!_process_strings || !_do_in_parallel || StringTable::parallel_claimed_index() >= _initial_string_table_size, err_msg("claim value "INT32_FORMAT" after unlink less than initial string table size "INT32_FORMAT, StringTable::parallel_claimed_index(), _initial_string_table_size)); - guarantee(!_process_symbols || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, + guarantee(!_process_symbols || !_do_in_parallel || SymbolTable::parallel_claimed_index() >= _initial_symbol_table_size, err_msg("claim value "INT32_FORMAT" after unlink less than initial symbol table size "INT32_FORMAT, SymbolTable::parallel_claimed_index(), _initial_symbol_table_size)); } void work(uint worker_id) { - if (G1CollectedHeap::use_parallel_gc_threads()) { + if (_do_in_parallel) { int strings_processed = 0; int strings_removed = 0; int symbols_processed = 0; From 0a63fe1c101abc1f87db22d2cf319c9d98f15995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20Lid=C3=A9n?= Date: Thu, 6 Feb 2014 14:12:43 +0100 Subject: [PATCH 08/35] 8031703: Missing post-barrier in ReferenceProcessor Reviewed-by: tonyp, tschatzl --- .../gc_implementation/g1/g1CollectedHeap.cpp | 2 +- .../share/vm/memory/referenceProcessor.cpp | 44 +++++++++---------- .../share/vm/memory/referenceProcessor.hpp | 17 ++++--- 3 files changed, 33 insertions(+), 30 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index ec2813244ec..5fab3d84f96 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -2266,7 +2266,7 @@ void G1CollectedHeap::ref_processing_init() { // (for efficiency/performance) false); // Setting next fields of discovered - // lists requires a barrier. + // lists does not require a barrier. } size_t G1CollectedHeap::capacity() const { diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp index f6a48ee99b9..d7d48ba7548 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.cpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp @@ -95,11 +95,11 @@ ReferenceProcessor::ReferenceProcessor(MemRegion span, uint mt_discovery_degree, bool atomic_discovery, BoolObjectClosure* is_alive_non_header, - bool discovered_list_needs_barrier) : + bool discovered_list_needs_post_barrier) : _discovering_refs(false), _enqueuing_is_done(false), _is_alive_non_header(is_alive_non_header), - _discovered_list_needs_barrier(discovered_list_needs_barrier), + _discovered_list_needs_post_barrier(discovered_list_needs_post_barrier), _processing_is_mt(mt_processing), _next_id(0) { @@ -490,13 +490,13 @@ void DiscoveredListIterator::remove() { } else { new_next = _next; } - - if (UseCompressedOops) { - // Remove Reference object from list. - oopDesc::encode_store_heap_oop((narrowOop*)_prev_next, new_next); - } else { - // Remove Reference object from list. - oopDesc::store_heap_oop((oop*)_prev_next, new_next); + // Remove Reference object from discovered list. Note that G1 does not need a + // pre-barrier here because we know the Reference has already been found/marked, + // that's how it ended up in the discovered list in the first place. + oop_store_raw(_prev_next, new_next); + if (_discovered_list_needs_post_barrier && _prev_next != _refs_list.adr_head()) { + // Needs post-barrier and this is not the list head (which is not on the heap) + oopDesc::bs()->write_ref_field(_prev_next, new_next); } NOT_PRODUCT(_removed++); _refs_list.dec_length(1); @@ -544,7 +544,7 @@ ReferenceProcessor::process_phase1(DiscoveredList& refs_list, OopClosure* keep_alive, VoidClosure* complete_gc) { assert(policy != NULL, "Must have a non-NULL policy"); - DiscoveredListIterator iter(refs_list, keep_alive, is_alive); + DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier); // Decide which softly reachable refs should be kept alive. while (iter.has_next()) { iter.load_ptrs(DEBUG_ONLY(!discovery_is_atomic() /* allow_null_referent */)); @@ -584,7 +584,7 @@ ReferenceProcessor::pp2_work(DiscoveredList& refs_list, BoolObjectClosure* is_alive, OopClosure* keep_alive) { assert(discovery_is_atomic(), "Error"); - DiscoveredListIterator iter(refs_list, keep_alive, is_alive); + DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier); while (iter.has_next()) { iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */)); DEBUG_ONLY(oop next = java_lang_ref_Reference::next(iter.obj());) @@ -621,7 +621,7 @@ ReferenceProcessor::pp2_work_concurrent_discovery(DiscoveredList& refs_list, OopClosure* keep_alive, VoidClosure* complete_gc) { assert(!discovery_is_atomic(), "Error"); - DiscoveredListIterator iter(refs_list, keep_alive, is_alive); + DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier); while (iter.has_next()) { iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */)); HeapWord* next_addr = java_lang_ref_Reference::next_addr(iter.obj()); @@ -664,7 +664,7 @@ ReferenceProcessor::process_phase3(DiscoveredList& refs_list, OopClosure* keep_alive, VoidClosure* complete_gc) { ResourceMark rm; - DiscoveredListIterator iter(refs_list, keep_alive, is_alive); + DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier); while (iter.has_next()) { iter.update_discovered(); iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */)); @@ -782,8 +782,8 @@ private: void ReferenceProcessor::set_discovered(oop ref, oop value) { java_lang_ref_Reference::set_discovered_raw(ref, value); - if (_discovered_list_needs_barrier) { - oopDesc::bs()->write_ref_field(ref, value); + if (_discovered_list_needs_post_barrier) { + oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(ref), value); } } @@ -980,7 +980,7 @@ void ReferenceProcessor::clean_up_discovered_references() { void ReferenceProcessor::clean_up_discovered_reflist(DiscoveredList& refs_list) { assert(!discovery_is_atomic(), "Else why call this method?"); - DiscoveredListIterator iter(refs_list, NULL, NULL); + DiscoveredListIterator iter(refs_list, NULL, NULL, _discovered_list_needs_post_barrier); while (iter.has_next()) { iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */)); oop next = java_lang_ref_Reference::next(iter.obj()); @@ -1076,7 +1076,7 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, // elided this out for G1, but left in the test for some future // collector that might have need for a pre-barrier here, e.g.:- // oopDesc::bs()->write_ref_field_pre((oop* or narrowOop*)discovered_addr, next_discovered); - assert(!_discovered_list_needs_barrier || UseG1GC, + assert(!_discovered_list_needs_post_barrier || UseG1GC, "Need to check non-G1 collector: " "may need a pre-write-barrier for CAS from NULL below"); oop retest = oopDesc::atomic_compare_exchange_oop(next_discovered, discovered_addr, @@ -1087,7 +1087,7 @@ ReferenceProcessor::add_to_discovered_list_mt(DiscoveredList& refs_list, // is necessary. refs_list.set_head(obj); refs_list.inc_length(1); - if (_discovered_list_needs_barrier) { + if (_discovered_list_needs_post_barrier) { oopDesc::bs()->write_ref_field((void*)discovered_addr, next_discovered); } @@ -1240,7 +1240,7 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { if (_discovery_is_mt) { add_to_discovered_list_mt(*list, obj, discovered_addr); } else { - // If "_discovered_list_needs_barrier", we do write barriers when + // If "_discovered_list_needs_post_barrier", we do write barriers when // updating the discovered reference list. Otherwise, we do a raw store // here: the field will be visited later when processing the discovered // references. @@ -1252,10 +1252,10 @@ bool ReferenceProcessor::discover_reference(oop obj, ReferenceType rt) { // pre-value, we can safely elide the pre-barrier here for the case of G1. // e.g.:- oopDesc::bs()->write_ref_field_pre((oop* or narrowOop*)discovered_addr, next_discovered); assert(discovered == NULL, "control point invariant"); - assert(!_discovered_list_needs_barrier || UseG1GC, + assert(!_discovered_list_needs_post_barrier || UseG1GC, "For non-G1 collector, may need a pre-write-barrier for CAS from NULL below"); oop_store_raw(discovered_addr, next_discovered); - if (_discovered_list_needs_barrier) { + if (_discovered_list_needs_post_barrier) { oopDesc::bs()->write_ref_field((void*)discovered_addr, next_discovered); } list->set_head(obj); @@ -1351,7 +1351,7 @@ ReferenceProcessor::preclean_discovered_reflist(DiscoveredList& refs_list, OopClosure* keep_alive, VoidClosure* complete_gc, YieldClosure* yield) { - DiscoveredListIterator iter(refs_list, keep_alive, is_alive); + DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier); while (iter.has_next()) { iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */)); oop obj = iter.obj(); diff --git a/hotspot/src/share/vm/memory/referenceProcessor.hpp b/hotspot/src/share/vm/memory/referenceProcessor.hpp index 63b3556bfdd..f9f69f07142 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.hpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp @@ -99,6 +99,7 @@ private: oop _referent; OopClosure* _keep_alive; BoolObjectClosure* _is_alive; + bool _discovered_list_needs_post_barrier; DEBUG_ONLY( oop _first_seen; // cyclic linked list check @@ -112,7 +113,8 @@ private: public: inline DiscoveredListIterator(DiscoveredList& refs_list, OopClosure* keep_alive, - BoolObjectClosure* is_alive): + BoolObjectClosure* is_alive, + bool discovered_list_needs_post_barrier = false): _refs_list(refs_list), _prev_next(refs_list.adr_head()), _prev(NULL), @@ -126,7 +128,8 @@ public: #endif _next(NULL), _keep_alive(keep_alive), - _is_alive(is_alive) + _is_alive(is_alive), + _discovered_list_needs_post_barrier(discovered_list_needs_post_barrier) { } // End Of List. @@ -228,12 +231,12 @@ class ReferenceProcessor : public CHeapObj { bool _discovery_is_mt; // true if reference discovery is MT. // If true, setting "next" field of a discovered refs list requires - // write barrier(s). (Must be true if used in a collector in which + // write post barrier. (Must be true if used in a collector in which // elements of a discovered list may be moved during discovery: for // example, a collector like Garbage-First that moves objects during a // long-term concurrent marking phase that does weak reference // discovery.) - bool _discovered_list_needs_barrier; + bool _discovered_list_needs_post_barrier; bool _enqueuing_is_done; // true if all weak references enqueued bool _processing_is_mt; // true during phases when @@ -380,8 +383,8 @@ class ReferenceProcessor : public CHeapObj { protected: // Set the 'discovered' field of the given reference to - // the given value - emitting barriers depending upon - // the value of _discovered_list_needs_barrier. + // the given value - emitting post barriers depending upon + // the value of _discovered_list_needs_post_barrier. void set_discovered(oop ref, oop value); // "Preclean" the given discovered reference list @@ -425,7 +428,7 @@ class ReferenceProcessor : public CHeapObj { bool mt_discovery = false, uint mt_discovery_degree = 1, bool atomic_discovery = true, BoolObjectClosure* is_alive_non_header = NULL, - bool discovered_list_needs_barrier = false); + bool discovered_list_needs_post_barrier = false); // RefDiscoveryPolicy values enum DiscoveryPolicy { From b109e793aaabc52a60f097f01a33c75919f4b729 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Thu, 6 Feb 2014 17:12:10 +0100 Subject: [PATCH 09/35] 8033545: Missing volatile specifier in Bitmap::par_put_range_within_word The method Bitmap::par_put_range_within_word reloads the original value during a CAS, which may be optimized away. Instead of reloading, use the value returned by Atomic::cmpxchg_ptr() for further processing. Reviewed-by: tschatzl, brutisso, tonyp --- hotspot/src/share/vm/utilities/bitMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/share/vm/utilities/bitMap.cpp b/hotspot/src/share/vm/utilities/bitMap.cpp index b6760488709..8431395a6ba 100644 --- a/hotspot/src/share/vm/utilities/bitMap.cpp +++ b/hotspot/src/share/vm/utilities/bitMap.cpp @@ -107,7 +107,7 @@ void BitMap::par_put_range_within_word(idx_t beg, idx_t end, bool value) { while (true) { intptr_t res = Atomic::cmpxchg_ptr(nw, pw, w); if (res == w) break; - w = *pw; + w = res; nw = value ? (w | ~mr) : (w & mr); } } From 980e57c6c423c671c90f00b73de243cfd37c5d97 Mon Sep 17 00:00:00 2001 From: Bengt Rutisson Date: Fri, 7 Feb 2014 13:48:07 +0100 Subject: [PATCH 10/35] 8033922: G1: Back out 8033601 and go back to use the to-obj for chunked arrays Reviewed-by: stefank, tschatzl --- .../gc_implementation/g1/g1CollectedHeap.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index 5fab3d84f96..a56b4ec0c23 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -4764,9 +4764,9 @@ oop G1ParCopyClosure if (obj->is_objArray() && arrayOop(obj)->length() >= ParGCArrayScanChunk) { // We keep track of the next start index in the length field of - // the from-space object. The actual length can be found in the - // length field of the to-space object. - arrayOop(old)->set_length(0); + // the to-space object. The actual length can be found in the + // length field of the from-space object. + arrayOop(obj)->set_length(0); oop* old_p = set_partial_array_mask(old); _par_scan_state->push_on_queue(old_p); } else { @@ -4840,16 +4840,16 @@ template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(Universe::heap()->is_in_reserved(from_obj), "must be in heap."); assert(from_obj->is_objArray(), "must be obj array"); objArrayOop from_obj_array = objArrayOop(from_obj); - // We keep track of the next start index in the length field of the - // from-space object. - int next_index = from_obj_array->length(); + // The from-space object contains the real length. + int length = from_obj_array->length(); assert(from_obj->is_forwarded(), "must be forwarded"); oop to_obj = from_obj->forwardee(); assert(from_obj != to_obj, "should not be chunking self-forwarded objects"); objArrayOop to_obj_array = objArrayOop(to_obj); - // The to-space object contains the real length. - int length = to_obj_array->length(); + // We keep track of the next start index in the length field of the + // to-space object. + int next_index = to_obj_array->length(); assert(0 <= next_index && next_index < length, err_msg("invariant, next index: %d, length: %d", next_index, length)); @@ -4859,7 +4859,7 @@ template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { // We'll try not to push a range that's smaller than ParGCArrayScanChunk. if (remainder > 2 * ParGCArrayScanChunk) { end = start + ParGCArrayScanChunk; - from_obj_array->set_length(end); + to_obj_array->set_length(end); // Push the remainder before we process the range in case another // worker has run out of things to do and can steal it. oop* from_obj_p = set_partial_array_mask(from_obj); @@ -4868,7 +4868,7 @@ template void G1ParScanPartialArrayClosure::do_oop_nv(T* p) { assert(length == end, "sanity"); // We'll process the final range for this object. Restore the length // so that the heap remains parsable in case of evacuation failure. - from_obj_array->set_length(end); + to_obj_array->set_length(end); } _scanner.set_region(_g1->heap_region_containing_raw(to_obj)); // Process indexes [start,end). It will also process the header From a26a6715b00b0e79dc2f568f2e740aa6ad9218bc Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 10 Feb 2014 12:51:51 +0100 Subject: [PATCH 11/35] 8033764: Remove the usage of StarTask from BufferingOopClosure Reviewed-by: mgerdin, brutisso, tschatzl --- .../g1/bufferingOopClosure.cpp | 271 ++++++++++++++++++ .../g1/bufferingOopClosure.hpp | 113 +++++--- .../vm/gc_implementation/g1/g1RemSet.cpp | 1 - .../vm/gc_implementation/g1/g1RemSet.hpp | 2 +- hotspot/src/share/vm/prims/jni.cpp | 2 + 5 files changed, 352 insertions(+), 37 deletions(-) create mode 100644 hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.cpp diff --git a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.cpp b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.cpp new file mode 100644 index 00000000000..d1edd60da9d --- /dev/null +++ b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.cpp @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2014, 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. + * + * 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. + * + */ + +#include "precompiled.hpp" +#include "gc_implementation/g1/bufferingOopClosure.hpp" +#include "memory/iterator.hpp" +#include "utilities/debug.hpp" + +/////////////// Unit tests /////////////// + +#ifndef PRODUCT + +class TestBufferingOopClosure { + + // Helper class to fake a set of oop*s and narrowOop*s. + class FakeRoots { + public: + // Used for sanity checking of the values passed to the do_oops functions in the test. + static const uintptr_t NarrowOopMarker = uintptr_t(1) << (BitsPerWord -1); + + int _num_narrow; + int _num_full; + void** _narrow; + void** _full; + + FakeRoots(int num_narrow, int num_full) : + _num_narrow(num_narrow), + _num_full(num_full), + _narrow((void**)::malloc(sizeof(void*) * num_narrow)), + _full((void**)::malloc(sizeof(void*) * num_full)) { + + for (int i = 0; i < num_narrow; i++) { + _narrow[i] = (void*)(NarrowOopMarker + (uintptr_t)i); + } + for (int i = 0; i < num_full; i++) { + _full[i] = (void*)(uintptr_t)i; + } + } + + ~FakeRoots() { + ::free(_narrow); + ::free(_full); + } + + void oops_do_narrow_then_full(OopClosure* cl) { + for (int i = 0; i < _num_narrow; i++) { + cl->do_oop((narrowOop*)_narrow[i]); + } + for (int i = 0; i < _num_full; i++) { + cl->do_oop((oop*)_full[i]); + } + } + + void oops_do_full_then_narrow(OopClosure* cl) { + for (int i = 0; i < _num_full; i++) { + cl->do_oop((oop*)_full[i]); + } + for (int i = 0; i < _num_narrow; i++) { + cl->do_oop((narrowOop*)_narrow[i]); + } + } + + void oops_do_mixed(OopClosure* cl) { + int i; + for (i = 0; i < _num_full && i < _num_narrow; i++) { + cl->do_oop((oop*)_full[i]); + cl->do_oop((narrowOop*)_narrow[i]); + } + for (int j = i; j < _num_full; j++) { + cl->do_oop((oop*)_full[i]); + } + for (int j = i; j < _num_narrow; j++) { + cl->do_oop((narrowOop*)_narrow[i]); + } + } + + static const int MaxOrder = 2; + + void oops_do(OopClosure* cl, int do_oop_order) { + switch(do_oop_order) { + case 0: + oops_do_narrow_then_full(cl); + break; + case 1: + oops_do_full_then_narrow(cl); + break; + case 2: + oops_do_mixed(cl); + break; + default: + oops_do_narrow_then_full(cl); + break; + } + } + }; + + class CountOopClosure : public OopClosure { + int _narrow_oop_count; + int _full_oop_count; + public: + CountOopClosure() : _narrow_oop_count(0), _full_oop_count(0) {} + void do_oop(narrowOop* p) { + assert((uintptr_t(p) & FakeRoots::NarrowOopMarker) != 0, + "The narrowOop was unexpectedly not marked with the NarrowOopMarker"); + _narrow_oop_count++; + } + + void do_oop(oop* p){ + assert((uintptr_t(p) & FakeRoots::NarrowOopMarker) == 0, + "The oop was unexpectedly marked with the NarrowOopMarker"); + _full_oop_count++; + } + + int narrow_oop_count() { return _narrow_oop_count; } + int full_oop_count() { return _full_oop_count; } + int all_oop_count() { return _narrow_oop_count + _full_oop_count; } + }; + + class DoNothingOopClosure : public OopClosure { + public: + void do_oop(narrowOop* p) {} + void do_oop(oop* p) {} + }; + + static void testCount(int num_narrow, int num_full, int do_oop_order) { + FakeRoots fr(num_narrow, num_full); + + CountOopClosure coc; + BufferingOopClosure boc(&coc); + + fr.oops_do(&boc, do_oop_order); + + boc.done(); + + #define assert_testCount(got, expected) \ + assert((got) == (expected), \ + err_msg("Expected: %d, got: %d, when running testCount(%d, %d, %d)", \ + (got), (expected), num_narrow, num_full, do_oop_order)) + + assert_testCount(num_narrow, coc.narrow_oop_count()); + assert_testCount(num_full, coc.full_oop_count()); + assert_testCount(num_narrow + num_full, coc.all_oop_count()); + } + + static void testCount() { + int buffer_length = BufferingOopClosure::BufferLength; + + for (int order = 0; order < FakeRoots::MaxOrder; order++) { + testCount(0, 0, order); + testCount(10, 0, order); + testCount(0, 10, order); + testCount(10, 10, order); + testCount(buffer_length, 10, order); + testCount(10, buffer_length, order); + testCount(buffer_length, buffer_length, order); + testCount(buffer_length + 1, 10, order); + testCount(10, buffer_length + 1, order); + testCount(buffer_length + 1, buffer_length, order); + testCount(buffer_length, buffer_length + 1, order); + testCount(buffer_length + 1, buffer_length + 1, order); + } + } + + static void testIsBufferEmptyOrFull(int num_narrow, int num_full, bool expect_empty, bool expect_full) { + FakeRoots fr(num_narrow, num_full); + + DoNothingOopClosure cl; + BufferingOopClosure boc(&cl); + + fr.oops_do(&boc, 0); + + #define assert_testIsBufferEmptyOrFull(got, expected) \ + assert((got) == (expected), \ + err_msg("Expected: %d, got: %d. testIsBufferEmptyOrFull(%d, %d, %s, %s)", \ + (got), (expected), num_narrow, num_full, \ + BOOL_TO_STR(expect_empty), BOOL_TO_STR(expect_full))) + + assert_testIsBufferEmptyOrFull(expect_empty, boc.is_buffer_empty()); + assert_testIsBufferEmptyOrFull(expect_full, boc.is_buffer_full()); + } + + static void testIsBufferEmptyOrFull() { + int bl = BufferingOopClosure::BufferLength; + + testIsBufferEmptyOrFull(0, 0, true, false); + testIsBufferEmptyOrFull(1, 0, false, false); + testIsBufferEmptyOrFull(0, 1, false, false); + testIsBufferEmptyOrFull(1, 1, false, false); + testIsBufferEmptyOrFull(10, 0, false, false); + testIsBufferEmptyOrFull(0, 10, false, false); + testIsBufferEmptyOrFull(10, 10, false, false); + testIsBufferEmptyOrFull(0, bl, false, true); + testIsBufferEmptyOrFull(bl, 0, false, true); + testIsBufferEmptyOrFull(bl/2, bl/2, false, true); + testIsBufferEmptyOrFull(bl-1, 1, false, true); + testIsBufferEmptyOrFull(1, bl-1, false, true); + // Processed + testIsBufferEmptyOrFull(bl+1, 0, false, false); + testIsBufferEmptyOrFull(bl*2, 0, false, true); + } + + static void testEmptyAfterDone(int num_narrow, int num_full) { + FakeRoots fr(num_narrow, num_full); + + DoNothingOopClosure cl; + BufferingOopClosure boc(&cl); + + fr.oops_do(&boc, 0); + + // Make sure all get processed. + boc.done(); + + assert(boc.is_buffer_empty(), + err_msg("Should be empty after call to done(). testEmptyAfterDone(%d, %d)", + num_narrow, num_full)); + } + + static void testEmptyAfterDone() { + int bl = BufferingOopClosure::BufferLength; + + testEmptyAfterDone(0, 0); + testEmptyAfterDone(1, 0); + testEmptyAfterDone(0, 1); + testEmptyAfterDone(1, 1); + testEmptyAfterDone(10, 0); + testEmptyAfterDone(0, 10); + testEmptyAfterDone(10, 10); + testEmptyAfterDone(0, bl); + testEmptyAfterDone(bl, 0); + testEmptyAfterDone(bl/2, bl/2); + testEmptyAfterDone(bl-1, 1); + testEmptyAfterDone(1, bl-1); + // Processed + testEmptyAfterDone(bl+1, 0); + testEmptyAfterDone(bl*2, 0); + } + + public: + static void test() { + testCount(); + testIsBufferEmptyOrFull(); + testEmptyAfterDone(); + } +}; + +void TestBufferingOopClosure_test() { + TestBufferingOopClosure::test(); +} + +#endif diff --git a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp index 9d8d8704d33..ffdc69dfa5c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/bufferingOopClosure.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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,10 +25,10 @@ #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP #define SHARE_VM_GC_IMPLEMENTATION_G1_BUFFERINGOOPCLOSURE_HPP -#include "memory/genOopClosures.hpp" -#include "memory/generation.hpp" +#include "memory/iterator.hpp" +#include "oops/oopsHierarchy.hpp" #include "runtime/os.hpp" -#include "utilities/taskqueue.hpp" +#include "utilities/debug.hpp" // A BufferingOops closure tries to separate out the cost of finding roots // from the cost of applying closures to them. It maintains an array of @@ -41,60 +41,103 @@ // The caller must be sure to call "done" to process any unprocessed // buffered entries. -class Generation; -class HeapRegion; - class BufferingOopClosure: public OopClosure { + friend class TestBufferingOopClosure; protected: - enum PrivateConstants { - BufferLength = 1024 - }; + static const size_t BufferLength = 1024; - StarTask _buffer[BufferLength]; - StarTask* _buffer_top; - StarTask* _buffer_curr; + // We need to know if the buffered addresses contain oops or narrowOops. + // We can't tag the addresses the way StarTask does, because we need to + // be able to handle unaligned addresses coming from oops embedded in code. + // + // The addresses for the full-sized oops are filled in from the bottom, + // while the addresses for the narrowOops are filled in from the top. + OopOrNarrowOopStar _buffer[BufferLength]; + OopOrNarrowOopStar* _oop_top; + OopOrNarrowOopStar* _narrowOop_bottom; OopClosure* _oc; double _closure_app_seconds; - void process_buffer () { - double start = os::elapsedTime(); - for (StarTask* curr = _buffer; curr < _buffer_curr; ++curr) { - if (curr->is_narrow()) { - assert(UseCompressedOops, "Error"); - _oc->do_oop((narrowOop*)(*curr)); - } else { - _oc->do_oop((oop*)(*curr)); - } + + bool is_buffer_empty() { + return _oop_top == _buffer && _narrowOop_bottom == (_buffer + BufferLength - 1); + } + + bool is_buffer_full() { + return _narrowOop_bottom < _oop_top; + } + + // Process addresses containing full-sized oops. + void process_oops() { + for (OopOrNarrowOopStar* curr = _buffer; curr < _oop_top; ++curr) { + _oc->do_oop((oop*)(*curr)); } - _buffer_curr = _buffer; + _oop_top = _buffer; + } + + // Process addresses containing narrow oops. + void process_narrowOops() { + for (OopOrNarrowOopStar* curr = _buffer + BufferLength - 1; curr > _narrowOop_bottom; --curr) { + _oc->do_oop((narrowOop*)(*curr)); + } + _narrowOop_bottom = _buffer + BufferLength - 1; + } + + // Apply the closure to all oops and clear the buffer. + // Accumulate the time it took. + void process_buffer() { + double start = os::elapsedTime(); + + process_oops(); + process_narrowOops(); + _closure_app_seconds += (os::elapsedTime() - start); } - template inline void do_oop_work(T* p) { - if (_buffer_curr == _buffer_top) { + void process_buffer_if_full() { + if (is_buffer_full()) { process_buffer(); } - StarTask new_ref(p); - *_buffer_curr = new_ref; - ++_buffer_curr; + } + + void add_narrowOop(narrowOop* p) { + assert(!is_buffer_full(), "Buffer should not be full"); + *_narrowOop_bottom = (OopOrNarrowOopStar)p; + _narrowOop_bottom--; + } + + void add_oop(oop* p) { + assert(!is_buffer_full(), "Buffer should not be full"); + *_oop_top = (OopOrNarrowOopStar)p; + _oop_top++; } public: - virtual void do_oop(narrowOop* p) { do_oop_work(p); } - virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { + process_buffer_if_full(); + add_narrowOop(p); + } - void done () { - if (_buffer_curr > _buffer) { + virtual void do_oop(oop* p) { + process_buffer_if_full(); + add_oop(p); + } + + void done() { + if (!is_buffer_empty()) { process_buffer(); } } - double closure_app_seconds () { + + double closure_app_seconds() { return _closure_app_seconds; } - BufferingOopClosure (OopClosure *oc) : + + BufferingOopClosure(OopClosure *oc) : _oc(oc), - _buffer_curr(_buffer), _buffer_top(_buffer + BufferLength), + _oop_top(_buffer), + _narrowOop_bottom(_buffer + BufferLength - 1), _closure_app_seconds(0.0) { } }; diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp index 44437fcdb7a..48e70a1c984 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.cpp @@ -23,7 +23,6 @@ */ #include "precompiled.hpp" -#include "gc_implementation/g1/bufferingOopClosure.hpp" #include "gc_implementation/g1/concurrentG1Refine.hpp" #include "gc_implementation/g1/concurrentG1RefineThread.hpp" #include "gc_implementation/g1/g1BlockOffsetTable.inline.hpp" diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp index 7c010f9daf6..edaeff6e229 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1RemSet.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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 diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index a4201f1e84b..c62c08b68cc 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -4952,6 +4952,7 @@ void TestVirtualSpaceNode_test(); void TestOldFreeSpaceCalculation_test(); #if INCLUDE_ALL_GCS void TestG1BiasedArray_test(); +void TestBufferingOopClosure_test(); #endif void execute_internal_vm_tests() { @@ -4977,6 +4978,7 @@ void execute_internal_vm_tests() { #if INCLUDE_ALL_GCS run_unit_test(TestG1BiasedArray_test()); run_unit_test(HeapRegionRemSet::test_prt()); + run_unit_test(TestBufferingOopClosure_test()); #endif tty->print_cr("All internal VM tests passed"); } From 5d460f1f3d9f1ac8a9cf64c5fc2b7a111e00fb9a Mon Sep 17 00:00:00 2001 From: Stefan Karlsson Date: Mon, 10 Feb 2014 12:58:09 +0100 Subject: [PATCH 12/35] 8033923: Use BufferingOopClosure for G1 code root scanning Reviewed-by: mgerdin, brutisso --- .../vm/gc_implementation/g1/g1CollectedHeap.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp index a56b4ec0c23..f027f29491c 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp @@ -5115,15 +5115,12 @@ g1_process_strong_roots(bool is_scavenging, BufferingOopClosure buf_scan_non_heap_roots(scan_non_heap_roots); - assert(so & SO_AllCodeCache || scan_rs != NULL, "must scan code roots somehow"); - // Walk the code cache/strong code roots w/o buffering, because StarTask - // cannot handle unaligned oop locations. - CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); + CodeBlobToOopClosure scan_code_roots(&buf_scan_non_heap_roots, true /* do_marking */); process_strong_roots(false, // no scoping; this is parallel code so, &buf_scan_non_heap_roots, - &eager_scan_code_roots, + &scan_code_roots, scan_klasses ); @@ -5177,9 +5174,9 @@ g1_process_strong_roots(bool is_scavenging, g1_policy()->phase_times()->record_strong_code_root_mark_time(worker_i, mark_strong_code_roots_ms); // Now scan the complement of the collection set. - if (scan_rs != NULL) { - g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); - } + CodeBlobToOopClosure eager_scan_code_roots(scan_non_heap_roots, true /* do_marking */); + g1_rem_set()->oops_into_collection_set_do(scan_rs, &eager_scan_code_roots, worker_i); + _process_strong_tasks->all_tasks_completed(); } From 40ba2bba2ccc3b5269481b29b1ee598bd248f253 Mon Sep 17 00:00:00 2001 From: Jesper Wilhelmsson Date: Tue, 10 Dec 2013 15:11:02 +0100 Subject: [PATCH 13/35] 8026849: Fix typos in the GC code, part 2 Fixed typos in assert messages, flag descriptions and verbose messages Reviewed-by: stefank, tschatzl --- .../cmsAdaptiveSizePolicy.cpp | 2 +- .../concurrentMarkSweepGeneration.cpp | 6 +++--- .../concurrentMarkSweep/vmCMSOperations.cpp | 2 +- .../vm/gc_implementation/g1/g1_globals.hpp | 2 +- .../vm/gc_implementation/g1/satbQueue.cpp | 2 +- .../parNew/parCardTableModRefBS.cpp | 2 +- .../shared/adaptiveSizePolicy.cpp | 2 +- .../shared/mutableNUMASpace.cpp | 2 +- .../share/vm/memory/binaryTreeDictionary.cpp | 2 +- .../src/share/vm/memory/cardTableModRefBS.cpp | 4 ++-- hotspot/src/share/vm/memory/metaspace.cpp | 4 ++-- .../src/share/vm/memory/referenceProcessor.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 18 +++++++----------- hotspot/src/share/vm/runtime/javaCalls.cpp | 2 +- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/virtualspace.cpp | 4 ++-- 16 files changed, 27 insertions(+), 31 deletions(-) diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp index 999b1f8ca53..657ab30f5a6 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsAdaptiveSizePolicy.cpp @@ -700,7 +700,7 @@ void CMSAdaptiveSizePolicy::ms_collection_end(GCCause::Cause gc_cause) { double latest_cms_sum_concurrent_phases_time_secs = concurrent_collection_time(); if (PrintAdaptiveSizePolicy && Verbose) { - gclog_or_tty->print_cr("\nCMSAdaptiveSizePolicy::ms_collecton_end " + gclog_or_tty->print_cr("\nCMSAdaptiveSizePolicy::ms_collection_end " "STW_in_foreground_in_seconds %f " "_latest_cms_initial_mark_start_to_end_time_secs %f " "_latest_cms_remark_start_to_end_time_secs %f " diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp index c6f608f5da6..847a8326fa0 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @@ -958,7 +958,7 @@ void ConcurrentMarkSweepGeneration::compute_new_size_free_list() { desired_free_percentage); gclog_or_tty->print_cr(" Maximum free fraction %f", maximum_free_percentage); - gclog_or_tty->print_cr(" Capactiy "SIZE_FORMAT, capacity()/1000); + gclog_or_tty->print_cr(" Capacity "SIZE_FORMAT, capacity()/1000); gclog_or_tty->print_cr(" Desired capacity "SIZE_FORMAT, desired_capacity/1000); int prev_level = level() - 1; @@ -3313,7 +3313,7 @@ void CMSCollector::setup_cms_unloading_and_verification_state() { } // Not unloading classes this cycle - assert(!should_unload_classes(), "Inconsitency!"); + assert(!should_unload_classes(), "Inconsistency!"); remove_root_scanning_option(SharedHeap::SO_SystemClasses); add_root_scanning_option(SharedHeap::SO_AllClasses); @@ -7243,7 +7243,7 @@ size_t SurvivorSpacePrecleanClosure::do_object_careful(oop p) { HeapWord* addr = (HeapWord*)p; DEBUG_ONLY(_collector->verify_work_stacks_empty();) assert(!_span.contains(addr), "we are scanning the survivor spaces"); - assert(p->klass_or_null() != NULL, "object should be initializd"); + assert(p->klass_or_null() != NULL, "object should be initialized"); // an initialized object; ignore mark word in verification below // since we are running concurrent with mutators assert(p->is_oop(true), "should be an oop"); diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp index 0860369e706..8024d298f05 100644 --- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp +++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/vmCMSOperations.cpp @@ -254,7 +254,7 @@ bool VM_GenCollectFullConcurrent::evaluate_at_safepoint() const { // No need to do a young gc, we'll just nudge the CMS thread // in the doit() method above, to be executed soon. assert(_gc_count_before < gch->total_collections(), - "total_collections() should be monotnically increasing"); + "total_collections() should be monotonically increasing"); return false; // no need for foreground young gc } } diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp index f82fda912c9..74158edb7c3 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp +++ b/hotspot/src/share/vm/gc_implementation/g1/g1_globals.hpp @@ -183,7 +183,7 @@ "When true, record recent calls to rem set operations.") \ \ develop(intx, G1MaxVerifyFailures, -1, \ - "The maximum number of verification failrues to print. " \ + "The maximum number of verification failures to print. " \ "-1 means print all.") \ \ develop(bool, G1ScrubRemSets, true, \ diff --git a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp index ec6581431b3..3c34883a808 100644 --- a/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp +++ b/hotspot/src/share/vm/gc_implementation/g1/satbQueue.cpp @@ -91,7 +91,7 @@ void ObjPtrQueue::filter() { assert(new_index > 0, "we should not have already filled up the buffer"); new_index -= oopSize; assert(new_index >= i, - "new_index should never be below i, as we alwaysr compact 'up'"); + "new_index should never be below i, as we always compact 'up'"); oop* new_p = (oop*) &buf[byte_index_to_index((int) new_index)]; assert(new_p >= p, "the destination location should never be below " "the source as we always compact 'up'"); diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp index 64bf6f03458..b1dacc870eb 100644 --- a/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp +++ b/hotspot/src/share/vm/gc_implementation/parNew/parCardTableModRefBS.cpp @@ -250,7 +250,7 @@ process_chunk_boundaries(Space* sp, // right neighbor (up to the end of the first object). if (last_card_of_cur_chunk < last_card_of_first_obj) { tty->print_cr(" LNC: BEWARE!!! first obj straddles past right end of chunk:\n" - " might be efficient to get value from right neighbour?"); + " might be efficient to get value from right neighbor?"); } }) } else { diff --git a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp index ada9cbb3490..8c9ca0a9fd9 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/adaptiveSizePolicy.cpp @@ -168,7 +168,7 @@ int AdaptiveSizePolicy::calc_default_active_workers(uintx total_workers, if (TraceDynamicGCThreads) { gclog_or_tty->print_cr("GCTaskManager::calc_default_active_workers() : " - "active_workers(): %d new_acitve_workers: %d " + "active_workers(): %d new_active_workers: %d " "prev_active_workers: %d\n" " active_workers_by_JT: %d active_workers_by_heap_size: %d", active_workers, new_active_workers, prev_active_workers, diff --git a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp index f27cf5155d0..e198590ef4b 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/mutableNUMASpace.cpp @@ -559,7 +559,7 @@ void MutableNUMASpace::initialize(MemRegion mr, bool clear_space, bool mangle_space, bool setup_pages) { - assert(clear_space, "Reallocation will destory data!"); + assert(clear_space, "Reallocation will destroy data!"); assert(lgrp_spaces()->length() > 0, "There should be at least one space"); MemRegion old_region = region(), new_region; diff --git a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp index 9f2dcebfc14..68b97e9f0d3 100644 --- a/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp +++ b/hotspot/src/share/vm/memory/binaryTreeDictionary.cpp @@ -1352,7 +1352,7 @@ void BinaryTreeDictionary::print_free_lists(outputStream* s template class FreeList_t> void BinaryTreeDictionary::verify_tree() const { guarantee(root() == NULL || total_free_blocks() == 0 || - total_size() != 0, "_total_size should't be 0?"); + total_size() != 0, "_total_size shouldn't be 0?"); guarantee(root() == NULL || root()->parent() == NULL, "_root shouldn't have parent"); verify_tree_helper(root()); } diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp index 2f23b3a7617..76c899e973d 100644 --- a/hotspot/src/share/vm/memory/cardTableModRefBS.cpp +++ b/hotspot/src/share/vm/memory/cardTableModRefBS.cpp @@ -54,8 +54,8 @@ size_t CardTableModRefBS::cards_required(size_t covered_words) size_t CardTableModRefBS::compute_byte_map_size() { assert(_guard_index == cards_required(_whole_heap.word_size()) - 1, - "unitialized, check declaration order"); - assert(_page_size != 0, "unitialized, check declaration order"); + "uninitialized, check declaration order"); + assert(_page_size != 0, "uninitialized, check declaration order"); const size_t granularity = os::vm_allocation_granularity(); return align_size_up(_guard_index + 1, MAX2(_page_size, granularity)); } diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp index 73da1c74ef8..6105321c30f 100644 --- a/hotspot/src/share/vm/memory/metaspace.cpp +++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -746,7 +746,7 @@ void VirtualSpaceNode::inc_container_count() { assert_lock_strong(SpaceManager::expand_lock()); _container_count++; assert(_container_count == container_count_slow(), - err_msg("Inconsistency in countainer_count _container_count " SIZE_FORMAT + err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT " container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow())); } @@ -759,7 +759,7 @@ void VirtualSpaceNode::dec_container_count() { #ifdef ASSERT void VirtualSpaceNode::verify_container_count() { assert(_container_count == container_count_slow(), - err_msg("Inconsistency in countainer_count _container_count " SIZE_FORMAT + err_msg("Inconsistency in container_count _container_count " SIZE_FORMAT " container_count_slow() " SIZE_FORMAT, _container_count, container_count_slow())); } #endif diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp index d7d48ba7548..72a43d85df3 100644 --- a/hotspot/src/share/vm/memory/referenceProcessor.cpp +++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp @@ -62,7 +62,7 @@ void ReferenceProcessor::init_statics() { } guarantee(RefDiscoveryPolicy == ReferenceBasedDiscovery || RefDiscoveryPolicy == ReferentBasedDiscovery, - "Unrecongnized RefDiscoveryPolicy"); + "Unrecognized RefDiscoveryPolicy"); _pending_list_uses_discovered_field = JDK_Version::current().pending_list_uses_discovered_field(); } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index b5d8880e91e..eb3a01bebac 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -565,7 +565,7 @@ class CommandLineFlags { "Force NUMA optimizations on single-node/UMA systems") \ \ product(uintx, NUMAChunkResizeWeight, 20, \ - "Percentage (0-100) used to weigh the current sample when " \ + "Percentage (0-100) used to weight the current sample when " \ "computing exponentially decaying average for " \ "AdaptiveNUMAChunkSizing") \ \ @@ -1502,7 +1502,7 @@ class CommandLineFlags { "allocation") \ \ product(uintx, PLABWeight, 75, \ - "Percentage (0-100) used to weigh the current sample when " \ + "Percentage (0-100) used to weight the current sample when " \ "computing exponentially decaying average for ResizePLAB") \ \ product(bool, ResizePLAB, true, \ @@ -1611,11 +1611,11 @@ class CommandLineFlags { "is shifted to the right within the period between young GCs") \ \ product(uintx, CMSExpAvgFactor, 50, \ - "Percentage (0-100) used to weigh the current sample when " \ + "Percentage (0-100) used to weight the current sample when " \ "computing exponential averages for CMS statistics") \ \ product(uintx, CMS_FLSWeight, 75, \ - "Percentage (0-100) used to weigh the current sample when " \ + "Percentage (0-100) used to weight the current sample when " \ "computing exponentially decaying averages for CMS FLS " \ "statistics") \ \ @@ -1727,19 +1727,15 @@ class CommandLineFlags { "to simulate overflow; a smaller number increases frequency") \ \ product(uintx, CMSMaxAbortablePrecleanLoops, 0, \ - "(Temporary, subject to experimentation) " \ "Maximum number of abortable preclean iterations, if > 0") \ \ product(intx, CMSMaxAbortablePrecleanTime, 5000, \ - "(Temporary, subject to experimentation) " \ "Maximum time in abortable preclean (in milliseconds)") \ \ product(uintx, CMSAbortablePrecleanMinWorkPerIteration, 100, \ - "(Temporary, subject to experimentation) " \ "Nominal minimum work per abortable preclean iteration") \ \ manageable(intx, CMSAbortablePrecleanWaitMillis, 100, \ - "(Temporary, subject to experimentation) " \ "Time that we sleep between iterations when not given " \ "enough work per iteration") \ \ @@ -1955,13 +1951,13 @@ class CommandLineFlags { "(other young collectors)") \ \ develop(uintx, PromotionFailureALotInterval, 5, \ - "Total collections between promotion failures alot") \ + "Total collections between promotion failures a lot") \ \ experimental(uintx, WorkStealingSleepMillis, 1, \ "Sleep time when sleep is used for yields") \ \ experimental(uintx, WorkStealingYieldsBeforeSleep, 5000, \ - "Number of yields before a sleep is done during workstealing") \ + "Number of yields before a sleep is done during work stealing") \ \ experimental(uintx, WorkStealingHardSpins, 4096, \ "Number of iterations in a spin loop between checks on " \ @@ -2039,7 +2035,7 @@ class CommandLineFlags { "size; deprecated: to be renamed to MaxRAMFraction") \ \ product(uintx, MinRAMFraction, 2, \ - "Minimum fraction (1/n) of real memory used for maxmimum heap " \ + "Minimum fraction (1/n) of real memory used for maximum heap " \ "size on systems with small physical memory size") \ \ product(uintx, InitialRAMFraction, 64, \ diff --git a/hotspot/src/share/vm/runtime/javaCalls.cpp b/hotspot/src/share/vm/runtime/javaCalls.cpp index 027d8d9b50f..d7ff466ec36 100644 --- a/hotspot/src/share/vm/runtime/javaCalls.cpp +++ b/hotspot/src/share/vm/runtime/javaCalls.cpp @@ -337,7 +337,7 @@ void JavaCalls::call_helper(JavaValue* result, methodHandle* m, JavaCallArgument // A klass might not be initialized since JavaCall's might be used during the executing of // the . For example, a Thread.start might start executing on an object that is // not fully initialized! (bad Java programming style) - assert(holder->is_linked(), "rewritting must have taken place"); + assert(holder->is_linked(), "rewriting must have taken place"); } #endif diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 74617ab97e8..3062861360f 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -1197,7 +1197,7 @@ char* os::format_boot_path(const char* format_string, char fileSep, char pathSep) { assert((fileSep == '/' && pathSep == ':') || - (fileSep == '\\' && pathSep == ';'), "unexpected seperator chars"); + (fileSep == '\\' && pathSep == ';'), "unexpected separator chars"); // Scan the format string to determine the length of the actual // boot classpath, and handle platform dependencies as well. diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp index 45730fa49fc..0e14c57e26c 100644 --- a/hotspot/src/share/vm/runtime/virtualspace.cpp +++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -215,9 +215,9 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, noaccess_prefix == _alignment, "noaccess prefix wrong"); assert(markOopDesc::encode_pointer_as_mark(_base)->decode_pointer() == _base, - "area must be distinguisable from marks for mark-sweep"); + "area must be distinguishable from marks for mark-sweep"); assert(markOopDesc::encode_pointer_as_mark(&_base[size])->decode_pointer() == &_base[size], - "area must be distinguisable from marks for mark-sweep"); + "area must be distinguishable from marks for mark-sweep"); } From 455663f56eb08935d0d8793fcee26839e805e090 Mon Sep 17 00:00:00 2001 From: Jaroslav Bachorik Date: Thu, 30 Jan 2014 09:41:45 +0100 Subject: [PATCH 14/35] 6656031: SA: jmap -permstat number of classes is off by 1 Reviewed-by: sla, dholmes --- .../classes/sun/jvm/hotspot/tools/ClassLoaderStats.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java index d2ea2db855d..a5fac511d18 100644 --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/ClassLoaderStats.java @@ -103,11 +103,12 @@ public class ClassLoaderStats extends Tool { } SystemDictionary dict = VM.getVM().getSystemDictionary(); - dict.classesDo(new SystemDictionary.ClassAndLoaderVisitor() { - public void visit(Klass k, Oop loader) { + dict.classesDo(new SystemDictionary.ClassVisitor() { + public void visit(Klass k) { if (! (k instanceof InstanceKlass)) { return; } + Oop loader = ((InstanceKlass) k).getClassLoader(); LoaderData ld = (loader != null) ? (LoaderData)loaderMap.get(loader) : bootstrapLoaderData; if (ld != null) { From 97d55c801e4d833db53c92d2f0fd23da31a49621 Mon Sep 17 00:00:00 2001 From: Ron Durbin Date: Thu, 30 Jan 2014 14:12:22 -0800 Subject: [PATCH 15/35] 8027113: decouple the '-XXaltjvm=' option from the gamma launcher Decoupled the '-XXaltjvm=' option from the gamma launcher. Clearing the way for removing the remaining cruft associated with the previously removed gamma launcher. Reviewed-by: dcubed, dholmes --- hotspot/make/Makefile | 6 +-- hotspot/make/hotspot.script | 30 ++++++++++--- hotspot/src/os/bsd/vm/os_bsd.cpp | 14 +++--- hotspot/src/os/linux/vm/os_linux.cpp | 15 ++++--- hotspot/src/os/solaris/vm/os_solaris.cpp | 15 ++++--- hotspot/src/os/windows/vm/os_windows.cpp | 44 +++++++++---------- .../ProjectCreator/WinGammaPlatformVC10.java | 13 +++++- hotspot/src/share/vm/runtime/arguments.cpp | 35 +++++++-------- hotspot/src/share/vm/runtime/arguments.hpp | 10 ++--- 9 files changed, 105 insertions(+), 77 deletions(-) diff --git a/hotspot/make/Makefile b/hotspot/make/Makefile index 581a5daae12..e313baef93a 100644 --- a/hotspot/make/Makefile +++ b/hotspot/make/Makefile @@ -557,11 +557,11 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar: # Testing the built JVM -RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -Dsun.java.launcher=gamma +RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -XXaltjvm=$(ALTJVM_DIR) -Dsun.java.launcher.is_altjvm=true generic_test: @$(ECHO) "Running with: $(ALTJVM_DIR)" - @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -Xinternalversion - @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help + @$(RUN_JVM) -Xinternalversion + @$(RUN_JVM) -showversion -help # C2 test targets test_product test_optimized test_fastdebug test_debug: diff --git a/hotspot/make/hotspot.script b/hotspot/make/hotspot.script index 9177f6efef8..331cf6b38d4 100644 --- a/hotspot/make/hotspot.script +++ b/hotspot/make/hotspot.script @@ -49,7 +49,7 @@ then GDB=gdb fi -# This is the name of the gdb binary to use +# This is the name of the dbx binary to use if [ ! "$DBX" ] then DBX=dbx @@ -68,9 +68,16 @@ EMACS=emacs # End of user changeable parameters ----------------------------------------- # +OS=`uname -s` + # Make sure the paths are fully specified, i.e. they must begin with /. REL_MYDIR=`dirname $0` MYDIR=`cd $REL_MYDIR && pwd` +case "$OS" in +CYGWIN*) + MYDIR=`cygpath -m "$MYDIR"` + ;; +esac # # Look whether the user wants to run inside gdb @@ -102,8 +109,17 @@ else JDK=@@JDK_IMPORT_PATH@@ fi -if [ "${JDK}" = "" ]; then - echo "Failed to find JDK. Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty." +if [ "${JDK}" != "" ]; then + case "$OS" in + CYGWIN*) + JDK=`cygpath -m "$JDK"` + ;; + esac + +else + echo "Failed to find JDK." \ + "Either ALT_JAVA_HOME is not set or JDK_IMPORT_PATH is empty." + exit 1 fi # We will set the LD_LIBRARY_PATH as follows: @@ -120,7 +136,6 @@ SBP=${MYDIR}:${JRE}/lib/${ARCH} # Set up a suitable LD_LIBRARY_PATH or DYLD_LIBRARY_PATH -OS=`uname -s` if [ "${OS}" = "Darwin" ] then if [ -z "$DYLD_LIBRARY_PATH" ] @@ -141,7 +156,7 @@ else export LD_LIBRARY_PATH fi -JPARMS="-Dsun.java.launcher=gamma -XXaltjvm=$MYDIR $@ $JAVA_ARGS"; +JPARMS="-XXaltjvm=$MYDIR -Dsun.java.launcher.is_altjvm=true $@ $JAVA_ARGS"; # Locate the java launcher LAUNCHER=$JDK/bin/java @@ -152,6 +167,11 @@ fi GDBSRCDIR=$MYDIR BASEDIR=`cd $MYDIR/../../.. && pwd` +case "$OS" in +CYGWIN*) + BASEDIR=`cygpath -m "$BASEDIR"` + ;; +esac init_gdb() { # Create a gdb script in case we should run inside gdb diff --git a/hotspot/src/os/bsd/vm/os_bsd.cpp b/hotspot/src/os/bsd/vm/os_bsd.cpp index 456daba559c..cadf960b1ac 100644 --- a/hotspot/src/os/bsd/vm/os_bsd.cpp +++ b/hotspot/src/os/bsd/vm/os_bsd.cpp @@ -1788,12 +1788,14 @@ void os::jvm_path(char *buf, jint buflen) { if (rp == NULL) return; - if (Arguments::created_by_gamma_launcher()) { - // Support for the gamma launcher. Typical value for buf is - // "/jre/lib///libjvm". If "/jre/lib/" appears at - // the right place in the string, then assume we are installed in a JDK and - // we're done. Otherwise, check for a JAVA_HOME environment variable and - // construct a path to the JVM being overridden. + if (Arguments::sun_java_launcher_is_altjvm()) { + // Support for the java launcher's '-XXaltjvm=' option. Typical + // value for buf is "/jre/lib///libjvm.so" + // or "/jre/lib//libjvm.dylib". If "/jre/lib/" + // appears at the right place in the string, then assume we are + // installed in a JDK and we're done. Otherwise, check for a + // JAVA_HOME environment variable and construct a path to the JVM + // being overridden. const char *p = buf + strlen(buf) - 1; for (int count = 0; p > buf && count < 5; ++count) { diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index d0751f005ad..1e3fc78b505 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -2371,13 +2371,14 @@ void os::jvm_path(char *buf, jint buflen) { if (rp == NULL) return; - if (Arguments::created_by_gamma_launcher()) { - // Support for the gamma launcher. Typical value for buf is - // "/jre/lib///libjvm.so". If "/jre/lib/" appears at - // the right place in the string, then assume we are installed in a JDK and - // we're done. Otherwise, check for a JAVA_HOME environment variable and fix - // up the path so it looks like libjvm.so is installed there (append a - // fake suffix hotspot/libjvm.so). + if (Arguments::sun_java_launcher_is_altjvm()) { + // Support for the java launcher's '-XXaltjvm=' option. Typical + // value for buf is "/jre/lib///libjvm.so". + // If "/jre/lib/" appears at the right place in the string, then + // assume we are installed in a JDK and we're done. Otherwise, check + // for a JAVA_HOME environment variable and fix up the path so it + // looks like libjvm.so is installed there (append a fake suffix + // hotspot/libjvm.so). const char *p = buf + strlen(buf) - 1; for (int count = 0; p > buf && count < 5; ++count) { for (--p; p > buf && *p != '/'; --p) diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 533bbb76650..396e9df542e 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -2441,13 +2441,14 @@ void os::jvm_path(char *buf, jint buflen) { return; } - if (Arguments::created_by_gamma_launcher()) { - // Support for the gamma launcher. Typical value for buf is - // "/jre/lib///libjvm.so". If "/jre/lib/" appears at - // the right place in the string, then assume we are installed in a JDK and - // we're done. Otherwise, check for a JAVA_HOME environment variable and fix - // up the path so it looks like libjvm.so is installed there (append a - // fake suffix hotspot/libjvm.so). + if (Arguments::sun_java_launcher_is_altjvm()) { + // Support for the java launcher's '-XXaltjvm=' option. Typical + // value for buf is "/jre/lib///libjvm.so". + // If "/jre/lib/" appears at the right place in the string, then + // assume we are installed in a JDK and we're done. Otherwise, check + // for a JAVA_HOME environment variable and fix up the path so it + // looks like libjvm.so is installed there (append a fake suffix + // hotspot/libjvm.so). const char *p = buf + strlen(buf) - 1; for (int count = 0; p > buf && count < 5; ++count) { for (--p; p > buf && *p != '/'; --p) diff --git a/hotspot/src/os/windows/vm/os_windows.cpp b/hotspot/src/os/windows/vm/os_windows.cpp index 5cf47426595..2fa8269ee5e 100644 --- a/hotspot/src/os/windows/vm/os_windows.cpp +++ b/hotspot/src/os/windows/vm/os_windows.cpp @@ -1810,32 +1810,30 @@ void os::jvm_path(char *buf, jint buflen) { } buf[0] = '\0'; - if (Arguments::created_by_gamma_launcher()) { - // Support for the gamma launcher. Check for an - // JAVA_HOME environment variable - // and fix up the path so it looks like - // libjvm.so is installed there (append a fake suffix - // hotspot/libjvm.so). - char* java_home_var = ::getenv("JAVA_HOME"); - if (java_home_var != NULL && java_home_var[0] != 0) { + if (Arguments::sun_java_launcher_is_altjvm()) { + // Support for the java launcher's '-XXaltjvm=' option. Check + // for a JAVA_HOME environment variable and fix up the path so it + // looks like jvm.dll is installed there (append a fake suffix + // hotspot/jvm.dll). + char* java_home_var = ::getenv("JAVA_HOME"); + if (java_home_var != NULL && java_home_var[0] != 0) { + strncpy(buf, java_home_var, buflen); - strncpy(buf, java_home_var, buflen); - - // determine if this is a legacy image or modules image - // modules image doesn't have "jre" subdirectory - size_t len = strlen(buf); - char* jrebin_p = buf + len; - jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\"); - if (0 != _access(buf, 0)) { - jio_snprintf(jrebin_p, buflen-len, "\\bin\\"); - } - len = strlen(buf); - jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); - } + // determine if this is a legacy image or modules image + // modules image doesn't have "jre" subdirectory + size_t len = strlen(buf); + char* jrebin_p = buf + len; + jio_snprintf(jrebin_p, buflen-len, "\\jre\\bin\\"); + if (0 != _access(buf, 0)) { + jio_snprintf(jrebin_p, buflen-len, "\\bin\\"); + } + len = strlen(buf); + jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); + } } - if(buf[0] == '\0') { - GetModuleFileName(vm_lib_handle, buf, buflen); + if (buf[0] == '\0') { + GetModuleFileName(vm_lib_handle, buf, buflen); } strcpy(saved_jvm_path, buf); } diff --git a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java index 6216a84adb1..0e0c846c318 100644 --- a/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java +++ b/hotspot/src/share/tools/ProjectCreator/WinGammaPlatformVC10.java @@ -161,7 +161,18 @@ public class WinGammaPlatformVC10 extends WinGammaPlatformVC7 { for (BuildConfig cfg : allConfigs) { startTag(cfg, "PropertyGroup"); tagData("LocalDebuggerCommand", cfg.get("JdkTargetRoot") + "\\bin\\java.exe"); - tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) -Dsun.java.launcher=gamma"); + // The JVM loads some libraries using a path relative to + // itself because it expects to be in a JRE or a JDK. The java + // launcher's '-XXaltjvm=' option allows the JVM to be outside + // the JRE or JDK so '-Dsun.java.launcher.is_altjvm=true' + // forces a fake JAVA_HOME relative path to be used to + // find the other libraries. The '-XX:+PauseAtExit' option + // causes the VM to wait for key press before exiting; this + // allows any stdout or stderr messages to be seen before + // the cmdtool exits. + tagData("LocalDebuggerCommandArguments", "-XXaltjvm=$(TargetDir) " + + "-Dsun.java.launcher.is_altjvm=true " + + "-XX:+UnlockDiagnosticVMOptions -XX:+PauseAtExit"); tagData("LocalDebuggerEnvironment", "JAVA_HOME=" + cfg.get("JdkTargetRoot")); endTag(); } diff --git a/hotspot/src/share/vm/runtime/arguments.cpp b/hotspot/src/share/vm/runtime/arguments.cpp index e237ba00f0c..acd5c162c58 100644 --- a/hotspot/src/share/vm/runtime/arguments.cpp +++ b/hotspot/src/share/vm/runtime/arguments.cpp @@ -101,7 +101,7 @@ bool Arguments::_xdebug_mode = false; const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG; const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER; int Arguments::_sun_java_launcher_pid = -1; -bool Arguments::_created_by_gamma_launcher = false; +bool Arguments::_sun_java_launcher_is_altjvm = false; // These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*) bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods; @@ -151,7 +151,8 @@ static void logOption(const char* opt) { // Process java launcher properties. void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) { - // See if sun.java.launcher or sun.java.launcher.pid is defined. + // See if sun.java.launcher, sun.java.launcher.is_altjvm or + // sun.java.launcher.pid is defined. // Must do this before setting up other system properties, // as some of them may depend on launcher type. for (int index = 0; index < args->nOptions; index++) { @@ -162,6 +163,12 @@ void Arguments::process_sun_java_launcher_properties(JavaVMInitArgs* args) { process_java_launcher_argument(tail, option->extraInfo); continue; } + if (match_option(option, "-Dsun.java.launcher.is_altjvm=", &tail)) { + if (strcmp(tail, "true") == 0) { + _sun_java_launcher_is_altjvm = true; + } + continue; + } if (match_option(option, "-Dsun.java.launcher.pid=", &tail)) { _sun_java_launcher_pid = atoi(tail); continue; @@ -1013,9 +1020,10 @@ bool Arguments::add_property(const char* prop) { _java_command = value; // Record value in Arguments, but let it get passed to Java. - } else if (strcmp(key, "sun.java.launcher.pid") == 0) { - // launcher.pid property is private and is processed - // in process_sun_java_launcher_properties(); + } else if (strcmp(key, "sun.java.launcher.is_altjvm") == 0 || + strcmp(key, "sun.java.launcher.pid") == 0) { + // sun.java.launcher.is_altjvm and sun.java.launcher.pid property are + // private and are processed in process_sun_java_launcher_properties(); // the sun.java.launcher property is passed on to the java application FreeHeap(key); if (eq != NULL) { @@ -1800,9 +1808,6 @@ void Arguments::process_java_compiler_argument(char* arg) { void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) { _sun_java_launcher = strdup(launcher); - if (strcmp("gamma", _sun_java_launcher) == 0) { - _created_by_gamma_launcher = true; - } } bool Arguments::created_by_java_launcher() { @@ -1810,8 +1815,8 @@ bool Arguments::created_by_java_launcher() { return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0; } -bool Arguments::created_by_gamma_launcher() { - return _created_by_gamma_launcher; +bool Arguments::sun_java_launcher_is_altjvm() { + return _sun_java_launcher_is_altjvm; } //=========================================================================================================== @@ -3765,16 +3770,6 @@ jint Arguments::apply_ergo() { } } - // set PauseAtExit if the gamma launcher was used and a debugger is attached - // but only if not already set on the commandline - if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) { - bool set = false; - CommandLineFlags::wasSetOnCmdline("PauseAtExit", &set); - if (!set) { - FLAG_SET_DEFAULT(PauseAtExit, true); - } - } - return JNI_OK; } diff --git a/hotspot/src/share/vm/runtime/arguments.hpp b/hotspot/src/share/vm/runtime/arguments.hpp index d016e22f22e..65dd0711a61 100644 --- a/hotspot/src/share/vm/runtime/arguments.hpp +++ b/hotspot/src/share/vm/runtime/arguments.hpp @@ -268,14 +268,14 @@ class Arguments : AllStatic { static const char* _java_vendor_url_bug; // sun.java.launcher, private property to provide information about - // java/gamma launcher + // java launcher static const char* _sun_java_launcher; // sun.java.launcher.pid, private property static int _sun_java_launcher_pid; - // was this VM created by the gamma launcher - static bool _created_by_gamma_launcher; + // was this VM created via the -XXaltjvm= option + static bool _sun_java_launcher_is_altjvm; // Option flags static bool _has_profile; @@ -483,8 +483,8 @@ class Arguments : AllStatic { static const char* sun_java_launcher() { return _sun_java_launcher; } // Was VM created by a Java launcher? static bool created_by_java_launcher(); - // Was VM created by the gamma Java launcher? - static bool created_by_gamma_launcher(); + // -Dsun.java.launcher.is_altjvm + static bool sun_java_launcher_is_altjvm(); // -Dsun.java.launcher.pid static int sun_java_launcher_pid() { return _sun_java_launcher_pid; } From eaac73cf8426c61917df515a34f4cb4b6b75eb25 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 3 Feb 2014 13:41:26 +0100 Subject: [PATCH 16/35] 8032462: Change the linux SDT implementation to use USDT2 instead of USDT1 Reviewed-by: coleenp, sspitsyn, kamg --- hotspot/make/bsd/makefiles/dtrace.make | 13 +- hotspot/make/linux/makefiles/buildtree.make | 12 +- hotspot/make/linux/makefiles/dtrace.make | 33 +- hotspot/make/linux/makefiles/top.make | 5 +- hotspot/make/solaris/makefiles/dtrace.make | 17 +- hotspot/src/os/bsd/dtrace/hs_private.d | 40 -- .../src/os/{bsd => posix}/dtrace/hotspot.d | 0 .../os/{bsd => posix}/dtrace/hotspot_jni.d | 0 .../os/{solaris => posix}/dtrace/hs_private.d | 0 hotspot/src/os/solaris/dtrace/hotspot.d | 86 --- hotspot/src/os/solaris/dtrace/hotspot_jni.d | 506 ------------------ hotspot/src/share/vm/utilities/dtrace.hpp | 14 +- 12 files changed, 64 insertions(+), 662 deletions(-) delete mode 100644 hotspot/src/os/bsd/dtrace/hs_private.d rename hotspot/src/os/{bsd => posix}/dtrace/hotspot.d (100%) rename hotspot/src/os/{bsd => posix}/dtrace/hotspot_jni.d (100%) rename hotspot/src/os/{solaris => posix}/dtrace/hs_private.d (100%) delete mode 100644 hotspot/src/os/solaris/dtrace/hotspot.d delete mode 100644 hotspot/src/os/solaris/dtrace/hotspot_jni.d diff --git a/hotspot/make/bsd/makefiles/dtrace.make b/hotspot/make/bsd/makefiles/dtrace.make index 7bef4f8a616..c13672aed16 100644 --- a/hotspot/make/bsd/makefiles/dtrace.make +++ b/hotspot/make/bsd/makefiles/dtrace.make @@ -53,6 +53,7 @@ JVMOFFS.o = $(JVMOFFS).o GENOFFS = generate$(JVMOFFS) DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace +DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace DTRACE = dtrace DTRACE.o = $(DTRACE).o @@ -262,14 +263,14 @@ endif $(DtraceOutDir): mkdir $(DtraceOutDir) -$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir) - $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d +$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d -$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) - $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d +$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d -$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir) - $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d +$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h diff --git a/hotspot/make/linux/makefiles/buildtree.make b/hotspot/make/linux/makefiles/buildtree.make index fd6c52513fe..67ef0e35d6c 100644 --- a/hotspot/make/linux/makefiles/buildtree.make +++ b/hotspot/make/linux/makefiles/buildtree.make @@ -124,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS)) # For dependencies and recursive makes. BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make -BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make +BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make trace.make sa.make dtrace.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \ SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT) @@ -361,6 +361,16 @@ sa.make: $(BUILDTREE_MAKE) echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ ) > $@ +dtrace.make: $(BUILDTREE_MAKE) + @echo Creating $@ ... + $(QUIETLY) ( \ + $(BUILDTREE_COMMENT); \ + echo; \ + echo include flags.make; \ + echo; \ + echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(@F)"; \ + ) > $@ + FORCE: .PHONY: all FORCE diff --git a/hotspot/make/linux/makefiles/dtrace.make b/hotspot/make/linux/makefiles/dtrace.make index b50eab183de..3a053736aae 100644 --- a/hotspot/make/linux/makefiles/dtrace.make +++ b/hotspot/make/linux/makefiles/dtrace.make @@ -42,18 +42,39 @@ ifneq ($(ALT_SDT_H),) else SDT_H_FILE = /usr/include/sys/sdt.h endif + DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE)) REASON = "$(SDT_H_FILE) not found" -ifneq ($(DTRACE_ENABLED),) - CFLAGS += -DDTRACE_ENABLED -endif +endif # GCC version +endif # OPENJDK -endif + +DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace +DTRACE_PROG = dtrace +DtraceOutDir = $(GENERATED)/dtracefiles + +$(DtraceOutDir): + mkdir $(DtraceOutDir) + +$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d + +$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d + +$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d + +ifneq ($(DTRACE_ENABLED),) +CFLAGS += -DDTRACE_ENABLED +dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h +else +dtrace_gen_headers: + $(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)" endif # Phony target used in vm.make build target to check whether enabled. -.PHONY: dtraceCheck ifeq ($(DTRACE_ENABLED),) dtraceCheck: $(QUIETLY) echo "**NOTICE** Dtrace support disabled: $(REASON)" @@ -61,5 +82,7 @@ else dtraceCheck: endif +.PHONY: dtrace_gen_headers dtraceCheck + # It doesn't support HAVE_DTRACE_H though. diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index 95e6e6856e8..8c6c2ca0194 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -80,7 +80,7 @@ default: vm_build_preliminaries the_vm @echo All done. # This is an explicit dependency for the sake of parallel makes. -vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff +vm_build_preliminaries: checks $(Cached_plat) $(AD_Files_If_Required) trace_stuff jvmti_stuff sa_stuff dtrace_stuff @# We need a null action here, so implicit rules don't get consulted. $(Cached_plat): $(Plat_File) @@ -102,6 +102,9 @@ trace_stuff: jvmti_stuff $(Cached_plat) $(adjust-mflags) sa_stuff: @$(MAKE) -f sa.make $(MFLAGS-adjusted) +dtrace_stuff: $(Cached_plat) $(adjust-mflags) + @$(MAKE) -f dtrace.make dtrace_gen_headers $(MFLAGS-adjusted) GENERATED=$(GENERATED) + # and the VM: must use other makefile with dependencies included # We have to go to great lengths to get control over the -jN argument diff --git a/hotspot/make/solaris/makefiles/dtrace.make b/hotspot/make/solaris/makefiles/dtrace.make index 3b32385ecad..5af625b54db 100644 --- a/hotspot/make/solaris/makefiles/dtrace.make +++ b/hotspot/make/solaris/makefiles/dtrace.make @@ -55,6 +55,7 @@ JVMOFFS.o = $(JVMOFFS).o GENOFFS = generate$(JVMOFFS) DTRACE_SRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/dtrace +DTRACE_COMMON_SRCDIR = $(GAMMADIR)/src/os/posix/dtrace DTRACE = dtrace DTRACE.o = $(DTRACE).o @@ -253,8 +254,8 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) endif endif -$(DTRACE).d: $(DTRACE_SRCDIR)/hotspot.d $(DTRACE_SRCDIR)/hotspot_jni.d \ - $(DTRACE_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d +$(DTRACE).d: $(DTRACE_COMMON_SRCDIR)/hotspot.d $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d \ + $(DTRACE_COMMON_SRCDIR)/hs_private.d $(DTRACE_SRCDIR)/jhelper.d $(QUIETLY) cat $^ > $@ DTraced_Files = ciEnv.o \ @@ -332,14 +333,14 @@ $(DTRACE.o): $(DTRACE).d $(JVMOFFS).h $(JVMOFFS)Index.h $(DTraced_Files) $(DtraceOutDir): mkdir $(DtraceOutDir) -$(DtraceOutDir)/hotspot.h: $(DTRACE_SRCDIR)/hotspot.d | $(DtraceOutDir) - $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot.d +$(DtraceOutDir)/hotspot.h: $(DTRACE_COMMON_SRCDIR)/hotspot.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot.d -$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) - $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hotspot_jni.d +$(DtraceOutDir)/hotspot_jni.h: $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d -$(DtraceOutDir)/hs_private.h: $(DTRACE_SRCDIR)/hs_private.d | $(DtraceOutDir) - $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_SRCDIR)/hs_private.d +$(DtraceOutDir)/hs_private.h: $(DTRACE_COMMON_SRCDIR)/hs_private.d | $(DtraceOutDir) + $(QUIETLY) $(DTRACE_PROG) $(DTRACE_OPTS) -C -I. -h -o $@ -s $(DTRACE_COMMON_SRCDIR)/hs_private.d dtrace_gen_headers: $(DtraceOutDir)/hotspot.h $(DtraceOutDir)/hotspot_jni.h $(DtraceOutDir)/hs_private.h diff --git a/hotspot/src/os/bsd/dtrace/hs_private.d b/hotspot/src/os/bsd/dtrace/hs_private.d deleted file mode 100644 index 50f4264a3c1..00000000000 --- a/hotspot/src/os/bsd/dtrace/hs_private.d +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2005, 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. - * - * 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. - * - */ - -provider hs_private { - probe hashtable__new_entry(void*, uint32_t, uintptr_t, void*); - probe safepoint__begin(); - probe safepoint__end(); - probe cms__initmark__begin(); - probe cms__initmark__end(); - probe cms__remark__begin(); - probe cms__remark__end(); -}; - -#pragma D attributes Private/Private/Common provider hs_private provider -#pragma D attributes Private/Private/Unknown provider hs_private module -#pragma D attributes Private/Private/Unknown provider hs_private function -#pragma D attributes Private/Private/Common provider hs_private name -#pragma D attributes Private/Private/Common provider hs_private args - diff --git a/hotspot/src/os/bsd/dtrace/hotspot.d b/hotspot/src/os/posix/dtrace/hotspot.d similarity index 100% rename from hotspot/src/os/bsd/dtrace/hotspot.d rename to hotspot/src/os/posix/dtrace/hotspot.d diff --git a/hotspot/src/os/bsd/dtrace/hotspot_jni.d b/hotspot/src/os/posix/dtrace/hotspot_jni.d similarity index 100% rename from hotspot/src/os/bsd/dtrace/hotspot_jni.d rename to hotspot/src/os/posix/dtrace/hotspot_jni.d diff --git a/hotspot/src/os/solaris/dtrace/hs_private.d b/hotspot/src/os/posix/dtrace/hs_private.d similarity index 100% rename from hotspot/src/os/solaris/dtrace/hs_private.d rename to hotspot/src/os/posix/dtrace/hs_private.d diff --git a/hotspot/src/os/solaris/dtrace/hotspot.d b/hotspot/src/os/solaris/dtrace/hotspot.d deleted file mode 100644 index b3679eaba62..00000000000 --- a/hotspot/src/os/solaris/dtrace/hotspot.d +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2005, 2010, 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. - * - * 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. - * - */ - -provider hotspot { - probe class__loaded(char*, uintptr_t, void*, uintptr_t); - probe class__unloaded(char*, uintptr_t, void*, uintptr_t); - probe class__initialization__required(char*, uintptr_t, void*, intptr_t); - probe class__initialization__recursive(char*, uintptr_t, void*, intptr_t,int); - probe class__initialization__concurrent(char*, uintptr_t, void*, intptr_t,int); - probe class__initialization__erroneous(char*, uintptr_t, void*, intptr_t, int); - probe class__initialization__super__failed(char*, uintptr_t, void*, intptr_t,int); - probe class__initialization__clinit(char*, uintptr_t, void*, intptr_t,int); - probe class__initialization__error(char*, uintptr_t, void*, intptr_t,int); - probe class__initialization__end(char*, uintptr_t, void*, intptr_t,int); - probe vm__init__begin(); - probe vm__init__end(); - probe vm__shutdown(); - probe vmops__request(char*, uintptr_t, int); - probe vmops__begin(char*, uintptr_t, int); - probe vmops__end(char*, uintptr_t, int); - probe gc__begin(uintptr_t); - probe gc__end(); - probe mem__pool__gc__begin( - char*, uintptr_t, char*, uintptr_t, - uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe mem__pool__gc__end( - char*, uintptr_t, char*, uintptr_t, - uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__start(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__stop(char*, uintptr_t, uintptr_t, uintptr_t, uintptr_t); - probe thread__sleep__begin(long long); - probe thread__sleep__end(int); - probe thread__yield(); - probe thread__park__begin(uintptr_t, int, long long); - probe thread__park__end(uintptr_t); - probe thread__unpark(uintptr_t); - probe method__compile__begin( - char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, char*, uintptr_t); - probe method__compile__end( - char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, - char*, uintptr_t, uintptr_t); - probe compiled__method__load( - char*, uintptr_t, char*, uintptr_t, char*, uintptr_t, void*, uintptr_t); - probe compiled__method__unload( - char*, uintptr_t, char*, uintptr_t, char*, uintptr_t); - probe monitor__contended__enter(uintptr_t, uintptr_t, char*, uintptr_t); - probe monitor__contended__entered(uintptr_t, uintptr_t, char*, uintptr_t); - probe monitor__contended__exit(uintptr_t, uintptr_t, char*, uintptr_t); - probe monitor__wait(uintptr_t, uintptr_t, char*, uintptr_t, uintptr_t); - probe monitor__waited(uintptr_t, uintptr_t, char*, uintptr_t); - probe monitor__notify(uintptr_t, uintptr_t, char*, uintptr_t); - probe monitor__notifyAll(uintptr_t, uintptr_t, char*, uintptr_t); - - probe object__alloc(int, char*, uintptr_t, uintptr_t); - probe method__entry( - int, char*, int, char*, int, char*, int); - probe method__return( - int, char*, int, char*, int, char*, int); -}; - -#pragma D attributes Evolving/Evolving/Common provider hotspot provider -#pragma D attributes Private/Private/Unknown provider hotspot module -#pragma D attributes Private/Private/Unknown provider hotspot function -#pragma D attributes Evolving/Evolving/Common provider hotspot name -#pragma D attributes Evolving/Evolving/Common provider hotspot args diff --git a/hotspot/src/os/solaris/dtrace/hotspot_jni.d b/hotspot/src/os/solaris/dtrace/hotspot_jni.d deleted file mode 100644 index cca1c517650..00000000000 --- a/hotspot/src/os/solaris/dtrace/hotspot_jni.d +++ /dev/null @@ -1,506 +0,0 @@ -/* - * Copyright (c) 2005, 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. - * - * 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. - * - */ - -provider hotspot_jni { - probe AllocObject__entry(void*, void*); - probe AllocObject__return(void*); - probe AttachCurrentThreadAsDaemon__entry(void*, void**, void*); - probe AttachCurrentThreadAsDaemon__return(uint32_t); - probe AttachCurrentThread__entry(void*, void**, void*); - probe AttachCurrentThread__return(uint32_t); - probe CallBooleanMethodA__entry(void*, void*, uintptr_t); - probe CallBooleanMethodA__return(uintptr_t); - probe CallBooleanMethod__entry(void*, void*, uintptr_t); - probe CallBooleanMethod__return(uintptr_t); - probe CallBooleanMethodV__entry(void*, void*, uintptr_t); - probe CallBooleanMethodV__return(uintptr_t); - probe CallByteMethodA__entry(void*, void*, uintptr_t); - probe CallByteMethodA__return(char); - probe CallByteMethod__entry(void*, void*, uintptr_t); - probe CallByteMethod__return(char); - probe CallByteMethodV__entry(void*, void*, uintptr_t); - probe CallByteMethodV__return(char); - probe CallCharMethodA__entry(void*, void*, uintptr_t); - probe CallCharMethodA__return(uint16_t); - probe CallCharMethod__entry(void*, void*, uintptr_t); - probe CallCharMethod__return(uint16_t); - probe CallCharMethodV__entry(void*, void*, uintptr_t); - probe CallCharMethodV__return(uint16_t); - probe CallDoubleMethodA__entry(void*, void*, uintptr_t); - probe CallDoubleMethodA__return(); - probe CallDoubleMethod__entry(void*, void*, uintptr_t); - probe CallDoubleMethod__return(); - probe CallDoubleMethodV__entry(void*, void*, uintptr_t); - probe CallDoubleMethodV__return(); - probe CallFloatMethodA__entry(void*, void*, uintptr_t); - probe CallFloatMethodA__return(); - probe CallFloatMethod__entry(void*, void*, uintptr_t); - probe CallFloatMethod__return(); - probe CallFloatMethodV__entry(void*, void*, uintptr_t); - probe CallFloatMethodV__return(); - probe CallIntMethodA__entry(void*, void*, uintptr_t); - probe CallIntMethodA__return(uint32_t); - probe CallIntMethod__entry(void*, void*, uintptr_t); - probe CallIntMethod__return(uint32_t); - probe CallIntMethodV__entry(void*, void*, uintptr_t); - probe CallIntMethodV__return(uint32_t); - probe CallLongMethodA__entry(void*, void*, uintptr_t); - probe CallLongMethodA__return(uintptr_t); - probe CallLongMethod__entry(void*, void*, uintptr_t); - probe CallLongMethod__return(uintptr_t); - probe CallLongMethodV__entry(void*, void*, uintptr_t); - probe CallLongMethodV__return(uintptr_t); - probe CallNonvirtualBooleanMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualBooleanMethodA__return(uintptr_t); - probe CallNonvirtualBooleanMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualBooleanMethod__return(uintptr_t); - probe CallNonvirtualBooleanMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualBooleanMethodV__return(uintptr_t); - probe CallNonvirtualByteMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualByteMethodA__return(char); - probe CallNonvirtualByteMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualByteMethod__return(char); - probe CallNonvirtualByteMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualByteMethodV__return(char); - probe CallNonvirtualCharMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualCharMethodA__return(uint16_t); - probe CallNonvirtualCharMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualCharMethod__return(uint16_t); - probe CallNonvirtualCharMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualCharMethodV__return(uint16_t); - probe CallNonvirtualDoubleMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualDoubleMethodA__return(); - probe CallNonvirtualDoubleMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualDoubleMethod__return(); - probe CallNonvirtualDoubleMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualDoubleMethodV__return(); - probe CallNonvirtualFloatMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualFloatMethodA__return(); - probe CallNonvirtualFloatMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualFloatMethod__return(); - probe CallNonvirtualFloatMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualFloatMethodV__return(); - probe CallNonvirtualIntMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualIntMethodA__return(uint32_t); - probe CallNonvirtualIntMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualIntMethod__return(uint32_t); - probe CallNonvirtualIntMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualIntMethodV__return(uint32_t); - probe CallNonvirtualLongMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualLongMethodA__return(uintptr_t); - probe CallNonvirtualLongMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualLongMethod__return(uintptr_t); - probe CallNonvirtualLongMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualLongMethodV__return(uintptr_t); - probe CallNonvirtualObjectMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualObjectMethodA__return(void*); - probe CallNonvirtualObjectMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualObjectMethod__return(void*); - probe CallNonvirtualObjectMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualObjectMethodV__return(void*); - probe CallNonvirtualShortMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualShortMethodA__return(uint16_t); - probe CallNonvirtualShortMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualShortMethod__return(uint16_t); - probe CallNonvirtualShortMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualShortMethodV__return(uint16_t); - probe CallNonvirtualVoidMethodA__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualVoidMethodA__return(); - probe CallNonvirtualVoidMethod__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualVoidMethod__return(); - probe CallNonvirtualVoidMethodV__entry(void*, void*, void*, uintptr_t); - probe CallNonvirtualVoidMethodV__return(); - probe CallObjectMethodA__entry(void*, void*, uintptr_t); - probe CallObjectMethodA__return(void*); - probe CallObjectMethod__entry(void*, void*, uintptr_t); - probe CallObjectMethod__return(void*); - probe CallObjectMethodV__entry(void*, void*, uintptr_t); - probe CallObjectMethodV__return(void*); - probe CallShortMethodA__entry(void*, void*, uintptr_t); - probe CallShortMethodA__return(uint16_t); - probe CallShortMethod__entry(void*, void*, uintptr_t); - probe CallShortMethod__return(uint16_t); - probe CallShortMethodV__entry(void*, void*, uintptr_t); - probe CallShortMethodV__return(uint16_t); - probe CallStaticBooleanMethodA__entry(void*, void*, uintptr_t); - probe CallStaticBooleanMethodA__return(uintptr_t); - probe CallStaticBooleanMethod__entry(void*, void*, uintptr_t); - probe CallStaticBooleanMethod__return(uintptr_t); - probe CallStaticBooleanMethodV__entry(void*, void*, uintptr_t); - probe CallStaticBooleanMethodV__return(uintptr_t); - probe CallStaticByteMethodA__entry(void*, void*, uintptr_t); - probe CallStaticByteMethodA__return(char); - probe CallStaticByteMethod__entry(void*, void*, uintptr_t); - probe CallStaticByteMethod__return(char); - probe CallStaticByteMethodV__entry(void*, void*, uintptr_t); - probe CallStaticByteMethodV__return(char); - probe CallStaticCharMethodA__entry(void*, void*, uintptr_t); - probe CallStaticCharMethodA__return(uint16_t); - probe CallStaticCharMethod__entry(void*, void*, uintptr_t); - probe CallStaticCharMethod__return(uint16_t); - probe CallStaticCharMethodV__entry(void*, void*, uintptr_t); - probe CallStaticCharMethodV__return(uint16_t); - probe CallStaticDoubleMethodA__entry(void*, void*, uintptr_t); - probe CallStaticDoubleMethodA__return(); - probe CallStaticDoubleMethod__entry(void*, void*, uintptr_t); - probe CallStaticDoubleMethod__return(); - probe CallStaticDoubleMethodV__entry(void*, void*, uintptr_t); - probe CallStaticDoubleMethodV__return(); - probe CallStaticFloatMethodA__entry(void*, void*, uintptr_t); - probe CallStaticFloatMethodA__return(); - probe CallStaticFloatMethod__entry(void*, void*, uintptr_t); - probe CallStaticFloatMethod__return(); - probe CallStaticFloatMethodV__entry(void*, void*, uintptr_t); - probe CallStaticFloatMethodV__return(); - probe CallStaticIntMethodA__entry(void*, void*, uintptr_t); - probe CallStaticIntMethodA__return(uint32_t); - probe CallStaticIntMethod__entry(void*, void*, uintptr_t); - probe CallStaticIntMethod__return(uint32_t); - probe CallStaticIntMethodV__entry(void*, void*, uintptr_t); - probe CallStaticIntMethodV__return(uint32_t); - probe CallStaticLongMethodA__entry(void*, void*, uintptr_t); - probe CallStaticLongMethodA__return(uintptr_t); - probe CallStaticLongMethod__entry(void*, void*, uintptr_t); - probe CallStaticLongMethod__return(uintptr_t); - probe CallStaticLongMethodV__entry(void*, void*, uintptr_t); - probe CallStaticLongMethodV__return(uintptr_t); - probe CallStaticObjectMethodA__entry(void*, void*, uintptr_t); - probe CallStaticObjectMethodA__return(void*); - probe CallStaticObjectMethod__entry(void*, void*, uintptr_t); - probe CallStaticObjectMethod__return(void*); - probe CallStaticObjectMethodV__entry(void*, void*, uintptr_t); - probe CallStaticObjectMethodV__return(void*); - probe CallStaticShortMethodA__entry(void*, void*, uintptr_t); - probe CallStaticShortMethodA__return(uint16_t); - probe CallStaticShortMethod__entry(void*, void*, uintptr_t); - probe CallStaticShortMethod__return(uint16_t); - probe CallStaticShortMethodV__entry(void*, void*, uintptr_t); - probe CallStaticShortMethodV__return(uint16_t); - probe CallStaticVoidMethodA__entry(void*, void*, uintptr_t); - probe CallStaticVoidMethodA__return(); - probe CallStaticVoidMethod__entry(void*, void*, uintptr_t); - probe CallStaticVoidMethod__return(); - probe CallStaticVoidMethodV__entry(void*, void*, uintptr_t); - probe CallStaticVoidMethodV__return(); - probe CallVoidMethodA__entry(void*, void*, uintptr_t); - probe CallVoidMethodA__return(); - probe CallVoidMethod__entry(void*, void*, uintptr_t); - probe CallVoidMethod__return(); - probe CallVoidMethodV__entry(void*, void*, uintptr_t); - probe CallVoidMethodV__return(); - probe CreateJavaVM__entry(void**, void**, void*); - probe CreateJavaVM__return(uint32_t); - probe DefineClass__entry(void*, const char*, void*, char*, uintptr_t); - probe DefineClass__return(void*); - probe DeleteGlobalRef__entry(void*, void*); - probe DeleteGlobalRef__return(); - probe DeleteLocalRef__entry(void*, void*); - probe DeleteLocalRef__return(); - probe DeleteWeakGlobalRef__entry(void*, void*); - probe DeleteWeakGlobalRef__return(); - probe DestroyJavaVM__entry(void*); - probe DestroyJavaVM__return(uint32_t); - probe DetachCurrentThread__entry(void*); - probe DetachCurrentThread__return(uint32_t); - probe EnsureLocalCapacity__entry(void*, uint32_t); - probe EnsureLocalCapacity__return(uint32_t); - probe ExceptionCheck__entry(void*); - probe ExceptionCheck__return(uintptr_t); - probe ExceptionClear__entry(void*); - probe ExceptionClear__return(); - probe ExceptionDescribe__entry(void*); - probe ExceptionDescribe__return(); - probe ExceptionOccurred__entry(void*); - probe ExceptionOccurred__return(void*); - probe FatalError__entry(void* env, const char*); - probe FindClass__entry(void*, const char*); - probe FindClass__return(void*); - probe FromReflectedField__entry(void*, void*); - probe FromReflectedField__return(uintptr_t); - probe FromReflectedMethod__entry(void*, void*); - probe FromReflectedMethod__return(uintptr_t); - probe GetArrayLength__entry(void*, void*); - probe GetArrayLength__return(uintptr_t); - probe GetBooleanArrayElements__entry(void*, void*, uintptr_t*); - probe GetBooleanArrayElements__return(uintptr_t*); - probe GetBooleanArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uintptr_t*); - probe GetBooleanArrayRegion__return(); - probe GetBooleanField__entry(void*, void*, uintptr_t); - probe GetBooleanField__return(uintptr_t); - probe GetByteArrayElements__entry(void*, void*, uintptr_t*); - probe GetByteArrayElements__return(char*); - probe GetByteArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, char*); - probe GetByteArrayRegion__return(); - probe GetByteField__entry(void*, void*, uintptr_t); - probe GetByteField__return(char); - probe GetCharArrayElements__entry(void*, void*, uintptr_t*); - probe GetCharArrayElements__return(uint16_t*); - probe GetCharArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uint16_t*); - probe GetCharArrayRegion__return(); - probe GetCharField__entry(void*, void*, uintptr_t); - probe GetCharField__return(uint16_t); - probe GetCreatedJavaVMs__entry(void**, uintptr_t, uintptr_t*); - probe GetCreatedJavaVMs__return(uintptr_t); - probe GetDefaultJavaVMInitArgs__entry(void*); - probe GetDefaultJavaVMInitArgs__return(uint32_t); - probe GetDirectBufferAddress__entry(void*, void*); - probe GetDirectBufferAddress__return(void*); - probe GetDirectBufferCapacity__entry(void*, void*); - probe GetDirectBufferCapacity__return(uintptr_t); - probe GetDoubleArrayElements__entry(void*, void*, uintptr_t*); - probe GetDoubleArrayElements__return(double*); - probe GetDoubleArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, double*); - probe GetDoubleArrayRegion__return(); - probe GetDoubleField__entry(void*, void*, uintptr_t); - probe GetDoubleField__return(); - probe GetEnv__entry(void*, void*, uint32_t); - probe GetEnv__return(uint32_t); - probe GetFieldID__entry(void*, void*, const char*, const char*); - probe GetFieldID__return(uintptr_t); - probe GetFloatArrayElements__entry(void*, void*, uintptr_t*); - probe GetFloatArrayElements__return(float*); - probe GetFloatArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, float*); - probe GetFloatArrayRegion__return(); - probe GetFloatField__entry(void*, void*, uintptr_t); - probe GetFloatField__return(); - probe GetIntArrayElements__entry(void*, void*, uintptr_t*); - probe GetIntArrayElements__return(uint32_t*); - probe GetIntArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uint32_t*); - probe GetIntArrayRegion__return(); - probe GetIntField__entry(void*, void*, uintptr_t); - probe GetIntField__return(uint32_t); - probe GetJavaVM__entry(void*, void**); - probe GetJavaVM__return(uint32_t); - probe GetLongArrayElements__entry(void*, void*, uintptr_t*); - probe GetLongArrayElements__return(uintptr_t*); - probe GetLongArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uintptr_t*); - probe GetLongArrayRegion__return(); - probe GetLongField__entry(void*, void*, uintptr_t); - probe GetLongField__return(uintptr_t); - probe GetMethodID__entry(void*, void*, const char*, const char*); - probe GetMethodID__return(uintptr_t); - probe GetObjectArrayElement__entry(void*, void*, uintptr_t); - probe GetObjectArrayElement__return(void*); - probe GetObjectClass__entry(void*, void*); - probe GetObjectClass__return(void*); - probe GetObjectField__entry(void*, void*, uintptr_t); - probe GetObjectField__return(void*); - probe GetObjectRefType__entry(void*, void*); - probe GetObjectRefType__return(void*); - probe GetPrimitiveArrayCritical__entry(void*, void*, uintptr_t*); - probe GetPrimitiveArrayCritical__return(void*); - probe GetShortArrayElements__entry(void*, void*, uintptr_t*); - probe GetShortArrayElements__return(uint16_t*); - probe GetShortArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, uint16_t*); - probe GetShortArrayRegion__return(); - probe GetShortField__entry(void*, void*, uintptr_t); - probe GetShortField__return(uint16_t); - probe GetStaticBooleanField__entry(void*, void*, uintptr_t); - probe GetStaticBooleanField__return(uintptr_t); - probe GetStaticByteField__entry(void*, void*, uintptr_t); - probe GetStaticByteField__return(char); - probe GetStaticCharField__entry(void*, void*, uintptr_t); - probe GetStaticCharField__return(uint16_t); - probe GetStaticDoubleField__entry(void*, void*, uintptr_t); - probe GetStaticDoubleField__return(); - probe GetStaticFieldID__entry(void*, void*, const char*, const char*); - probe GetStaticFieldID__return(uintptr_t); - probe GetStaticFloatField__entry(void*, void*, uintptr_t); - probe GetStaticFloatField__return(); - probe GetStaticIntField__entry(void*, void*, uintptr_t); - probe GetStaticIntField__return(uint32_t); - probe GetStaticLongField__entry(void*, void*, uintptr_t); - probe GetStaticLongField__return(uintptr_t); - probe GetStaticMethodID__entry(void*, void*, const char*, const char*); - probe GetStaticMethodID__return(uintptr_t); - probe GetStaticObjectField__entry(void*, void*, uintptr_t); - probe GetStaticObjectField__return(void*); - probe GetStaticShortField__entry(void*, void*, uintptr_t); - probe GetStaticShortField__return(uint16_t); - probe GetStringChars__entry(void*, void*, uintptr_t*); - probe GetStringChars__return(const uint16_t*); - probe GetStringCritical__entry(void*, void*, uintptr_t*); - probe GetStringCritical__return(const uint16_t*); - probe GetStringLength__entry(void*, void*); - probe GetStringLength__return(uintptr_t); - probe GetStringRegion__entry(void*, void*, uintptr_t, uintptr_t, uint16_t*); - probe GetStringRegion__return(); - probe GetStringUTFChars__entry(void*, void*, uintptr_t*); - probe GetStringUTFChars__return(const char*); - probe GetStringUTFLength__entry(void*, void*); - probe GetStringUTFLength__return(uintptr_t); - probe GetStringUTFRegion__entry(void*, void*, uintptr_t, uintptr_t, char*); - probe GetStringUTFRegion__return(); - probe GetSuperclass__entry(void*, void*); - probe GetSuperclass__return(void*); - probe GetVersion__entry(void*); - probe GetVersion__return(uint32_t); - probe IsAssignableFrom__entry(void*, void*, void*); - probe IsAssignableFrom__return(uintptr_t); - probe IsInstanceOf__entry(void*, void*, void*); - probe IsInstanceOf__return(uintptr_t); - probe IsSameObject__entry(void*, void*, void*); - probe IsSameObject__return(uintptr_t); - probe MonitorEnter__entry(void*, void*); - probe MonitorEnter__return(uint32_t); - probe MonitorExit__entry(void*, void*); - probe MonitorExit__return(uint32_t); - probe NewBooleanArray__entry(void*, uintptr_t); - probe NewBooleanArray__return(void*); - probe NewByteArray__entry(void*, uintptr_t); - probe NewByteArray__return(void*); - probe NewCharArray__entry(void*, uintptr_t); - probe NewCharArray__return(void*); - probe NewDirectByteBuffer__entry(void*, void*, uintptr_t); - probe NewDirectByteBuffer__return(void*); - probe NewDoubleArray__entry(void*, uintptr_t); - probe NewDoubleArray__return(void*); - probe NewFloatArray__entry(void*, uintptr_t); - probe NewFloatArray__return(void*); - probe NewGlobalRef__entry(void*, void*); - probe NewGlobalRef__return(void*); - probe NewIntArray__entry(void*, uintptr_t); - probe NewIntArray__return(void*); - probe NewLocalRef__entry(void*, void*); - probe NewLocalRef__return(void*); - probe NewLongArray__entry(void*, uintptr_t); - probe NewLongArray__return(void*); - probe NewObjectA__entry(void*, void*, uintptr_t); - probe NewObjectA__return(void*); - probe NewObjectArray__entry(void*, uintptr_t, void*, void*); - probe NewObjectArray__return(void*); - probe NewObject__entry(void*, void*, uintptr_t); - probe NewObject__return(void*); - probe NewObjectV__entry(void*, void*, uintptr_t); - probe NewObjectV__return(void*); - probe NewShortArray__entry(void*, uintptr_t); - probe NewShortArray__return(void*); - probe NewString__entry(void*, const uint16_t*, uintptr_t); - probe NewString__return(void*); - probe NewStringUTF__entry(void*, const char*); - probe NewStringUTF__return(void*); - probe NewWeakGlobalRef__entry(void*, void*); - probe NewWeakGlobalRef__return(void*); - probe PopLocalFrame__entry(void*, void*); - probe PopLocalFrame__return(void*); - probe PushLocalFrame__entry(void*, uint32_t); - probe PushLocalFrame__return(uint32_t); - probe RegisterNatives__entry(void*, void*, const void*, uint32_t); - probe RegisterNatives__return(uint32_t); - probe ReleaseBooleanArrayElements__entry(void*, void*, uintptr_t*, uint32_t); - probe ReleaseBooleanArrayElements__return(); - probe ReleaseByteArrayElements__entry(void*, void*, char*, uint32_t); - probe ReleaseByteArrayElements__return(); - probe ReleaseCharArrayElements__entry(void*, void*, uint16_t*, uint32_t); - probe ReleaseCharArrayElements__return(); - probe ReleaseDoubleArrayElements__entry(void*, void*, double*, uint32_t); - probe ReleaseDoubleArrayElements__return(); - probe ReleaseFloatArrayElements__entry(void*, void*, float*, uint32_t); - probe ReleaseFloatArrayElements__return(); - probe ReleaseIntArrayElements__entry(void*, void*, uint32_t*, uint32_t); - probe ReleaseIntArrayElements__return(); - probe ReleaseLongArrayElements__entry(void*, void*, uintptr_t*, uint32_t); - probe ReleaseLongArrayElements__return(); - probe ReleasePrimitiveArrayCritical__entry(void*, void*, void*, uint32_t); - probe ReleasePrimitiveArrayCritical__return(); - probe ReleaseShortArrayElements__entry(void*, void*, uint16_t*, uint32_t); - probe ReleaseShortArrayElements__return(); - probe ReleaseStringChars__entry(void*, void*, const uint16_t*); - probe ReleaseStringChars__return(); - probe ReleaseStringCritical__entry(void*, void*, const uint16_t*); - probe ReleaseStringCritical__return(); - probe ReleaseStringUTFChars__entry(void*, void*, const char*); - probe ReleaseStringUTFChars__return(); - probe SetBooleanArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uintptr_t*); - probe SetBooleanArrayRegion__return(); - probe SetBooleanField__entry(void*, void*, uintptr_t, uintptr_t); - probe SetBooleanField__return(); - probe SetByteArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const char*); - probe SetByteArrayRegion__return(); - probe SetByteField__entry(void*, void*, uintptr_t, char); - probe SetByteField__return(); - probe SetCharArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uint16_t*); - probe SetCharArrayRegion__return(); - probe SetCharField__entry(void*, void*, uintptr_t, uint16_t); - probe SetCharField__return(); - probe SetDoubleArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const double*); - probe SetDoubleArrayRegion__return(); - probe SetDoubleField__entry(void*, void*, uintptr_t); - probe SetDoubleField__return(); - probe SetFloatArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const float*); - probe SetFloatArrayRegion__return(); - probe SetFloatField__entry(void*, void*, uintptr_t); - probe SetFloatField__return(); - probe SetIntArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uint32_t*); - probe SetIntArrayRegion__return(); - probe SetIntField__entry(void*, void*, uintptr_t, uint32_t); - probe SetIntField__return(); - probe SetLongArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uintptr_t*); - probe SetLongArrayRegion__return(); - probe SetLongField__entry(void*, void*, uintptr_t, uintptr_t); - probe SetLongField__return(); - probe SetObjectArrayElement__entry(void*, void*, uintptr_t, void*); - probe SetObjectArrayElement__return(); - probe SetObjectField__entry(void*, void*, uintptr_t, void*); - probe SetObjectField__return(); - probe SetShortArrayRegion__entry(void*, void*, uintptr_t, uintptr_t, const uint16_t*); - probe SetShortArrayRegion__return(); - probe SetShortField__entry(void*, void*, uintptr_t, uint16_t); - probe SetShortField__return(); - probe SetStaticBooleanField__entry(void*, void*, uintptr_t, uintptr_t); - probe SetStaticBooleanField__return(); - probe SetStaticByteField__entry(void*, void*, uintptr_t, char); - probe SetStaticByteField__return(); - probe SetStaticCharField__entry(void*, void*, uintptr_t, uint16_t); - probe SetStaticCharField__return(); - probe SetStaticDoubleField__entry(void*, void*, uintptr_t); - probe SetStaticDoubleField__return(); - probe SetStaticFloatField__entry(void*, void*, uintptr_t); - probe SetStaticFloatField__return(); - probe SetStaticIntField__entry(void*, void*, uintptr_t, uint32_t); - probe SetStaticIntField__return(); - probe SetStaticLongField__entry(void*, void*, uintptr_t, uintptr_t); - probe SetStaticLongField__return(); - probe SetStaticObjectField__entry(void*, void*, uintptr_t, void*); - probe SetStaticObjectField__return(); - probe SetStaticShortField__entry(void*, void*, uintptr_t, uint16_t); - probe SetStaticShortField__return(); - probe Throw__entry(void*, void*); - probe Throw__return(intptr_t); - probe ThrowNew__entry(void*, void*, const char*); - probe ThrowNew__return(intptr_t); - probe ToReflectedField__entry(void*, void*, uintptr_t, uintptr_t); - probe ToReflectedField__return(void*); - probe ToReflectedMethod__entry(void*, void*, uintptr_t, uintptr_t); - probe ToReflectedMethod__return(void*); - probe UnregisterNatives__entry(void*, void*); - probe UnregisterNatives__return(uint32_t); -}; - -#pragma D attributes Standard/Standard/Common provider hotspot_jni provider -#pragma D attributes Private/Private/Unknown provider hotspot_jni module -#pragma D attributes Private/Private/Unknown provider hotspot_jni function -#pragma D attributes Standard/Standard/Common provider hotspot_jni name -#pragma D attributes Evolving/Evolving/Common provider hotspot_jni args - diff --git a/hotspot/src/share/vm/utilities/dtrace.hpp b/hotspot/src/share/vm/utilities/dtrace.hpp index 73f5f7c3fba..92d99de204a 100644 --- a/hotspot/src/share/vm/utilities/dtrace.hpp +++ b/hotspot/src/share/vm/utilities/dtrace.hpp @@ -38,24 +38,20 @@ #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() \ do { volatile size_t dtrace_workaround_tail_call_bug = 1; } while (0) -#define USDT2 1 -#include "dtracefiles/hotspot.h" -#include "dtracefiles/hotspot_jni.h" -#include "dtracefiles/hs_private.h" #elif defined(LINUX) #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() -#define USDT1 1 #elif defined(__APPLE__) #define HS_DTRACE_WORKAROUND_TAIL_CALL_BUG() -#define USDT2 1 #include -#include "dtracefiles/hotspot.h" -#include "dtracefiles/hotspot_jni.h" -#include "dtracefiles/hs_private.h" #else #error "dtrace enabled for unknown os" #endif /* defined(SOLARIS) */ +#define USDT2 1 +#include "dtracefiles/hotspot.h" +#include "dtracefiles/hotspot_jni.h" +#include "dtracefiles/hs_private.h" + #else /* defined(DTRACE_ENABLED) */ #define DTRACE_ONLY(x) From 731320a7fdb7669e6a7be7aa2e0686fdf044d668 Mon Sep 17 00:00:00 2001 From: Staffan Larsen Date: Mon, 3 Feb 2014 15:24:20 +0100 Subject: [PATCH 17/35] 8033126: Can't call default methods from JNI Reviewed-by: dholmes, acorn, kamg --- hotspot/src/share/vm/prims/jni.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index a4201f1e84b..5d3327d1c23 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -1320,9 +1320,13 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive // interface call KlassHandle h_holder(THREAD, holder); - int itbl_index = m->itable_index(); - Klass* k = h_recv->klass(); - selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK); + if (call_type == JNI_VIRTUAL) { + int itbl_index = m->itable_index(); + Klass* k = h_recv->klass(); + selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK); + } else { + selected_method = m; + } } } From 465cfd7c0164b8dd737295442269476172652c11 Mon Sep 17 00:00:00 2001 From: Serguei Spitsyn Date: Tue, 4 Feb 2014 19:41:46 -0800 Subject: [PATCH 18/35] 8032223: nsk/regression/b4663146 gets assert(SafepointSynchronize::is_at_safepoint() || JvmtiEnv::is_thread_fully_suspended(get_thread(), false, &debug_bits)) It is better to calculate frame count for suspended threads at a safepoint Reviewed-by: twisti, dsamersoff, sla, dholmes, dcubed --- hotspot/src/share/vm/prims/jvmtiEnv.cpp | 11 +++++++---- hotspot/src/share/vm/prims/jvmtiEnvBase.hpp | 14 +++++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/hotspot/src/share/vm/prims/jvmtiEnv.cpp b/hotspot/src/share/vm/prims/jvmtiEnv.cpp index 318fe4e0b7e..6a197a84996 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnv.cpp +++ b/hotspot/src/share/vm/prims/jvmtiEnv.cpp @@ -1360,8 +1360,10 @@ JvmtiEnv::GetFrameCount(JavaThread* java_thread, jint* count_ptr) { if (state == NULL) { return JVMTI_ERROR_THREAD_NOT_ALIVE; } - uint32_t debug_bits = 0; - if (is_thread_fully_suspended(java_thread, true, &debug_bits)) { + + // It is only safe to perform the direct operation on the current + // thread. All other usage needs to use a vm-safepoint-op for safety. + if (java_thread == JavaThread::current()) { err = get_frame_count(state, count_ptr); } else { // get java stack frame count at safepoint. @@ -1476,9 +1478,10 @@ JvmtiEnv::PopFrame(JavaThread* java_thread) { jvmtiError JvmtiEnv::GetFrameLocation(JavaThread* java_thread, jint depth, jmethodID* method_ptr, jlocation* location_ptr) { jvmtiError err = JVMTI_ERROR_NONE; - uint32_t debug_bits = 0; - if (is_thread_fully_suspended(java_thread, true, &debug_bits)) { + // It is only safe to perform the direct operation on the current + // thread. All other usage needs to use a vm-safepoint-op for safety. + if (java_thread == JavaThread::current()) { err = get_frame_location(java_thread, depth, method_ptr, location_ptr); } else { // JVMTI get java stack frame location at safepoint. diff --git a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp index 084e19b45e4..0682118c88a 100644 --- a/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp +++ b/hotspot/src/share/vm/prims/jvmtiEnvBase.hpp @@ -533,7 +533,11 @@ public: VMOp_Type type() const { return VMOp_GetFrameCount; } jvmtiError result() { return _result; } void doit() { - _result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr); + _result = JVMTI_ERROR_THREAD_NOT_ALIVE; + JavaThread* jt = _state->get_thread(); + if (Threads::includes(jt) && !jt->is_exiting() && jt->threadObj() != NULL) { + _result = ((JvmtiEnvBase*)_env)->get_frame_count(_state, _count_ptr); + } } }; @@ -559,8 +563,12 @@ public: VMOp_Type type() const { return VMOp_GetFrameLocation; } jvmtiError result() { return _result; } void doit() { - _result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth, - _method_ptr, _location_ptr); + _result = JVMTI_ERROR_THREAD_NOT_ALIVE; + if (Threads::includes(_java_thread) && !_java_thread->is_exiting() && + _java_thread->threadObj() != NULL) { + _result = ((JvmtiEnvBase*)_env)->get_frame_location(_java_thread, _depth, + _method_ptr, _location_ptr); + } } }; From 05e4dd3c74cbac9e08f242a498562971cdb06919 Mon Sep 17 00:00:00 2001 From: Stefan Johansson Date: Wed, 5 Feb 2014 11:05:13 +0100 Subject: [PATCH 19/35] 8033426: Scale initial NewSize using NewRatio if not set on command line Now using NewRatio to size initial NewSize if not specified on commandline. Reviewed-by: jmasa, jwilhelm --- .../src/share/vm/memory/collectorPolicy.cpp | 127 ++++++++++++++++-- .../src/share/vm/memory/collectorPolicy.hpp | 1 + hotspot/src/share/vm/prims/jni.cpp | 2 + 3 files changed, 121 insertions(+), 9 deletions(-) diff --git a/hotspot/src/share/vm/memory/collectorPolicy.cpp b/hotspot/src/share/vm/memory/collectorPolicy.cpp index 17a88c08a86..a2f7166eda7 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.cpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.cpp @@ -446,18 +446,20 @@ void GenCollectorPolicy::initialize_size_info() { _max_gen0_size = max_new_size; } else { size_t desired_new_size = 0; - if (!FLAG_IS_DEFAULT(NewSize)) { - // If NewSize is set ergonomically (for example by cms), it - // would make sense to use it. If it is used, also use it - // to set the initial size. Although there is no reason - // the minimum size and the initial size have to be the same, - // the current implementation gets into trouble during the calculation - // of the tenured generation sizes if they are different. - // Note that this makes the initial size and the minimum size - // generally small compared to the NewRatio calculation. + if (FLAG_IS_CMDLINE(NewSize)) { + // If NewSize is set on the command line, we must use it as + // the initial size and it also makes sense to use it as the + // lower limit. _min_gen0_size = NewSize; desired_new_size = NewSize; max_new_size = MAX2(max_new_size, NewSize); + } else if (FLAG_IS_ERGO(NewSize)) { + // If NewSize is set ergonomically, we should use it as a lower + // limit, but use NewRatio to calculate the initial size. + _min_gen0_size = NewSize; + desired_new_size = + MAX2(scale_by_NewRatio_aligned(_initial_heap_byte_size), NewSize); + max_new_size = MAX2(max_new_size, NewSize); } else { // For the case where NewSize is the default, use NewRatio // to size the minimum and initial generation sizes. @@ -980,3 +982,110 @@ void MarkSweepPolicy::initialize_gc_policy_counters() { _gc_policy_counters = new GCPolicyCounters("Copy:MSC", 2, 3); } } + +/////////////// Unit tests /////////////// + +#ifndef PRODUCT +// Testing that the NewSize flag is handled correct is hard because it +// depends on so many other configurable variables. This test only tries to +// verify that there are some basic rules for NewSize honored by the policies. +class TestGenCollectorPolicy { +public: + static void test() { + size_t flag_value; + + save_flags(); + + // Set some limits that makes the math simple. + FLAG_SET_ERGO(uintx, MaxHeapSize, 180 * M); + FLAG_SET_ERGO(uintx, InitialHeapSize, 120 * M); + Arguments::set_min_heap_size(40 * M); + + // If NewSize is set on the command line, it should be used + // for both min and initial young size if less than min heap. + flag_value = 20 * M; + FLAG_SET_CMDLINE(uintx, NewSize, flag_value); + verify_min(flag_value); + verify_initial(flag_value); + + // If NewSize is set on command line, but is larger than the min + // heap size, it should only be used for initial young size. + flag_value = 80 * M; + FLAG_SET_CMDLINE(uintx, NewSize, flag_value); + verify_initial(flag_value); + + // If NewSize has been ergonomically set, the collector policy + // should use it for min but calculate the initial young size + // using NewRatio. + flag_value = 20 * M; + FLAG_SET_ERGO(uintx, NewSize, flag_value); + verify_min(flag_value); + verify_scaled_initial(InitialHeapSize); + + restore_flags(); + + } + + static void verify_min(size_t expected) { + MarkSweepPolicy msp; + msp.initialize_all(); + + assert(msp.min_gen0_size() <= expected, err_msg("%zu > %zu", msp.min_gen0_size(), expected)); + } + + static void verify_initial(size_t expected) { + MarkSweepPolicy msp; + msp.initialize_all(); + + assert(msp.initial_gen0_size() == expected, err_msg("%zu != %zu", msp.initial_gen0_size(), expected)); + } + + static void verify_scaled_initial(size_t initial_heap_size) { + MarkSweepPolicy msp; + msp.initialize_all(); + + size_t expected = msp.scale_by_NewRatio_aligned(initial_heap_size); + assert(msp.initial_gen0_size() == expected, err_msg("%zu != %zu", msp.initial_gen0_size(), expected)); + assert(FLAG_IS_ERGO(NewSize) && NewSize == expected, + err_msg("NewSize should have been set ergonomically to %zu, but was %zu", expected, NewSize)); + } + +private: + static size_t original_InitialHeapSize; + static size_t original_MaxHeapSize; + static size_t original_MaxNewSize; + static size_t original_MinHeapDeltaBytes; + static size_t original_NewSize; + static size_t original_OldSize; + + static void save_flags() { + original_InitialHeapSize = InitialHeapSize; + original_MaxHeapSize = MaxHeapSize; + original_MaxNewSize = MaxNewSize; + original_MinHeapDeltaBytes = MinHeapDeltaBytes; + original_NewSize = NewSize; + original_OldSize = OldSize; + } + + static void restore_flags() { + InitialHeapSize = original_InitialHeapSize; + MaxHeapSize = original_MaxHeapSize; + MaxNewSize = original_MaxNewSize; + MinHeapDeltaBytes = original_MinHeapDeltaBytes; + NewSize = original_NewSize; + OldSize = original_OldSize; + } +}; + +size_t TestGenCollectorPolicy::original_InitialHeapSize = 0; +size_t TestGenCollectorPolicy::original_MaxHeapSize = 0; +size_t TestGenCollectorPolicy::original_MaxNewSize = 0; +size_t TestGenCollectorPolicy::original_MinHeapDeltaBytes = 0; +size_t TestGenCollectorPolicy::original_NewSize = 0; +size_t TestGenCollectorPolicy::original_OldSize = 0; + +void TestNewSize_test() { + TestGenCollectorPolicy::test(); +} + +#endif diff --git a/hotspot/src/share/vm/memory/collectorPolicy.hpp b/hotspot/src/share/vm/memory/collectorPolicy.hpp index 815f1555726..57869225d3d 100644 --- a/hotspot/src/share/vm/memory/collectorPolicy.hpp +++ b/hotspot/src/share/vm/memory/collectorPolicy.hpp @@ -220,6 +220,7 @@ class ClearedAllSoftRefs : public StackObj { }; class GenCollectorPolicy : public CollectorPolicy { +friend class TestGenCollectorPolicy; protected: size_t _min_gen0_size; size_t _initial_gen0_size; diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp index 38d62977a34..1164448d3da 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -4954,6 +4954,7 @@ void TestMetaspaceAux_test(); void TestMetachunk_test(); void TestVirtualSpaceNode_test(); void TestOldFreeSpaceCalculation_test(); +void TestNewSize_test(); #if INCLUDE_ALL_GCS void TestG1BiasedArray_test(); void TestBufferingOopClosure_test(); @@ -4976,6 +4977,7 @@ void execute_internal_vm_tests() { run_unit_test(AltHashing::test_alt_hash()); run_unit_test(test_loggc_filename()); run_unit_test(TestOldFreeSpaceCalculation_test()); + run_unit_test(TestNewSize_test()); #if INCLUDE_VM_STRUCTS run_unit_test(VMStructs::test()); #endif From a3c78aac2f93ed928178bfd1711ed02c0179ce09 Mon Sep 17 00:00:00 2001 From: Calvin Cheung Date: Wed, 5 Feb 2014 15:14:47 -0800 Subject: [PATCH 20/35] 8032010: Attempt to resolve abstract method in concrete class fails with AbstractMethodError Removing a check in LinkResolver::resolve_method() to conform with a change in JVMS-8 5.4.3.3. Method Resolution Reviewed-by: coleenp, lfoltan --- .../src/share/vm/interpreter/linkResolver.cpp | 11 +- .../TestConcreteClassWithAbstractMethod.java | 181 ++++++++++++++++++ 2 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java diff --git a/hotspot/src/share/vm/interpreter/linkResolver.cpp b/hotspot/src/share/vm/interpreter/linkResolver.cpp index 52c88bd3a66..aa11784b718 100644 --- a/hotspot/src/share/vm/interpreter/linkResolver.cpp +++ b/hotspot/src/share/vm/interpreter/linkResolver.cpp @@ -564,16 +564,7 @@ void LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle res } } - // 5. check if method is concrete - if (resolved_method->is_abstract() && !resolved_klass->is_abstract()) { - ResourceMark rm(THREAD); - THROW_MSG(vmSymbols::java_lang_AbstractMethodError(), - Method::name_and_sig_as_C_string(resolved_klass(), - method_name, - method_signature)); - } - - // 6. access checks, access checking may be turned off when calling from within the VM. + // 5. access checks, access checking may be turned off when calling from within the VM. if (check_access) { assert(current_klass.not_null() , "current_klass should not be null"); diff --git a/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java b/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java new file mode 100644 index 00000000000..0fd1a426679 --- /dev/null +++ b/hotspot/test/runtime/lambda-features/TestConcreteClassWithAbstractMethod.java @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2014, 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. + * + * 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. + * + */ + +/* + * @test + * @bug 8032010 + * @summary method lookup on an abstract method in a concrete class should be successful + * @run main TestConcreteClassWithAbstractMethod + */ + +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; + +import static jdk.internal.org.objectweb.asm.Opcodes.*; + +/* + * class T1 { public int m() {} } + * class T2 { public abstract int m(); } + * class T3 { public int m() {} } + * + * Call site: T3.test() { invokevirtual T2.m() } + * T3.m() should be invoked + */ +public class TestConcreteClassWithAbstractMethod { + static final String classT1 = "p1.T1"; + static final String classT2 = "p1.T2"; + static final String classT3 = "p1.T3"; + + static final String callerName = classT3; + + public static void main(String[] args) throws Exception { + ClassLoader cl = new ClassLoader() { + public Class loadClass(String name) throws ClassNotFoundException { + if (findLoadedClass(name) != null) { + return findLoadedClass(name); + } + + if (classT1.equals(name)) { + byte[] classFile = dumpT1(); + return defineClass(classT1, classFile, 0, classFile.length); + } + if (classT2.equals(name)) { + byte[] classFile = dumpT2(); + return defineClass(classT2, classFile, 0, classFile.length); + } + if (classT3.equals(name)) { + byte[] classFile = dumpT3(); + return defineClass(classT3, classFile, 0, classFile.length); + } + + return super.loadClass(name); + } + }; + + cl.loadClass(classT1); + cl.loadClass(classT2); + cl.loadClass(classT3); + + //cl.loadClass(callerName).getDeclaredMethod("m"); + cl.loadClass(callerName).newInstance(); + + int result = (Integer)cl.loadClass(callerName).getDeclaredMethod("test").invoke(null); + System.out.println(""+result); + } + + public static byte[] dumpT1() { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(52, ACC_PUBLIC | ACC_SUPER, "p1/T1", null, "java/lang/Object", null); + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null); + mv.visitCode(); + mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); + mv.visitLdcInsn("p1/T1.m()"); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "print", "(Ljava/lang/String;)V", false); + mv.visitIntInsn(BIPUSH, 3); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 1); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + + public static byte[] dumpT2() { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(52, ACC_PUBLIC | ACC_SUPER, "p1/T2", null, "p1/T1", null); + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "p1/T1", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC + ACC_ABSTRACT, "m", "()I", null, null); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } + + public static byte[] dumpT3() { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(52, ACC_PUBLIC + ACC_SUPER, "p1/T3", null, "p1/T2", null); + + { + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "p1/T2", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null); + mv.visitCode(); + mv.visitFieldInsn(GETSTATIC, "java/lang/System", "out", "Ljava/io/PrintStream;"); + mv.visitLdcInsn("p1/T3.m()"); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/io/PrintStream", "print", "(Ljava/lang/String;)V", false); + mv.visitIntInsn(BIPUSH, 2); + mv.visitInsn(IRETURN); + mv.visitMaxs(2, 1); + mv.visitEnd(); + } + { + mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "()I", null, null); + mv.visitCode(); + mv.visitTypeInsn(NEW, "p1/T3"); + mv.visitInsn(DUP); + mv.visitMethodInsn(INVOKESPECIAL, "p1/T3", "", "()V", false); + mv.visitMethodInsn(INVOKEVIRTUAL, "p1/T2", "m", "()I", false); + mv.visitInsn(IRETURN); + mv.visitMaxs(3, 2); + mv.visitEnd(); + } + cw.visitEnd(); + + return cw.toByteArray(); + } +} From aae536aad7c59b421c2a97c2830a23a2acca1b56 Mon Sep 17 00:00:00 2001 From: Henry Jen Date: Wed, 5 Feb 2014 21:24:29 -0800 Subject: [PATCH 21/35] 8033289: clang: clean up unused function warning Reviewed-by: coleenp, dholmes, mgerdin --- hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp | 4 ---- hotspot/src/share/vm/prims/jvmtiTagMap.cpp | 2 ++ hotspot/src/share/vm/runtime/mutex.cpp | 10 ---------- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp index 544019c7179..462c0c58f89 100644 --- a/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp +++ b/hotspot/src/cpu/x86/vm/templateTable_x86_64.cpp @@ -107,10 +107,6 @@ static inline Address at_tos_p2() { return Address(rsp, Interpreter::expr_offset_in_bytes(2)); } -static inline Address at_tos_p3() { - return Address(rsp, Interpreter::expr_offset_in_bytes(3)); -} - // Condition conversion static Assembler::Condition j_not(TemplateTable::Condition cc) { switch (cc) { diff --git a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp index 977614648d3..8f2e1af6e44 100644 --- a/hotspot/src/share/vm/prims/jvmtiTagMap.cpp +++ b/hotspot/src/share/vm/prims/jvmtiTagMap.cpp @@ -2790,6 +2790,7 @@ inline bool VM_HeapWalkOperation::iterate_over_type_array(oop o) { return true; } +#ifdef ASSERT // verify that a static oop field is in range static inline bool verify_static_oop(InstanceKlass* ik, oop mirror, int offset) { @@ -2804,6 +2805,7 @@ static inline bool verify_static_oop(InstanceKlass* ik, return false; } } +#endif // #ifdef ASSERT // a class references its super class, interfaces, class loader, ... // and finally its static fields diff --git a/hotspot/src/share/vm/runtime/mutex.cpp b/hotspot/src/share/vm/runtime/mutex.cpp index 4cd55e7d6f9..41e10bac28a 100644 --- a/hotspot/src/share/vm/runtime/mutex.cpp +++ b/hotspot/src/share/vm/runtime/mutex.cpp @@ -280,16 +280,6 @@ static inline jint MarsagliaXORV (jint x) { return x & 0x7FFFFFFF ; } -static inline jint MarsagliaXOR (jint * const a) { - jint x = *a ; - if (x == 0) x = UNS(a)|1 ; - x ^= x << 6; - x ^= ((unsigned)x) >> 21; - x ^= x << 7 ; - *a = x ; - return x & 0x7FFFFFFF ; -} - static int Stall (int its) { static volatile jint rv = 1 ; volatile int OnFrame = 0 ; From 41edfa7107bf30adbafa1c089822a0763122f7c9 Mon Sep 17 00:00:00 2001 From: Frederic Parain Date: Thu, 6 Feb 2014 17:59:35 +0000 Subject: [PATCH 22/35] 8030808: dtrace/hotspot/Monitors/Monitors001 fails in product builds on solaris-sparc Reviewed-by: sspitsyn, dcubed, kamg, dholmes --- hotspot/src/share/vm/runtime/synchronizer.cpp | 13 +++++++------ hotspot/src/share/vm/runtime/synchronizer.hpp | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hotspot/src/share/vm/runtime/synchronizer.cpp b/hotspot/src/share/vm/runtime/synchronizer.cpp index 75e81704122..39a44775edc 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.cpp +++ b/hotspot/src/share/vm/runtime/synchronizer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -373,23 +373,24 @@ ObjectLocker::~ObjectLocker() { // ----------------------------------------------------------------------------- // Wait/Notify/NotifyAll // NOTE: must use heavy weight monitor to handle wait() -void ObjectSynchronizer::wait(Handle obj, jlong millis, TRAPS) { +int ObjectSynchronizer::wait(Handle obj, jlong millis, TRAPS) { if (UseBiasedLocking) { BiasedLocking::revoke_and_rebias(obj, false, THREAD); assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now"); } if (millis < 0) { TEVENT (wait - throw IAX) ; - THROW_MSG(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); + THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), "timeout value is negative"); } ObjectMonitor* monitor = ObjectSynchronizer::inflate(THREAD, obj()); DTRACE_MONITOR_WAIT_PROBE(monitor, obj(), THREAD, millis); monitor->wait(millis, true, THREAD); - /* This dummy call is in place to get around dtrace bug 6254741. Once - that's fixed we can uncomment the following line and remove the call */ + // This dummy call is in place to get around dtrace bug 6254741. Once + // that's fixed we can uncomment the following line, remove the call + // and change this function back into a "void" func. // DTRACE_MONITOR_PROBE(waited, monitor, obj(), THREAD); - dtrace_waited_probe(monitor, obj, THREAD); + return dtrace_waited_probe(monitor, obj, THREAD); } void ObjectSynchronizer::waitUninterruptibly (Handle obj, jlong millis, TRAPS) { diff --git a/hotspot/src/share/vm/runtime/synchronizer.hpp b/hotspot/src/share/vm/runtime/synchronizer.hpp index 4908c559c78..4f95b31350d 100644 --- a/hotspot/src/share/vm/runtime/synchronizer.hpp +++ b/hotspot/src/share/vm/runtime/synchronizer.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -68,7 +68,7 @@ class ObjectSynchronizer : AllStatic { static void jni_exit (oop obj, Thread* THREAD); // Handle all interpreter, compiler and jni cases - static void wait (Handle obj, jlong millis, TRAPS); + static int wait (Handle obj, jlong millis, TRAPS); static void notify (Handle obj, TRAPS); static void notifyall (Handle obj, TRAPS); From 3eb1ac89c6bf92eb7cfda8746977256318b9b5db Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Thu, 6 Feb 2014 18:57:46 +0000 Subject: [PATCH 23/35] 8028735: runtime/RedefineObject/TestRedefineObject.java interrupted (timed out?) on solaris_sparcv9-fastdebug-c2-runtime and solaris_x64-debugOpen-c2-runtime Change GC loop counter to 100 which is enough to test the original problem but doesn't timeout the test. Reviewed-by: ctornqvi, lfoltan, mseledtsov, sla --- hotspot/test/runtime/RedefineObject/Agent.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hotspot/test/runtime/RedefineObject/Agent.java b/hotspot/test/runtime/RedefineObject/Agent.java index d9c3656d8b2..b1c025da3cf 100644 --- a/hotspot/test/runtime/RedefineObject/Agent.java +++ b/hotspot/test/runtime/RedefineObject/Agent.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2014, 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 @@ -65,8 +65,8 @@ public class Agent implements ClassFileTransformer { public static void main(String[] args) { byte[] ba = new byte[0]; - // If it survives 1000 GC's, it's good. - for (int i = 0; i < 1000 ; i++) { + // If it survives 100 GC's, it's good. + for (int i = 0; i < 100 ; i++) { System.gc(); ba.clone(); } From d3a85e73a73ac2591e593ec2025fc2677efbb710 Mon Sep 17 00:00:00 2001 From: Gerald Thornbrugh Date: Thu, 6 Feb 2014 14:28:35 -0500 Subject: [PATCH 24/35] 8029775: Solaris code cleanup 8033464: Linux code cleanup Cleaned up warnings in solaris and linux specific os code. Reviewed-by: coleenp, fparain, dcubed --- hotspot/src/os/linux/vm/os_linux.cpp | 6 +++-- hotspot/src/os/linux/vm/perfMemory_linux.cpp | 14 ++++++++--- hotspot/src/os/solaris/vm/os_solaris.cpp | 25 +++++++++++++------ .../src/os/solaris/vm/perfMemory_solaris.cpp | 20 +++++++++++---- .../os_cpu/solaris_x86/vm/os_solaris_x86.cpp | 11 +++++--- 5 files changed, 54 insertions(+), 22 deletions(-) diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 1e3fc78b505..bf701718c35 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -3000,7 +3000,9 @@ address get_stack_commited_bottom(address bottom, size_t size) { unsigned char vec[1]; unsigned imin = 1, imax = pages + 1, imid; - int mincore_return_value; + int mincore_return_value = 0; + + assert(imin < imax, "Unexpected page size"); while (imin < imax) { imid = (imax + imin) / 2; diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp index 87fc56b2b58..d95d33107e6 100644 --- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp +++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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 @@ -891,8 +891,16 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor FREE_C_HEAP_ARRAY(char, filename, mtInternal); // open the shared memory file for the give vmid - fd = open_sharedmem_file(rfilename, file_flags, CHECK); - assert(fd != OS_ERR, "unexpected value"); + fd = open_sharedmem_file(rfilename, file_flags, THREAD); + + if (fd == OS_ERR) { + return; + } + + if (HAS_PENDING_EXCEPTION) { + ::close(fd); + return; + } if (*sizep == 0) { size = sharedmem_filesize(fd, CHECK); diff --git a/hotspot/src/os/solaris/vm/os_solaris.cpp b/hotspot/src/os/solaris/vm/os_solaris.cpp index 396e9df542e..19ab10b4444 100644 --- a/hotspot/src/os/solaris/vm/os_solaris.cpp +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -2232,8 +2232,8 @@ static bool check_addr0(outputStream* st) { st->cr(); status = true; } - ::close(fd); } + ::close(fd); } return status; } @@ -2257,13 +2257,18 @@ const char *ill_names[] = { "ILL0", "ILL_ILLOPC", "ILL_ILLOPN", "ILL_ILLADR", "ILL_ILLTRP", "ILL_PRVOPC", "ILL_PRVREG", "ILL_COPROC", "ILL_BADSTK" }; +const size_t ill_names_length = (sizeof(ill_names)/sizeof(char *)); + const char *fpe_names[] = { "FPE0", "FPE_INTDIV", "FPE_INTOVF", "FPE_FLTDIV", "FPE_FLTOVF", "FPE_FLTUND", "FPE_FLTRES", "FPE_FLTINV", "FPE_FLTSUB" }; +const size_t fpe_names_length = (sizeof(fpe_names)/sizeof(char *)); const char *segv_names[] = { "SEGV0", "SEGV_MAPERR", "SEGV_ACCERR" }; +const size_t segv_names_length = (sizeof(segv_names)/sizeof(char *)); const char *bus_names[] = { "BUS0", "BUS_ADRALN", "BUS_ADRERR", "BUS_OBJERR" }; +const size_t bus_names_length = (sizeof(bus_names)/sizeof(char *)); void os::print_siginfo(outputStream* st, void* siginfo) { st->print("siginfo:"); @@ -2282,19 +2287,23 @@ void os::print_siginfo(outputStream* st, void* siginfo) { assert(c > 0, "unexpected si_code"); switch (si->si_signo) { case SIGILL: - st->print(", si_code=%d (%s)", c, c > 8 ? "" : ill_names[c]); + st->print(", si_code=%d (%s)", c, + c >= ill_names_length ? "" : ill_names[c]); st->print(", si_addr=" PTR_FORMAT, si->si_addr); break; case SIGFPE: - st->print(", si_code=%d (%s)", c, c > 9 ? "" : fpe_names[c]); + st->print(", si_code=%d (%s)", c, + c >= fpe_names_length ? "" : fpe_names[c]); st->print(", si_addr=" PTR_FORMAT, si->si_addr); break; case SIGSEGV: - st->print(", si_code=%d (%s)", c, c > 2 ? "" : segv_names[c]); + st->print(", si_code=%d (%s)", c, + c >= segv_names_length ? "" : segv_names[c]); st->print(", si_addr=" PTR_FORMAT, si->si_addr); break; case SIGBUS: - st->print(", si_code=%d (%s)", c, c > 3 ? "" : bus_names[c]); + st->print(", si_code=%d (%s)", c, + c >= bus_names_length ? "" : bus_names[c]); st->print(", si_addr=" PTR_FORMAT, si->si_addr); break; default: @@ -3012,7 +3021,7 @@ bool os::get_page_info(char *start, page_info* info) { char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info* page_found) { const uint_t info_types[] = { MEMINFO_VLGRP, MEMINFO_VPAGESIZE }; const size_t types = sizeof(info_types) / sizeof(info_types[0]); - uint64_t addrs[MAX_MEMINFO_CNT], outdata[types * MAX_MEMINFO_CNT]; + uint64_t addrs[MAX_MEMINFO_CNT], outdata[types * MAX_MEMINFO_CNT + 1]; uint_t validity[MAX_MEMINFO_CNT]; size_t page_size = MAX2((size_t)os::vm_page_size(), page_expected->size); @@ -3051,7 +3060,7 @@ char *os::scan_pages(char *start, char* end, page_info* page_expected, page_info } } - if (i != addrs_count) { + if (i < addrs_count) { if ((validity[i] & 2) != 0) { page_found->lgrp_id = outdata[types * i]; } else { diff --git a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp index e7b31ac6483..1fa30012d6b 100644 --- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp +++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2014, 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 @@ -431,10 +431,12 @@ static char* get_user_name(int vmid, TRAPS) { RESTARTABLE(::read(fd, addr, remaining), result); if (result == OS_ERR) { + ::close(fd); THROW_MSG_0(vmSymbols::java_io_IOException(), "Read error"); + } else { + remaining-=result; + addr+=result; } - remaining-=result; - addr+=result; } ::close(fd); @@ -906,8 +908,16 @@ static void mmap_attach_shared(const char* user, int vmid, PerfMemory::PerfMemor FREE_C_HEAP_ARRAY(char, filename, mtInternal); // open the shared memory file for the give vmid - fd = open_sharedmem_file(rfilename, file_flags, CHECK); - assert(fd != OS_ERR, "unexpected value"); + fd = open_sharedmem_file(rfilename, file_flags, THREAD); + + if (fd == OS_ERR) { + return; + } + + if (HAS_PENDING_EXCEPTION) { + ::close(fd); + return; + } if (*sizep == 0) { size = sharedmem_filesize(fd, CHECK); diff --git a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp index eb8cbe81918..054a8132b3b 100644 --- a/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp +++ b/hotspot/src/os_cpu/solaris_x86/vm/os_solaris_x86.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2014, 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 @@ -475,9 +475,11 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, // here if the underlying file has been truncated. // Do not crash the VM in such a case. CodeBlob* cb = CodeCache::find_blob_unsafe(pc); - nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL; - if (nm != NULL && nm->has_unsafe_access()) { - stub = StubRoutines::handler_for_unsafe_access(); + if (cb != NULL) { + nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL; + if (nm != NULL && nm->has_unsafe_access()) { + stub = StubRoutines::handler_for_unsafe_access(); + } } } else @@ -724,6 +726,7 @@ JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, err.report_and_die(); ShouldNotReachHere(); + return false; } void os::print_context(outputStream *st, void *context) { From 50b13833fa1608e2641102f7950959ed1cb10171 Mon Sep 17 00:00:00 2001 From: Oleg Mazurov Date: Thu, 6 Feb 2014 20:13:38 -0800 Subject: [PATCH 25/35] 8025841: JVMTI: "vtable stub" dynamic code notification is misplaced Generate correct "vtable stub" dynamic code notifications Reviewed-by: sspitsyn, kvn, coleenp --- hotspot/src/share/vm/code/vtableStubs.cpp | 24 ++++++++++++++----- hotspot/src/share/vm/code/vtableStubs.hpp | 1 + .../share/vm/prims/jvmtiCodeBlobEvents.cpp | 17 +++++++++++++ 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/hotspot/src/share/vm/code/vtableStubs.cpp b/hotspot/src/share/vm/code/vtableStubs.cpp index 5af91a3a6ee..b3bfc258f56 100644 --- a/hotspot/src/share/vm/code/vtableStubs.cpp +++ b/hotspot/src/share/vm/code/vtableStubs.cpp @@ -55,6 +55,9 @@ void* VtableStub::operator new(size_t size, int code_size) throw() { const int chunk_factor = 32; if (_chunk == NULL || _chunk + real_size > _chunk_end) { const int bytes = chunk_factor * real_size + pd_code_alignment(); + + // There is a dependency on the name of the blob in src/share/vm/prims/jvmtiCodeBlobEvents.cpp + // If changing the name, update the other file accordingly. BufferBlob* blob = BufferBlob::create("vtable chunks", bytes); if (blob == NULL) { return NULL; @@ -62,12 +65,6 @@ void* VtableStub::operator new(size_t size, int code_size) throw() { _chunk = blob->content_begin(); _chunk_end = _chunk + bytes; Forte::register_stub("vtable stub", _chunk, _chunk_end); - // Notify JVMTI about this stub. The event will be recorded by the enclosing - // JvmtiDynamicCodeEventCollector and posted when this thread has released - // all locks. - if (JvmtiExport::should_post_dynamic_code_generated()) { - JvmtiExport::post_dynamic_code_generated_while_holding_locks("vtable stub", _chunk, _chunk_end); - } align_chunk(); } assert(_chunk + real_size <= _chunk_end, "bad allocation"); @@ -130,6 +127,13 @@ address VtableStubs::find_stub(bool is_vtable_stub, int vtable_index) { is_vtable_stub? "vtbl": "itbl", vtable_index, VtableStub::receiver_location()); Disassembler::decode(s->code_begin(), s->code_end()); } + // Notify JVMTI about this stub. The event will be recorded by the enclosing + // JvmtiDynamicCodeEventCollector and posted when this thread has released + // all locks. + if (JvmtiExport::should_post_dynamic_code_generated()) { + JvmtiExport::post_dynamic_code_generated_while_holding_locks(is_vtable_stub? "vtable stub": "itable stub", + s->code_begin(), s->code_end()); + } } return s->entry_point(); } @@ -195,6 +199,14 @@ void vtableStubs_init() { VtableStubs::initialize(); } +void VtableStubs::vtable_stub_do(void f(VtableStub*)) { + for (int i = 0; i < N; i++) { + for (VtableStub* s = _table[i]; s != NULL; s = s->next()) { + f(s); + } + } +} + //----------------------------------------------------------------------------------------------------- // Non-product code diff --git a/hotspot/src/share/vm/code/vtableStubs.hpp b/hotspot/src/share/vm/code/vtableStubs.hpp index 06f2a67a857..b3d4f2d838e 100644 --- a/hotspot/src/share/vm/code/vtableStubs.hpp +++ b/hotspot/src/share/vm/code/vtableStubs.hpp @@ -131,6 +131,7 @@ class VtableStubs : AllStatic { static VtableStub* stub_containing(address pc); // stub containing pc or NULL static int number_of_vtable_stubs() { return _number_of_vtable_stubs; } static void initialize(); + static void vtable_stub_do(void f(VtableStub*)); // iterates over all vtable stubs }; #endif // SHARE_VM_CODE_VTABLESTUBS_HPP diff --git a/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp b/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp index c46afdc1074..18d8786b81f 100644 --- a/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp +++ b/hotspot/src/share/vm/prims/jvmtiCodeBlobEvents.cpp @@ -26,6 +26,7 @@ #include "code/codeBlob.hpp" #include "code/codeCache.hpp" #include "code/scopeDesc.hpp" +#include "code/vtableStubs.hpp" #include "memory/resourceArea.hpp" #include "oops/oop.inline.hpp" #include "prims/jvmtiCodeBlobEvents.hpp" @@ -63,6 +64,7 @@ class CodeBlobCollector : StackObj { // used during a collection static GrowableArray* _global_code_blobs; static void do_blob(CodeBlob* cb); + static void do_vtable_stub(VtableStub* vs); public: CodeBlobCollector() { _code_blobs = NULL; @@ -119,6 +121,10 @@ void CodeBlobCollector::do_blob(CodeBlob* cb) { if (cb->is_nmethod()) { return; } + // exclude VtableStubs, which are processed separately + if (cb->is_buffer_blob() && strcmp(cb->name(), "vtable chunks") == 0) { + return; + } // check if this starting address has been seen already - the // assumption is that stubs are inserted into the list before the @@ -136,6 +142,13 @@ void CodeBlobCollector::do_blob(CodeBlob* cb) { _global_code_blobs->append(scb); } +// called for each VtableStub in VtableStubs + +void CodeBlobCollector::do_vtable_stub(VtableStub* vs) { + JvmtiCodeBlobDesc* scb = new JvmtiCodeBlobDesc(vs->is_vtable_stub() ? "vtable stub" : "itable stub", + vs->code_begin(), vs->code_end()); + _global_code_blobs->append(scb); +} // collects a list of CodeBlobs in the CodeCache. // @@ -166,6 +179,10 @@ void CodeBlobCollector::collect() { _global_code_blobs->append(new JvmtiCodeBlobDesc(desc->name(), desc->begin(), desc->end())); } + // Vtable stubs are not described with StubCodeDesc, + // process them separately + VtableStubs::vtable_stub_do(do_vtable_stub); + // next iterate over all the non-nmethod code blobs and add them to // the list - as noted above this will filter out duplicates and // enclosing blobs. From 62755b73589336a2ab352b696c5a9cc200409656 Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Fri, 7 Feb 2014 09:03:44 -0800 Subject: [PATCH 26/35] 8033714: hotspot 'install_jvm' bld target broken with ZIP_DEBUGINFO_FILES=0 Fixed faulty logic in makefiles when compressed FDS builds are disabled Reviewed-by: rdurbin, dholmes, never, dnsimon, tbell --- hotspot/make/bsd/makefiles/jsig.make | 8 ++++---- hotspot/make/bsd/makefiles/saproc.make | 8 ++++---- hotspot/make/bsd/makefiles/vm.make | 8 ++++---- hotspot/make/linux/makefiles/jsig.make | 6 +++--- hotspot/make/linux/makefiles/saproc.make | 14 +++++++------- hotspot/make/linux/makefiles/vm.make | 6 +++--- hotspot/make/solaris/makefiles/jsig.make | 6 +++--- hotspot/make/solaris/makefiles/saproc.make | 14 +++++++------- hotspot/make/solaris/makefiles/vm.make | 6 +++--- 9 files changed, 38 insertions(+), 38 deletions(-) diff --git a/hotspot/make/bsd/makefiles/jsig.make b/hotspot/make/bsd/makefiles/jsig.make index b4802fb5069..220a5d091f6 100644 --- a/hotspot/make/bsd/makefiles/jsig.make +++ b/hotspot/make/bsd/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, 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 @@ -91,13 +91,13 @@ endif install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" ifeq ($(OS_VENDOR), Darwin) - $(QUIETLY) test -d $(LIBJSIG_DEBUGINFO) && \ + $(QUIETLY) test ! -d $(LIBJSIG_DEBUGINFO) || \ cp -f -r $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) else - $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBJSIG_DEBUGINFO) || \ cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) endif - $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ + $(QUIETLY) test ! -f $(LIBJSIG_DIZ) || \ cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" diff --git a/hotspot/make/bsd/makefiles/saproc.make b/hotspot/make/bsd/makefiles/saproc.make index 8cb38dbca47..a147325979f 100644 --- a/hotspot/make/bsd/makefiles/saproc.make +++ b/hotspot/make/bsd/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, 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 @@ -153,13 +153,13 @@ endif install_saproc: $(BUILDLIBSAPROC) @echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)" ifeq ($(OS_VENDOR), Darwin) - $(QUIETLY) test -d $(LIBSAPROC_DEBUGINFO) && \ + $(QUIETLY) test ! -d $(LIBSAPROC_DEBUGINFO) || \ cp -f -r $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) else - $(QUIETLY) test -f $(LIBSAPROC_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBSAPROC_DEBUGINFO) || \ cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO) endif - $(QUIETLY) test -f $(LIBSAPROC_DIZ) && \ + $(QUIETLY) test ! -f $(LIBSAPROC_DIZ) || \ cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ) $(QUIETLY) cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done" diff --git a/hotspot/make/bsd/makefiles/vm.make b/hotspot/make/bsd/makefiles/vm.make index 3e8ea764066..3726ab6be77 100644 --- a/hotspot/make/bsd/makefiles/vm.make +++ b/hotspot/make/bsd/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2014, 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 @@ -367,13 +367,13 @@ DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ) install_jvm: $(LIBJVM) @echo "Copying $(LIBJVM) to $(DEST_JVM)" ifeq ($(OS_VENDOR), Darwin) - $(QUIETLY) test -d $(LIBJVM_DEBUGINFO) && \ + $(QUIETLY) test ! -d $(LIBJVM_DEBUGINFO) || \ cp -f -r $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO) else - $(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBJVM_DEBUGINFO) || \ cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO) endif - $(QUIETLY) test -f $(LIBJVM_DIZ) && \ + $(QUIETLY) test ! -f $(LIBJVM_DIZ) || \ cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ) $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done" diff --git a/hotspot/make/linux/makefiles/jsig.make b/hotspot/make/linux/makefiles/jsig.make index 6e13959482a..8295cbbe6ec 100644 --- a/hotspot/make/linux/makefiles/jsig.make +++ b/hotspot/make/linux/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, 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 @@ -74,9 +74,9 @@ endif install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" - $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBJSIG_DEBUGINFO) || \ cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) - $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ + $(QUIETLY) test ! -f $(LIBJSIG_DIZ) || \ cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make index 7e8f7c430f9..c2397491d43 100644 --- a/hotspot/make/linux/makefiles/saproc.make +++ b/hotspot/make/linux/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, 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 @@ -113,13 +113,13 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) endif install_saproc: $(BUILDLIBSAPROC) - $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ - echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ - test -f $(LIBSAPROC_DEBUGINFO) && \ + $(QUIETLY) if [ -e $(LIBSAPROC) ] ; then \ + echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ + test ! -f $(LIBSAPROC_DEBUGINFO) || \ cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \ - test -f $(LIBSAPROC_DIZ) && \ - cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \ - cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ + test ! -f $(LIBSAPROC_DIZ) || \ + cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \ + cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ fi .PHONY: install_saproc diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make index 7df141f8895..442c9afb1bf 100644 --- a/hotspot/make/linux/makefiles/vm.make +++ b/hotspot/make/linux/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2014, 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 @@ -366,9 +366,9 @@ DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ) install_jvm: $(LIBJVM) @echo "Copying $(LIBJVM) to $(DEST_JVM)" - $(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBJVM_DEBUGINFO) || \ cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO) - $(QUIETLY) test -f $(LIBJVM_DIZ) && \ + $(QUIETLY) test ! -f $(LIBJVM_DIZ) || \ cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ) $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done" diff --git a/hotspot/make/solaris/makefiles/jsig.make b/hotspot/make/solaris/makefiles/jsig.make index 59ac98401fc..0087fe958d8 100644 --- a/hotspot/make/solaris/makefiles/jsig.make +++ b/hotspot/make/solaris/makefiles/jsig.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, 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 @@ -79,9 +79,9 @@ endif install_jsig: $(LIBJSIG) @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" - $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBJSIG_DEBUGINFO) || \ cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) - $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ + $(QUIETLY) test ! -f $(LIBJSIG_DIZ) || \ cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" diff --git a/hotspot/make/solaris/makefiles/saproc.make b/hotspot/make/solaris/makefiles/saproc.make index 822735a5112..9721b8c065d 100644 --- a/hotspot/make/solaris/makefiles/saproc.make +++ b/hotspot/make/solaris/makefiles/saproc.make @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2014, 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 @@ -147,13 +147,13 @@ ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) endif install_saproc: $(BULDLIBSAPROC) - $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ - echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ - test -f $(LIBSAPROC_DEBUGINFO) && \ + $(QUIETLY) if [ -f $(LIBSAPROC) ] ; then \ + echo "Copying $(LIBSAPROC) to $(DEST_SAPROC)"; \ + test ! -f $(LIBSAPROC_DEBUGINFO) || \ cp -f $(LIBSAPROC_DEBUGINFO) $(DEST_SAPROC_DEBUGINFO); \ - test -f $(LIBSAPROC_DIZ) && \ - cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \ - cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ + test ! -f $(LIBSAPROC_DIZ) || \ + cp -f $(LIBSAPROC_DIZ) $(DEST_SAPROC_DIZ); \ + cp -f $(LIBSAPROC) $(DEST_SAPROC) && echo "Done"; \ fi .PHONY: install_saproc diff --git a/hotspot/make/solaris/makefiles/vm.make b/hotspot/make/solaris/makefiles/vm.make index b3939fbe144..6c27eaa1d06 100644 --- a/hotspot/make/solaris/makefiles/vm.make +++ b/hotspot/make/solaris/makefiles/vm.make @@ -1,5 +1,5 @@ # -# Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1998, 2014, 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 @@ -333,9 +333,9 @@ DEST_JVM_DIZ = $(DEST_SUBDIR)/$(LIBJVM_DIZ) install_jvm: $(LIBJVM) @echo "Copying $(LIBJVM) to $(DEST_JVM)" - $(QUIETLY) test -f $(LIBJVM_DEBUGINFO) && \ + $(QUIETLY) test ! -f $(LIBJVM_DEBUGINFO) || \ cp -f $(LIBJVM_DEBUGINFO) $(DEST_JVM_DEBUGINFO) - $(QUIETLY) test -f $(LIBJVM_DIZ) && \ + $(QUIETLY) test ! -f $(LIBJVM_DIZ) || \ cp -f $(LIBJVM_DIZ) $(DEST_JVM_DIZ) $(QUIETLY) cp -f $(LIBJVM) $(DEST_JVM) && echo "Done" From 3d76a6654eead70c00fdd0df51477251ec75cbd2 Mon Sep 17 00:00:00 2001 From: Gerald Thornbrugh Date: Fri, 7 Feb 2014 11:47:24 -0800 Subject: [PATCH 27/35] 8033931: Several nightly tests failing with assert(imin < imax) failed: Unexpected page size Loosen new assert() in get_stack_commited_bottom() Reviewed-by: dcubed, coleenp, dsamersoff, hseigel --- hotspot/src/os/linux/vm/os_linux.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index bf701718c35..42f9471ea91 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -3002,7 +3002,7 @@ address get_stack_commited_bottom(address bottom, size_t size) { unsigned imin = 1, imax = pages + 1, imid; int mincore_return_value = 0; - assert(imin < imax, "Unexpected page size"); + assert(imin <= imax, "Unexpected page size"); while (imin < imax) { imid = (imax + imin) / 2; From 2759eb10aed0552b9bbd52bb18aacccd60ec0131 Mon Sep 17 00:00:00 2001 From: Coleen Phillimore Date: Fri, 7 Feb 2014 18:30:27 -0500 Subject: [PATCH 28/35] 8033528: assert(0 <= i && i < length()) failed: index out of bounds Restoring bytecodes for invokedynamic had wrong index calculation added testing stress option. Reviewed-by: twisti, hseigel --- hotspot/src/share/vm/interpreter/rewriter.cpp | 43 ++++++++++++------- hotspot/src/share/vm/interpreter/rewriter.hpp | 5 ++- hotspot/src/share/vm/oops/constantPool.cpp | 3 ++ hotspot/src/share/vm/runtime/globals.hpp | 5 ++- hotspot/src/share/vm/utilities/array.hpp | 4 +- .../InvokespecialInterface.java | 3 +- 6 files changed, 43 insertions(+), 20 deletions(-) diff --git a/hotspot/src/share/vm/interpreter/rewriter.cpp b/hotspot/src/share/vm/interpreter/rewriter.cpp index 208f8617d5d..2474ae758ba 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.cpp +++ b/hotspot/src/share/vm/interpreter/rewriter.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -250,8 +250,8 @@ void Rewriter::rewrite_invokedynamic(address bcp, int offset, bool reverse) { // We will reverse the bytecode rewriting _after_ adjusting them. // Adjust the cache index by offset to the invokedynamic entries in the // cpCache plus the delta if the invokedynamic bytecodes were adjusted. - cache_index = cp_cache_delta() + _first_iteration_cp_cache_limit; - int cp_index = invokedynamic_cp_cache_entry_pool_index(cache_index); + int adjustment = cp_cache_delta() + _first_iteration_cp_cache_limit; + int cp_index = invokedynamic_cp_cache_entry_pool_index(cache_index - adjustment); assert(_pool->tag_at(cp_index).is_invoke_dynamic(), "wrong index"); // zero out 4 bytes Bytes::put_Java_u4(p, 0); @@ -453,18 +453,7 @@ methodHandle Rewriter::rewrite_jsrs(methodHandle method, TRAPS) { return method; } -void Rewriter::rewrite(instanceKlassHandle klass, TRAPS) { - ResourceMark rm(THREAD); - Rewriter rw(klass, klass->constants(), klass->methods(), CHECK); - // (That's all, folks.) -} - - -Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array* methods, TRAPS) - : _klass(klass), - _pool(cpool), - _methods(methods) -{ +void Rewriter::rewrite_bytecodes(TRAPS) { assert(_pool->cache() == NULL, "constant pool cache must not be set yet"); // determine index maps for Method* rewriting @@ -508,6 +497,29 @@ Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Arrayconstants(), klass->methods(), CHECK); + // (That's all, folks.) +} + + +Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Array* methods, TRAPS) + : _klass(klass), + _pool(cpool), + _methods(methods) +{ + + // Rewrite bytecodes - exception here exits. + rewrite_bytecodes(CHECK); + + // Stress restoring bytecodes + if (StressRewriter) { + restore_bytecodes(); + rewrite_bytecodes(CHECK); + } // allocate constant pool cache, now that we've seen all the bytecodes make_constant_pool_cache(THREAD); @@ -523,6 +535,7 @@ Rewriter::Rewriter(instanceKlassHandle klass, constantPoolHandle cpool, Arraylength(); for (int i = len-1; i >= 0; i--) { methodHandle m(THREAD, _methods->at(i)); diff --git a/hotspot/src/share/vm/interpreter/rewriter.hpp b/hotspot/src/share/vm/interpreter/rewriter.hpp index 2c7990fa7e5..aa4b7cd5228 100644 --- a/hotspot/src/share/vm/interpreter/rewriter.hpp +++ b/hotspot/src/share/vm/interpreter/rewriter.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -199,6 +199,9 @@ class Rewriter: public StackObj { void patch_invokedynamic_bytecodes(); + // Do all the work. + void rewrite_bytecodes(TRAPS); + // Revert bytecodes in case of an exception. void restore_bytecodes(); diff --git a/hotspot/src/share/vm/oops/constantPool.cpp b/hotspot/src/share/vm/oops/constantPool.cpp index 223fbc16935..e008ccb8d4a 100644 --- a/hotspot/src/share/vm/oops/constantPool.cpp +++ b/hotspot/src/share/vm/oops/constantPool.cpp @@ -82,6 +82,9 @@ ConstantPool::ConstantPool(Array* tags) { void ConstantPool::deallocate_contents(ClassLoaderData* loader_data) { MetadataFactory::free_metadata(loader_data, cache()); set_cache(NULL); + MetadataFactory::free_array(loader_data, reference_map()); + set_reference_map(NULL); + MetadataFactory::free_array(loader_data, operands()); set_operands(NULL); diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index b5d8880e91e..037743828b7 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -1260,6 +1260,9 @@ class CommandLineFlags { develop(bool, TraceJNICalls, false, \ "Trace JNI calls") \ \ + develop(bool, StressRewriter, false, \ + "Stress linktime bytecode rewriting") \ + \ notproduct(bool, TraceJVMCalls, false, \ "Trace JVM calls") \ \ diff --git a/hotspot/src/share/vm/utilities/array.hpp b/hotspot/src/share/vm/utilities/array.hpp index 9f8e45f3243..0fbcd94d2be 100644 --- a/hotspot/src/share/vm/utilities/array.hpp +++ b/hotspot/src/share/vm/utilities/array.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2014, 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 @@ -58,7 +58,7 @@ class ResourceArray: public ResourceObj { void initialize(size_t esize, int length) { assert(length >= 0, "illegal length"); - assert(_data == NULL, "must be new object"); + assert(StressRewriter || _data == NULL, "must be new object"); _length = length; _data = resource_allocate_bytes(esize * length); DEBUG_ONLY(init_nesting();) diff --git a/hotspot/test/runtime/lambda-features/InvokespecialInterface.java b/hotspot/test/runtime/lambda-features/InvokespecialInterface.java index 25e7904c257..80c26186da2 100644 --- a/hotspot/test/runtime/lambda-features/InvokespecialInterface.java +++ b/hotspot/test/runtime/lambda-features/InvokespecialInterface.java @@ -26,8 +26,9 @@ * @test * @bug 8032024 * @bug 8025937 + * @bug 8033528 * @summary [JDK 8] Test invokespecial and invokeinterface with the same JVM_CONSTANT_InterfaceMethodref - * @run main InvokespecialInterface + * @run main/othervm -XX:+StressRewriter InvokespecialInterface */ import java.util.function.*; import java.util.*; From dd25d6fed0fa237700f9e11b4de4403316dc4199 Mon Sep 17 00:00:00 2001 From: Christian Tornqvist Date: Mon, 10 Feb 2014 17:49:17 +0100 Subject: [PATCH 29/35] 8016644: Improve UnsupportedClassVersionError message Improved the UnsupportedClassVersionError message to hopefully be more user friendly Reviewed-by: coleenp, dholmes, twisti --- .../share/vm/classfile/classFileParser.cpp | 14 ++-- .../UnsupportedClassFileVersion.java | 69 +++++++++++++++++++ .../oracle/java/testlibrary/ProcessTools.java | 13 +++- 3 files changed, 91 insertions(+), 5 deletions(-) create mode 100644 hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp index f45bb750269..41e7a7a62eb 100644 --- a/hotspot/src/share/vm/classfile/classFileParser.cpp +++ b/hotspot/src/share/vm/classfile/classFileParser.cpp @@ -3746,18 +3746,24 @@ instanceKlassHandle ClassFileParser::parseClassFile(Symbol* name, Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_UnsupportedClassVersionError(), - "Unsupported major.minor version %u.%u", + "Unsupported class file version %u.%u, " + "this version of the Java Runtime only recognizes class file versions up to %u.%u", major_version, - minor_version); + minor_version, + JAVA_MAX_SUPPORTED_VERSION, + JAVA_MAX_SUPPORTED_MINOR_VERSION); } else { ResourceMark rm(THREAD); Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_UnsupportedClassVersionError(), - "%s : Unsupported major.minor version %u.%u", + "%s has been compiled by a more recent version of the Java Runtime (class file version %u.%u), " + "this version of the Java Runtime only recognizes class file versions up to %u.%u", name->as_C_string(), major_version, - minor_version); + minor_version, + JAVA_MAX_SUPPORTED_VERSION, + JAVA_MAX_SUPPORTED_MINOR_VERSION); } return nullHandle; } diff --git a/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java new file mode 100644 index 00000000000..7978d285a84 --- /dev/null +++ b/hotspot/test/runtime/ClassFile/UnsupportedClassFileVersion.java @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2014, 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. + * + * 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. + */ + +/* + * @test + * @library /testlibrary + * @compile -XDignore.symbol.file UnsupportedClassFileVersion.java + * @run main UnsupportedClassFileVersion + */ + +import java.io.File; +import java.io.FileOutputStream; +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import jdk.internal.org.objectweb.asm.Opcodes; +import com.oracle.java.testlibrary.*; + +public class UnsupportedClassFileVersion implements Opcodes { + public static void main(String... args) throws Exception { + writeClassFile(); + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".", "ClassFile"); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + output.shouldContain("ClassFile has been compiled by a more recent version of the " + + "Java Runtime (class file version 99.0), this version of " + + "the Java Runtime only recognizes class file versions up to " + + System.getProperty("java.class.version")); + + output.shouldHaveExitValue(1); + } + + public static void writeClassFile() throws Exception { + ClassWriter cw = new ClassWriter(0); + MethodVisitor mv; + + cw.visit(99, ACC_PUBLIC + ACC_SUPER, "ClassFile", null, "java/lang/Object", null); + mv = cw.visitMethod(ACC_PUBLIC, "", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + cw.visitEnd(); + + try (FileOutputStream fos = new FileOutputStream(new File("ClassFile.class"))) { + fos.write(cw.toByteArray()); + } + } +} diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java index 56277f046ec..4bc11f8bf5d 100644 --- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java +++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/ProcessTools.java @@ -142,11 +142,23 @@ public final class ProcessTools { * with any platform specific arguments prepended */ public static ProcessBuilder createJavaProcessBuilder(String... command) throws Exception { + return createJavaProcessBuilder(false, command); + } + + public static ProcessBuilder createJavaProcessBuilder(boolean addTestVmOptions, String... command) throws Exception { String javapath = JDKToolFinder.getJDKTool("java"); ArrayList args = new ArrayList<>(); args.add(javapath); Collections.addAll(args, getPlatformSpecificVMArgs()); + + if (addTestVmOptions) { + String vmopts = System.getProperty("test.vm.opts"); + if (vmopts != null) { + Collections.addAll(args, vmopts.split("\\s")); + } + } + Collections.addAll(args, command); // Reporting @@ -157,5 +169,4 @@ public final class ProcessTools { return new ProcessBuilder(args.toArray(new String[args.size()])); } - } From 57d286084a692193cd6a04b3992efef040317334 Mon Sep 17 00:00:00 2001 From: Ron Durbin Date: Mon, 10 Feb 2014 12:38:34 -0800 Subject: [PATCH 30/35] 8005262: possible gamma launcher issues Cleaned out make targets and comments associated with the previously removed gamma launcher Reviewed-by: dcubed, stefank --- hotspot/make/bsd/makefiles/optimized.make | 2 +- hotspot/make/bsd/makefiles/product.make | 2 +- hotspot/make/bsd/makefiles/top.make | 2 +- hotspot/make/linux/makefiles/optimized.make | 2 +- hotspot/make/linux/makefiles/product.make | 2 +- hotspot/make/linux/makefiles/top.make | 2 +- hotspot/make/solaris/makefiles/optimized.make | 2 +- hotspot/make/solaris/makefiles/product.make | 2 +- hotspot/make/solaris/makefiles/top.make | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/hotspot/make/bsd/makefiles/optimized.make b/hotspot/make/bsd/makefiles/optimized.make index c89c3461ea5..f098efdbd82 100644 --- a/hotspot/make/bsd/makefiles/optimized.make +++ b/hotspot/make/bsd/makefiles/optimized.make @@ -22,7 +22,7 @@ # # -# Sets make macros for making optimized version of Gamma VM +# Sets make macros for making optimized version of HotSpot VM # (This is the "product", not the "release" version.) # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make diff --git a/hotspot/make/bsd/makefiles/product.make b/hotspot/make/bsd/makefiles/product.make index c67528eec79..7d3c345d38c 100644 --- a/hotspot/make/bsd/makefiles/product.make +++ b/hotspot/make/bsd/makefiles/product.make @@ -22,7 +22,7 @@ # # -# Sets make macros for making optimized version of Gamma VM +# Sets make macros for making optimized version of HotSpot VM # (This is the "product", not the "release" version.) # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make diff --git a/hotspot/make/bsd/makefiles/top.make b/hotspot/make/bsd/makefiles/top.make index aebadebe35c..6094e83c841 100644 --- a/hotspot/make/bsd/makefiles/top.make +++ b/hotspot/make/bsd/makefiles/top.make @@ -128,7 +128,7 @@ the_vm: vm_build_preliminaries $(adjust-mflags) @$(UpdatePCH) @$(MAKE) -f vm.make $(MFLAGS-adjusted) -install gamma: the_vm +install : the_vm @$(MAKE) -f vm.make $@ # next rules support "make foo.[ois]" diff --git a/hotspot/make/linux/makefiles/optimized.make b/hotspot/make/linux/makefiles/optimized.make index 07470f0756a..41d5e5d792e 100644 --- a/hotspot/make/linux/makefiles/optimized.make +++ b/hotspot/make/linux/makefiles/optimized.make @@ -22,7 +22,7 @@ # # -# Sets make macros for making optimized version of Gamma VM +# Sets make macros for making optimized version of HotSpot VM # (This is the "product", not the "release" version.) # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make diff --git a/hotspot/make/linux/makefiles/product.make b/hotspot/make/linux/makefiles/product.make index be241f41c92..70e23c6cb5e 100644 --- a/hotspot/make/linux/makefiles/product.make +++ b/hotspot/make/linux/makefiles/product.make @@ -22,7 +22,7 @@ # # -# Sets make macros for making optimized version of Gamma VM +# Sets make macros for making optimized version of HotSpot VM # (This is the "product", not the "release" version.) # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make diff --git a/hotspot/make/linux/makefiles/top.make b/hotspot/make/linux/makefiles/top.make index 8c6c2ca0194..aca73c6eb6c 100644 --- a/hotspot/make/linux/makefiles/top.make +++ b/hotspot/make/linux/makefiles/top.make @@ -122,7 +122,7 @@ the_vm: vm_build_preliminaries $(adjust-mflags) @$(UpdatePCH) @$(MAKE) -f vm.make $(MFLAGS-adjusted) -install gamma: the_vm +install: the_vm @$(MAKE) -f vm.make $@ # next rules support "make foo.[ois]" diff --git a/hotspot/make/solaris/makefiles/optimized.make b/hotspot/make/solaris/makefiles/optimized.make index 08a8c347351..f353628aec8 100644 --- a/hotspot/make/solaris/makefiles/optimized.make +++ b/hotspot/make/solaris/makefiles/optimized.make @@ -22,7 +22,7 @@ # # -# Sets make macros for making optimized version of Gamma VM +# Sets make macros for making optimized version of HotSpot VM # (This is the "product", not the "release" version.) # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make diff --git a/hotspot/make/solaris/makefiles/product.make b/hotspot/make/solaris/makefiles/product.make index 0e26cbc82e1..1f9224b17f0 100644 --- a/hotspot/make/solaris/makefiles/product.make +++ b/hotspot/make/solaris/makefiles/product.make @@ -22,7 +22,7 @@ # # -# Sets make macros for making optimized version of Gamma VM +# Sets make macros for making optimized version of HotSpot VM # (This is the "product", not the "release" version.) # Compiler specific OPT_CFLAGS are passed in from gcc.make, sparcWorks.make diff --git a/hotspot/make/solaris/makefiles/top.make b/hotspot/make/solaris/makefiles/top.make index 19060bdd501..c211151b09f 100644 --- a/hotspot/make/solaris/makefiles/top.make +++ b/hotspot/make/solaris/makefiles/top.make @@ -114,7 +114,7 @@ $(adjust-mflags): $(GAMMADIR)/make/$(Platform_os_family)/makefiles/adjust-mflags the_vm: vm_build_preliminaries $(adjust-mflags) @$(MAKE) -f vm.make $(MFLAGS-adjusted) -install gamma: the_vm +install: the_vm @$(MAKE) -f vm.make $@ # next rules support "make foo.[oi]" From cf5c3370a39083442e7ec98a84a19db450687daa Mon Sep 17 00:00:00 2001 From: "Daniel D. Daugherty" Date: Mon, 10 Feb 2014 12:48:54 -0800 Subject: [PATCH 31/35] 8028073: race condition in ObjectMonitor implementation causing deadlocks Move redo of ParkEvent.unpark() after JVMTI_EVENT_MONITOR_WAITED event handler is called. Reviewed-by: dholmes, sspitsyn, dice, acorn --- hotspot/src/share/vm/prims/jvm.cpp | 8 ++- .../src/share/vm/runtime/objectMonitor.cpp | 56 +++++++++++++------ 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 1059783eb05..74c0df13326 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -518,6 +518,12 @@ JVM_ENTRY(void, JVM_MonitorWait(JNIEnv* env, jobject handle, jlong ms)) JavaThreadInObjectWaitState jtiows(thread, ms != 0); if (JvmtiExport::should_post_monitor_wait()) { JvmtiExport::post_monitor_wait((JavaThread *)THREAD, (oop)obj(), ms); + + // The current thread already owns the monitor and it has not yet + // been added to the wait queue so the current thread cannot be + // made the successor. This means that the JVMTI_EVENT_MONITOR_WAIT + // event handler cannot accidentally consume an unpark() meant for + // the ParkEvent associated with this ObjectMonitor. } ObjectSynchronizer::wait(obj, ms, CHECK); JVM_END diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp index 5ab77844195..9b86b43b636 100644 --- a/hotspot/src/share/vm/runtime/objectMonitor.cpp +++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2014, 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 @@ -382,6 +382,12 @@ void ATTR ObjectMonitor::enter(TRAPS) { DTRACE_MONITOR_PROBE(contended__enter, this, object(), jt); if (JvmtiExport::should_post_monitor_contended_enter()) { JvmtiExport::post_monitor_contended_enter(jt, this); + + // The current thread does not yet own the monitor and does not + // yet appear on any queues that would get it made the successor. + // This means that the JVMTI_EVENT_MONITOR_CONTENDED_ENTER event + // handler cannot accidentally consume an unpark() meant for the + // ParkEvent associated with this ObjectMonitor. } OSThreadContendState osts(Self->osthread()); @@ -439,6 +445,12 @@ void ATTR ObjectMonitor::enter(TRAPS) { DTRACE_MONITOR_PROBE(contended__entered, this, object(), jt); if (JvmtiExport::should_post_monitor_contended_entered()) { JvmtiExport::post_monitor_contended_entered(jt, this); + + // The current thread already owns the monitor and is not going to + // call park() for the remainder of the monitor enter protocol. So + // it doesn't matter if the JVMTI_EVENT_MONITOR_CONTENDED_ENTERED + // event handler consumed an unpark() issued by the thread that + // just exited the monitor. } if (event.should_commit()) { @@ -1456,6 +1468,14 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) { // Note: 'false' parameter is passed here because the // wait was not timed out due to thread interrupt. JvmtiExport::post_monitor_waited(jt, this, false); + + // In this short circuit of the monitor wait protocol, the + // current thread never drops ownership of the monitor and + // never gets added to the wait queue so the current thread + // cannot be made the successor. This means that the + // JVMTI_EVENT_MONITOR_WAITED event handler cannot accidentally + // consume an unpark() meant for the ParkEvent associated with + // this ObjectMonitor. } if (event.should_commit()) { post_monitor_wait_event(&event, 0, millis, false); @@ -1499,21 +1519,6 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) { exit (true, Self) ; // exit the monitor guarantee (_owner != Self, "invariant") ; - // As soon as the ObjectMonitor's ownership is dropped in the exit() - // call above, another thread can enter() the ObjectMonitor, do the - // notify(), and exit() the ObjectMonitor. If the other thread's - // exit() call chooses this thread as the successor and the unpark() - // call happens to occur while this thread is posting a - // MONITOR_CONTENDED_EXIT event, then we run the risk of the event - // handler using RawMonitors and consuming the unpark(). - // - // To avoid the problem, we re-post the event. This does no harm - // even if the original unpark() was not consumed because we are the - // chosen successor for this monitor. - if (node._notified != 0 && _succ == Self) { - node._event->unpark(); - } - // The thread is on the WaitSet list - now park() it. // On MP systems it's conceivable that a brief spin before we park // could be profitable. @@ -1595,6 +1600,25 @@ void ObjectMonitor::wait(jlong millis, bool interruptible, TRAPS) { // post monitor waited event. Note that this is past-tense, we are done waiting. if (JvmtiExport::should_post_monitor_waited()) { JvmtiExport::post_monitor_waited(jt, this, ret == OS_TIMEOUT); + + if (node._notified != 0 && _succ == Self) { + // In this part of the monitor wait-notify-reenter protocol it + // is possible (and normal) for another thread to do a fastpath + // monitor enter-exit while this thread is still trying to get + // to the reenter portion of the protocol. + // + // The ObjectMonitor was notified and the current thread is + // the successor which also means that an unpark() has already + // been done. The JVMTI_EVENT_MONITOR_WAITED event handler can + // consume the unpark() that was done when the successor was + // set because the same ParkEvent is shared between Java + // monitors and JVM/TI RawMonitors (for now). + // + // We redo the unpark() to ensure forward progress, i.e., we + // don't want all pending threads hanging (parked) with none + // entering the unlocked monitor. + node._event->unpark(); + } } if (event.should_commit()) { From a90e842e0c04a51c799ab8c9276c4198da727ec8 Mon Sep 17 00:00:00 2001 From: Yumin Qi Date: Mon, 10 Feb 2014 21:29:14 -0800 Subject: [PATCH 32/35] 8033792: AltHashing used jint for imprecise bit shifting AltHashing used jint the way of juint in bit shifting which could lead loss of precision. Fix by change _seed defined as juint. Reviewed-by: coleenp, ccheung --- hotspot/src/share/vm/classfile/altHashing.cpp | 78 +++++++++---------- hotspot/src/share/vm/classfile/altHashing.hpp | 20 ++--- hotspot/src/share/vm/oops/instanceKlass.hpp | 3 +- hotspot/src/share/vm/oops/metadata.hpp | 4 +- hotspot/src/share/vm/oops/oop.cpp | 4 +- hotspot/src/share/vm/oops/oop.hpp | 4 +- hotspot/src/share/vm/oops/symbol.cpp | 4 +- hotspot/src/share/vm/oops/symbol.hpp | 4 +- hotspot/src/share/vm/utilities/hashtable.cpp | 4 +- hotspot/src/share/vm/utilities/hashtable.hpp | 6 +- 10 files changed, 66 insertions(+), 65 deletions(-) diff --git a/hotspot/src/share/vm/classfile/altHashing.cpp b/hotspot/src/share/vm/classfile/altHashing.cpp index 8dfc3153ca4..91eb5bec152 100644 --- a/hotspot/src/share/vm/classfile/altHashing.cpp +++ b/hotspot/src/share/vm/classfile/altHashing.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -39,18 +39,18 @@ intptr_t object_hash(Klass* k) { } // Seed value used for each alternative hash calculated. -jint AltHashing::compute_seed() { +juint AltHashing::compute_seed() { jlong nanos = os::javaTimeNanos(); jlong now = os::javaTimeMillis(); - jint SEED_MATERIAL[8] = { - (jint) object_hash(SystemDictionary::String_klass()), - (jint) object_hash(SystemDictionary::System_klass()), - (jint) os::random(), // current thread isn't a java thread - (jint) (((julong)nanos) >> 32), - (jint) nanos, - (jint) (((julong)now) >> 32), - (jint) now, - (jint) (os::javaTimeNanos() >> 2) + int SEED_MATERIAL[8] = { + (int) object_hash(SystemDictionary::String_klass()), + (int) object_hash(SystemDictionary::System_klass()), + (int) os::random(), // current thread isn't a java thread + (int) (((julong)nanos) >> 32), + (int) nanos, + (int) (((julong)now) >> 32), + (int) now, + (int) (os::javaTimeNanos() >> 2) }; return murmur3_32(SEED_MATERIAL, 8); @@ -58,14 +58,14 @@ jint AltHashing::compute_seed() { // Murmur3 hashing for Symbol -jint AltHashing::murmur3_32(jint seed, const jbyte* data, int len) { - jint h1 = seed; +juint AltHashing::murmur3_32(juint seed, const jbyte* data, int len) { + juint h1 = seed; int count = len; int offset = 0; // body while (count >= 4) { - jint k1 = (data[offset] & 0x0FF) + juint k1 = (data[offset] & 0x0FF) | (data[offset + 1] & 0x0FF) << 8 | (data[offset + 2] & 0x0FF) << 16 | data[offset + 3] << 24; @@ -85,7 +85,7 @@ jint AltHashing::murmur3_32(jint seed, const jbyte* data, int len) { // tail if (count > 0) { - jint k1 = 0; + juint k1 = 0; switch (count) { case 3: @@ -109,18 +109,18 @@ jint AltHashing::murmur3_32(jint seed, const jbyte* data, int len) { h1 ^= len; // finalization mix force all bits of a hash block to avalanche - h1 ^= ((unsigned int)h1) >> 16; + h1 ^= h1 >> 16; h1 *= 0x85ebca6b; - h1 ^= ((unsigned int)h1) >> 13; + h1 ^= h1 >> 13; h1 *= 0xc2b2ae35; - h1 ^= ((unsigned int)h1) >> 16; + h1 ^= h1 >> 16; return h1; } // Murmur3 hashing for Strings -jint AltHashing::murmur3_32(jint seed, const jchar* data, int len) { - jint h1 = seed; +juint AltHashing::murmur3_32(juint seed, const jchar* data, int len) { + juint h1 = seed; int off = 0; int count = len; @@ -129,7 +129,7 @@ jint AltHashing::murmur3_32(jint seed, const jchar* data, int len) { while (count >= 2) { jchar d1 = data[off++] & 0xFFFF; jchar d2 = data[off++]; - jint k1 = (d1 | d2 << 16); + juint k1 = (d1 | d2 << 16); count -= 2; @@ -145,7 +145,7 @@ jint AltHashing::murmur3_32(jint seed, const jchar* data, int len) { // tail if (count > 0) { - int k1 = data[off]; + juint k1 = (juint)data[off]; k1 *= 0xcc9e2d51; k1 = Integer_rotateLeft(k1, 15); @@ -157,25 +157,25 @@ jint AltHashing::murmur3_32(jint seed, const jchar* data, int len) { h1 ^= len * 2; // (Character.SIZE / Byte.SIZE); // finalization mix force all bits of a hash block to avalanche - h1 ^= ((unsigned int)h1) >> 16; + h1 ^= h1 >> 16; h1 *= 0x85ebca6b; - h1 ^= ((unsigned int)h1) >> 13; + h1 ^= h1 >> 13; h1 *= 0xc2b2ae35; - h1 ^= ((unsigned int)h1) >> 16; + h1 ^= h1 >> 16; return h1; } // Hash used for the seed. -jint AltHashing::murmur3_32(jint seed, const int* data, int len) { - jint h1 = seed; +juint AltHashing::murmur3_32(juint seed, const int* data, int len) { + juint h1 = seed; int off = 0; int end = len; // body while (off < end) { - jint k1 = data[off++]; + juint k1 = (juint)data[off++]; k1 *= 0xcc9e2d51; k1 = Integer_rotateLeft(k1, 15); @@ -193,26 +193,26 @@ jint AltHashing::murmur3_32(jint seed, const int* data, int len) { h1 ^= len * 4; // (Integer.SIZE / Byte.SIZE); // finalization mix force all bits of a hash block to avalanche - h1 ^= ((juint)h1) >> 16; + h1 ^= h1 >> 16; h1 *= 0x85ebca6b; - h1 ^= ((juint)h1) >> 13; + h1 ^= h1 >> 13; h1 *= 0xc2b2ae35; - h1 ^= ((juint)h1) >> 16; + h1 ^= h1 >> 16; return h1; } -jint AltHashing::murmur3_32(const int* data, int len) { +juint AltHashing::murmur3_32(const int* data, int len) { return murmur3_32(0, data, len); } #ifndef PRODUCT // Overloaded versions for internal test. -jint AltHashing::murmur3_32(const jbyte* data, int len) { +juint AltHashing::murmur3_32(const jbyte* data, int len) { return murmur3_32(0, data, len); } -jint AltHashing::murmur3_32(const jchar* data, int len) { +juint AltHashing::murmur3_32(const jchar* data, int len) { return murmur3_32(0, data, len); } @@ -251,11 +251,11 @@ void AltHashing::testMurmur3_32_ByteArray() { // Hash subranges {}, {0}, {0,1}, {0,1,2}, ..., {0,...,255} for (int i = 0; i < 256; i++) { - jint hash = murmur3_32(256 - i, vector, i); + juint hash = murmur3_32(256 - i, vector, i); hashes[i * 4] = (jbyte) hash; - hashes[i * 4 + 1] = (jbyte) (((juint)hash) >> 8); - hashes[i * 4 + 2] = (jbyte) (((juint)hash) >> 16); - hashes[i * 4 + 3] = (jbyte) (((juint)hash) >> 24); + hashes[i * 4 + 1] = (jbyte)(hash >> 8); + hashes[i * 4 + 2] = (jbyte)(hash >> 16); + hashes[i * 4 + 3] = (jbyte)(hash >> 24); } // hash to get const result. @@ -269,7 +269,7 @@ void AltHashing::testMurmur3_32_ByteArray() { } void AltHashing::testEquivalentHashes() { - jint jbytes, jchars, ints; + juint jbytes, jchars, ints; // printf("testEquivalentHashes\n"); diff --git a/hotspot/src/share/vm/classfile/altHashing.hpp b/hotspot/src/share/vm/classfile/altHashing.hpp index 941b9a0dc37..2e04fd33a2d 100644 --- a/hotspot/src/share/vm/classfile/altHashing.hpp +++ b/hotspot/src/share/vm/classfile/altHashing.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2014, 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 @@ -39,24 +39,24 @@ class AltHashing : AllStatic { // utility function copied from java/lang/Integer - static jint Integer_rotateLeft(jint i, int distance) { - return (i << distance) | (((juint)i) >> (32-distance)); + static juint Integer_rotateLeft(juint i, int distance) { + return (i << distance) | (i >> (32-distance)); } - static jint murmur3_32(const int* data, int len); - static jint murmur3_32(jint seed, const int* data, int len); + static juint murmur3_32(const int* data, int len); + static juint murmur3_32(juint seed, const int* data, int len); #ifndef PRODUCT // Hashing functions used for internal testing - static jint murmur3_32(const jbyte* data, int len); - static jint murmur3_32(const jchar* data, int len); + static juint murmur3_32(const jbyte* data, int len); + static juint murmur3_32(const jchar* data, int len); static void testMurmur3_32_ByteArray(); static void testEquivalentHashes(); #endif // PRODUCT public: - static jint compute_seed(); - static jint murmur3_32(jint seed, const jbyte* data, int len); - static jint murmur3_32(jint seed, const jchar* data, int len); + static juint compute_seed(); + static juint murmur3_32(juint seed, const jbyte* data, int len); + static juint murmur3_32(juint seed, const jchar* data, int len); NOT_PRODUCT(static void test_alt_hash();) }; #endif // SHARE_VM_CLASSFILE_ALTHASHING_HPP diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp index 2b7a73a3189..f503de6725a 100644 --- a/hotspot/src/share/vm/oops/instanceKlass.hpp +++ b/hotspot/src/share/vm/oops/instanceKlass.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -554,6 +554,7 @@ class InstanceKlass: public Klass { if (hk == NULL) { return NULL; } else { + assert(*hk != NULL, "host klass should always be set if the address is not null"); return *hk; } } diff --git a/hotspot/src/share/vm/oops/metadata.hpp b/hotspot/src/share/vm/oops/metadata.hpp index a1afb0d0562..84a60893e81 100644 --- a/hotspot/src/share/vm/oops/metadata.hpp +++ b/hotspot/src/share/vm/oops/metadata.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2014, 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 @@ -40,7 +40,7 @@ class Metadata : public MetaspaceObj { int identity_hash() { return (int)(uintptr_t)this; } // Rehashing support for tables containing pointers to this - unsigned int new_hash(jint seed) { ShouldNotReachHere(); return 0; } + unsigned int new_hash(juint seed) { ShouldNotReachHere(); return 0; } virtual bool is_klass() const volatile { return false; } virtual bool is_method() const volatile { return false; } diff --git a/hotspot/src/share/vm/oops/oop.cpp b/hotspot/src/share/vm/oops/oop.cpp index aed29da6796..281188354a0 100644 --- a/hotspot/src/share/vm/oops/oop.cpp +++ b/hotspot/src/share/vm/oops/oop.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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,7 @@ intptr_t oopDesc::slow_identity_hash() { } // When String table needs to rehash -unsigned int oopDesc::new_hash(jint seed) { +unsigned int oopDesc::new_hash(juint seed) { EXCEPTION_MARK; ResourceMark rm; int length; diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp index 350c0fc6131..2013c3ea758 100644 --- a/hotspot/src/share/vm/oops/oop.hpp +++ b/hotspot/src/share/vm/oops/oop.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -362,7 +362,7 @@ class oopDesc { intptr_t slow_identity_hash(); // Alternate hashing code if string table is rehashed - unsigned int new_hash(jint seed); + unsigned int new_hash(juint seed); // marks are forwarded to stack when object is locked bool has_displaced_mark() const; diff --git a/hotspot/src/share/vm/oops/symbol.cpp b/hotspot/src/share/vm/oops/symbol.cpp index 2a2c975b6ef..cab865503fa 100644 --- a/hotspot/src/share/vm/oops/symbol.cpp +++ b/hotspot/src/share/vm/oops/symbol.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -207,7 +207,7 @@ const char* Symbol::as_klass_external_name() const { } // Alternate hashing for unbalanced symbol tables. -unsigned int Symbol::new_hash(jint seed) { +unsigned int Symbol::new_hash(juint seed) { ResourceMark rm; // Use alternate hashing algorithm on this symbol. return AltHashing::murmur3_32(seed, (const jbyte*)as_C_string(), utf8_length()); diff --git a/hotspot/src/share/vm/oops/symbol.hpp b/hotspot/src/share/vm/oops/symbol.hpp index e747c464607..aaa55c58992 100644 --- a/hotspot/src/share/vm/oops/symbol.hpp +++ b/hotspot/src/share/vm/oops/symbol.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2014, 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 @@ -154,7 +154,7 @@ class Symbol : private SymbolBase { int identity_hash() { return _identity_hash; } // For symbol table alternate hashing - unsigned int new_hash(jint seed); + unsigned int new_hash(juint seed); // Reference counting. See comments above this class for when to use. int refcount() const { return _refcount; } diff --git a/hotspot/src/share/vm/utilities/hashtable.cpp b/hotspot/src/share/vm/utilities/hashtable.cpp index 3e1413f618f..40fb3b1537d 100644 --- a/hotspot/src/share/vm/utilities/hashtable.cpp +++ b/hotspot/src/share/vm/utilities/hashtable.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -93,7 +93,7 @@ template bool BasicHashtable::check_rehash_table(int count) { return false; } -template jint Hashtable::_seed = 0; +template juint Hashtable::_seed = 0; // Create a new table and using alternate hash code, populate the new table // with the existing elements. This can be used to change the hash code diff --git a/hotspot/src/share/vm/utilities/hashtable.hpp b/hotspot/src/share/vm/utilities/hashtable.hpp index 468965dab3b..aa45100249c 100644 --- a/hotspot/src/share/vm/utilities/hashtable.hpp +++ b/hotspot/src/share/vm/utilities/hashtable.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2014, 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 @@ -280,7 +280,7 @@ protected: // Function to move these elements into the new table. void move_to(Hashtable* new_table); static bool use_alternate_hashcode() { return _seed != 0; } - static jint seed() { return _seed; } + static juint seed() { return _seed; } static int literal_size(Symbol *symbol); static int literal_size(oop oop); @@ -296,7 +296,7 @@ public: void dump_table(outputStream* st, const char *table_name); private: - static jint _seed; + static juint _seed; }; From 7f138c55021339aeceb8dbbfee8e5a4763dcef4d Mon Sep 17 00:00:00 2001 From: Ioi Lam Date: Tue, 11 Feb 2014 08:43:17 -0800 Subject: [PATCH 33/35] 7182040: volano29 limited by os resource on Linux - need better diagnostic message Changed message to "unable to create native thread: possibly out of memory or process/resource limits reached" Reviewed-by: dholmes, sla --- hotspot/src/share/vm/compiler/compileBroker.cpp | 2 +- .../vm/gc_implementation/shared/concurrentGCThread.cpp | 3 ++- hotspot/src/share/vm/prims/jvm.cpp | 4 ++-- hotspot/src/share/vm/runtime/os.cpp | 2 +- hotspot/src/share/vm/runtime/os.hpp | 7 +++++++ hotspot/src/share/vm/runtime/serviceThread.cpp | 3 ++- hotspot/src/share/vm/services/attachListener.cpp | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index 57eee0b91e3..536bca7851a 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -955,7 +955,7 @@ CompilerThread* CompileBroker::make_compiler_thread(const char* name, CompileQue if (compiler_thread == NULL || compiler_thread->osthread() == NULL){ vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } java_lang_Thread::set_thread(thread_oop(), compiler_thread); diff --git a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp index 0aba69e2a64..b0c6e95191a 100644 --- a/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp +++ b/hotspot/src/share/vm/gc_implementation/shared/concurrentGCThread.cpp @@ -31,6 +31,7 @@ #include "runtime/interfaceSupport.hpp" #include "runtime/java.hpp" #include "runtime/javaCalls.hpp" +#include "runtime/os.hpp" // CopyrightVersion 1.2 @@ -206,7 +207,7 @@ SurrogateLockerThread* SurrogateLockerThread::make(TRAPS) { // exceptions anyway, check and abort if this fails. if (res == NULL || res->osthread() == NULL) { vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } java_lang_Thread::set_thread(thread_oop(), res); java_lang_Thread::set_priority(thread_oop(), NearMaxPriority); diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp index 1059783eb05..d1d7c3efbfe 100644 --- a/hotspot/src/share/vm/prims/jvm.cpp +++ b/hotspot/src/share/vm/prims/jvm.cpp @@ -2875,10 +2875,10 @@ JVM_ENTRY(void, JVM_StartThread(JNIEnv* env, jobject jthread)) if (JvmtiExport::should_post_resource_exhausted()) { JvmtiExport::post_resource_exhausted( JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_THREADS, - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } THROW_MSG(vmSymbols::java_lang_OutOfMemoryError(), - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } Thread::start(native_thread); diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index 74617ab97e8..8615b6d4108 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -362,7 +362,7 @@ void os::signal_init() { // exceptions anyway, check and abort if this fails. if (signal_thread == NULL || signal_thread->osthread() == NULL) { vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } java_lang_Thread::set_thread(thread_oop(), signal_thread); diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp index 54aeb012a49..0731663ddad 100644 --- a/hotspot/src/share/vm/runtime/os.hpp +++ b/hotspot/src/share/vm/runtime/os.hpp @@ -805,6 +805,10 @@ class os: AllStatic { #endif #ifdef TARGET_OS_ARCH_bsd_zero # include "os_bsd_zero.hpp" +#endif + +#ifndef OS_NATIVE_THREAD_CREATION_FAILED_MSG +#define OS_NATIVE_THREAD_CREATION_FAILED_MSG "unable to create native thread: possibly out of memory or process/resource limits reached" #endif public: @@ -829,6 +833,9 @@ class os: AllStatic { // Hint to the underlying OS that a task switch would not be good. // Void return because it's a hint and can fail. static void hint_no_preempt(); + static const char* native_thread_creation_failed_msg() { + return OS_NATIVE_THREAD_CREATION_FAILED_MSG; + } // Used at creation if requested by the diagnostic flag PauseAtStartup. // Causes the VM to wait until an external stimulus has been applied diff --git a/hotspot/src/share/vm/runtime/serviceThread.cpp b/hotspot/src/share/vm/runtime/serviceThread.cpp index 66d4572522f..3c1224abb2c 100644 --- a/hotspot/src/share/vm/runtime/serviceThread.cpp +++ b/hotspot/src/share/vm/runtime/serviceThread.cpp @@ -27,6 +27,7 @@ #include "runtime/javaCalls.hpp" #include "runtime/serviceThread.hpp" #include "runtime/mutexLocker.hpp" +#include "runtime/os.hpp" #include "prims/jvmtiImpl.hpp" #include "services/gcNotifier.hpp" #include "services/diagnosticArgument.hpp" @@ -66,7 +67,7 @@ void ServiceThread::initialize() { // exceptions anyway, check and abort if this fails. if (thread == NULL || thread->osthread() == NULL) { vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } java_lang_Thread::set_thread(thread_oop(), thread); diff --git a/hotspot/src/share/vm/services/attachListener.cpp b/hotspot/src/share/vm/services/attachListener.cpp index e7d8c380951..8551563f59f 100644 --- a/hotspot/src/share/vm/services/attachListener.cpp +++ b/hotspot/src/share/vm/services/attachListener.cpp @@ -532,7 +532,7 @@ void AttachListener::init() { // Check that thread and osthread were created if (listener_thread == NULL || listener_thread->osthread() == NULL) { vm_exit_during_initialization("java.lang.OutOfMemoryError", - "unable to create new native thread"); + os::native_thread_creation_failed_msg()); } java_lang_Thread::set_thread(thread_oop(), listener_thread); From 2e916722f5fc3954241318bf032cac5fdad44870 Mon Sep 17 00:00:00 2001 From: Jeff Dinkins Date: Mon, 13 Jan 2014 14:42:26 -0800 Subject: [PATCH 34/35] 7129980: Third Party License Readme update for JDK8 Reviewed-by: lana, tbell --- hotspot/THIRD_PARTY_README | 1312 +++++++++++++++++++++--------------- 1 file changed, 766 insertions(+), 546 deletions(-) diff --git a/hotspot/THIRD_PARTY_README b/hotspot/THIRD_PARTY_README index ee5463a922e..ba48858c28f 100644 --- a/hotspot/THIRD_PARTY_README +++ b/hotspot/THIRD_PARTY_README @@ -2,11 +2,12 @@ DO NOT TRANSLATE OR LOCALIZE. ----------------------------- %% This notice is provided with respect to ASM Bytecode Manipulation -Framework v3.1, which is included with JRE 7, JDK 7, and OpenJDK 7. +Framework v5.0, which may be included with JRE 8, and JDK 8, and +OpenJDK 8. --- begin of LICENSE --- -Copyright (c) 2000-2005 INRIA, France Telecom +Copyright (c) 2000-2011 France Télécom All rights reserved. Redistribution and use in source and binary forms, with or without @@ -40,8 +41,41 @@ THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- -%% This notice is provided with respect to CodeViewer 1.0, which is included -with JDK 7. +%% This notice is provided with respect to BSDiff v4.3, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright 2003-2005 Colin Percival +All rights reserved + +Redistribution and use in source and binary forms, with or without +modification, are permitted providing that the following conditions +are met: +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to CodeViewer 1.0, which may be +included with JDK 8. --- begin of LICENSE --- @@ -81,8 +115,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ------------------------------------------------------------------------------- -%% This notice is provided with respect to Cryptix AES 3.2.0, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to Cryptix AES 3.2.0, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -121,7 +155,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- %% This notice is provided with respect to CUP Parser Generator for -Java 0.10k, which is included with JRE 7, JDK 7, and OpenJDK 7. +Java 0.10k, which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -148,7 +182,7 @@ performance of this software. ------------------------------------------------------------------------------- %% This notice is provided with respect to Document Object Model (DOM) Level 2 -& 3, which is included with JRE 7, JDK 7, and OpenJDK 7. +& 3, which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -212,19 +246,52 @@ site-policy@w3.org. ------------------------------------------------------------------------------- +%% This notice is provided with respect to Dynalink v0.5, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2009-2013, Attila Szegedi + +All rights reserved.Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following conditions are +met:* Redistributions of source code must retain the above copyright notice, +this list of conditions and the following disclaimer. * Redistributions in +binary form must reproduce the above copyright notice, this list of +conditions and the following disclaimer in the documentation and/or other +materials provided with the distribution. * Neither the name of Attila +Szegedi nor the names of its contributors may be used to endorse or promote +products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% This notice is provided with respect to Elliptic Curve Cryptography, which -is included with JRE 7, JDK 7, and OpenJDK 7. +may be included with JRE 8, JDK 8, and OpenJDK 8. You are receiving a copy of the Elliptic Curve Cryptography library in source -form with the JDK 7 source distribution and object code in the JRE 7 & JDK 7 -runtime. +form with the JDK 8 and OpenJDK 8 source distributions, and as object code in +the JRE 8 & JDK 8 runtimes. + +In the case of the JRE 8 & JDK 8 runtimes, the terms of the Oracle license do +NOT apply to the Elliptic Curve Cryptography library; it is licensed under the +following license, separately from Oracle's JDK & JRE. If you do not wish to +install the Elliptic Curve Cryptography library, you may delete the library +named libsunec.so (on Solaris and Linux systems) or sunec.dll (on Windows +systems) from the JRE bin directory reserved for native libraries. -The terms of the Oracle license do NOT apply to the Elliptic Curve -Cryptography library program; it is licensed under the following license, -separately from the Oracle programs you receive. If you do not wish to install -this program, you may delete the library named libsunec.so (on Solaris and -Linux systems) or sunec.dll (on Windows systems) from the JRE bin directory -reserved for native libraries. --- begin of LICENSE --- @@ -735,13 +802,138 @@ That's all there is to it! ------------------------------------------------------------------------------- -%% This notice is provided with respect to FontConfig 2.5, which is -included with JRE 7, JDK 7, and OpenJDK 7 source distributions on +%% This notice is provided with respect to ECMAScript Language +Specification ECMA-262 Edition 5.1 which may be included with +JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Copyright notice +Copyright © 2011 Ecma International +Ecma International +Rue du Rhone 114 +CH-1204 Geneva +Tel: +41 22 849 6000 +Fax: +41 22 849 6001 +Web: http://www.ecma-international.org + +This document and possible translations of it may be copied and furnished to +others, and derivative works that comment on or otherwise explain it or assist +in its implementation may be prepared, copied, published, and distributed, in +whole or in part, without restriction of any kind, provided that the above +copyright notice and this section are included on all such copies and derivative +works. However, this document itself may not be modified in any way, including +by removing the copyright notice or references to Ecma International, except as +needed for the purpose of developing any document or deliverable produced by +Ecma International (in which case the rules applied to copyrights must be +followed) or as required to translate it into languages other than English. The +limited permissions granted above are perpetual and will not be revoked by Ecma +International or its successors or assigns. This document and the information +contained herein is provided on an "AS IS" basis and ECMA INTERNATIONAL +DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY +WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY OWNERSHIP +RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR +PURPOSE." Software License + +All Software contained in this document ("Software)" is protected by copyright +and is being made available under the "BSD License", included below. This +Software may be subject to third party rights (rights from parties other than +Ecma International), including patent rights, and no licenses under such third +party rights are granted under this license even if the third party concerned is +a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS +AVAILABLE AT http://www.ecma-international.org/memento/codeofconduct.htm FOR +INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO +IMPLEMENT ECMA INTERNATIONAL STANDARDS*. Redistribution and use in source and +binary forms, with or without modification, are permitted provided that the +following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +3. Neither the name of the authors nor Ecma International may be used to endorse +or promote products derived from this software without specific prior written +permission. + +THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT +SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. +--- end of LICENSE --- + +%% This notice is provided with respect to Dynalink library which is included +with the Nashorn technology. + +--- begin of LICENSE --- +Copyright (c) 2009-2013, Attila Szegedi + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +--- end of LICENSE --- + +%% This notice is provided with respect to Joni library which is included +with the Nashorn technology. + +--- begin of LICENSE --- +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to FontConfig 2.5, which may be +included with JRE 8, JDK 8, and OpenJDK 8 source distributions on Linux and Solaris. --- begin of LICENSE --- -Copyright ¬© 2001,2003 Keith Packard +Copyright © 2001,2003 Keith Packard Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the @@ -765,7 +957,7 @@ CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ------------------------------------------------------------------------------- %% This notice is provided with respect to IAIK PKCS#11 Wrapper, -which is included with JRE 7, JDK 7, and OpenJDK 7. +which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -816,7 +1008,7 @@ POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- %% This notice is provided with respect to ICU4C 4.0.1 and ICU4J 4.4, which -is included with JRE 7, JDK 7, and OpenJDK 7. +may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -852,8 +1044,8 @@ their respective owners. ------------------------------------------------------------------------------- -%% This notice is provided with respect to IJG JPEG 6b, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to IJG JPEG 6b, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -891,8 +1083,35 @@ assumed by the product vendor. -------------------------------------------------------------------------------- -%% This notice is provided with respect to JOpt-Simple v3.0, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to Joni v1.1.9, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + +%% This notice is provided with respect to JOpt-Simple v3.0, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -921,8 +1140,39 @@ included with JRE 7, JDK 7, and OpenJDK 7. -------------------------------------------------------------------------------- +%% This notice is provided with respect to JSON, which may be included +with JRE 8 & JDK 8. + +--- begin of LICENSE --- + +Copyright (c) 2002 JSON.org + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +The Software shall be used for Good, not Evil. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% This notice is provided with respect to Kerberos functionality, which -which is included with JRE 7, JDK 7, and OpenJDK 7. +which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -934,7 +1184,7 @@ which is included with JRE 7, JDK 7, and OpenJDK 7. ------------------------------------------------------------------------------- %% This notice is provided with respect to Kerberos functionality from -FundsXpress, INC., which is included with JRE 7, JDK 7, and OpenJDK 7. +FundsXpress, INC., which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -967,8 +1217,8 @@ FundsXpress, INC., which is included with JRE 7, JDK 7, and OpenJDK 7. ------------------------------------------------------------------------------- -%% This notice is provided with respect to Kronos OpenGL headers, which is -included with JDK 7 and OpenJDK 7 source distributions. +%% This notice is provided with respect to Kronos OpenGL headers, which may be +included with JDK 8 and OpenJDK 8 source distributions. --- begin of LICENSE --- @@ -1000,8 +1250,8 @@ included with JDK 7 and OpenJDK 7 source distributions. ------------------------------------------------------------------------------- -%% This notice is provided with respect to libpng 1.2.18, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to libpng 1.5.4, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1014,8 +1264,10 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: If you modify libpng you may insert additional notices immediately following this sentence. -libpng versions 1.2.6, August 15, 2004, through 1.2.18, May 15, 2007, are -Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are +This code is released under the libpng license. + +libpng versions 1.2.6, August 15, 2004, through 1.5.4, July 7, 2011, are +Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.2.5 with the following individual added to the list of Contributing Authors @@ -1112,14 +1364,14 @@ certification mark of the Open Source Initiative. Glenn Randers-Pehrson glennrp at users.sourceforge.net -May 15, 2007 +July 7, 2011 --- end of LICENSE --- ------------------------------------------------------------------------------- -%% This notice is provided with respect to libungif 4.1.3, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to libungif 4.1.3, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1147,8 +1399,8 @@ THE SOFTWARE. ------------------------------------------------------------------------------- -%% This notice is provided with respect to Little CMS 2.0, which is -included with OpenJDK 7. +%% This notice is provided with respect to Little CMS 2.4, which may be +included with OpenJDK 8. --- begin of LICENSE --- @@ -1183,7 +1435,7 @@ U.S. and other countries. ------------------------------------------------------------------------------- %% This notice is provided with respect to Mesa 3D Graphics Library v4.1, -which is included with JRE 7, JDK 7, and OpenJDK 7 source distributions. +which may be included with JRE 8, JDK 8, and OpenJDK 8 source distributions. --- begin of LICENSE --- @@ -1213,8 +1465,402 @@ which is included with JRE 7, JDK 7, and OpenJDK 7 source distributions. ------------------------------------------------------------------------------- +%% This notice is provided with respect to Mozilla Network Security +Services (NSS), which is supplied with the JDK test suite in the OpenJDK +source code repository. It is licensed under Mozilla Public License (MPL), +version 2.0. + +The NSS libraries are supplied in executable form, built from unmodified +NSS source code labeled with the "NSS_3.13.1_RTM" release tag. + +The NSS source code is available in the OpenJDK source code repository at: + jdk/test/sun/security/pkcs11/nss/src + +The NSS libraries are available in the OpenJDK source code repository at: + jdk/test/sun/security/pkcs11/nss/lib + +--- begin of LICENSE --- + +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% This notice is provided with respect to PC/SC Lite for Suse Linux v.1.1.1, -which is included with JRE 7, JDK 7, and OpenJDK 7 on Linux and Solaris. +which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. --- begin of LICENSE --- @@ -1257,8 +1903,30 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- +%% This notice is provided with respect to PorterStemmer v4, which may be +included with JRE 8, JDK 8, and OpenJDK 8. + +--- begin of LICENSE --- + +See: http://tartarus.org/~martin/PorterStemmer + +The software is completely free for any purpose, unless notes at the head of +the program text indicates otherwise (which is rare). In any case, the notes +about licensing are never more restrictive than the BSD License. + +In every case where the software is not written by me (Martin Porter), this +licensing arrangement has been endorsed by the contributor, and it is +therefore unnecessary to ask the contributor again to confirm it. + +I have not asked any contributors (or their employers, if they have them) for +proofs that they have the right to distribute their software in this way. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% This notice is provided with respect to Relax NG Object/Parser v.20050510, -which is included with JRE 7, JDK 7, and OpenJDK 7. +which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1285,8 +1953,8 @@ SOFTWARE. ------------------------------------------------------------------------------- -%% This notice is provided with respect to RelaxNGCC v1.12, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to RelaxNGCC v1.12, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1335,487 +2003,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------- -%% This notice is provided with respect to Mozilla Rhino v1.7R3, which -is included with JRE 7, JDK 7, and OpenJDK 7 - ---- begin of LICENSE --- - - MOZILLA PUBLIC LICENSE - Version 1.1 - - --------------- - -1. Definitions. - - 1.0.1. "Commercial Use" means distribution or otherwise making the - Covered Code available to a third party. - - 1.1. "Contributor" means each entity that creates or contributes to - the creation of Modifications. - - 1.2. "Contributor Version" means the combination of the Original - Code, prior Modifications used by a Contributor, and the Modifications - made by that particular Contributor. - - 1.3. "Covered Code" means the Original Code or Modifications or the - combination of the Original Code and Modifications, in each case - including portions thereof. - - 1.4. "Electronic Distribution Mechanism" means a mechanism generally - accepted in the software development community for the electronic - transfer of data. - - 1.5. "Executable" means Covered Code in any form other than Source - Code. - - 1.6. "Initial Developer" means the individual or entity identified - as the Initial Developer in the Source Code notice required by Exhibit - A. - - 1.7. "Larger Work" means a work which combines Covered Code or - portions thereof with code not governed by the terms of this License. - - 1.8. "License" means this document. - - 1.8.1. "Licensable" means having the right to grant, to the maximum - extent possible, whether at the time of the initial grant or - subsequently acquired, any and all of the rights conveyed herein. - - 1.9. "Modifications" means any addition to or deletion from the - substance or structure of either the Original Code or any previous - Modifications. When Covered Code is released as a series of files, a - Modification is: - A. Any addition to or deletion from the contents of a file - containing Original Code or previous Modifications. - - B. Any new file that contains any part of the Original Code or - previous Modifications. - - 1.10. "Original Code" means Source Code of computer software code - which is described in the Source Code notice required by Exhibit A as - Original Code, and which, at the time of its release under this - License is not already Covered Code governed by this License. - - 1.10.1. "Patent Claims" means any patent claim(s), now owned or - hereafter acquired, including without limitation, method, process, - and apparatus claims, in any patent Licensable by grantor. - - 1.11. "Source Code" means the preferred form of the Covered Code for - making modifications to it, including all modules it contains, plus - any associated interface definition files, scripts used to control - compilation and installation of an Executable, or source code - differential comparisons against either the Original Code or another - well known, available Covered Code of the Contributor's choice. The - Source Code can be in a compressed or archival form, provided the - appropriate decompression or de-archiving software is widely available - for no charge. - - 1.12. "You" (or "Your") means an individual or a legal entity - exercising rights under, and complying with all of the terms of, this - License or a future version of this License issued under Section 6.1. - For legal entities, "You" includes any entity which controls, is - controlled by, or is under common control with You. For purposes of - this definition, "control" means (a) the power, direct or indirect, - to cause the direction or management of such entity, whether by - contract or otherwise, or (b) ownership of more than fifty percent - (50%) of the outstanding shares or beneficial ownership of such - entity. - -2. Source Code License. - - 2.1. The Initial Developer Grant. - The Initial Developer hereby grants You a world-wide, royalty-free, - non-exclusive license, subject to third party intellectual property - claims: - (a) under intellectual property rights (other than patent or - trademark) Licensable by Initial Developer to use, reproduce, - modify, display, perform, sublicense and distribute the Original - Code (or portions thereof) with or without Modifications, and/or - as part of a Larger Work; and - - (b) under Patents Claims infringed by the making, using or - selling of Original Code, to make, have made, use, practice, - sell, and offer for sale, and/or otherwise dispose of the - Original Code (or portions thereof). - - (c) the licenses granted in this Section 2.1(a) and (b) are - effective on the date Initial Developer first distributes - Original Code under the terms of this License. - - (d) Notwithstanding Section 2.1(b) above, no patent license is - granted: 1) for code that You delete from the Original Code; 2) - separate from the Original Code; or 3) for infringements caused - by: i) the modification of the Original Code or ii) the - combination of the Original Code with other software or devices. - - 2.2. Contributor Grant. - Subject to third party intellectual property claims, each Contributor - hereby grants You a world-wide, royalty-free, non-exclusive license - - (a) under intellectual property rights (other than patent or - trademark) Licensable by Contributor, to use, reproduce, modify, - display, perform, sublicense and distribute the Modifications - created by such Contributor (or portions thereof) either on an - unmodified basis, with other Modifications, as Covered Code - and/or as part of a Larger Work; and - - (b) under Patent Claims infringed by the making, using, or - selling of Modifications made by that Contributor either alone - and/or in combination with its Contributor Version (or portions - of such combination), to make, use, sell, offer for sale, have - made, and/or otherwise dispose of: 1) Modifications made by that - Contributor (or portions thereof); and 2) the combination of - Modifications made by that Contributor with its Contributor - Version (or portions of such combination). - - (c) the licenses granted in Sections 2.2(a) and 2.2(b) are - effective on the date Contributor first makes Commercial Use of - the Covered Code. - - (d) Notwithstanding Section 2.2(b) above, no patent license is - granted: 1) for any code that Contributor has deleted from the - Contributor Version; 2) separate from the Contributor Version; - 3) for infringements caused by: i) third party modifications of - Contributor Version or ii) the combination of Modifications made - by that Contributor with other software (except as part of the - Contributor Version) or other devices; or 4) under Patent Claims - infringed by Covered Code in the absence of Modifications made by - that Contributor. - -3. Distribution Obligations. - - 3.1. Application of License. - The Modifications which You create or to which You contribute are - governed by the terms of this License, including without limitation - Section 2.2. The Source Code version of Covered Code may be - distributed only under the terms of this License or a future version - of this License released under Section 6.1, and You must include a - copy of this License with every copy of the Source Code You - distribute. You may not offer or impose any terms on any Source Code - version that alters or restricts the applicable version of this - License or the recipients' rights hereunder. However, You may include - an additional document offering the additional rights described in - Section 3.5. - - 3.2. Availability of Source Code. - Any Modification which You create or to which You contribute must be - made available in Source Code form under the terms of this License - either on the same media as an Executable version or via an accepted - Electronic Distribution Mechanism to anyone to whom you made an - Executable version available; and if made available via Electronic - Distribution Mechanism, must remain available for at least twelve (12) - months after the date it initially became available, or at least six - (6) months after a subsequent version of that particular Modification - has been made available to such recipients. You are responsible for - ensuring that the Source Code version remains available even if the - Electronic Distribution Mechanism is maintained by a third party. - - 3.3. Description of Modifications. - You must cause all Covered Code to which You contribute to contain a - file documenting the changes You made to create that Covered Code and - the date of any change. You must include a prominent statement that - the Modification is derived, directly or indirectly, from Original - Code provided by the Initial Developer and including the name of the - Initial Developer in (a) the Source Code, and (b) in any notice in an - Executable version or related documentation in which You describe the - origin or ownership of the Covered Code. - - 3.4. Intellectual Property Matters - (a) Third Party Claims. - If Contributor has knowledge that a license under a third party's - intellectual property rights is required to exercise the rights - granted by such Contributor under Sections 2.1 or 2.2, - Contributor must include a text file with the Source Code - distribution titled "LEGAL" which describes the claim and the - party making the claim in sufficient detail that a recipient will - know whom to contact. If Contributor obtains such knowledge after - the Modification is made available as described in Section 3.2, - Contributor shall promptly modify the LEGAL file in all copies - Contributor makes available thereafter and shall take other steps - (such as notifying appropriate mailing lists or newsgroups) - reasonably calculated to inform those who received the Covered - Code that new knowledge has been obtained. - - (b) Contributor APIs. - If Contributor's Modifications include an application programming - interface and Contributor has knowledge of patent licenses which - are reasonably necessary to implement that API, Contributor must - also include this information in the LEGAL file. - - (c) Representations. - Contributor represents that, except as disclosed pursuant to - Section 3.4(a) above, Contributor believes that Contributor's - Modifications are Contributor's original creation(s) and/or - Contributor has sufficient rights to grant the rights conveyed by - this License. - - 3.5. Required Notices. - You must duplicate the notice in Exhibit A in each file of the Source - Code. If it is not possible to put such notice in a particular Source - Code file due to its structure, then You must include such notice in a - location (such as a relevant directory) where a user would be likely - to look for such a notice. If You created one or more Modification(s) - You may add your name as a Contributor to the notice described in - Exhibit A. You must also duplicate this License in any documentation - for the Source Code where You describe recipients' rights or ownership - rights relating to Covered Code. You may choose to offer, and to - charge a fee for, warranty, support, indemnity or liability - obligations to one or more recipients of Covered Code. However, You - may do so only on Your own behalf, and not on behalf of the Initial - Developer or any Contributor. You must make it absolutely clear than - any such warranty, support, indemnity or liability obligation is - offered by You alone, and You hereby agree to indemnify the Initial - Developer and every Contributor for any liability incurred by the - Initial Developer or such Contributor as a result of warranty, - support, indemnity or liability terms You offer. - - 3.6. Distribution of Executable Versions. - You may distribute Covered Code in Executable form only if the - requirements of Section 3.1-3.5 have been met for that Covered Code, - and if You include a notice stating that the Source Code version of - the Covered Code is available under the terms of this License, - including a description of how and where You have fulfilled the - obligations of Section 3.2. The notice must be conspicuously included - in any notice in an Executable version, related documentation or - collateral in which You describe recipients' rights relating to the - Covered Code. You may distribute the Executable version of Covered - Code or ownership rights under a license of Your choice, which may - contain terms different from this License, provided that You are in - compliance with the terms of this License and that the license for the - Executable version does not attempt to limit or alter the recipient's - rights in the Source Code version from the rights set forth in this - License. If You distribute the Executable version under a different - license You must make it absolutely clear that any terms which differ - from this License are offered by You alone, not by the Initial - Developer or any Contributor. You hereby agree to indemnify the - Initial Developer and every Contributor for any liability incurred by - the Initial Developer or such Contributor as a result of any such - terms You offer. - - 3.7. Larger Works. - You may create a Larger Work by combining Covered Code with other code - not governed by the terms of this License and distribute the Larger - Work as a single product. In such a case, You must make sure the - requirements of this License are fulfilled for the Covered Code. - -4. Inability to Comply Due to Statute or Regulation. - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Code due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description - must be included in the LEGAL file described in Section 3.4 and must - be included with all distributions of the Source Code. Except to the - extent prohibited by statute or regulation, such description must be - sufficiently detailed for a recipient of ordinary skill to be able to - understand it. - -5. Application of this License. - - This License applies to code to which the Initial Developer has - attached the notice in Exhibit A and to related Covered Code. - -6. Versions of the License. - - 6.1. New Versions. - Netscape Communications Corporation ("Netscape") may publish revised - and/or new versions of the License from time to time. Each version - will be given a distinguishing version number. - - 6.2. Effect of New Versions. - Once Covered Code has been published under a particular version of the - License, You may always continue to use it under the terms of that - version. You may also choose to use such Covered Code under the terms - of any subsequent version of the License published by Netscape. No one - other than Netscape has the right to modify the terms applicable to - Covered Code created under this License. - - 6.3. Derivative Works. - If You create or use a modified version of this License (which you may - only do in order to apply it to code which is not already Covered Code - governed by this License), You must (a) rename Your license so that - the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", - "MPL", "NPL" or any confusingly similar phrase do not appear in your - license (except to note that your license differs from this License) - and (b) otherwise make it clear that Your version of the license - contains terms which differ from the Mozilla Public License and - Netscape Public License. (Filling in the name of the Initial - Developer, Original Code or Contributor in the notice described in - Exhibit A shall not of themselves be deemed to be modifications of - this License.) - -7. DISCLAIMER OF WARRANTY. - - COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, - WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF - DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. - THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE - IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, - YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE - COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER - OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF - ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. - -8. TERMINATION. - - 8.1. This License and the rights granted hereunder will terminate - automatically if You fail to comply with terms herein and fail to cure - such breach within 30 days of becoming aware of the breach. All - sublicenses to the Covered Code which are properly granted shall - survive any termination of this License. Provisions which, by their - nature, must remain in effect beyond the termination of this License - shall survive. - - 8.2. If You initiate litigation by asserting a patent infringement - claim (excluding declatory judgment actions) against Initial Developer - or a Contributor (the Initial Developer or Contributor against whom - You file such action is referred to as "Participant") alleging that: - - (a) such Participant's Contributor Version directly or indirectly - infringes any patent, then any and all rights granted by such - Participant to You under Sections 2.1 and/or 2.2 of this License - shall, upon 60 days notice from Participant terminate prospectively, - unless if within 60 days after receipt of notice You either: (i) - agree in writing to pay Participant a mutually agreeable reasonable - royalty for Your past and future use of Modifications made by such - Participant, or (ii) withdraw Your litigation claim with respect to - the Contributor Version against such Participant. If within 60 days - of notice, a reasonable royalty and payment arrangement are not - mutually agreed upon in writing by the parties or the litigation claim - is not withdrawn, the rights granted by Participant to You under - Sections 2.1 and/or 2.2 automatically terminate at the expiration of - the 60 day notice period specified above. - - (b) any software, hardware, or device, other than such Participant's - Contributor Version, directly or indirectly infringes any patent, then - any rights granted to You by such Participant under Sections 2.1(b) - and 2.2(b) are revoked effective as of the date You first made, used, - sold, distributed, or had made, Modifications made by that - Participant. - - 8.3. If You assert a patent infringement claim against Participant - alleging that such Participant's Contributor Version directly or - indirectly infringes any patent where such claim is resolved (such as - by license or settlement) prior to the initiation of patent - infringement litigation, then the reasonable value of the licenses - granted by such Participant under Sections 2.1 or 2.2 shall be taken - into account in determining the amount or value of any payment or - license. - - 8.4. In the event of termination under Sections 8.1 or 8.2 above, - all end user license agreements (excluding distributors and resellers) - which have been validly granted by You or any distributor hereunder - prior to termination shall survive termination. - -9. LIMITATION OF LIABILITY. - - UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT - (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL - DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, - OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR - ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY - CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, - WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER - COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN - INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF - LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY - RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW - PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE - EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO - THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. - -10. U.S. GOVERNMENT END USERS. - - The Covered Code is a "commercial item," as that term is defined in - 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer - software" and "commercial computer software documentation," as such - terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 - C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), - all U.S. Government End Users acquire Covered Code with only those - rights set forth herein. - -11. MISCELLANEOUS. - - This License represents the complete agreement concerning subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. This License shall be governed by - California law provisions (except to the extent applicable law, if - any, provides otherwise), excluding its conflict-of-law provisions. - With respect to disputes in which at least one party is a citizen of, - or an entity chartered or registered to do business in the United - States of America, any litigation relating to this License shall be - subject to the jurisdiction of the Federal Courts of the Northern - District of California, with venue lying in Santa Clara County, - California, with the losing party responsible for costs, including - without limitation, court costs and reasonable attorneys' fees and - expenses. The application of the United Nations Convention on - Contracts for the International Sale of Goods is expressly excluded. - Any law or regulation which provides that the language of a contract - shall be construed against the drafter shall not apply to this - License. - -12. RESPONSIBILITY FOR CLAIMS. - - As between Initial Developer and the Contributors, each party is - responsible for claims and damages arising, directly or indirectly, - out of its utilization of rights under this License and You agree to - work with Initial Developer and Contributors to distribute such - responsibility on an equitable basis. Nothing herein is intended or - shall be deemed to constitute any admission of liability. - -13. MULTIPLE-LICENSED CODE. - - Initial Developer may designate portions of the Covered Code as - "Multiple-Licensed". "Multiple-Licensed" means that the Initial - Developer permits you to utilize portions of the Covered Code under - Your choice of the NPL or the alternative licenses, if any, specified - by the Initial Developer in the file described in Exhibit A. - -EXHIBIT A - Mozilla Public License. - - ``The contents of this file are subject to the Mozilla Public License - Version 1.1 (the "License"); you may not use this file except in - compliance with the License. You may obtain a copy of the License at - http://www.mozilla.org/MPL/ - - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the - License for the specific language governing rights and limitations - under the License. - - The Original Code is ______________________________________. - - The Initial Developer of the Original Code is ________________________. - Portions created by ______________________ are Copyright (C) ______ - _______________________. All Rights Reserved. - - Contributor(s): ______________________________________. - - Alternatively, the contents of this file may be used under the terms - of the _____ license (the "[___] License"), in which case the - provisions of [______] License are applicable instead of those - above. If you wish to allow use of your version of this file only - under the terms of the [____] License and not to allow others to use - your version of this file under the MPL, indicate your decision by - deleting the provisions above and replace them with the notice and - other provisions required by the [___] License. If you do not delete - the provisions above, a recipient may use your version of this file - under either the MPL or the [___] License." - - [NOTE: The text of this Exhibit A may differ slightly from the text of - the notices in the Source Code files of the Original Code. You should - use the text of this Exhibit A rather than the text found in the - Original Code Source Code for Your Modifications.] - ---- end of LICENSE --- - -------------------------------------------------------------------------------- - -%% This notice is provided with respect to SAX 2.0.1, which is included -with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to SAX 2.0.1, which may be included +with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1876,8 +2065,8 @@ with JRE 7, JDK 7, and OpenJDK 7. ------------------------------------------------------------------------------- -%% This notice is provided with respect to SoftFloat version 2b, which is -included with JRE 7, JDK 7, and OpenJDK 7 on Linux/ARM. +%% This notice is provided with respect to SoftFloat version 2b, which may be +included with JRE 8, JDK 8, and OpenJDK 8 on Linux/ARM. --- begin of LICENSE --- @@ -1909,12 +2098,41 @@ satisfied. ------------------------------------------------------------------------------- +%% This notice is provided with respect to Sparkle 1.5, +which may be included with JRE 8 on Mac OS X. + +--- begin of LICENSE --- + +Copyright (c) 2012 Sparkle.org and Andy Matuschak + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- end of LICENSE --- + +------------------------------------------------------------------------------- + %% Portions licensed from Taligent, Inc. ------------------------------------------------------------------------------- -%% This notice is provided with respect to Thai Dictionary, which is -included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to Thai Dictionary, which may be +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1947,8 +2165,8 @@ SOFTWARE. ------------------------------------------------------------------------------- -%% This notice is provided with respect to Unicode 6.0.0, CLDR v1.4.1, & CLDR -v1.9, which is included with JRE 7, JDK 7, and OpenJDK 7. +%% This notice is provided with respect to Unicode 6.2.0 & CLDR 21.0.1 +which may be included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- @@ -1959,7 +2177,7 @@ Privacy Policy. For trademark usage, see the Unicode® Consortium Name and Trademark Usage Policy. A. Unicode Copyright. - 1. Copyright © 1991-2011 Unicode, Inc. All rights reserved. + 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. 2. Certain documents and files on this website contain a legend indicating that "Modification is permitted." Any person is hereby authorized, @@ -2094,7 +2312,7 @@ SOFTWARE. COPYRIGHT AND PERMISSION NOTICE -Copyright © 1991-2011 Unicode, Inc. All rights reserved. Distributed under the +Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining a copy @@ -2134,8 +2352,8 @@ the property of their respective owners. ------------------------------------------------------------------------------- -%% This notice is provided with respect to UPX v3.01, which is included -with JRE 7 on Windows. +%% This notice is provided with respect to UPX v3.01, which may be included +with JRE 8 on Windows. --- begin of LICENSE --- @@ -2274,7 +2492,7 @@ The UPX license file is at http://upx.sourceforge.net/upx-license.html. ------------------------------------------------------------------------------- %% This notice is provided with respect to Xfree86-VidMode Extension 1.0, -which is included with JRE 7, JDK 7, and OpenJDK 7 on Linux and Solaris. +which may be included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. --- begin of LICENSE --- @@ -2326,8 +2544,8 @@ to do so,subject to the following conditions: ------------------------------------------------------------------------------- -%% This notice is provided with respect to X Window System 6.8.2, which is -included with JRE 7, JDK 7, and OpenJDK 7 on Linux and Solaris. +%% This notice is provided with respect to X Window System 6.8.2, which may be +included with JRE 8, JDK 8, and OpenJDK 8 on Linux and Solaris. --- begin of LICENSE --- @@ -3131,12 +3349,12 @@ info@urwpp.de or design@bigelowandholmes.com ------------------------------------------------------------------------------- -%% This notice is provided with respect to zlib v1.2.3, which is included -with JRE 7, JDK 7, and OpenJDK 7 +%% This notice is provided with respect to zlib v1.2.5, which may be included +with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE --- - version 1.2.3, July 18th, 2005 + version 1.2.5, July 18th, 2005 Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler @@ -3163,16 +3381,18 @@ with JRE 7, JDK 7, and OpenJDK 7 ------------------------------------------------------------------------------- -%% This notice is provided with respect to the following which is -included with JRE 7, JDK 7, and OpenJDK 7, except where noted: +%% This notice is provided with respect to the following which may be +included with JRE 8, JDK 8, and OpenJDK 8, except where noted: - Apache Derby 10.8.1.2 [included with JDK 7 only] + Apache Commons Math 2.2 + Apache Derby 10.10.1.2 [included with JDK 8] Apache Jakarta BCEL 5.2 Apache Jakarta Regexp 1.4 - Apache Santuario XMLSec-Java 1.4.2 + Apache Santuario XML Security for Java 1.5.4 Apache Xalan-Java 2.7.1 - Apache Xerces2 Java 2.10.0 + Apache Xerces Java 2.10.0 Apache XML Resolver 1.1 + Dynalink 0.5 --- begin of LICENSE --- From 5159b7ce2055322e20b695c2684f5326629fc3d9 Mon Sep 17 00:00:00 2001 From: Jeff Dinkins Date: Tue, 28 Jan 2014 20:09:41 +0000 Subject: [PATCH 35/35] 8032816: THIRDPARTYREADME LittleCMS preamble missing JRE 8 & JDK 8 Reviewed-by: lana --- hotspot/THIRD_PARTY_README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hotspot/THIRD_PARTY_README b/hotspot/THIRD_PARTY_README index ba48858c28f..a93b35b994c 100644 --- a/hotspot/THIRD_PARTY_README +++ b/hotspot/THIRD_PARTY_README @@ -1400,7 +1400,7 @@ THE SOFTWARE. ------------------------------------------------------------------------------- %% This notice is provided with respect to Little CMS 2.4, which may be -included with OpenJDK 8. +included with JRE 8, JDK 8, and OpenJDK 8. --- begin of LICENSE ---