Thu, 26 Jun 2014 07:52:19 -0700
Merge
.hgtags | file | annotate | diff | comparison | revisions | |
make/hotspot_version | file | annotate | diff | comparison | revisions |
1.1 --- a/.hgtags Wed Jun 18 12:53:21 2014 -0700 1.2 +++ b/.hgtags Thu Jun 26 07:52:19 2014 -0700 1.3 @@ -488,3 +488,5 @@ 1.4 11159d7ec80462a422e39c9b3a39ae932923622d jdk8u20-b18 1.5 3e1cec358ab95ef985f821219104141b9ffda83f hs25.20-b19 1.6 b15553cde967dfd7781a4a5c669e4cb7db734317 jdk8u20-b19 1.7 +4f18dea0312d601d0515976bc0c643ea7acc829d hs25.20-b20 1.8 +9e4d27da4ac04c6e19291087f7c68a5c5803c7ca jdk8u20-b20
2.1 --- a/agent/src/os/linux/libproc.h Wed Jun 18 12:53:21 2014 -0700 2.2 +++ b/agent/src/os/linux/libproc.h Thu Jun 26 07:52:19 2014 -0700 2.3 @@ -34,7 +34,7 @@ 2.4 #include "libproc_md.h" 2.5 #endif 2.6 2.7 -#include <linux/ptrace.h> 2.8 +#include <sys/ptrace.h> 2.9 2.10 /************************************************************************************ 2.11
3.1 --- a/make/hotspot_version Wed Jun 18 12:53:21 2014 -0700 3.2 +++ b/make/hotspot_version Thu Jun 26 07:52:19 2014 -0700 3.3 @@ -35,7 +35,7 @@ 3.4 3.5 HS_MAJOR_VER=25 3.6 HS_MINOR_VER=20 3.7 -HS_BUILD_NUMBER=19 3.8 +HS_BUILD_NUMBER=20 3.9 3.10 JDK_MAJOR_VER=1 3.11 JDK_MINOR_VER=8
4.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Wed Jun 18 12:53:21 2014 -0700 4.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp Thu Jun 26 07:52:19 2014 -0700 4.3 @@ -432,14 +432,6 @@ 4.4 return hr; 4.5 } 4.6 4.7 -void G1CollectedHeap::stop_conc_gc_threads() { 4.8 - _cg1r->stop(); 4.9 - _cmThread->stop(); 4.10 - if (G1StringDedup::is_enabled()) { 4.11 - G1StringDedup::stop(); 4.12 - } 4.13 -} 4.14 - 4.15 #ifdef ASSERT 4.16 // A region is added to the collection set as it is retired 4.17 // so an address p can point to a region which will be in the 4.18 @@ -2186,20 +2178,14 @@ 4.19 } 4.20 4.21 void G1CollectedHeap::stop() { 4.22 -#if 0 4.23 - // Stopping concurrent worker threads is currently disabled until 4.24 - // some bugs in concurrent mark has been resolve. Without fixing 4.25 - // those bugs first we risk haning during VM exit when trying to 4.26 - // stop these threads. 4.27 - 4.28 - // Abort any ongoing concurrent root region scanning and stop all 4.29 - // concurrent threads. We do this to make sure these threads do 4.30 - // not continue to execute and access resources (e.g. gclog_or_tty) 4.31 + // Stop all concurrent threads. We do this to make sure these threads 4.32 + // do not continue to execute and access resources (e.g. gclog_or_tty) 4.33 // that are destroyed during shutdown. 4.34 - _cm->root_regions()->abort(); 4.35 - _cm->root_regions()->wait_until_scan_finished(); 4.36 - stop_conc_gc_threads(); 4.37 -#endif 4.38 + _cg1r->stop(); 4.39 + _cmThread->stop(); 4.40 + if (G1StringDedup::is_enabled()) { 4.41 + G1StringDedup::stop(); 4.42 + } 4.43 } 4.44 4.45 size_t G1CollectedHeap::conservative_max_heap_alignment() {
5.1 --- a/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Wed Jun 18 12:53:21 2014 -0700 5.2 +++ b/src/share/vm/gc_implementation/g1/g1CollectedHeap.hpp Thu Jun 26 07:52:19 2014 -0700 5.3 @@ -1699,8 +1699,6 @@ 5.4 void print_all_rsets() PRODUCT_RETURN; 5.5 5.6 public: 5.7 - void stop_conc_gc_threads(); 5.8 - 5.9 size_t pending_card_num(); 5.10 size_t cards_scanned(); 5.11
6.1 --- a/src/share/vm/opto/graphKit.cpp Wed Jun 18 12:53:21 2014 -0700 6.2 +++ b/src/share/vm/opto/graphKit.cpp Thu Jun 26 07:52:19 2014 -0700 6.3 @@ -2458,7 +2458,7 @@ 6.4 6.5 //------------------------------make_slow_call_ex------------------------------ 6.6 // Make the exception handler hookups for the slow call 6.7 -void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj) { 6.8 +void GraphKit::make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj, bool deoptimize) { 6.9 if (stopped()) return; 6.10 6.11 // Make a catch node with just two handlers: fall-through and catch-all 6.12 @@ -2472,11 +2472,17 @@ 6.13 set_i_o(i_o); 6.14 6.15 if (excp != top()) { 6.16 - // Create an exception state also. 6.17 - // Use an exact type if the caller has specified a specific exception. 6.18 - const Type* ex_type = TypeOopPtr::make_from_klass_unique(ex_klass)->cast_to_ptr_type(TypePtr::NotNull); 6.19 - Node* ex_oop = new (C) CreateExNode(ex_type, control(), i_o); 6.20 - add_exception_state(make_exception_state(_gvn.transform(ex_oop))); 6.21 + if (deoptimize) { 6.22 + // Deoptimize if an exception is caught. Don't construct exception state in this case. 6.23 + uncommon_trap(Deoptimization::Reason_unhandled, 6.24 + Deoptimization::Action_none); 6.25 + } else { 6.26 + // Create an exception state also. 6.27 + // Use an exact type if the caller has specified a specific exception. 6.28 + const Type* ex_type = TypeOopPtr::make_from_klass_unique(ex_klass)->cast_to_ptr_type(TypePtr::NotNull); 6.29 + Node* ex_oop = new (C) CreateExNode(ex_type, control(), i_o); 6.30 + add_exception_state(make_exception_state(_gvn.transform(ex_oop))); 6.31 + } 6.32 } 6.33 } 6.34 6.35 @@ -3290,7 +3296,8 @@ 6.36 6.37 //---------------------------set_output_for_allocation------------------------- 6.38 Node* GraphKit::set_output_for_allocation(AllocateNode* alloc, 6.39 - const TypeOopPtr* oop_type) { 6.40 + const TypeOopPtr* oop_type, 6.41 + bool deoptimize_on_exception) { 6.42 int rawidx = Compile::AliasIdxRaw; 6.43 alloc->set_req( TypeFunc::FramePtr, frameptr() ); 6.44 add_safepoint_edges(alloc); 6.45 @@ -3298,7 +3305,7 @@ 6.46 set_control( _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Control) ) ); 6.47 // create memory projection for i_o 6.48 set_memory ( _gvn.transform( new (C) ProjNode(allocx, TypeFunc::Memory, true) ), rawidx ); 6.49 - make_slow_call_ex(allocx, env()->Throwable_klass(), true); 6.50 + make_slow_call_ex(allocx, env()->Throwable_klass(), true, deoptimize_on_exception); 6.51 6.52 // create a memory projection as for the normal control path 6.53 Node* malloc = _gvn.transform(new (C) ProjNode(allocx, TypeFunc::Memory)); 6.54 @@ -3376,9 +3383,11 @@ 6.55 // The optional arguments are for specialized use by intrinsics: 6.56 // - If 'extra_slow_test' if not null is an extra condition for the slow-path. 6.57 // - If 'return_size_val', report the the total object size to the caller. 6.58 +// - deoptimize_on_exception controls how Java exceptions are handled (rethrow vs deoptimize) 6.59 Node* GraphKit::new_instance(Node* klass_node, 6.60 Node* extra_slow_test, 6.61 - Node* *return_size_val) { 6.62 + Node* *return_size_val, 6.63 + bool deoptimize_on_exception) { 6.64 // Compute size in doublewords 6.65 // The size is always an integral number of doublewords, represented 6.66 // as a positive bytewise size stored in the klass's layout_helper. 6.67 @@ -3447,7 +3456,7 @@ 6.68 size, klass_node, 6.69 initial_slow_test); 6.70 6.71 - return set_output_for_allocation(alloc, oop_type); 6.72 + return set_output_for_allocation(alloc, oop_type, deoptimize_on_exception); 6.73 } 6.74 6.75 //-------------------------------new_array------------------------------------- 6.76 @@ -3457,7 +3466,8 @@ 6.77 Node* GraphKit::new_array(Node* klass_node, // array klass (maybe variable) 6.78 Node* length, // number of array elements 6.79 int nargs, // number of arguments to push back for uncommon trap 6.80 - Node* *return_size_val) { 6.81 + Node* *return_size_val, 6.82 + bool deoptimize_on_exception) { 6.83 jint layout_con = Klass::_lh_neutral_value; 6.84 Node* layout_val = get_layout_helper(klass_node, layout_con); 6.85 int layout_is_con = (layout_val == NULL); 6.86 @@ -3600,7 +3610,7 @@ 6.87 ary_type = ary_type->is_aryptr()->cast_to_size(length_type); 6.88 } 6.89 6.90 - Node* javaoop = set_output_for_allocation(alloc, ary_type); 6.91 + Node* javaoop = set_output_for_allocation(alloc, ary_type, deoptimize_on_exception); 6.92 6.93 // Cast length on remaining path to be as narrow as possible 6.94 if (map()->find_edge(length) >= 0) {
7.1 --- a/src/share/vm/opto/graphKit.hpp Wed Jun 18 12:53:21 2014 -0700 7.2 +++ b/src/share/vm/opto/graphKit.hpp Thu Jun 26 07:52:19 2014 -0700 7.3 @@ -802,7 +802,7 @@ 7.4 7.5 // merge in all memory slices from new_mem, along the given path 7.6 void merge_memory(Node* new_mem, Node* region, int new_path); 7.7 - void make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj); 7.8 + void make_slow_call_ex(Node* call, ciInstanceKlass* ex_klass, bool separate_io_proj, bool deoptimize = false); 7.9 7.10 // Helper functions to build synchronizations 7.11 int next_monitor(); 7.12 @@ -844,13 +844,16 @@ 7.13 7.14 // implementation of object creation 7.15 Node* set_output_for_allocation(AllocateNode* alloc, 7.16 - const TypeOopPtr* oop_type); 7.17 + const TypeOopPtr* oop_type, 7.18 + bool deoptimize_on_exception=false); 7.19 Node* get_layout_helper(Node* klass_node, jint& constant_value); 7.20 Node* new_instance(Node* klass_node, 7.21 Node* slow_test = NULL, 7.22 - Node* *return_size_val = NULL); 7.23 + Node* *return_size_val = NULL, 7.24 + bool deoptimize_on_exception = false); 7.25 Node* new_array(Node* klass_node, Node* count_val, int nargs, 7.26 - Node* *return_size_val = NULL); 7.27 + Node* *return_size_val = NULL, 7.28 + bool deoptimize_on_exception = false); 7.29 7.30 // java.lang.String helpers 7.31 Node* load_String_offset(Node* ctrl, Node* str);
8.1 --- a/src/share/vm/opto/library_call.cpp Wed Jun 18 12:53:21 2014 -0700 8.2 +++ b/src/share/vm/opto/library_call.cpp Thu Jun 26 07:52:19 2014 -0700 8.3 @@ -4576,7 +4576,10 @@ 8.4 // It's an instance, and it passed the slow-path tests. 8.5 PreserveJVMState pjvms(this); 8.6 Node* obj_size = NULL; 8.7 - Node* alloc_obj = new_instance(obj_klass, NULL, &obj_size); 8.8 + // Need to deoptimize on exception from allocation since Object.clone intrinsic 8.9 + // is reexecuted if deoptimization occurs and there could be problems when merging 8.10 + // exception state between multiple Object.clone versions (reexecute=true vs reexecute=false). 8.11 + Node* alloc_obj = new_instance(obj_klass, NULL, &obj_size, /*deoptimize_on_exception=*/true); 8.12 8.13 copy_to_clone(obj, alloc_obj, obj_size, false, !use_ReduceInitialCardMarks()); 8.14
9.1 --- a/src/share/vm/runtime/java.cpp Wed Jun 18 12:53:21 2014 -0700 9.2 +++ b/src/share/vm/runtime/java.cpp Thu Jun 26 07:52:19 2014 -0700 9.3 @@ -497,9 +497,6 @@ 9.4 os::infinite_sleep(); 9.5 } 9.6 9.7 - // Stop any ongoing concurrent GC work 9.8 - Universe::heap()->stop(); 9.9 - 9.10 // Terminate watcher thread - must before disenrolling any periodic task 9.11 if (PeriodicTask::num_tasks() > 0) 9.12 WatcherThread::stop(); 9.13 @@ -514,10 +511,8 @@ 9.14 StatSampler::disengage(); 9.15 StatSampler::destroy(); 9.16 9.17 - // We do not need to explicitly stop concurrent GC threads because the 9.18 - // JVM will be taken down at a safepoint when such threads are inactive -- 9.19 - // except for some concurrent G1 threads, see (comment in) 9.20 - // Threads::destroy_vm(). 9.21 + // Stop concurrent GC threads 9.22 + Universe::heap()->stop(); 9.23 9.24 // Print GC/heap related information. 9.25 if (PrintGCDetails) {
10.1 --- a/src/share/vm/runtime/thread.cpp Wed Jun 18 12:53:21 2014 -0700 10.2 +++ b/src/share/vm/runtime/thread.cpp Thu Jun 26 07:52:19 2014 -0700 10.3 @@ -4013,14 +4013,8 @@ 10.4 // GC vm_operations can get caught at the safepoint, and the 10.5 // heap is unparseable if they are caught. Grab the Heap_lock 10.6 // to prevent this. The GC vm_operations will not be able to 10.7 - // queue until after the vm thread is dead. 10.8 - // After this point, we'll never emerge out of the safepoint before 10.9 - // the VM exits, so concurrent GC threads do not need to be explicitly 10.10 - // stopped; they remain inactive until the process exits. 10.11 - // Note: some concurrent G1 threads may be running during a safepoint, 10.12 - // but these will not be accessing the heap, just some G1-specific side 10.13 - // data structures that are not accessed by any other threads but them 10.14 - // after this point in a terminal safepoint. 10.15 + // queue until after the vm thread is dead. After this point, 10.16 + // we'll never emerge out of the safepoint before the VM exits. 10.17 10.18 MutexLocker ml(Heap_lock); 10.19
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 11.2 +++ b/test/compiler/intrinsics/clone/TestObjectClone.java Thu Jun 26 07:52:19 2014 -0700 11.3 @@ -0,0 +1,80 @@ 11.4 +/* 11.5 + * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 11.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 11.7 + * 11.8 + * This code is free software; you can redistribute it and/or modify it 11.9 + * under the terms of the GNU General Public License version 2 only, as 11.10 + * published by the Free Software Foundation. 11.11 + * 11.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 11.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 11.15 + * version 2 for more details (a copy is included in the LICENSE file that 11.16 + * accompanied this code). 11.17 + * 11.18 + * You should have received a copy of the GNU General Public License version 11.19 + * 2 along with this work; if not, write to the Free Software Foundation, 11.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 11.21 + * 11.22 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 11.23 + * or visit www.oracle.com if you need additional information or have any 11.24 + * questions. 11.25 + * 11.26 + */ 11.27 + 11.28 +/* 11.29 + * @test 11.30 + * @bug 8033626 11.31 + * @summary assert(ex_map->jvms()->same_calls_as(_exceptions->jvms())) failed: all collected exceptions must come from the same place 11.32 + * @library /testlibrary 11.33 + * @run main/othervm -XX:-TieredCompilation -Xbatch -XX:CompileOnly=TestObjectClone::f TestObjectClone 11.34 + */ 11.35 +import com.oracle.java.testlibrary.Asserts; 11.36 + 11.37 +public class TestObjectClone implements Cloneable { 11.38 + static class A extends TestObjectClone {} 11.39 + static class B extends TestObjectClone { 11.40 + public B clone() { 11.41 + return (B)TestObjectClone.b; 11.42 + } 11.43 + } 11.44 + static class C extends TestObjectClone { 11.45 + public C clone() { 11.46 + return (C)TestObjectClone.c; 11.47 + } 11.48 + } 11.49 + static class D extends TestObjectClone { 11.50 + public D clone() { 11.51 + return (D)TestObjectClone.d; 11.52 + } 11.53 + } 11.54 + static TestObjectClone a = new A(), b = new B(), c = new C(), d = new D(); 11.55 + 11.56 + public static Object f(TestObjectClone o) throws CloneNotSupportedException { 11.57 + // Polymorphic call site: >90% Object::clone / <10% other methods 11.58 + return o.clone(); 11.59 + } 11.60 + 11.61 + public static void main(String[] args) throws Exception { 11.62 + TestObjectClone[] params1 = {a, a, a, a, a, a, a, a, a, a, a, 11.63 + a, a, a, a, a, a, a, a, a, a, a, 11.64 + a, a, a, a, a, a, a, a, a, a, a, 11.65 + b, c, d}; 11.66 + 11.67 + for (int i = 0; i < 15000; i++) { 11.68 + f(params1[i % params1.length]); 11.69 + } 11.70 + 11.71 + Asserts.assertTrue(f(a) != a); 11.72 + Asserts.assertTrue(f(b) == b); 11.73 + Asserts.assertTrue(f(c) == c); 11.74 + Asserts.assertTrue(f(d) == d); 11.75 + 11.76 + try { 11.77 + f(null); 11.78 + throw new AssertionError(""); 11.79 + } catch (NullPointerException e) { /* expected */ } 11.80 + 11.81 + System.out.println("TEST PASSED"); 11.82 + } 11.83 +}